1/*! For license information please see 9963.a9993d92.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunkkunaiu_addon_v2=self.webpackChunkkunaiu_addon_v2||[]).push([[9963],{746:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(77784).A)("user-x",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]])},2580:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(77784).A)("funnel",[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]])},7118:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(77784).A)("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]])},14459:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(77784).A)("user",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},28646:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(77784).A)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]])},35327:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(77784).A)("mail",[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]])},69022:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(77784).A)("shield-alert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]])},76245:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(77784).A)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},76833:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(77784).A)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},84669:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(77784).A)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]])},95258:(e,t,a)=>{a.d(t,{A:()=>s});const s=(0,a(77784).A)("layers",[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]])},99963:(e,t,a)=>{a.r(t),a.d(t,{default:()=>je});var s=a(22555),r=a(65043),n=a(75439),l=a(65982),i=a(40117),o=a(34677),d=a(9700),c=a(41680),p=a(84669),u=a(38326),m=a(7118),v=a(35327),h=a(14459),b=a(56804),g=a(95258),y=a(70067),f=a(75088),x=a(69022),j=a(77784);const N=(0,j.A)("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);var I=a(76245),k=a(76833),w=a(71482),A=a(9855),_=a(40614),C=a(746),R=a(28646),S=a(42489),T=a(37719),z=a(65727),D=a(71360),M=a(35746),B=a(85692),P=a(39292),U=a(2580);const L=(0,j.A)("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);var E=a(5077);const O=(0,j.A)("scale",[["path",{d:"M12 3v18",key:"108xh3"}],["path",{d:"m19 8 3 8a5 5 0 0 1-6 0zV7",key:"zcdpyk"}],["path",{d:"M3 7h1a17 17 0 0 0 8-2 17 17 0 0 0 8 2h1",key:"1yorad"}],["path",{d:"m5 8 3 8a5 5 0 0 1-6 0zV7",key:"eua70x"}],["path",{d:"M7 21h10",key:"1b0cd5"}]]);var V=a(13005),q=a(10624),G=a(59773),W=a(52222),H=a(70579);const K={posts:{label:"\u0645\u0646\u0634\u0648\u0631",icon:c.A,color:"#6366f1",bg:"rgba(99,102,241,0.12)"},comments:{label:"\u062a\u0639\u0644\u064a\u0642",icon:p.A,color:"#8b5cf6",bg:"rgba(139,92,246,0.12)"},replies:{label:"\u0631\u062f",icon:u.A,color:"#a78bfa",bg:"rgba(167,139,250,0.12)"},teams:{label:"\u0641\u0631\u064a\u0642",icon:m.A,color:"#06b6d4",bg:"rgba(6,182,212,0.12)"},messages:{label:"\u0631\u0633\u0627\u0644\u0629",icon:v.A,color:"#0ea5e9",bg:"rgba(14,165,233,0.12)"},profiles:{label:"\u062d\u0633\u0627\u0628",icon:h.A,color:"#10b981",bg:"rgba(16,185,129,0.12)"},sarhne:{label:"\u0635\u0627\u0631\u062d\u0646\u064a",icon:b.A,color:"#f59e0b",bg:"rgba(245,158,11,0.12)"},groups:{label:"\u0645\u062c\u0645\u0648\u0639\u0629",icon:g.A,color:"#ef4444",bg:"rgba(239,68,68,0.12)"},content_reports:{label:"\u0645\u062d\u062a\u0648\u0649",icon:y.A,color:"#f43f5e",bg:"rgba(244,63,94,0.12)"}},Z={pending:{label:"\u0642\u064a\u062f \u0627\u0644\u0627\u0646\u062a\u0638\u0627\u0631",color:"#94a3b8",dot:"#94a3b8"},investigating:{label:"\u0642\u064a\u062f \u0627\u0644\u062a\u062d\u0642\u064a\u0642",color:"#f59e0b",dot:"#f59e0b"},awaiting_response:{label:"\u064a\u0646\u062a\u0638\u0631 \u0627\u0644\u0631\u062f",color:"#0ea5e9",dot:"#0ea5e9"},escalated:{label:"\u062a\u0645 \u0627\u0644\u062a\u0635\u0639\u064a\u062f",color:"#ef4444",dot:"#ef4444"},action_applied:{label:"\u062a\u0645 \u0627\u0644\u062a\u0635\u0631\u0641",color:"#8b5cf6",dot:"#8b5cf6"},resolved:{label:"\u062a\u0645 \u0627\u0644\u062d\u0644",color:"#10b981",dot:"#10b981"},rejected:{label:"\u0645\u0631\u0641\u0648\u0636",color:"#6b7280",dot:"#6b7280"},closed:{label:"\u0645\u063a\u0644\u0642",color:"#374151",dot:"#374151"}},F=Object.entries(Z).filter((e=>{let[t]=e;return"resolved"!==t})),J=new Set(["rejected","action_applied","resolved","closed"]),Q=new Set(["rejected","action_applied","resolved","closed"]),X={critical:{label:"\u062d\u0631\u062c",color:"#ef4444",bg:"rgba(239,68,68,0.12)",score:[80,100]},high:{label:"\u0639\u0627\u0644\u064a",color:"#f59e0b",bg:"rgba(245,158,11,0.12)",score:[60,79]},medium:{label:"\u0645\u062a\u0648\u0633\u0637",color:"#0ea5e9",bg:"rgba(14,165,233,0.12)",score:[40,59]},low:{label:"\u0645\u0646\u062e\u0641\u0636",color:"#10b981",bg:"rgba(16,185,129,0.12)",score:[0,39]}},Y=[{id:"pending",status:"pending",label:"\u0642\u064a\u062f \u0627\u0644\u0627\u0646\u062a\u0638\u0627\u0631",icon:f.A,color:"#94a3b8"},{id:"investigating",status:"investigating",label:"\u0642\u064a\u062f \u0627\u0644\u062a\u062d\u0642\u064a\u0642",icon:x.A,color:"#f59e0b"},{id:"escalated",status:"escalated",label:"\u062a\u0635\u0639\u064a\u062f \u0644\u0645\u0634\u0631\u0641 \u0623\u0639\u0644\u0649",icon:N,color:"#ef4444"},{id:"rejected",status:"rejected",label:"\u0631\u0641\u0636 \u0627\u0644\u0628\u0644\u0627\u063a",icon:I.A,color:"#6b7280"},{id:"action_applied",status:"action_applied",label:"\u062a\u0645 \u0627\u0644\u062a\u0635\u0631\u0641",icon:k.A,color:"#8b5cf6"}],$=(e,t,a)=>{var s;return"investigating"===e?[{actor:"\u0627\u0644\u0646\u0638\u0627\u0645",action:'\u062a\u0645 \u0627\u0633\u062a\u0644\u0627\u0645 \u0627\u0644\u0628\u0644\u0627\u063a \u0631\u0633\u0645\u064a\u064b\u0627 \u0628\u0648\u0627\u0633\u0637\u0629 \u0627\u0644\u0645\u0634\u0631\u0641 "'.concat(t,'" \u0648\u0641\u062a\u062d \u062a\u062d\u0642\u064a\u0642 \u0641\u0648\u0631\u064a \u0641\u064a \u0627\u0644\u0648\u0627\u0642\u0639\u0629.'),time:a},{actor:t,action:'\u0627\u0644\u0645\u0634\u0631\u0641 "'.concat(t,'" \u064a\u0634\u0631\u0641 \u0627\u0644\u0622\u0646 \u0639\u0644\u0649 \u0627\u0644\u062a\u062d\u0642\u0642 \u0627\u0644\u062f\u0642\u064a\u0642 \u0645\u0646 \u0635\u062d\u0629 \u0627\u0644\u0628\u0644\u0627\u063a \u0648\u062c\u0645\u0639 \u0627\u0644\u0623\u062f\u0644\u0629 \u0644\u0627\u062a\u062e\u0627\u0630 \u0627\u0644\u0642\u0631\u0627\u0631 \u0627\u0644\u0645\u0646\u0627\u0633\u0628.'),time:a+1}]:"escalated"===e?[{actor:"\u0627\u0644\u0646\u0638\u0627\u0645",action:"\u062a\u0645 \u0631\u0641\u0639 \u0627\u0644\u062a\u062d\u0642\u064a\u0642 \u0625\u0644\u0649 \u0627\u0644\u0625\u062f\u0627\u0631\u0629 \u0627\u0644\u0639\u0644\u064a\u0627 \u0644\u0627\u0633\u062a\u0643\u0645\u0627\u0644 \u0627\u0644\u0645\u0631\u0627\u062c\u0639\u0629 \u0639\u0644\u0649 \u0645\u0633\u062a\u0648\u0649 \u0623\u0639\u0644\u0649 \u0645\u0646 \u0627\u0644\u0635\u0644\u0627\u062d\u064a\u0629.",time:a}]:"rejected"===e?[{actor:"\u0627\u0644\u0646\u0638\u0627\u0645",action:"\u062a\u0645 \u0631\u0641\u0636 \u0627\u0644\u0628\u0644\u0627\u063a \u0628\u0639\u062f \u0645\u0631\u0627\u062c\u0639\u0629 \u0634\u0627\u0645\u0644\u0629\u060c \u0648\u0644\u0645 \u064a\u062a\u0645 \u0627\u0644\u0639\u062b\u0648\u0631 \u0639\u0644\u0649 \u0645\u062e\u0627\u0644\u0641\u0629 \u0641\u0639\u0644\u064a\u0629 \u062a\u062f\u0639\u0645 \u0645\u0627 \u0648\u0631\u062f \u0641\u064a \u0627\u0644\u0628\u0644\u0627\u063a.",time:a}]:"action_applied"===e?[{actor:"\u0627\u0644\u0646\u0638\u0627\u0645",action:"\u0634\u0643\u0631\u064b\u0627 \u0639\u0644\u0649 \u0628\u0644\u0627\u063a\u0643. \u
2062a\u0645 \u0627\u0644\u062a\u062d\u0642\u0642 \u0645\u0646 \u0627\u0644\u062d\u0627\u0644\u0629 \u0648\u0627\u062a\u062e\u0627\u0630 \u0625\u062c\u0631\u0627\u0621 \u0641\u0639\u0644\u064a \u0639\u0644\u0649 \u0627\u0644\u0645\u062d\u062a\u0648\u0649/\u0627\u0644\u062d\u0633\u0627\u0628 \u0627\u0644\u0645\u062e\u0627\u0644\u0641.",time:a}]:"pending"===e?[{actor:"\u0627\u0644\u0646\u0638\u0627\u0645",action:"\u062a\u0645 \u0625\u0639\u0627\u062f\u0629 \u0636\u0628\u0637 \u062d\u0627\u0644\u0629 \u0627\u0644\u0628\u0644\u0627\u063a \u0625\u0644\u0649 \u0642\u064a\u062f \u0627\u0644\u0627\u0646\u062a\u0638\u0627\u0631 \u0648\u0625\u062f\u0631\u0627\u062c\u0647 \u0636\u0645\u0646 \u0642\u0627\u0626\u0645\u0629 \u0627\u0644\u0645\u0631\u0627\u062c\u0639\u0629.",time:a}]:[{actor:t,action:"\u062a\u0645 \u062a\u062d\u062f\u064a\u062b \u062d\u0627\u0644\u0629 \u0627\u0644\u0628\u0644\u0627\u063a \u0625\u0644\u0649 ".concat((null===(s=Z[e])||void 0===s?void 0:s.label)||e,"."),time:a}]},ee={post:"posts",comment:"comments",reply:"replies",message:"messages",sarahah:"sarhne",profile:"profiles"},te=e=>{if("number"===typeof(null===e||void 0===e?void 0:e.aiScore))return e.aiScore;const t=(0,d.Np)(e);if(t>0)return t;switch(null===e||void 0===e?void 0:e.severity){case"critical":return 90;case"high":return 70;case"medium":return 50;case"low":return 25;default:return 20}},ae=e=>{if(null!==e&&void 0!==e&&e.severity&&X[e.severity])return e.severity;const t=te(e);return t>=80?"critical":t>=60?"high":t>=40?"medium":"low"},se=e=>!Q.has(null===e||void 0===e?void 0:e.status),re=e=>String(null!==e&&void 0!==e?e:"").trim().toUpperCase().replace(/^RPT-/,"").replace(/[^0-9]/g,""),ne=e=>{const t=(null===e||void 0===e?void 0:e.type)||(null===e||void 0===e?void 0:e.targetType)||"";return"posts"===t||"post"===t?"post":"comments"===t||"comment"===t?"comment":"replies"===t||"reply"===t?"reply":"messages"===t||"message"===t?"message":t},le=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"content_reports"===e?ee[t.targetType]||"content_reports":"suggestions_reports"===e?"sarhne":"literature_report"===e?"profile_img"===t.type||"cover_img"===t.type?"profiles":"posts":"police_report"===e||"health_report"===e?"profiles":"law_report"===e?"posts":"content_reports"},ie=e=>{let{sourceType:t,reportId:a,report:s={},parentUserId:r=null,index:n=0}=e;const l=s.reporterId||s.reportedBy||s.userId||null,i=s.reportedUserId||s.targetUserId||s.targetId||null,o=s.timestamp||Date.now(),d=((e,t)=>Array.isArray(t)?[...new Set(t.filter((t=>"string"===typeof t&&t&&t!==e)))]:[])(a,s.similarReportIds);return{id:"RPT-".concat(String(n+1).padStart(5,"0")),_fbId:a,_fbType:t,type:le(t,s),status:s.status||"pending",severity:ae(s),aiScore:te(s),reason:s.reason||s.content||s.messageText||s.description||"\u063a\u064a\u0631 \u0645\u062d\u062f\u062f",description:s.description||s.content||s.messageText||"",reporterName:s.reporterName||s.userName||"",reporterTrust:"number"===typeof s.reporterTrust?s.reporterTrust:0,reporterId:l,targetId:i,messageId:s.targetId||null,chatRoomId:s.chatRoomId||null,isGroupChat:!!s.isGroupChat,contentText:s.contentText||"",assignedToId:s.handledById||s.assignedToId||null,postId:s.postId||null,commentId:s.commentId||null,replyId:s.replyId||null,targetName:s.targetName||s.reportedUserName||s.userName||s.userTag||"",relatedCount:d.length>0?d.length:"number"===typeof s.relatedCount?s.relatedCount:0,similarReportIds:d,prevViolations:"number"===typeof s.prevViolations?s.prevViolations:0,assignedTo:s.handledByName||s.assignedToName||s.handledBy||s.assignedTo||null,moderatorReplies:Array.isArray(s.moderatorReplies)?s.moderatorReplies:s.moderatorReplyText||s.replyText?[{text:s.moderatorReplyText||s.replyText||"",byId:s.moderatorReplyById||null,byName:s.moderatorReplyByName||null,at:s.moderatorReplyAt||null}]:[],timestamp:o,timeline:[{actor:"\u0627\u0644\u0646\u0638\u0627\u0645",action:"\u0627\u0633\u062a\u0644\u0627\u0645 \u0627\u0644\u0628\u0644\u0627\u063a",time:o},...s.handledBy||s.handledByName?[{actor:s.handledByName||"\u0645\u0634\u0631\u0641",action:"\u0628\u062f\u0621 \u0645\u0631\u0627\u062c\u0639\u0629 \u0627\u0644\u0628\u0644\u0627\u063a",time:s.handledAt||o}]:[]],notes:Array.isArray(s.notes)?s.notes:[],sourceUserId:r}},oe=e=>null!==e&&void 0!==e&&e._fbType&&null!==e&&void 0!==e&&e._fbId?"content_reports/".concat(e._fbId):null,de=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";if(!t)return a||"\u063a\u064a\u0631 \u0645\u0639\u0631\u0648\u0641";const s=e[t]||{};return s.name||s.fullName||s.displayName||s.username||a||"\u063a\u064a\u0631 \u0645\u0639\u0631\u0648\u0641"},ce=(e,t)=>{if(!t)return"";const a=e[t]||{};return a.img||a.avatar||""},pe=(e,t)=>{if(!t)return"\u063a\u064a\u0631 \u0645\u062e\u0635\u0635";const a=e[t]||{};return a.name||a.fullName||a.displayName||a.username||t},ue=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return"number"===typeof e.warningsCount?e.warningsCount:"number"===typeof e.warnings?e.warnings:Array.isArray(e.warnings)?e.warnings.length:e.warnings&&"object"===typeof e.warnings?Object.keys(e.warnings).length:0},me=e=>String(null!==e&&void 0!==e?e:"").replace(/[\u0660-\u0669]/g,(e=>String("\u0660\u0661\u0662\u0663\u0664\u0665\u0666\u0667\u0668\u0669".indexOf(e)))),ve=e=>{if(!e)return"-";const t=new Date(e);
2return Number.isNaN(t.getTime())?"-":me(t.toLocaleString("ar-EG",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0}))},he=e=>{let{icon:t,label:a,value:s,sub:r,accent:n,statPercent:l,trendDirection:i="negative",onClick:o,isActive:d}=e;return(0,H.jsxs)("button",{type:"button",className:"rp-stat-card ".concat(d?"rp-stat-card--active":""),onClick:o,children:[(0,H.jsx)("div",{className:"rp-stat-icon",style:{"--accent":n},children:(0,H.jsx)(t,{size:18})}),(0,H.jsxs)("div",{className:"rp-stat-body",children:[(0,H.jsx)("div",{className:"rp-stat-value",children:s}),(0,H.jsx)("div",{className:"rp-stat-label",children:a}),r&&(0,H.jsx)("div",{className:"rp-stat-sub",style:{color:n},children:r})]}),"number"===typeof l&&(0,H.jsxs)("div",{className:"rp-stat-trend ".concat("positive"===i?"rp-stat-trend--positive":"rp-stat-trend--negative"),children:[l,"%"]})]})},be=e=>{let{score:t}=e;const a=X[t>=80?"critical":t>=60?"high":t>=40?"medium":"low"];return(0,H.jsxs)("div",{className:"rp-severity-bar",children:[(0,H.jsx)("div",{className:"rp-severity-track",children:(0,H.jsx)("div",{className:"rp-severity-fill",style:{width:"".concat(t,"%"),background:a.color}})}),(0,H.jsxs)("span",{style:{color:a.color,fontSize:11,fontWeight:600},children:[t,"%"]})]})},ge=e=>{let{status:t}=e;const a=Z[t]||Z.pending;return(0,H.jsxs)("span",{className:"rp-status-badge",children:[(0,H.jsx)("span",{className:"rp-status-dot",style:{background:a.dot}}),a.label]})},ye=e=>{let{type:t}=e;const a=K[t];if(!a)return null;const s=a.icon;return(0,H.jsxs)("span",{className:"rp-type-badge",style:{color:a.color,background:a.bg},children:[(0,H.jsx)(s,{size:12}),a.label]})},fe=e=>{let{report:t,userDataMap:a,similarCandidates:s=[],linkedSimilarReports:n=[],onClose:l,onStatusChange:d,onNote:c,onEditNote:p,onDeleteNote:u,onOpenProfile:m,onOpenContent:v,onReviewChat:b,canReviewChat:g,onSaveReply:y,onLinkSimilarReport:f,onUnlinkSimilarReport:x,canDeleteReport:j,onDeleteReport:N}=e;const[I,k]=(0,r.useState)(""),[B,P]=(0,r.useState)("overview"),U=(0,r.useRef)(null),[L,E]=(0,r.useState)(null),[O,V]=(0,r.useState)(""),[q,G]=(0,r.useState)(!1),[W,Z]=(0,r.useState)("unknown"),[F,J]=(0,r.useState)(""),[Q,X]=(0,r.useState)(!1),[$,ee]=(0,r.useState)(null),[te,ae]=(0,r.useState)(""),[se,le]=(0,r.useState)(!1);(0,r.useEffect)((()=>{G(!1)}),[null===t||void 0===t?void 0:t.id]),(0,r.useEffect)((()=>{J(""),ee(null)}),[null===t||void 0===t?void 0:t.id]),(0,r.useEffect)((()=>{Array.isArray(s)&&0!==s.length?ae((e=>{var t;return e||(null===(t=s[0])||void 0===t?void 0:t.id)||""})):ae("")}),[null===t||void 0===t?void 0:t.id,s]),(0,r.useEffect)((()=>{let e=!0;return(async()=>{if(!t)return void(e&&Z("unknown"));const a=ne(t);try{if("message"===a){if(!t.chatRoomId||!t.messageId)return void(e&&Z(t.contentText?"available":"unknown"));const a=t.isGroupChat?"group_messages/".concat(t.chatRoomId,"/").concat(t.messageId):"private_messages/".concat(t.chatRoomId,"/").concat(t.messageId),s=await i.firebase.database().ref(a).once("value");return void(e&&Z(s.val()?"available":"deleted"))}const s=t.postId||t.targetId;if(!s)return void(e&&Z("unknown"));if("post"===a){const t=(await i.firebase.database().ref("posts/".concat(s)).once("value")).val();return void(e&&Z(!t||t.deleted?"deleted":"available"))}if("comment"===a&&t.commentId){const a=await i.firebase.database().ref("posts/".concat(s,"/comments/").concat(t.commentId)).once("value");return void(e&&Z(a.val()?"available":"deleted"))}if("reply"===a&&t.commentId&&t.replyId){const a=await i.firebase.database().ref("posts/".concat(s,"/comments/").concat(t.commentId,"/replies/").concat(t.replyId)).once("value");return void(e&&Z(a.val()?"available":"deleted"))}e&&Z("unknown")}catch(s){console.error("Error checking target state:",s),e&&Z("unknown")}})(),()=>{e=!1}}),[null===t||void 0===t?void 0:t.id,null===t||void 0===t?void 0:t.postId,null===t||void 0===t?void 0:t.targetId,null===t||void 0===t?void 0:t.messageId,null===t||void 0===t?void 0:t.chatRoomId,null===t||void 0===t?void 0:t.isGroupChat,null===t||void 0===t?void 0:t.commentId,null===t||void 0===t?void 0:t.replyId,null===t||void 0===t?void 0:t.type]);const ie=(0,r.useMemo)((()=>{const e=te.trim(),t=re(e);return e?s.filter((a=>
2{const s=re(a.id||a._fbId),r=String(a.id||"").toUpperCase(),n=String(a._fbId||"").toUpperCase(),l=e.toUpperCase();return t?s.includes(t):r.includes(l)||n.includes(l)})):s}),[s,te]);if(!t)return null;(K[t.type]||{}).icon||w.A;const oe=de(a,t.reporterId,t.reporterName),ue=ce(a,t.reporterId),he=de(a,t.targetId,t.targetName),fe=ce(a,t.targetId),xe=((e,t)=>{const a=null===t||void 0===t?void 0:t.assignedToId;if(a&&e[a])return a;const s=null===t||void 0===t?void 0:t.assignedTo;if(!s)return null;if(e[s])return s;const r=String(s).trim().toLowerCase();if(!r)return null;const n=Object.entries(e).find((e=>{let[,t]=e;return!(!t||"object"!==typeof t)&&[t.name,t.fullName,t.displayName,t.username].filter(Boolean).map((e=>String(e).trim().toLowerCase())).includes(r)}));return n?n[0]:null})(a,t),je="message"===ne(t),Ne=()=>{je?null===b||void 0===b||b(t):null===v||void 0===v||v(t)},Ie=async()=>{null!==L&&O.trim()&&(await(null===p||void 0===p?void 0:p(t,L,O.trim())),E(null),V(""))},ke=async()=>{if(se)return;const e=re(te),a=s.find((t=>{const a=re(t.id||t._fbId),s=String(t._fbId||"").toUpperCase(),r=String(te||"").trim().toUpperCase();return e?a===e:s===r}));if(a){le(!0);try{await(null===f||void 0===f?void 0:f(t,a._fbId)),ae("")}finally{le(!1)}}};return(0,H.jsxs)("div",{className:"rp-detail-panel",children:[(0,H.jsxs)("div",{className:"rp-detail-header",children:[(0,H.jsxs)("div",{className:"rp-detail-id",children:[(0,H.jsx)("span",{children:t.id}),(0,H.jsx)(ye,{type:t.type}),(0,H.jsx)(ge,{status:t.status})]}),(0,H.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[j&&(0,H.jsxs)("button",{type:"button",className:"rp-note-action-btn rp-note-action-btn--danger",onClick:()=>null===N||void 0===N?void 0:N(t),title:"\u062d\u0630\u0641 \u0627\u0644\u0628\u0644\u0627\u063a (\u0645\u062e\u0635\u0635 \u0644\u0644\u0645\u0634\u0631\u0641 \u0627\u0644\u0639\u0627\u0645 \u0648\u0646\u0627\u0626\u0628\u0647 \u0641\u0642\u0637)",children:[(0,H.jsx)(A.A,{size:14})," \u062d\u0630\u0641 \u0627\u0644\u0628\u0644\u0627\u063a"]}),(0,H.jsx)("button",{className:"rp-icon-btn",onClick:l,children:(0,H.jsx)(_.A,{size:18})})]})]}),(0,H.jsx)("div",{className:"rp-tabs",children:["overview","timeline","status","notes"].map((e=>(0,H.jsx)("button",{className:"rp-tab ".concat(B===e?"active":""),onClick:()=>P(e),children:"overview"===e?"\u0646\u0638\u0631\u0629 \u0639\u0627\u0645\u0629":"timeline"===e?"\u0627\u0644\u0633\u062c\u0644":"status"===e?"\u0627\u0644\u062d\u0627\u0644\u0629":"\u0627\u0644\u0645\u0644\u0627\u062d\u0638\u0627\u062a"},e)))}),(0,H.jsxs)("div",{className:"rp-detail-body",children:["overview"===B&&(0,H.jsxs)("div",{className:"rp-overview",children:[(0,H.jsxs)("div",{className:"rp-meta-grid",children:[(0,H.jsxs)("button",{className:"rp-meta-cell rp-meta-cell--clickable",onClick:()=>t.reporterId&&(null===m||void 0===m?void 0:m(t.reporterId)),type:"button",disabled:!t.reporterId,children:[(0,H.jsx)("div",{className:"rp-meta-label",children:"\u0627\u0644\u0645\u064f\u0628\u0644\u0650\u0651\u063a"}),(0,H.jsxs)("div",{className:"rp-meta-val rp-user-inline",children:[ue?(0,H.jsx)("img",{src:ue,alt:oe,className:"rp-user-avatar"}):(0,H.jsx)(h.A,{size:13}),(0,H.jsx)("span",{children:oe})]})]}),(0,H.jsxs)("div",{className:"rp-meta-cell rp-meta-cell--clickable",children:[(0,H.jsx)("div",{className:"rp-meta-label",children:"\u0627\u0644\u0647\u062f\u0641"}),(0,H.jsxs)("button",{className:"rp-meta-val rp-meta-button rp-user-inline",onClick:()=>t.targetId&&(null===m||void 0===m?void 0:m(t.targetId)),type:"button",disabled:!t.targetId,children:[fe?(0,H.jsx)("img",{src:fe,alt:he,className:"rp-user-avatar"}):(0,H.jsx)(C.A,{size:13}),(0,H.jsx)("span",{children:he})]})]}),(0,H.jsxs)("div",{className:"rp-meta-cell rp-meta-cell--clickable",children:[(0,H.jsx)("div",{className:"rp-meta-label",children:"\u062a\u0627\u0631\u064a\u062e \u0627\u0644\u0625\u0628\u0644\u0627\u063a"}),(0,H.jsxs)("button",{className:"rp-meta-val rp-meta-button",type:"button",onClick:()=>G((e=>!e)),title:q?"\u0639\u0631\u0636 \u0627\u0644\u0648\u0642\u062a \u0627\u0644\u0646\u0633\u0628\u064a":"\u0639\u0631\u0636 \u0627\u0644\u062a\u0627\u0631\u064a\u062e \u0648\u0627\u0644\u0648\u0642\u062a \u0627\u0644\u0643\u0627\u0645\u0644",children:[(0,H.jsx)(R.A,{size:13}),q?ve(t.timestamp):me((0,o.f)(t.timestamp))]})]}),(0,H.jsxs)("div",{className:"rp-meta-cell rp-meta-cell--clickable",children:[(0,H.jsx)("div",{className:"rp-meta-label",children:"\u0645\u062e\u0635\u0635 \u0644\u0640"}),(0,H.jsxs)("button",{className:"rp-meta-val rp-meta-button rp-user-inline",onClick:()=>xe&&(null===m||void 0===m?void 0:m(xe)),type:"button",disabled:!xe,children:[(0,H.jsx)(S.A,{size:13}),(0,H.jsx)("span",{children:pe(a,t.assignedTo)})]})]}),(0,H.jsxs)("div",{className:"rp-meta-cell",children:[(0,H.jsx)("div",{className:"rp-meta-label",children:"\u0645\u062e\u0627\u0644\u0641\u0627\u062a \u0633\u0627\u0628\u0642\u0629"}),(0,H.jsxs)("div",{className:"rp-meta-val",style:{color:t.prevViolations>2?"#ef4444":"inherit"},children:[(0,H.jsx)(T.A,{size:13}),t.prevViolations," \u0645\u062e\u0627\u0644\u0641\u0629"]})]}),(0,H.jsxs)("div",{className:"rp-meta-cell",children:[(0,H.jsx)("div",{className:"rp-meta-label",children:"\u0627\u0644\u0645\u062d\u062a\u0648\u0649 \u0627\u0644\u0623\u0635\u0644\u064a"}),(0,H.jsxs)("div",{className:"rp-meta-val",style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[(0,H.jsx)("span",{children:"deleted"===W?"\u0645\u062d\u0630\u0648\u0641 \u0623\u0648 \u063a\u064a\u0631 \u0645\u062a\u0627\u062d":"available"===W?"\u0645\u062a\u0627\u062d \u0644\u0644\u0645\u0631\u0627\u062c\u0639\u0629":"\u063a\u064a\u0631 \u0645\u0639\u0631\u0648\u0641"}),je?g?(0,H.jsx)("button",{className:"rp-note-action-btn",type:"button",onClick:Ne,disabled:!t.chatRoomId,children:"\u0645\u0631\u0627\u062c\u0639\u0629 \u0627\u0644\u0645\u062d\u0627\u062f\u062b\u0629"}):(0,H.jsxs)("span",{className:"rp-locked-hint",title:"\u0645\u0631\u0627\u062c\u0639\u0629 \u0627\u0644\u0645\u062d\u0627\u062f\u062b\u0629 \u0645\u062a\u0627\u062d\u0629 \u0641\u0642\u0637 \u0644\u0644\u0645\u0634\u0631\u0641 \u0627\u0644\u0639\u0627\u0645 \u0648\u0646\u0627\u0626\u0628 \u0627\u0644\u0645\u0634\u0631\u0641 \u0627\u0644\u0639\u0627\u0645",children:[(0,H.jsx)(z.A,{size:12})," \u0645\u0631\u0627\u062c\u0639\u0629 \u0627\u0644\u0645\u062d\u0627\u062f\u062b\u0629 (\u0645\u0642\u064a\u0651\u062f\u0629)"]}):(0,H.jsx)("button",{className:"rp-note-action-btn",type:"button",onClick:Ne,disabled:!v,children:"\u0639\u0631\u0636 \u0627\u0644\u0645\u062d\u062a\u0648\u0649"})]})]})]}),je&&(0,H.jsxs)("div",{className:"rp-reason-block rp-reported-message-block",children:[(0,H.jsx)("div",{className:"rp-block-label",children:"\u0627\u0644\u0631\u0633\u0627\u0644\u0629 \u0627\u0644\u0645\u064f\u0628\u0644\u0651\u063a \u0639\u0646\u0647\u0627"}),t.contentText?(0,H.jsx)("p",{className:"rp-reported-message-text",children:t.contentText}):(0,H.jsx)("p",{className:"rp-reported-message-empty",children:"\u0644\u0645 \u064a\u062a\u0645 \u062d\u0641\u0638 \u0646\u0635 \u0627\u0644\u0631\u0633\u0627\u0644\u0629 \u0645\u0639 \u0647\u0630\u0627 \u0627\u0644\u0628\u0644\u0627\u063a"})]}),(0,H.jsxs)("div",{className:"rp-reason-block",children:[(0,H.jsx)("div",{className:"rp-block-label",children:"\u0633\u0628\u0628 \u0627\u0644\u0628\u0644\u0627\u063a"}),(0,H.jsx)("p",{children:t.reason})]}),t.description&&t.description!==t.reason&&(0,H.jsxs)("div",{className:"rp-reason-block",children:[(0,H.jsx)("div",{className:"rp-block-label",children:"\u062a\u0641\u0627\u0635\u064a\u0644 \u0625\u0636\u0627\u0641\u064a\u0629 \u0645\u0646 \u0627\u0644\u0645\u064f\u0628\u0644\u0650\u0651\u063a"}),(0,H.jsx)("p",{children:t.description})]}),(0,H.jsxs)("div",{className:"rp-reason-block",style:{marginTop:16},children:[(0,H.jsx)("div",{className:"rp-block-label",children:"\u0631\u062f \u0627\u0644\u0645\u0634\u0631\u0641"}),(0,H.jsx)("textarea",{className:"rp-note-input",style:{width:"100%",boxSizing:"border-box",display:"block"},rows:4,value:F,onChange:e=>J(e.target.value),placeholder:null!==$?"\u062a\u0639\u062f\u064a\u0644 \u0631\u062f \u0627\u0644\u0645\u0634\u0631\u0641...":"\u0627\u0643\u062a\u0628 \u0631\u062f \u0627\u0644\u0645\u0634\u0631\u0641 \u0639\u0644\u0649 \u0627\u0644\u0628\u0644\u0627\u063a..."}),(0,H.jsxs)("div",{className:"rp-note-edit-actions",style:{marginTop:10},children:[(0,H.jsx)("button",{type:"button",className:"rp-note-action-btn",onClick:async()=>
2{if(F.trim()&&!Q){X(!0);try{await(null===y||void 0===y?void 0:y(t,F.trim(),$)),J(""),ee(null)}finally{X(!1)}}},disabled:!F.trim()||Q,children:Q?"\u062c\u0627\u0631\u064a \u0627\u0644\u0625\u0631\u0633\u0627\u0644...":null!==$?"\u062a\u062d\u062f\u064a\u062b \u0627\u0644\u0631\u062f":"\u0625\u0631\u0633\u0627\u0644 \u0627\u0644\u0631\u062f"}),null!==$&&(0,H.jsx)("button",{type:"button",className:"rp-note-action-btn",onClick:()=>{ee(null),J("")},disabled:Q,children:"\u0625\u0644\u063a\u0627\u0621 \u0627\u0644\u062a\u0639\u062f\u064a\u0644"})]}),Array.isArray(t.moderatorReplies)&&t.moderatorReplies.length>0?(0,H.jsx)("div",{style:{marginTop:12,display:"grid",gap:10},children:t.moderatorReplies.map(((e,a)=>(0,H.jsxs)("div",{style:{padding:"10px 12px",borderRadius:12,background:"rgba(148,163,184,0.12)"},children:[(0,H.jsxs)("div",{style:{fontSize:12,opacity:.8,marginBottom:6},children:[e.byName||"\u0645\u0634\u0631\u0641",e.at?" \xb7 ".concat((0,o.f)(e.at)):"",(0,H.jsx)("button",{type:"button",className:"rp-note-action-btn",style:{marginInlineStart:8},onClick:()=>(e=>{const a=Array.isArray(t.moderatorReplies)?t.moderatorReplies[e]:null;a&&(ee(e),J(a.text||""),P("overview"))})(a),children:"\u062a\u0639\u062f\u064a\u0644 \u0627\u0644\u0631\u062f"})]}),(0,H.jsx)("div",{children:e.text})]},"".concat(e.at||a,"-").concat(a))))}):null]}),(0,H.jsx)("div",{className:"rp-block-label",style:{marginTop:16},children:"\u062a\u062d\u0644\u064a\u0644 \u0627\u0644\u0630\u0643\u0627\u0621 \u0627\u0644\u0627\u0635\u0637\u0646\u0627\u0639\u064a"}),(0,H.jsxs)("div",{className:"rp-ai-analysis",children:[(0,H.jsxs)("div",{className:"rp-ai-row",children:[(0,H.jsx)("span",{children:"\u0646\u0642\u0627\u0637 \u0627\u0644\u0645\u062e\u0627\u0637\u0631\u0629"}),(0,H.jsx)(be,{score:t.aiScore})]}),(0,H.jsxs)("div",{className:"rp-ai-row",children:[(0,H.jsx)("span",{children:"\u062b\u0642\u0629 \u0627\u0644\u0645\u0628\u0644\u063a"}),(0,H.jsx)(be,{score:"number"===typeof t.reporterTrust?t.reporterTrust:0})]}),(0,H.jsxs)("div",{className:"rp-ai-row",children:[(0,H.jsx)("span",{children:"\u0627\u0644\u0645\u062e\u0627\u0644\u0641\u0627\u062a \u0627\u0644\u0645\u0631\u062a\u0628\u0637\u0629"}),(0,H.jsxs)("div",{style:{display:"grid",gap:8,width:"100%"},children:[(0,H.jsxs)("span",{className:"rp-related-count",children:[t.relatedCount," \u0628\u0644\u0627\u063a \u0645\u0634\u0627\u0628\u0647"]}),(0,H.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center",flexWrap:"wrap"},children:[(0,H.jsx)("input",{className:"rp-similar-input",type:"text",value:te,onChange:e=>ae(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),ke())},placeholder:"\u0627\u0628\u062d\u062b \u0628\u0631\u0642\u0645 \u0627\u0644\u0628\u0644\u0627\u063a: RPT-00002 \u0623\u0648 00002",disabled:se}),(0,H.jsx)("button",{type:"button",className:"rp-note-action-btn",onClick:ke,disabled:!te.trim()||se||0===ie.length,title:"\u0625\u0636\u0627\u0641\u0629 \u0628\u0644\u0627\u063a \u0645\u0634\u0627\u0628\u0647",children:(0,H.jsx)(D.A,{size:13})})]}),(0,H.jsx)("div",{style:{display:"grid",gap:6},children:ie.length>0?(()=>{const e=ie[0],a=String(e.reason||"").slice(0,42);return(0,H.jsxs)("button",{type:"button",className:"rp-note-action-btn",onClick:()=>(async e=>{if(e&&!se){le(!0);try{await(null===f||void 0===f?void 0:f(t,e._fbId)),ae(e.id||"")}finally{le(!1)}}})(e),disabled:se,style:{justifyContent:"space-between",width:"100%"},children:[(0,H.jsx)("span",{children:e.id}),(0,H.jsx)("span",{style:{opacity:.72,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},children:a})]})})():te.trim()&&(0,H.jsx)("div",{style:{fontSize:12,opacity:.72},children:"\u0644\u0627 \u062a\u0648\u062c\u062f \u0628\u0644\u0627\u063a\u0627\u062a \u0645\u0641\u062a\u0648\u062d\u0629 \u0645\u0637\u0627\u0628\u0642\u0629 \u0644\u0647\u0630\u0627 \u0627\u0644\u0631\u0642\u0645 \u0623\u0648 \u0623\u0646\u0647 \u0645\u0636\u0627\u0641 \u0645\u0633\u0628\u0642\u064b\u0627"})}),n.length>0&&(0,H.jsx)("div",{style:{display:"grid",gap:6,marginTop:4},children:n.map((e=>(0,H.jsxs)("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"8px 10px",borderRadius:10,background:"rgba(148,163,184,0.10)",minWidth:0},children:[(0,H.jsxs)("div",{style:{minWidth:0},children:[(0,H.jsx)("div",{style:{fontSize:12,fontWeight:600},children:e.id}),(0,H.jsx)("div",{style:{fontSize:11,opacity:.75,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100%"},children:String(e.reason||"").slice(0,52)})]}),(0,H.jsx)("button",{type:"button",className:"rp-note-action-btn rp-note-action-btn--danger",onClick:()=>null===x||void 0===x?void 0:x(t,e._fbId),children:"\u062d\u0630\u0641"})]},e._fbId)))})]})]})]})]}),"timeline"===B&&(0,H.jsx)("div",{className:"rp-timeline",children:(t.timeline||[]).map(((e,t)=>(0,H.jsxs)("div",{className:"rp-timeline-item",children:[(0,H.jsx)("div",{className:"rp-tl-dot"}),(0,H.jsxs)("div",{className:"rp-tl-content",children:[(0,H.jsx)("span",{className:"rp-tl-actor",children:e.actor}),(0,H.jsx)("span",{className:"rp-tl-action",children:e.action}),(0,H.jsx)("span",{className:"rp-tl-time",children:(0,o.f)(e.time)})]})]},t)))}),"status"===B&&(0,H.jsx)("div",{className:"rp-actions-grid",children:Y.map((e=>{const a=e.icon,s=t.status===e.status;return(0,H.jsxs)("button",{className:"rp-action-btn ".concat(s?"rp-action-btn--active":""),onClick:()=>d(t,e),style:{"--act-color":e.color},"aria-pressed":s,children:[(0,H.jsx)(a,{size:15}),(0,H.jsx)("span",{children:e.label}),s&&(0,H.jsx)("span",{className:"rp-action-btn-current-badge",children:"\u0627\u0644\u062d\u0627\u0644\u0629 \u0627\u0644\u062d\u0627\u0644\u064a\u0629"})]},e.id)}))}),"notes"===B&&(0,H.jsxs)("div",{className:"rp-notes-section",children:[0===(t.notes||[]).length&&(0,H.jsx)("div",{className:"rp-empty-notes",children:"\u0644\u0627 \u062a\u0648\u062c\u062f \u0645\u0644\u0627\u062d\u0638\u0627\u062a \u0628\u0639\u062f"}),(t.notes||[]).map(((e,a)=>(0,H.jsxs)("div",{className:"rp-note-item",children:[(0,H.jsxs)("div",{className:"rp-note-meta",children:[(0,H.jsx)(S.A,{size:12}),e.author," \xb7 ",(0,o.f)(e.time),(0,H.jsxs)("div",{className:"rp-note-actions",children:[(0,H.jsx)("button",{type:"button",className:"rp-note-action-btn",onClick:()=>(e=>{var a;E(e),V((null===(a=t.notes[e])||void 0===a?void 0:a.text)||"")})(a),children:"\u062a\u0639\u062f\u064a\u0644"}),(0,H.jsx)("button",{type:"button",className:"rp-note-action-btn rp-note-action-btn--danger",onClick:()=>null===u||void 0===u?void 0:u(t,a),children:"\u062d\u0630\u0641"})]})]}),L===a?(0,H.jsxs)("div",{className:"rp-note-edit",children:[(0,H.jsx)("textarea",{className:"rp-note-input",rows:3,value:O,onChange:e=>V(e.target.value)}),(0,H.jsxs)("div",{className:"rp-note-edit-actions",children:[(0,H.jsx)("button",{type:"button",className:"rp-note-action-btn",onClick:Ie,children:"\u062d\u0641\u0638"}),(0,H.jsx)("button",{type:"button",className:"rp-note-action-btn",onClick:()=>{E(null),V("")},children:"\u0625\u0644\u063a\u0627\u0621"})]})]}):(0,H.jsx)("p",{children:e.text})]},a))),(0,H.jsxs)("div",{className:"rp-note-composer",children:[(0,H.jsx)("textarea",{ref:U,className:"rp-note-input",placeholder:"\u0623\u0636\u0641 \u0645\u0644\u0627\u062d\u0638\u0629 \u062f\u0627\u062e\u0644\u064a\u0629...",value:I,onChange:e=>k(e.target.value),rows:3}),(0,H.jsxs)("button",{className:"rp-note-send",disabled:!I.trim(),onClick:()=>{c(t,I),k("")},children:[(0,H.jsx)(M.A,{size:14})," \u0625\u0636\u0627\u0641\u0629"]})]})]})]})]})},xe=e=>{let{report:t,userDataMap:a,onClose:n,onOpenProfile:l}=e;const[o,d]=(0,r.useState)(!0),[c,u]=(0,r.useState)(null),[m,v]=(0,r.useState)([]),[b,g]=(0,r.useState)({}),y=(0,r.useRef)(null);(0,r.useEffect)((()=>{let e=!0;if(d(!0),u(null),v([]),null===t||void 0===t||!t.chatRoomId)return d(!1),void u("\u0644\u0627 \u064a\u0648\u062c\u062f \u0645\u0639\u0631\u0641 \u0645\u062d\u0627\u062f\u062b\u0629 \u0645\u062d\u0641\u0648\u0638 \u0645\u0639 \u0647\u0630\u0627 \u0627\u0644\u0628\u0644\u0627\u063a");const r=t.isGroupChat?"group_messages/".concat(t.chatRoomId):"private_messages/".concat(t.chatRoomId);return i.firebase.database().ref(r).limitToLast(200).once("value").then((async t=>{if(!e)return;const r=t.val()||{},n=Object.entries(r).map((e=>
2{let[t,a]=e;return(0,s.A)({id:t},a)})).sort(((e,t)=>(e.timestamp||0)-(t.timestamp||0)));v(n);const l=[...new Set(n.map((e=>e.senderId)).filter((e=>e&&!a[e])))];if(l.length){const t={};await Promise.all(l.map((async e=>{try{const a=await i.firebase.database().ref("Users/".concat(e)).once("value");a.val()&&(t[e]=a.val())}catch(a){}}))),e&&g(t)}})).catch((t=>{console.error(t),e&&u("\u062a\u0639\u0630\u0651\u0631 \u062a\u062d\u0645\u064a\u0644 \u0631\u0633\u0627\u0626\u0644 \u0627\u0644\u0645\u062d\u0627\u062f\u062b\u0629")})).finally((()=>{e&&d(!1)})),()=>{e=!1}}),[null===t||void 0===t?void 0:t.chatRoomId,null===t||void 0===t?void 0:t.isGroupChat]),(0,r.useEffect)((()=>{!o&&y.current&&y.current.scrollIntoView({behavior:"smooth",block:"center"})}),[o,m]);return(0,H.jsx)("div",{className:"rp-chat-review-overlay",onClick:n,children:(0,H.jsxs)("div",{className:"rp-chat-review-panel",onClick:e=>e.stopPropagation(),dir:"rtl",children:[(0,H.jsxs)("div",{className:"rp-chat-review-header",children:[(0,H.jsx)("button",{className:"rp-icon-btn",onClick:n,children:(0,H.jsx)(B.A,{size:18})}),(0,H.jsxs)("div",{className:"rp-chat-review-title",children:[(0,H.jsx)(p.A,{size:16}),(0,H.jsxs)("span",{children:["\u0645\u0631\u0627\u062c\u0639\u0629 \u0627\u0644\u0645\u062d\u0627\u062f\u062b\u0629 ",null!==t&&void 0!==t&&t.isGroupChat?"(\u0645\u062c\u0645\u0648\u0639\u0629)":"(\u062e\u0627\u0635\u0629)"]})]}),(0,H.jsxs)("span",{className:"rp-chat-review-readonly-badge",children:[(0,H.jsx)(z.A,{size:11})," \u0644\u0644\u0642\u0631\u0627\u0621\u0629 \u0641\u0642\u0637"]})]}),(0,H.jsxs)("div",{className:"rp-chat-review-body",children:[o&&(0,H.jsxs)("div",{className:"rp-loading",style:{padding:"40px 0"},children:[(0,H.jsx)("div",{className:"rp-spinner"}),(0,H.jsx)("span",{children:"\u062c\u0627\u0631\u064a \u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0645\u062d\u0627\u062f\u062b\u0629..."})]}),!o&&c&&(0,H.jsx)("div",{className:"rp-chat-review-empty",children:c}),!o&&!c&&0===m.length&&(0,H.jsx)("div",{className:"rp-chat-review-empty",children:"\u0644\u0627 \u062a\u0648\u062c\u062f \u0631\u0633\u0627\u0626\u0644 \u0641\u064a \u0647\u0630\u0647 \u0627\u0644\u0645\u062d\u0627\u062f\u062b\u0629"}),!o&&!c&&m.map((e=>{const s=e.id===t.messageId,r=(e=>{const t=a[e]||b[e]||{};return{name:t.name||t.fullName||t.displayName||t.username||"\u0645\u0633\u062a\u062e\u062f\u0645",avatar:t.img||t.avatar||""}})(e.senderId);return(0,H.jsxs)("div",{ref:s?y:null,className:"rp-chat-review-msg ".concat(s?"rp-chat-review-msg--flagged":""),children:[(0,H.jsxs)("button",{type:"button",className:"rp-chat-review-sender",onClick:()=>null===l||void 0===l?void 0:l(e.senderId),disabled:!e.senderId,children:[r.avatar?(0,H.jsx)("img",{src:r.avatar,alt:r.name}):(0,H.jsx)(h.A,{size:13}),(0,H.jsx)("span",{children:r.name})]}),s&&(0,H.jsxs)("span",{className:"rp-chat-review-flag-tag",children:[(0,H.jsx)(w.A,{size:11})," \u0627\u0644\u0631\u0633\u0627\u0644\u0629 \u0627\u0644\u0645\u064f\u0628\u0644\u0651\u063a \u0639\u0646\u0647\u0627"]}),(0,H.jsx)("div",{className:"rp-chat-review-bubble",children:e.text||(0,H.jsx)("em",{children:"(\u0628\u062f\u0648\u0646 \u0646\u0635 \u2014 \u0642\u062f \u062a\u0643\u0648\u0646 \u0635\u0648\u0631\u0629 \u0623\u0648 \u0645\u062d\u062a\u0648\u0649 \u0622\u062e\u0631)"})}),(0,H.jsx)("div",{className:"rp-chat-review-time",children:e.timestamp?new Date(e.timestamp).toLocaleString("ar"):""})]},e.id)}))]})]})})},je=()=>{const e=(0,n.Zp)(),{userData:t}=(0,r.useContext)(l.Rs),{theme:a}=(0,V.DP)(),{language:d,resolvedDirection:c,t:p}=(0,q.o)(),m=(0,r.useCallback)(((e,t,a)=>"ar"===d?t:p(e,a||{},t)),[d,p]),v="dark"===a,[b,y]=(0,r.useState)([]),[x,j]=(0,r.useState)(!0),[k,A]=(0,r.useState)({}),[C,R]=(0,r.useState)(null),[z,D]=(0,r.useState)(null),[M,B]=(0,r.useState)(""),[Z,Q]=(0,r.useState)("active"),[Y,ee]=(0,r.useState)("all"),[te,ae]=(0,r.useState)("all"),[re,le]=(0,r.useState)("newest"),[de,ce]=(0,r.useState)("active"),[pe,me]=(0,r.useState)(!1),[ve,be]=(0,r.useState)(!1),[je,Ne]=(0,r.useState)(null),[Ie,ke]=(0,r.useState)(null),we=["\u0627\u0644\u0645\u0634\u0631\u0641 \u0627\u0644\u0639\u0627\u0645","\u0646\u0627\u0626\u0628 \u0627\u0644\u0645\u0634\u0631\u0641 \u0627\u0644\u0639\u0627\u0645","super_admin"],Ae=["\u0627\u0644\u0645\u0634\u0631\u0641 \u0627\u0644\u0639\u0627\u0645","\u0646\u0627\u0626\u0628 \u0627\u0644\u0645\u0634\u0631\u0641 \u0627\u0644\u0639\u0627\u0645"].includes(je),_e=we.includes(je);[...we,"\u0645\u0633\u0624\u0648\u0644 \u0642\u0633\u0645 \u0627\u0644\u0645\u062d\u062a\u0648\u0649","\u0645\u0634\u0631\u0641 \u0627\u0644\u0645\u062d\u062a\u0648\u0649"].includes(je);(0,r.useEffect)((()=>{null!==t&&void 0!==t&&t.id&&i.firebase.database().ref("Roles/".concat(t.id)).once("value").then((e=>{Ne(e.val()||null)}))}),[null===t||void 0===t?void 0:t.id]);const Ce=(0,r.useCallback)((e=>{const t=null===e||void 0===e?void 0:e._fbId;if(!t)return[];const a=new Set([t,...e.similarReportIds||[]]),s=b.filter((e=>"content_reports"===e._fbType&&a.has(e._fbId)));return s.length>0?s:[e]}),[b]);(0,r.useEffect)((()=>
2{if(null===t||void 0===t||!t.id)return;j(!0);(async()=>{try{const e=[],t=new Set,a=(await i.firebase.database().ref("content_reports").once("value")).val()||{};Object.entries(a).forEach((a=>{let[s,r]=a;const n=ie({sourceType:"content_reports",reportId:s,report:r,index:e.length});e.push(n),n.reporterId&&t.add(n.reporterId),n.targetId&&t.add(n.targetId),r.reportedBy&&t.add(r.reportedBy),r.reportedUserId&&t.add(r.reportedUserId),r.targetUserId&&t.add(r.targetUserId)})),e.sort(((e,t)=>t.timestamp-e.timestamp)),y(e);const r={};await Promise.all([...t].map((async e=>{const[t,a]=await Promise.all([i.firebase.database().ref("kunaiu_bank/".concat(e)).once("value"),i.firebase.database().ref("kunaiu_bank/".concat(e,"/warnings")).once("value")]),n=t.val()||{},l=a.val();r[e]=(0,s.A)((0,s.A)({},n),{},{warnings:l,warningsCount:ue((0,s.A)((0,s.A)({},n),{},{warnings:l}))})}))),A(r),y((e=>e.map((e=>(0,s.A)((0,s.A)({},e),{},{prevViolations:ue(r[e.targetId]||{})}))))),be(!0)}catch(e){console.error("Error loading reports:",e),y([]),A({})}finally{j(!1)}})()}),[null===t||void 0===t?void 0:t.id]);const Re=b.filter(se),Se={pending:b.filter((e=>"pending"===e.status)).length,investigating:b.filter((e=>"investigating"===e.status)).length,escalated:b.filter((e=>"escalated"===e.status)).length,highRisk:Re.filter((e=>e.aiScore>=70)).length,actionTaken:b.filter((e=>"action_applied"===e.status)).length,false_:b.filter((e=>"rejected"===e.status)).length},Te=b.length,ze=Re.length,De=(0,r.useCallback)((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Te;return t?Math.round(e/t*100):0}),[Te]),Me=(0,r.useCallback)((e=>{if(ce(e),"highRisk"===e)return Q("active"),void ae("highRisk");Q({active:"active",pending:"pending",investigating:"investigating",escalated:"escalated",actionTaken:"action_applied",false_:"rejected"}[e]||"all"),ae("all")}),[]),Be=b.filter((e=>{if("active"===Z&&J.has(e.status))return!1;if("all"!==Z&&"active"!==Z&&e.status!==Z)return!1;if("all"!==Y&&e.type!==Y)return!1;if("highRisk"===te&&(e.aiScore<70||!se(e)))return!1;if("all"!==te&&"highRisk"!==te&&e.severity!==te)return!1;if(M){var t,a;const s=M.toLowerCase(),r=e.reporterName||(null===(t=k[e.reporterId])||void 0===t?void 0:t.name)||"",n=e.targetName||(null===(a=k[e.targetId])||void 0===a?void 0:a.name)||"";if(!e.reason.toLowerCase().includes(s)&&!e.description.toLowerCase().includes(s)&&!r.toLowerCase().includes(s)&&!n.toLowerCase().includes(s)&&!e.id.toLowerCase().includes(s))return!1}return!0})).sort(((e,t)=>"newest"===re?t.timestamp-e.timestamp:"severity"===re?t.aiScore-e.aiScore:"escalated"===re?("escalated"===t.status?1:0)-("escalated"===e.status?1:0):0)),Pe=(0,r.useCallback)((async(e,a)=>{const r=(null===a||void 0===a?void 0:a.status)||"pending";try{const a=Date.now(),n=(null===t||void 0===t?void 0:t.name)||(null===t||void 0===t?void 0:t.fullName)||(null===t||void 0===t?void 0:t.displayName)||(null===t||void 0===t?void 0:t.username)||(null===t||void 0===t?void 0:t.id)||"\u0645\u0634\u0631\u0641",l=Ce(e),o=new Set(l.map((e=>e._fbId)));await Promise.all(l.map((async(e,s)=>{const l=$(r,n,a+s),o=[...Array.isArray(e.timeline)?e.timeline:[],...l];await i.firebase.database().ref("content_reports/".concat(e._fbId)).update({status:r,handledBy:n,handledById:(null===t||void 0===t?void 0:t.id)||null,handledByName:n,handledAt:a,timeline:o})}))),y((e=>e.map((e=>{if(!o.has(e._fbId))return e;const l=$(r,n,a),i=Array.isArray(e.timeline)?e.timeline:[];return(0,s.A)((0,s.A)({},e),{},{status:r,assignedTo:n,assignedToId:(null===t||void 0===t?void 0:t.id)||null,timeline:[...i,...l]})})))),C&&o.has(C._fbId)&&R((e=>{if(!e)return e;const l=$(r,n,a),i=Array.isArray(e.timeline)?e.timeline:[];return(0,s.A)((0,s.A)({},e),{},{status:r,assignedTo:n,assignedToId:(null===t||void 0===t?void 0:t.id)||null,timeline:[...i,...l]})}))}catch(n){console.error(n)}}),[Ce,C,null===t||void 0===t?void 0:t.displayName,null===t||void 0===t?void 0:t.fullName,null===t||void 0===t?void 0:t.id,null===t||void 0===t?void 0:t.name,null===t||void 0===t?void 0:t.username]),Ue=(0,r.useCallback)((async e=>{if(null===e||void 0===e||!e._fbId||!_e)return;if(window.confirm("\u0647\u0644 \u0623\u0646\u062a \u0645\u062a\u0623\u0643\u062f \u0645\u0646 \u062d\u0630\u0641 \u0647\u0630\u0627 \u0627\u0644\u0628\u0644\u0627\u063a\u061f \u0644\u0627 \u064a\u0645\u0643\u0646 \u0627\u0644\u062a\u0631\u0627\u062c\u0639 \u0639\u0646 \u0647\u0630\u0627 \u0627\u0644\u0625\u062c\u0631\u0627\u0621."))try{await i.firebase.database().ref("content_reports/".concat(e._fbId)).remove(),y((t=>t.filter((t=>t._fbId!==e._fbId)))),C&&C._fbId===e._fbId&&R(null)}catch(t){console.error("Error deleting report:",t)}}),[_e,C]),Le=(0,r.useCallback)(((e,t)=>{const a={author:"\u0627\u0644\u0645\u0634\u0631\u0641",text:t,time:Date.now()};y((t=>t.map((t=>t.id===e.id?(0,s.A)((0,s.A)({},t),{}
2,{notes:[...t.notes,a]}):t)))),(null===C||void 0===C?void 0:C.id)===e.id&&R((e=>(0,s.A)((0,s.A)({},e),{},{notes:[...e.notes,a]})))}),[C]),Ee=(0,r.useCallback)((async(e,t)=>{const a=oe(e);a&&(await i.firebase.database().ref(a).update({notes:t}),y((a=>a.map((a=>a.id===e.id?(0,s.A)((0,s.A)({},a),{},{notes:t}):a)))),(null===C||void 0===C?void 0:C.id)===e.id&&R((e=>e?(0,s.A)((0,s.A)({},e),{},{notes:t}):e)))}),[C]),Oe=(0,r.useCallback)((async(e,t,a)=>{const r=(e.notes||[]).map(((e,r)=>r===t?(0,s.A)((0,s.A)({},e),{},{text:a,editedAt:Date.now()}):e));await Ee(e,r)}),[Ee]),Ve=(0,r.useCallback)((async(e,t)=>{const a=(e.notes||[]).filter(((e,a)=>a!==t));await Ee(e,a)}),[Ee]),qe=(0,r.useCallback)((async function(e,a){let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const n=Date.now(),l=(null===t||void 0===t?void 0:t.name)||(null===t||void 0===t?void 0:t.fullName)||(null===t||void 0===t?void 0:t.displayName)||(null===t||void 0===t?void 0:t.username)||(null===t||void 0===t?void 0:t.id)||"\u0645\u0634\u0631\u0641",o={text:a,byId:(null===t||void 0===t?void 0:t.id)||null,byName:l,at:n},d=Ce(e),c=new Set(d.map((e=>e._fbId))),p={};await Promise.all(d.map((async e=>{const s=oe(e);if(!s)return;const d=[...Array.isArray(e.moderatorReplies)?e.moderatorReplies:[]];"number"===typeof r&&r>=0&&r<d.length?d[r]=o:d.push(o),p[e._fbId]=d,await i.firebase.database().ref(s).update({moderatorReplies:d,moderatorReplyText:a,moderatorReplyById:(null===t||void 0===t?void 0:t.id)||null,moderatorReplyByName:l,moderatorReplyAt:n})}))),y((e=>e.map((e=>{if(!c.has(e._fbId))return e;const r=p[e._fbId]||e.moderatorReplies||[];return(0,s.A)((0,s.A)({},e),{},{moderatorReplies:r,moderatorReplyText:a,moderatorReplyById:(null===t||void 0===t?void 0:t.id)||null,moderatorReplyByName:l,moderatorReplyAt:n})})))),C&&c.has(C._fbId)&&R((e=>{if(!e)return e;const r=p[e._fbId]||e.moderatorReplies||[];return(0,s.A)((0,s.A)({},e),{},{moderatorReplies:r,moderatorReplyText:a,moderatorReplyById:(null===t||void 0===t?void 0:t.id)||null,moderatorReplyByName:l,moderatorReplyAt:n})}))}),[Ce,C,null===t||void 0===t?void 0:t.displayName,null===t||void 0===t?void 0:t.fullName,null===t||void 0===t?void 0:t.id,null===t||void 0===t?void 0:t.name,null===t||void 0===t?void 0:t.username]),Ge=(0,r.useCallback)((async(e,t)=>{if(null===e||void 0===e||!e._fbId||!t||e._fbId===t)return;const a=b.find((t=>t._fbId===e._fbId))||e,r=b.find((e=>e._fbId===t));if(!r||!se(r))return;const n=[...new Set([a._fbId,...a.similarReportIds||[],r._fbId,...r.similarReportIds||[]])];await Promise.all(n.map((async e=>{const t=n.filter((t=>t!==e));await i.firebase.database().ref("content_reports/".concat(e)).update({similarReportIds:t,relatedCount:t.length})}))),y((e=>e.map((e=>{if(!n.includes(e._fbId))return e;const t=n.filter((t=>t!==e._fbId));return(0,s.A)((0,s.A)({},e),{},{similarReportIds:t,relatedCount:t.length})})))),C&&n.includes(C._fbId)&&R((e=>{if(!e)return e;const t=n.filter((t=>t!==e._fbId));return(0,s.A)((0,s.A)({},e),{},{similarReportIds:t,relatedCount:t.length})}))}),[b,C]),We=(0,r.useCallback)((async(e,t)=>{if(null===e||void 0===e||!e._fbId||!t||e._fbId===t)return;const a=b.find((t=>t._fbId===e._fbId))||e,r=[...new Set([a._fbId,...a.similarReportIds||[]])];if(!r.includes(t))return;const n=r.filter((e=>e!==t));await Promise.all(n.map((async e=>{const t=n.filter((t=>t!==e));await i.firebase.database().ref("content_reports/".concat(e)).update({similarReportIds:t,relatedCount:t.length})}))),await i.firebase.database().ref("content_reports/".concat(t)).update({similarReportIds:[],relatedCount:0}),y((e=>e.map((e=>{if(e._fbId===t)return(0,s.A)((0,s.A)({},e),{},{similarReportIds:[],relatedCount:0});if(!n.includes(e._fbId))return e;const a=n.filter((t=>t!==e._fbId));return(0,s.A)((0,s.A)({},e),{},{similarReportIds:a,relatedCount:a.length})})))),C&&R((e=>{if(!e)return e;if(e._fbId===t)return(0,s.A)((0,s.A)({},e),{},{similarReportIds:[],relatedCount:0});if(!n.includes(e._fbId))return e;const a=n.filter((t=>t!==e._fbId));return(0,s.A)((0,s.A)({},e),{},{similarReportIds:a,relatedCount:a.length})}))}),[b,C]),He=(0,r.useMemo)((()=>
2{if(null===C||void 0===C||!C._fbId)return[];const e=new Set(C.similarReportIds||[]);return b.filter((t=>"content_reports"===t._fbType&&t._fbId!==C._fbId&&se(t)&&!e.has(t._fbId)))}),[b,C]),Ke=(0,r.useMemo)((()=>{var e;return null!==C&&void 0!==C&&null!==(e=C.similarReportIds)&&void 0!==e&&e.length?C.similarReportIds.map((e=>b.find((t=>t._fbId===e)))).filter(Boolean):[]}),[b,C]),Ze=(0,r.useCallback)((t=>{const a=(e=>{const t=ne(e);if("message"===t)return null!==e&&void 0!==e&&e.reportedUserId?"/messages/chat/".concat(e.reportedUserId):null;const a=(null===e||void 0===e?void 0:e.postId)||(null===e||void 0===e?void 0:e.targetId);return a?"reply"===t?null!==e&&void 0!==e&&e.replyId&&null!==e&&void 0!==e&&e.commentId?"/post/".concat(a,"/comment/").concat(e.commentId,"/reply/").concat(e.replyId,"/single"):null!==e&&void 0!==e&&e.commentId?"/post/".concat(a,"/comment/").concat(e.commentId,"/single"):"/post/".concat(a):"comment"===t&&null!==e&&void 0!==e&&e.commentId?"/post/".concat(a,"/comment/").concat(e.commentId,"/single"):"/post/".concat(a):null})(t);a&&e(a)}),[e]),Fe=v?"rp-dark":"rp-light";return(0,H.jsxs)("div",{className:"rp-page ".concat(Fe," ").concat(ve?"rp-anim-in":""),dir:c,children:[(0,H.jsx)(G.A,{title:m("reports_title","\u0645\u0631\u0643\u0632 \u0627\u0644\u0625\u0634\u0631\u0627\u0641"),onBack:()=>e(-1),className:v?"theme-dark-item":"theme-light-item",right:(0,H.jsxs)("div",{style:{display:"flex",gap:8,alignItems:"center"},children:[(0,H.jsxs)("div",{className:"rp-search-wrap",children:[(0,H.jsx)(P.A,{size:14,className:"rp-search-icon"}),(0,H.jsx)("input",{className:"rp-search-input",placeholder:m("reports_search_placeholder","\u0628\u062d\u062b..."),value:M,onChange:e=>B(e.target.value),dir:c}),M&&(0,H.jsx)("button",{className:"rp-search-clear",onClick:()=>B(""),children:(0,H.jsx)(_.A,{size:12})})]}),(0,H.jsx)("button",{type:"button",className:"rp-filter-toggle ".concat(pe?"is-active":""),onClick:()=>me((e=>!e)),"aria-label":m("reports_show_filters","\u0639\u0631\u0636 \u0627\u0644\u0641\u0644\u0627\u062a\u0631"),"aria-expanded":pe,children:(0,H.jsx)(U.A,{size:14})})]})}),x?(0,H.jsxs)("div",{className:"rp-loading",children:[(0,H.jsx)("div",{className:"rp-spinner"}),(0,H.jsx)("span",{children:m("reports_loading","\u062c\u0627\u0631\u064a \u062a\u062d\u0645\u064a\u0644 \u0627\u0644\u0628\u064a\u0627\u0646\u0627\u062a...")})]}):(0,H.jsxs)("div",{className:"rp-layout",children:[(0,H.jsxs)("div",{className:"rp-feed ".concat(C?"rp-feed--split":""),children:[(0,H.jsxs)("div",{className:"rp-stats-row",children:[(0,H.jsx)(he,{icon:f.A,label:m("reports_stat_pending","\u0642\u064a\u062f \u0627\u0644\u0627\u0646\u062a\u0638\u0627\u0631"),value:Se.pending,accent:"#f59e0b",statPercent:De(Se.pending),trendDirection:"negative",onClick:()=>Me("pending"),isActive:"pending"===de}),(0,H.jsx)(he,{icon:L,label:m("reports_stat_investigating","\u0642\u064a\u062f \u0627\u0644\u062a\u062d\u0642\u064a\u0642"),value:Se.investigating,accent:"#0ea5e9",statPercent:De(Se.investigating),trendDirection:"negative",onClick:()=>Me("investigating"),isActive:"investigating"===de}),(0,H.jsx)(he,{icon:N,label:m("reports_stat_escalated","\u0645\u064f\u0635\u0639\u064e\u0651\u062f"),value:Se.escalated,accent:"#ef4444",statPercent:De(Se.escalated),trendDirection:"negative",onClick:()=>Me("escalated"),isActive:"escalated"===de}),(0,H.jsx)(he,{icon:E.A,label:m("reports_stat_high_risk","\u0645\u062e\u0627\u0637\u0631 \u0639\u0627\u0644\u064a\u0629"),value:Se.highRisk,accent:"#dc2626",statPercent:De(Se.highRisk,ze),trendDirection:"negative",onClick:()=>Me("highRisk"),isActive:"highRisk"===de}),(0,H.jsx)(he,{icon:O,label:m("reports_stat_action_taken","\u062a\u0645 \u0627\u0644\u062a\u0635\u0631\u0641"),value:Se.actionTaken,accent:"#8b5cf6",statPercent:De(Se.actionTaken),trendDirection:"positive",onClick:()=>Me("actionTaken"),isActive:"actionTaken"===de}),(0,H.jsx)(he,{icon:I.A,label:m("reports_stat_rejected","\u0645\u0631\u0641\u0648\u0636\u0629"),value:Se.false_,accent:"#6b7280",statPercent:De(Se.false_),trendDirection:"negative",onClick:()=>Me("false_"),isActive:"false_"===de})]}),pe&&(0,H.jsxs)("div",{className:"rp-filters-bar",children:[(0,H.jsxs)("select",{className:"rp-select",value:Z,onChange:e=>{Q(e.target.value),ce("manual")},children:[(0,H.jsx)("option",{value:"active",children:m("reports_filter_active","\u0627\u0644\u0637\u0644\u0628\u0627\u062a \u0627\u0644\u062c\u0627\u0631\u064a\u0629")}),(0,H.jsx)("option",{value:"all",children:m("reports_filter_all_statuses","\u0643\u0644 \u0627\u0644\u062d\u0627\u0644\u0627\u062a")}),F.map((e=>
2{let[t,a]=e;return(0,H.jsx)("option",{value:t,children:a.label},t)}))]}),(0,H.jsxs)("select",{className:"rp-select",value:Y,onChange:e=>{ee(e.target.value),ce("manual")},children:[(0,H.jsx)("option",{value:"all",children:m("reports_filter_all_types","\u0643\u0644 \u0627\u0644\u0623\u0646\u0648\u0627\u0639")}),Object.entries(K).map((e=>{let[t,a]=e;return(0,H.jsx)("option",{value:t,children:a.label},t)}))]}),(0,H.jsxs)("select",{className:"rp-select",value:te,onChange:e=>{ae(e.target.value),ce("manual")},children:[(0,H.jsx)("option",{value:"all",children:m("reports_filter_all_priorities","\u0643\u0644 \u0627\u0644\u0623\u0648\u0644\u0648\u064a\u0627\u062a")}),(0,H.jsx)("option",{value:"highRisk",children:m("reports_filter_high_risk","\u0645\u062e\u0627\u0637\u0631 \u0639\u0627\u0644\u064a\u0629 (70%+)")}),Object.entries(X).map((e=>{let[t,a]=e;return(0,H.jsx)("option",{value:t,children:a.label},t)}))]}),(0,H.jsxs)("select",{className:"rp-select",value:re,onChange:e=>{le(e.target.value),ce("manual")},children:[(0,H.jsx)("option",{value:"newest",children:m("reports_sort_newest","\u0627\u0644\u0623\u062d\u062f\u062b")}),(0,H.jsx)("option",{value:"severity",children:m("reports_sort_severity","\u0627\u0644\u0623\u0639\u0644\u0649 \u062e\u0637\u0648\u0631\u0629")}),(0,H.jsx)("option",{value:"escalated",children:m("reports_sort_escalated","\u0627\u0644\u0645\u064f\u0635\u0639\u064e\u0651\u062f \u0623\u0648\u0644\u0627\u064b")})]}),(0,H.jsx)("div",{className:"rp-filter-count",children:m("reports_filter_count","{count} \u0628\u0644\u0627\u063a",{count:Be.length})})]}),(0,H.jsx)("div",{className:"rp-list",children:0===Be.length?(0,H.jsxs)("div",{className:"rp-empty",children:[(0,H.jsx)(S.A,{size:40,opacity:.2}),(0,H.jsx)("span",{children:m("reports_empty","\u0644\u0627 \u062a\u0648\u062c\u062f \u0628\u0644\u0627\u063a\u0627\u062a \u062a\u0637\u0627\u0628\u0642 \u0627\u0644\u0645\u0639\u0627\u064a\u064a\u0631")})]}):Be.map(((e,t)=>{var a;const s=K[e.type]||{},r=s.icon||w.A,n=X[e.severity]||X.low,l=(null===C||void 0===C?void 0:C.id)===e.id;return(0,H.jsxs)("div",{className:"rp-row ".concat(l?"rp-row--active":""," ").concat("escalated"===e.status?"rp-row--escalated":""),style:{animationDelay:"".concat(30*t,"ms")},onClick:()=>R(l?null:e),children:[(0,H.jsx)("div",{className:"rp-row-stripe",style:{background:n.color}}),(0,H.jsx)("div",{className:"rp-row-type-icon",style:{background:s.bg,color:s.color},children:(0,H.jsx)(r,{size:15})}),(0,H.jsxs)("div",{className:"rp-row-main",children:[(0,H.jsxs)("div",{className:"rp-row-top",children:[(0,H.jsx)("span",{className:"rp-row-id",children:e.id}),(0,H.jsx)(ye,{type:e.type}),(0,H.jsx)(ge,{status:e.status}),(0,H.jsx)("span",{className:"rp-row-sev",style:{color:n.color,background:n.bg},children:n.label})]}),(0,H.jsx)("div",{className:"rp-row-reason",children:e.reason}),(0,H.jsxs)("div",{className:"rp-row-meta",children:[(0,H.jsxs)("span",{children:[(0,H.jsx)(h.A,{size:11}),e.reporterName||(null===(a=k[e.reporterId])||void 0===a?void 0:a.name)||"\u0645\u062c\u0647\u0648\u0644"]}),e.relatedCount>0&&(0,H.jsxs)("span",{children:[(0,H.jsx)(g.A,{size:11}),e.relatedCount," \u0645\u0631\u062a\u0628\u0637"]}),e.prevViolations>0&&(0,H.jsxs)("span",{style:{color:"#ef4444"},children:[(0,H.jsx)(T.A,{size:11}),e.prevViolations," \u0645\u062e\u0627\u0644\u0641\u0629 \u0633\u0627\u0628\u0642\u0629"]}),(0,H.jsxs)("span",{className:"rp-row-time",children:[(0,H.jsx)(f.A,{size:11}),(0,o.f)(e.timestamp)]})]})]}),(0,H.jsx)("div",{className:"rp-row-ai",children:(0,H.jsx)("div",{className:"rp-ai-ring",style:{"--score":e.aiScore,"--color":n.color},children:(0,H.jsx)("span",{children:e.aiScore})})}),(0,H.jsx)(u.A,{size:14,className:"rp-row-arrow"})]},e.id)}))})]}),C&&(0,H.jsx)(fe,{report:C,userDataMap:k,similarCandidates:He,linkedSimilarReports:Ke,onClose:()=>R(null),onStatusChange:Pe,onNote:Le,onEditNote:Oe,onDeleteNote:Ve,onOpenProfile:D,onOpenContent:Ze,onReviewChat:ke,canReviewChat:Ae,onSaveReply:qe,onLinkSimilarReport:Ge,onUnlinkSimilarReport:We,canDeleteReport:_e,onDeleteReport:Ue})]}),z&&(0,H.jsx)(W.A,{userId:z,onClose:()=>D(null)}),Ie&&Ae&&(0,H.jsx)(xe,{report:Ie,userDataMap:k,onClose:()=>ke(null),onOpenProfile:D})]})}}}]); 3//# sourceMappingURL=9963.a9993d92.chunk.js.map
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.