1import{j as e,m as a,a5 as M,T as y,E as C,S as h,g as P,ab as k,aa as _,ac as A,a4 as F,l as R,ad as D,ae as H,W as O,G as z,af as Q}from"./vendor-ui-BrPKsPuL.js";import{r as l,L as W}from"./vendor-react-ESVE6sCt.js";import{u as K,s as B,S as X,H as q,B as u,I as J,F as V}from"./index-CT3HfFCY.js";import"./vendor-query-p8QMjtnk.js";import"./vendor-supabase-BOs-PjHc.js";const f={phishing:{label:"Phishing",icon:A,color:"text-orange-500 bg-orange-500/10"},scam:{label:"Scam/Fraud",icon:y,color:"text-danger bg-danger/10"},malware:{label:"Malware",icon:D,color:"text-purple-500 bg-purple-500/10"},ransomware:{label:"Ransomware",icon:h,color:"text-red-600 bg-red-600/10"},identity_theft:{label:"Identity Theft",icon:H,color:"text-pink-500 bg-pink-500/10"},payment_fraud:{label:"Payment Fraud",icon:O,color:"text-amber-500 bg-amber-500/10"},general:{label:"General",icon:z,color:"text-blue-500 bg-blue-500/10"}},E={government:{label:"Government",icon:R,color:"text-blue-600 bg-blue-600/10"},nonprofit:{label:"Non-Profit",icon:h,color:"text-green-600 bg-green-600/10"},blog:{label:"Security Blog",icon:Q,color:"text-purple-600 bg-purple-600/10"}},Y=[{name:"FTC Consumer Alerts",url:"https://consumer.ftc.gov/consumer-alerts",type:"government",description:"Federal Trade Commission consumer protection alerts"},{name:"FBI IC3",url:"https://www.ic3.gov/",type:"government",description:"Internet Crime Complaint Center public service announcements"},{name:"BBB Scam Tracker",url:"https://www.bbb.org/scamtracker",type:"nonprofit",description:"Better Business Bureau community scam reports"},{name:"CISA Advisories",url:"https://www.cisa.gov/news-events/cybersecurity-advisories",type:"government",description:"Cybersecurity & Infrastructure Security Agency alerts"},{name:"Krebs on Security",url:"https://krebsonsecurity.com/",type:"blog",description:"In-depth security news and investigation"},{name:"Google Safe Browsing",url:"https://safebrowsing.google.com/",type:"government",description:"Google threat intelligence on unsafe websites"}];function I(r){if(!r)return"Unknown";const c=new Date(r),i=Math.floor((new Date().getTime()-c.getTime())/1e3);return i<60?"just now":i<3600?`${Math.floor(i/60)}m ago`:i<86400?`${Math.floor(i/3600)}h ago`:i<604800?`${Math.floor(i/86400)}d ago`:c.toLocaleDateString()}function re(){const[r,c]=l.useState([]),[b,i]=l.useState(null),[L,j]=l.useState(!0),[o,v]=l.useState(!1),[d,$]=l.useState(""),[m,G]=l.useState(null),[x,U]=l.useState(null),{toast:N}=K();l.useEffect(()=>{w()},[]);const w=async()=>{j(!0);try{const{data:t,error:s}=await B.functions.invoke("public-threats",{body:null,method:"GET"});if(s)throw s;c(t?.threats||[])}catch(t){console.error("Error fetching threats:",t)}finally{j(!1)}},S=async()=>{v(!0);try{const{error:t}=await B.functions.invoke("fetch-threat-feeds");if(t)throw t;N({title:"ð Feeds Updated",description:"Threat intelligence has been refreshed from sources."}),await w()}catch(t){console.error("Error refreshing feeds:",t),N({title:"Refresh Failed",description:"Could not update threat feeds. Try again later.",variant:"destructive"})}finally{v(!1)}},T=r.filter(t=>{const s=!d||t.title.toLowerCase().includes(d.toLowerCase()),n=!m||t.type===m,p=!x||t.severity===x;return s&&n&&p});return e.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-background via-background to-muted/20",children:[e.jsx(X,{title:"Public Threat & Scam Feeds",description:"Real-time threat intelligence from trusted government agencies and security researchers. Stay ahead of phishing, scams, and malware.",canonical:"https://trustworthycheck.com/threat-feeds"}),e.jsx(q,{}),e.jsxs("main",{className:"container mx-auto px-4 py-8 max-w-6xl",children:[e.jsx(a.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},className:"mb-6",children:e.jsx(u,{variant:"ghost",size:"sm",asChild:!0,children:e.jsxs(W,{to:"/",children:[e.jsx(M,{className:"w-4 h-4 mr-2"}),"Back to Checker"]})})}),e.jsxs(a.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"text-center mb-8",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-primary/10 mb-4",children:e.jsx("span",{className:"text-4xl",children:"ð"})}),e.jsx("h1",{className:"font-display text-3xl md:text-4xl font-bold mb-2",children:"Public Threat & Scam Feeds"}),e.jsx("p",{className:"text-muted-foreground max-w-2xl mx-auto mb-6",children:"Real-time intelligence from trusted government agencies, security researchers, and fraud monitoring organizations."}),e.jsxs(a.a,{href:"https://reportfraud.ftc.gov/",target:"_blank",rel:"noopener noreferrer",initial:{opacity:0,scale:.95}
1,animate:{opacity:1,scale:1},transition:{delay:.15},className:"inline-flex items-center gap-3 px-6 py-3 rounded-xl bg-danger text-danger-foreground font-semibold hover:bg-danger/90 transition-all shadow-lg hover:shadow-xl hover:scale-105",children:[e.jsx(y,{className:"w-5 h-5"}),"Report a Scam to the FTC",e.jsx(C,{className:"w-4 h-4"})]})]}),e.jsxs(a.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.1},className:"mb-8",children:[e.jsxs("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[e.jsx(h,{className:"w-5 h-5 text-primary"}),"Trusted Sources"]}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:Y.map((t,s)=>{const n=E[t.type]||E.government;return e.jsxs(a.a,{href:t.url,target:"_blank",rel:"noopener noreferrer",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.05*s},className:"group flex items-start gap-3 p-4 rounded-xl bg-card border border-border hover:border-primary/30 hover:shadow-lg transition-all",children:[e.jsx("div",{className:`w-10 h-10 rounded-lg ${n.color} flex items-center justify-center flex-shrink-0`,children:e.jsx(n.icon,{className:"w-5 h-5"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h3",{className:"font-medium text-sm truncate",children:t.name}),e.jsx(C,{className:"w-3 h-3 text-muted-foreground opacity-0 group-hover:opacity-100 transition-opacity"})]}),e.jsx("p",{className:"text-xs text-muted-foreground line-clamp-2 mt-0.5",children:t.description})]})]},t.name)})})]}),e.jsxs(a.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.2},className:"flex flex-col md:flex-row gap-4 mb-6",children:[e.jsxs("div",{className:"relative flex-1",children:[e.jsx(P,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-muted-foreground"}),e.jsx(J,{type:"text",value:d,onChange:t=>$(t.target.value),placeholder:"Search threats...",className:"pl-10"})]}),e.jsxs("div",{className:"flex gap-2 flex-wrap",children:[e.jsxs("select",{value:m||"",onChange:t=>G(t.target.value||null),className:"h-10 px-3 rounded-lg border border-border bg-card text-sm",children:[e.jsx("option",{value:"",children:"All Types"}),Object.entries(f).map(([t,s])=>e.jsx("option",{value:t,children:s.label},t))]}),e.jsxs("select",{value:x||"",onChange:t=>U(t.target.value||null),className:"h-10 px-3 rounded-lg border border-border bg-card text-sm",children:[e.jsx("option",{value:"",children:"All Severity"}),e.jsx("option",{value:"high",children:"ð´ High"}),e.jsx("option",{value:"medium",children:"ð¡ Medium"}),e.jsx("option",{value:"low",children:"ð¢ Low"})]}),e.jsxs(u,{variant:"outline",onClick:S,disabled:o,className:"gap-2",children:[e.jsx(k,{className:`w-4 h-4 ${o?"animate-spin":""}`}),o?"Updating...":"Refresh"]})]})]}),e.jsxs(a.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{delay:.25},className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-8",children:[e.jsxs("div",{className:"p-4 rounded-xl bg-card border border-border",children:[e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground text-sm mb-1",children:[e.jsx(_,{className:"w-4 h-4"}),"Total Threats"]}),e.jsx("p",{className:"text-2xl font-bold",children:r.length})]}),e.jsxs("div",{className:"p-4 rounded-xl bg-danger/5 border border-danger/20",children:[e.jsxs("div",{className:"flex items-center gap-2 text-danger text-sm mb-1",children:[e.jsx(y,{className:"w-4 h-4"}),"High Severity"]}),e.jsx("p",{className:"text-2xl font-bold text-danger",children:r.filter(t=>t.severity==="high").length})]}),e.jsxs("div",{className:"p-4 rounded-xl bg-warning/5 border border-warning/20",children:[e.jsxs("div",{className:"flex items-center gap-2 text-warning text-sm mb-1",children:[e.jsx(A,{className:"w-4 h-4"}),"Phishing Alerts"]}),e.jsx("p",{className:"text-2xl font-bold text-warning",children:r.filter(t=>t.type==="phishing").length})]}),e.jsxs("div",{className:"p-4 rounded-xl bg-primary/5 border border-primary/20",children:[e.jsxs("div",{className:"flex items-center gap-2 text-primary text-sm mb-1",children:[e.jsx(F,{className:"w-4 h-4"}),"Last Updated"]}),e.jsx("p",{className:"text-lg font-medium text-primary",children:r[0]?I(r[0].date):"Never"})]})]}),L?e.jsx("div",{className:"space-y-4",children:[...Array(5)].map((t,s)=>e.jsx("div",{className:"h-28 rounded-xl bg-card/50 animate-pulse"},s))}):T.length===0?e.jsxs(a.div,{initial:{opacity:0}
1,animate:{opacity:1},className:"text-center py-16",children:[e.jsx(h,{className:"w-16 h-16 text-muted-foreground mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-semibold mb-2",children:"No Threats Found"}),e.jsx("p",{className:"text-muted-foreground mb-6",children:d||m||x?"Try adjusting your filters.":'Click "Refresh" to fetch the latest threat intelligence.'}),e.jsxs(u,{onClick:S,disabled:o,children:[e.jsx(k,{className:`w-4 h-4 mr-2 ${o?"animate-spin":""}`}),"Fetch Threats"]})]}):e.jsx(a.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.3},className:"space-y-3",children:T.map((t,s)=>{const n=f[t.type]||f.general,p=n.icon,g=b===t.id;return e.jsx(a.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:s*.03},onClick:()=>i(g?null:t.id),className:"group p-4 rounded-xl bg-card border border-border hover:border-primary/30 transition-all hover:shadow-lg cursor-pointer",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-start gap-4",children:[e.jsx("div",{className:`w-12 h-12 rounded-xl ${n.color} flex items-center justify-center flex-shrink-0`,children:e.jsx(p,{className:"w-6 h-6"})}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3 mb-2",children:[e.jsx("h3",{className:"font-semibold text-foreground line-clamp-2",children:t.title}),e.jsxs("span",{className:`px-2 py-0.5 rounded-full text-xs font-medium flex-shrink-0 ${t.severity==="high"?"bg-danger/10 text-danger":t.severity==="medium"?"bg-warning/10 text-warning":"bg-success/10 text-success"}`,children:[t.severity==="high"?"ð´":t.severity==="medium"?"ð¡":"ð¢"," ",t.severity]})]}),g&&t.description&&e.jsx(a.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mb-3",children:e.jsx("p",{className:"text-sm text-muted-foreground leading-relaxed",children:t.description})}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3 text-xs text-muted-foreground",children:[e.jsx("span",{className:`px-2 py-0.5 rounded-md ${n.color}`,children:n.label}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(R,{className:"w-3 h-3"}),t.source]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(F,{className:"w-3 h-3"}),I(t.date)]}),!g&&t.description&&e.jsx("span",{className:"text-primary text-xs",children:"Click for details â"})]})]})]})},t.id)})}),e.jsx(a.div,{initial:{opacity:0}
1,animate:{opacity:1},transition:{delay:.4},className:"mt-8 p-4 rounded-xl bg-muted/30 border border-border text-center",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:[e.jsx("strong",{children:"Disclaimer:"})," Threat intelligence is aggregated from public sources and updated periodically. Always verify information with official sources before taking action."]})})]}),e.jsx(V,{})]})}export{re as default};
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.