1import{k as Me,r as n,c as U,w as K,_ as Be,y as l,z as o,K as a,G as w,A as m,L as _,H as u,V as W,W as Ne,P as N,J as v,a3 as le,u as oe}from"./vendor-misc-5pJBpqhN.js";import{u as Ze,e as Ve}from"./vendor-vue-BIDZeepx.js";import{k as O,_ as $e}from"./index-BNPflmqD.js";import{u as qe}from"./useTraceApi-C1njW2ae.js";import{a as ge,f as Fe}from"./traceFans-CN0Tru1w.js";import{T as Ge,G as Xe,o as je,r as Ke,c as We,p as He}from"./traceEvidence-CnvMOjro.js";/* empty css */import"./vendor-tanstack-B6ELLr_Q.js";import"./vendor-sentry-84cD2ryj.js";import"./vendor-utils-CxkvrZ9U.js";import"./traceApi-BoQZsKq1.js";const Je={class:"tp-card"},Qe={class:"tp-wizard","aria-label":"Share workflow"},Ye={key:0,class:"tp-err"},et={class:"block"},tt={key:0,class:"tp-muted"},at={key:1,class:"tp-err"},st={key:2,class:"tp-muted"},lt={class:"field"},ot={key:0,class:"tp-muted"},nt={key:1,class:"tp-case-picker",role:"listbox"},ut=["aria-selected","onClick"],it={class:"tp-case-picker__id"},rt={class:"tp-case-picker__meta"},ct={key:0,class:"block actions-block"},dt={key:0,class:"tp-muted"},pt={key:1,class:"tp-err"},vt={key:0,class:"gate-lock"},bt={class:"field platform-pick"},yt=["disabled"],ft=["value"],mt={class:"tp-row share-actions tp-actions-desktop"},_t=["disabled"],ht=["disabled"],kt=["disabled"],gt=["disabled"],wt=["disabled"],Ct=["disabled"],Pt={class:"tp-actions-mobile"},Tt=["disabled"],St={class:"tp-actions-overflow"},Lt={class:"tp-actions-overflow__menu"},Rt=["disabled"],xt=["disabled"],zt=["disabled"],It=["disabled"],Dt=["disabled"],Ut={key:1,class:"guided-steps"},Ot={key:2,class:"tp-ok"},At={key:3,class:"tp-err"},Et={key:4,class:"tp-whats-next"},Mt={key:0,class:"tp-err"},Bt={class:"steps"},Nt=["disabled"],Zt=["value"],Vt=["disabled"],$t=["value"],qt={class:"tp-row"},Ft=["disabled"],Gt={key:0,class:"url"},Xt={key:0,class:"tp-ok"},jt={key:1,class:"tp-err"},Kt=Me({__name:"TraceSharePanel",props:{wmReady:{type:Boolean},canShare:{type:Boolean},refreshKey:{}},emits:["subscribe"],setup(H){const A=H,{createTraceManifest:we,exportTraceCase:Ce,fetchCaseShareUrl:Pe,fetchTraceCase:Te,fetchTraceCases:Se,fetchTraceSubscribers:Le,fetchTraceVideos:Re}=qe(),ne=Ze(),Z=Ve(),C=n([]),J=n(!1),V=n(""),$=n(""),d=n(""),q=n(null),F=n(!1),G=n(""),R=n([]),Q=n(!1),Y=n([]),X=n(""),E=n(""),h=n(""),x=n(!1),j=n(""),z=n(""),ee=n(!1),i=n(""),r=n(""),P=n(!1),b=n(!1),p=n(!1),k=n(!1),te=n(!1),xe=Xe,I=n(!1),T=n(!1),ze=Ge,M=n("onlyfans"),y=n(new Set),f=U(()=>q.value),D=U(()=>{var t;return!!((t=f.value)!=null&&t.gate_passed)}),ue=U(()=>{const t=$.value.trim().toLowerCase();return t?C.value.filter(e=>{const s=e.id.toLowerCase(),c=ie(e).toLowerCase(),S=(e.source_url||"").toLowerCase(),L=(e.notes||"").toLowerCase();return s.includes(t)||c.includes(t)||S.includes(t)||L.includes(t)}):C.value}),B=U(()=>Q.value?3:d.value&&f.value&&!F.value?2:1),Ie=U(()=>y.value.size>0),De=U(()=>R.value.find(t=>t.id===E.value));function g(t){y.value=new Set([...y.value,t])}function ie(t){return t.gate_passed&&t.accused_watermark_id!=null?ge(t.accused_watermark_id,R.value)||"Matched account":"No account named yet"}function ae(t){d.value=t,y.value=new Set,i.value="",r.value=""}function Ue(t){const e=t.currentTarget;Q.value=!!(e&&"open"in e&&e.open)}function re(){ne.push({path:"/trace",query:{tab:"decode"}})}async function se(){if(A.wmReady){J.value=!0,V.value="";try{const[t,e,s]=await Promise.all([Se(),Re(),Le()]);C.value=t.cases||[],R.value=s.subscribers||[],Y.value=(e.videos||[]).filter(S=>{const L=(S.status||"").toLowerCase();return L==="ready"||L==="succeeded"||L==="completed"||L==="success"||!L}),d.value&&!C.value.some(S=>S.id===d.value)&&(d.value="",q.value=null);const c=typeof Z.query.case=="string"&&Z.query.case.trim()?Z.query.case.trim():"";c&&C.value.some(S=>S.id===c)&&ae(c)}catch(t){V.value=O(t,"Could not load cases")}finally{J.value=!1}}}async function Oe(t){if(q.value=null,G.value="",r.value="",!!t){F.value=!0;try{q.value=await Te(t)}catch(e){G.value=O(e,"Could not load case")}finally{F.value=!1}}}K(d,t=>{Oe(t)}),K(()=>Z.query.case,t=>{typeof t=="string"&&t.trim()&&C.value.some(e=>e.id===t.trim())&&ae(t.trim())});function ce(t){return ge(t.accused_watermark_id,R.value)}function de(){const t=f.value;return t?We(t.id,ce(t),!!t.gate_passed,t.source_url,{createdAt:t.created_at,gateReason:t.gate_reason}):""}async function pe(){const t=de();if(t){P.value=!0,i.value="",r.value="";try{await navigator.clipboard.writeText(t),i.value="Public summary copied.",g("public"),setTimeout(()=>{P.value=!1},1600)}catch{P.value=!1,r.value="Could not copy â select the text manually from the case."}}}async function ve(){const t=de();if(t){I.value=!0,i.value="";try{const e=`https://twitter.com/intent/tweet?text=${encodeURIComponent(t.slice(0,240))}`;window.open(e,"_blank","noopener,noreferrer"),i.value="Opened X compose â review before posting.",g("public")}finally{setTimeout(()=>{I.value=!1},800)}}}function be(t){return He({caseId:t.id,fanLabel:t.gate_passed?ce(t):null,gatePassed:!!t.gate_passed,sourceUrl:t.source_url,createdAt:t.created_at,gateReason:t.gate_reason,platformId:M.value})}async function ye(t){const e=await Ce(t),s=URL.createObjectURL(e),c=document.createElement("a");c.href=s,c.download=`case_${t}.zip`,c.click(),URL.revokeObjectURL(s)}async function fe(){const t=f.value;if(t){b.value=!0,i.value="",r.value="";try{await navigator.clipboard.writeText(be(t)),i.value="Platform letter copied â paste into support and attach the evidence ZIP.",g("letter"),setTimeout(()=>{b.value=!1},1600)}catch{b.value=!1,r.value="Could not copy platform letter."}}}async function me(){const t=f.value;if(t){k.value=!0,i.value="",r.value="";try{await ye(t.id),i.value="Evidence ZIP downloaded.",g("zip")}catch(e){r.value=O(e,"Could not download evidence ZIP")}finally{k.value=!1}}}async function _e(){const t=f.value;if(t){p.value=!0,te.value=!1,i.value="",r.value="";try{await ye(t.id);const e=be(t);await navigator.clipboard.writeText(e);const s=je(M.value,{letterBody:e,subject:`Trace leak report â case ${t.id.slice(0,8)}`});te.value=!0,g("zip"),g("letter"),g("guided");const c=Ke(M.value);i.value=s?`ZIP downloaded, letter copied, and ${c.label}
1 support opened â paste and submit there.`:"ZIP downloaded and letter copied â open that platformâs support yourself, then paste and submit."}catch(e){r.value=O(e,"Could not prepare support pack")}finally{p.value=!1}}}async function he(){const t=f.value;if(t!=null&&t.id){T.value=!0,i.value="",r.value="";try{const s=(await Pe(t.id)).url||"";if(!s)throw new Error("No share link returned");await navigator.clipboard.writeText(s),i.value="Case share link copied.",g("link"),setTimeout(()=>{T.value=!1},1600)}catch(e){T.value=!1,r.value=O(e,"Could not get case share link")}}}function ke(){d.value&&ne.push({path:"/trace",query:{tab:"cases",case:d.value}})}async function Ae(){j.value="",z.value="";const t=De.value;if(!t){z.value="Select an account first";return}x.value=!0,h.value="";try{const e=await we({subscriberId:E.value,video_id:X.value,watermark_id:t.watermark_id});h.value=e.delivery_url||e.playlist_url||e.manifest_url||e.url||(e.playlist_path?`playlist:${e.playlist_path}`:"")||(e.session_id?`session:${e.session_id}`:""),j.value=h.value?"Private delivery session ready â send only to that account.":"Manifest created (no delivery cue returned)."}catch(e){z.value=O(e,"Could not create delivery link")}finally{x.value=!1}}async function Ee(){if(h.value)try{await navigator.clipboard.writeText(h.value),ee.value=!0,setTimeout(()=>{ee.value=!1},2e3)}catch{z.value="Could not copy â select the cue manually."}}return Be(()=>{A.wmReady&&se()}),K(()=>A.wmReady,t=>{t&&se()}),K(()=>A.refreshKey,()=>{A.wmReady&&se()}),(t,e)=>(l(),o("section",Je,[e[25]||(e[25]=a("h3",null,"Share findings",-1)),e[26]||(e[26]=a("p",{class:"tp-muted"},[w(" After Decode names an account, post a short public summary or download the support pack ZIP ("),a("code",null,"platform_support.md"),w(" + custody hashes + redacted card). Trace does not auto-file tickets â you still hit Send on their form. ")],-1)),e[27]||(e[27]=a("p",{class:"legal"}," Only share what youâre willing to stand behind. Naming someone publicly can have legal and platform consequences â prefer platform support / DMCA when you need enforcement. ",-1)),a("ol",Qe,[a("li",{class:m(["tp-wizard__step",{"tp-wizard__step--on":B.value===1,"tp-wizard__step--done":B.value>1}])},[...e[5]||(e[5]=[a("span",{class:"tp-wizard__num"},"1",-1),w(" Pick case ",-1)])],2),a("li",{class:m(["tp-wizard__step",{"tp-wizard__step--on":B.value===2,"tp-wizard__step--done":B.value>2}])},[...e[6]||(e[6]=[a("span",{class:"tp-wizard__num"},"2",-1),w(" Public / support pack ",-1)])],2),a("li",{class:m(["tp-wizard__step",{"tp-wizard__step--on":B.value===3,"tp-wizard__step--done":Q.value}])},[...e[7]||(e[7]=[a("span",{class:"tp-wizard__num"},"3",-1),w(" Optional private delivery ",-1)])],2)]),H.wmReady?(l(),o(_,{key:1},[a("div",et,[e[11]||(e[11]=a("h4",null,"1. Pick a case",-1)),J.value?(l(),o("p",tt,"Loading casesâ¦")):V.value?(l(),o("p",at,u(V.value),1)):C.value.length?(l(),o(_,{key:3},[a("label",lt,[e[10]||(e[10]=a("span",{class:"lbl"},"Search cases",-1)),W(a("input",{"onUpdate:modelValue":e[0]||(e[0]=s=>$.value=s),type:"search",class:"full",placeholder:"Case id, account, URLâ¦",autocomplete:"off"},null,512),[[Ne,$.value]])]),$.value.trim()&&!ue.value.length?(l(),o("p",ot," No cases match that search. ")):(l(),o("ul",nt,[(l(!0),o(_,null,N(ue.value,s=>(l(),o("li",{key:s.id},[a("button",{type:"button",class:m(["tp-case-picker__item",{"tp-case-picker__item--active":d.value===s.id}]),role:"option","aria-selected":d.value===s.id,onClick:c=>ae(s.id)},[a("code",it,u(s.id.slice(0,8)),1),a("span",rt,u(ie(s)),1),a("span",{class:m(["tp-pill",s.gate_passed?"tp-pill--ok":"tp-pill--warn"])},u(s.gate_passed?"Account named":"No account yet"),3)],10,ut)]))),128))]))],64)):(l(),o("p",st,[e[8]||(e[8]=w(" No cases yet â ",-1)),a("button",{type:"button",class:"linklike",onClick:re},"Decode a leak first"),e[9]||(e[9]=w(". ",-1))]))]),d.value?(l(),o("div",ct,[e[16]||(e[16]=a("h4",null,"2. Share or report",-1)),F.value?(l(),o("p",dt,"Loading case detailsâ¦")):G.value?(l(),o("p",pt,u(G.value),1)):f.value?(l(),o(_,{key:2},[f.value.gate_passed?v("",!0):(l(),o("div",vt,[e[12]||(e[12]=a("p",{class:"tp-muted"}," Public share that names an account stays locked until Trace names someone on this case. You can still copy a redacted platform letter and download the support pack. ",-1)),a("button",{type:"button",class:"tp-btn tp-btn--primary",onClick:re}," Decode a leak first ")])),a("label",bt,[e[13]||(e[13]=a("span",{class:"lbl"},"Platform letter",-1)),W(a("select",{"onUpdate:modelValue":e[1]||(e[1]=s=>M.value=s),class:"full",disabled:b.value||p.value},[(l(!0),o(_,null,N(oe(ze),s=>(l(),o("option",{key:s.id,value:s.id},u(s.label),9,ft))),128))],8,yt),[[le,M.value]])]),a("div",mt,[a("button",{type:"button",class:"tp-btn tp-btn--primary",disabled:p.value||b.value||k.value,onClick:_e},u(p.value?"Preparingâ¦":"Prepare & open support"),9,_t),a("button",{type:"button",class:"tp-btn tp-btn--ghost",disabled:b.value||p.value,onClick:fe},u(b.value?"Letter copied":"Copy platform letter"),9,ht),a("button",{type:"button",class:"tp-btn tp-btn--ghost",disabled:k.value||p.value,onClick:me},u(k.value?"Preparingâ¦":"Download support pack ZIP"),9,kt),a("button",{type:"button",class:"tp-btn tp-btn--ghost",disabled:!D.value||I.value,onClick:ve},u(I.value?"Openingâ¦":"Post summary on X"),9,gt),a("button",{type:"button",class:"tp-btn tp-btn--ghost",disabled:!D.value||P.value,onClick:pe},u(P.value?"Copied":"Copy public summary"),9,wt),a("button",{type:"button",class:"tp-btn tp-btn--ghost",disabled:!D.value||T.value,onClick:he},u(T.value?"Link copied":"Copy case share link"),9,Ct),a("button",{type:"button",class:"tp-btn tp-btn--ghost",onClick:ke}," Open full case ")]),a("div",Pt,[a("button",{type:"button",class:"tp-btn tp-btn--primary",disabled:p.value||b.value||k.value,onClick:_e},u(p.value?"Preparingâ¦":"Prepare & open support"),9,Tt),a("details",St,[e[14]||(e[14]=a("summary",null,"More share actions",-1)),a("div",Lt,[a("button",{type:"button",class:"tp-btn tp-btn--ghost",disabled:b.value||p.value,onClick:fe},u(b.value?"Letter copied":"Copy platform letter"),9,Rt),a("button",{type:"button",class:"tp-btn tp-btn--ghost",disabled:k.value||p.value,onClick:me},u(k.value?"Preparingâ¦":"Download support pack ZIP"),9,xt),a("button",{type:"button",class:"tp-btn tp-btn--ghost",disabled:!D.value||I.value,onClick:ve},u(I.value?"Openingâ¦":"Post summary on X"),9,zt),a("button",{type:"button",class:"tp-btn tp-btn--ghost",disabled:!D.value||P.value,onClick:pe},u(P.value?"Copied":"Copy public summary"),9,It),a("button",{type:"button",class:"tp-btn tp-btn--ghost",disabled:!D.value||T.value,onClick:he},u(T.value?"Link copied":"Copy case share link"),9,Dt),a("button",{type:"button",class:"tp-btn tp-btn--ghost",onClick:ke}," Open full case ")])])]),te.value?(l(),o("ol",Ut,[(l(!0),o(_,null,N(oe(xe),(s,c)=>(l(),o("li",{key:c},u(s),1))),128))])):v("",!0),i.value?(l(),o("p",Ot,u(i.value),1)):v("",!0),r.value?(l(),o("p",At,u(r.value),1)):v("",!0),Ie.value?(l(),o("div",Et,[e[15]||(e[15]=a("h4",null,"Whatâs next",-1)),a("ul",null,[a("li",{class:m({done:y.value.has("zip")})}," Attach the evidence ZIP to your platform support ticket. ",2),a("li",{class:m({done:y.value.has("letter")||y.value.has("guided")})}," Paste the platform letter into their form and hit Send. ",2),a("li",{class:m({done:y.value.has("link")})}," Optional: share the signed case link with counsel or your team. ",2),a("li",{class:m({done:y.value.has("public")})}," Optional: post the public summary only if youâre comfortable naming the account. ",2)])])):v("",!0)],64)):v("",!0)])):v("",!0),a("details",{class:"deliver",onToggle:Ue},[e[23]||(e[23]=a("summary",null,"3. Optional: private delivery link for an account",-1)),e[24]||(e[24]=a("p",{class:"tp-muted"}," Need a private cue for the labeled file you already encoded? Create a delivery session â send it yourself (OF / DM / Drive). This is not social posting. ",-1)),H.canShare?(l(),o(_,{key:1},[a("ol",Bt,[a("li",null,[e[19]||(e[19]=a("strong",null,"Encoded video",-1)),W(a("select",{"onUpdate:modelValue":e[3]||(e[3]=s=>X.value=s),disabled:x.value||!Y.value.length,class:"full"},[e[18]||(e[18]=a("option",{value:""},"Select videoâ¦",-1)),(l(!0),o(_,null,N(Y.value,s=>(l(),o("option",{key:s.id,value:s.id},u(s.title||s.id.slice(0,8))+" ("+u(s.status)+") ",9,Zt))),128))],8,Nt),[[le,X.value]])]),a("li",null,[e[21]||(e[21]=a("strong",null,"Account",-1)),W(a("select",{"onUpdate:modelValue":e[4]||(e[4]=s=>E.value=s),disabled:x.value||!R.value.length,class:"full"},[e[20]||(e[20]=a("option",{value:""},"Select accountâ¦",-1)),(l(!0),o(_,null,N(R.value,s=>(l(),o("option",{key:s.id,value:s.id},u(oe(Fe)(s)),9,$t))),128))],8,Vt),[[le,E.value]])]),a("li",null,[e[22]||(e[22]=a("strong",null,"Delivery link",-1)),a("div",qt,[a("button",{type:"button",class:"tp-btn tp-btn--primary",disabled:x.value||!X.value||!E.value,onClick:Ae},u(x.value?"Creatingâ¦":"Create private delivery link"),9,Ft),h.value?(l(),o("button",{key:0,t
1ype:"button",class:"tp-btn tp-btn--ghost",onClick:Ee},u(ee.value?"Copied":"Copy"),1)):v("",!0)]),h.value?(l(),o("p",Gt,u(h.value),1)):v("",!0)])]),j.value?(l(),o("p",Xt,u(j.value),1)):v("",!0),z.value?(l(),o("p",jt,u(z.value),1)):v("",!0)],64)):(l(),o("p",Mt,[e[17]||(e[17]=w(" Upgrade to Pro if youâve hit your Free share allowance, or wait until next month. ",-1)),a("button",{type:"button",class:"tp-btn tp-btn--primary",style:{"margin-left":"0.5rem"},onClick:e[2]||(e[2]=s=>t.$emit("subscribe"))}," Upgrade to Pro ")]))],32)],64)):(l(),o("p",Ye," Trace isnât available right now. Refresh, or email [email protected]. "))]))}}),na=$e(Kt,[["__scopeId","data-v-fe403820"]]);export{na 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.