1import{aD as z,b1 as N,aK as F,z as K,u as R,A as _,v,B as O,e as m,w,c as h,a3 as q,h as o,l as V,g as s,p as L,T as E,t as T,i as U,j as W,F as G,E as H,n as J,a1 as P,bw as Q,aE as X,k as C,m as Y,D as Z,f as S,aB as ee}from"./CujwEPkh.js";import{u as te}from"./ChTEIaWl.js";import{u as se}from"./B-53hwYd.js";const ae=z("reports",()=>{async function y({targetType:f,targetId:a,reason:g,details:k=null,context:u={}}){if(!f||!a||!g)throw new Error("Missing report fields");const{ensure:d}=N(),{getWriteClient:r}=F();await d();const c=await r(),{data:l,error:b}=await c.rpc("report_content",{p_target_type:f,p_target_id:a,p_reason:g,p_details:k,p_context:u});if(b)throw b;return l}return{reportContent:y}}),oe={class:"text-base font-bold text-gray-900"},re={class:"flex-1 overflow-y-auto px-5 py-4 space-y-3"},le=["value"],ne={class:"text-sm text-gray-900"},ie={class:"px-5 py-4 border-t border-gray-100"},pe={__name:"ReportModal",props:{isOpen:{type:Boolean,required:!0},targetType:{type:String,required:!0},targetId:{type:[String,null],default:null},context:{type:Object,default:()=>({})}},emits:["close","reported"],setup(y,{emit:f}){const a=y;te(()=>!!a.isOpen);const{sheetStyle:g,backdropStyle:k,onDragStart:u,onDragMove:d,onDragEnd:r}=se(()=>!!a.isOpen,()=>c("close")),c=f;K(()=>a.isOpen,()=>c("close"));const{t:l}=R(),b=ae(),$=ee(),j=["spam","harassment","scam","sexual","other"],i=S(""),x=S(""),p=S(!1);_(()=>a.isOpen,n=>{n&&(i.value="",x.value="",p.value=!1)});async function A(){if(!(!i.value||p.value||!a.targetId)){p.value=!0;try{await b.reportContent({targetType:a.targetType,targetId:a.targetId,reason:i.value,details:x.value,context:a.context}),$.success(l("report.success")),c("reported"),c("close")}catch(n){console.error("report failed",n?.message||n),$.error(l("report.error"))}finally{p.value=!1}}}return(n,e)=>{const B=W,D=U,I=X;return v(),O(Z,{to:"body"},[m(E,{"enter-active-class":"transition-opacity duration-200 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-150 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:w(()=>[y.isOpen?(v(),h("div",{key:0,class:"fixed inset-0 z-[10000]",onKeydown:e[13]||(e[13]=q(t=>n.$emit("close"),["esc"]))},[o("div",{class:"absolute inset-0 bg-black/50 backdrop-blur-sm",style:V(s(k)),onClick:e[0]||(e[0]=t=>n.$emit("close")),"aria-hidden":"true"},null,4),o("div",{class:"absolute inset-0 flex items-end sm:items-center justify-center p-0 sm:p-4",onClick:e[12]||(e[12]=L(t=>n.$emit("close"),["self"]))},[m(E,{appear:"","enter-active-class":"transition-all duration-[380ms] ease-spring","enter-from-class":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to-class":"opacity-100 translate-y-0 sm:scale-100","leave-active-class":"transition-all duration-150 ease-in","leave-from-class":"opacity-100 translate-y-0 sm:scale-100","leave-to-class":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:w(()=>[y.isOpen?(v(),h("div",{key:0,class:"relative bg-white w-full sm:max-w-md rounded-t-2xl sm:rounded-2xl shadow-xl flex flex-col max-h-[90vh]",style:V(s(g)),role:"dialog","aria-modal":"true"},[o("div",{class:"sm:hidden select-none flex justify-center pt-2.5 pb-1.5 cursor-grab",onTouchstart:e[1]||(e[1]=(...t)=>s(u)&&s(u)(...t)),onTouchmove:e[2]||(e[2]=(...t)=>s(d)&&s(d)(...t)),onTouchend:e[3]||(e[3]=(...t)=>s(r)&&s(r)(...t)),onTouchcancel:e[4]||(e[4]=(...t)=>s(r)&&s(r)(...t))},[...e[14]||(e[14]=[o("div",{class:"w-10 h-1 rounded-full bg-gray-300"},null,-1)])],32),o("div",{class:"flex items-center justify-between px-5 py-4 border-b border-gray-100",onTouchstart:e[6]||(e[6]=(...t)=>s(u)&&s(u)(...t)),onTouchmove:e[7]||(e[7]=(...t)=>s(d)&&s(d)(...t)),onTouchend:e[8]||(e[8]=(...t)=>s(r)&&s(r)(...t)),onTouchcancel:e[9]||(e[9]=(...t)=>s(r)&&s(r)(...t))},[o("h3",oe,T(s(l)("report.title")),1),m(D,{type:"button",variant:"icon-tonal",class:"w-9 h-9","aria-label":s(l)("close"),onClick:e[5]||(e[5]=t=>n.$emit("close"))},{default:w(()=>[m(B,{name:"close",class:"w-4 h-4"})]),_:1},8,["aria-label"])],32),o("div",re,[(v(),h(G,null,H(j,t=>o("label",{key:t,class:J(["flex items-center gap-3 rounded-xl border px-4 py-3 cursor-pointer transition-colors",i.value===t?"border-emerald-600 bg-emerald-50 dark:bg-emerald-500/15":"border-gray-200 hover:bg-gray-50"])},[P(o("input",{type:"radio",value:t,"onUpdate:modelValue":e[10]||(e[10]=M=>i.value=M),class:"h-4 w-4 border-gray-300 text-emerald-600 dark:text-emerald-300 focus:ring-emerald-600"},null,8,le),[[Q,i.value]]),o("span",ne,T(s(l)("report."+t)),1)],2)),64)),m(I,{tag:"textarea",modelValue:x.value,"onUpdate:modelValue":e[11]||(e[11]=t=>x.value=t),rows:"3",maxlength:"2000",placeholder:s(l)("report.details")},null,8,["modelValue","placeholder"])]),o("div",ie,[m(D,{type:"button",class:"w-full",disabled:!i.value||p.value,onClick:A},{default:w(()=>[p.value?(v(),O(B,{key:0,name:"spinner",class:"animate-spin h-4 w-4"})):C("",!0),Y(" "+T(s(l)("report.submit")),1)]),_:1},8,["disabled"])])],4)):C("",!0)]),_:1})])],32)):C("",!0)]),_:1})])}}};export{pe as _};
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.