1import{u as oe,r as j,j as e,c as g,d as k,at as me,z as ce,m as y,n as X,aq as xe,s as J}from"./index-C1DXNAgJ.js";import{u as pe,a as ue,x as he,g as be,f as fe,z as je}from"./queries-BBANSLRe.js";import{S as _}from"./SectionLoading-huDZyMLU.js";import{T as ge}from"./trending-down-DWaI3BTu.js";import{A as Q}from"./arrow-right-Cb1ziudB.js";import{T as ke}from"./triangle-alert-W8zEEdfs.js";import{S as ye}from"./sparkles-BslD847F.js";const Z=[{k:"emv",label:"EMV",fmt:t=>"$"+y(t)},{k:"reach",label:"EriÅim",fmt:t=>y(t)},{k:"engagement",label:"EtkileÅim",fmt:t=>y(t)}];function Ne(t,m,o,i,d,n){if(!m||!o)return null;const a=o/m;if(t==="emv")return i?{inf:m,cpi:a,rpc:i/o,vpr:n/i,total:n}:null;const r=t==="reach"?i:d;return{inf:m,cpi:a,rpc:r/o,total:r}}const ve=t=>({inf:"Influencer sayısı",cpi:"İçerik / influencer",rpc:t==="engagement"?"EtkileÅim / içerik":"EriÅim / içerik",vpr:"EMV / eriÅim"}),z=t=>t>=1e3?y(t):t.toFixed(t<10?2:0),we=[{k:"inf",title:"Kadroyu büyüt",sub:"Daha çok influencer ile çalıÅ"},{k:"cpi",title:"Kadroyu daha çok çalıÅtır",sub:"Aynı isimlerden daha fazla içerik"},{k:"rpc",title:"Daha büyük eriÅimle çalıÅ",sub:"Macro influencer'a kay â içerik baÅına eriÅimi yükselt"},{k:"vpr",title:"İçerik verimini artır",sub:"Format/platform karmasını eriÅim baÅına daha çok EMV getirecek Åekilde kaydır"}],ze=[{n:1,label:"Rapor"},{n:2,label:"Strateji"},{n:3,label:"Kadro"}];function De(){var q;const{selfBrand:t,period:m}=oe(),o=pe(),i=j.useMemo(()=>{var l;const s=[t,...((l=o.data)==null?void 0:l.competitors.map(p=>p.id))??[]];return[...new Set(s.filter(Boolean))]},[t,o.data]),d=s=>{var l,p,u,f;return(s===t?(p=(l=o.data)==null?void 0:l.self)==null?void 0:p.brandname:(f=(u=o.data)==null?void 0:u.competitors.find(w=>w.id===s))==null?void 0:f.brandname)??String(s)},n=ue(i),a=he(i),r=be(i),c=fe(i,"strong"),x=je(i),[h,I]=j.useState("emv"),[ee,se]=j.useState(null),[L,V]=j.useState(1),[te,ae]=j.useState([]),[P,re]=j.useState({inf:0,cpi:0,rpc:0,vpr:0}),ne=n.isLoading||a.isLoading||o.isLoading,B=j.useMemo(()=>{var p,u;const s=((p=n.data)==null?void 0:p.kpi)??{},l=((u=a.data)==null?void 0:u.brand_totals)??{};return i.map(f=>{var W;const w=(W=s[String(f)])==null?void 0:W.all,A=Number(l[String(f)]??0);if(!w)return null;const C=Ne(h,A,Number(w.content??0),Number(w.reach??0),Number(w.engagement??0),Number(w.emv??0));return C?{id:f,name:d(f),f:C}:null}).filter(Boolean)},[n.data,a.data,i,h,o.data]),E=B.find(s=>s.id===t),U=B.filter(s=>s.id!==t).sort((s,l)=>l.f.total-s.f.total),b=B.find(s=>s.id===ee)??U[0],N=Z.find(s=>s.k===h);if(ne)return e.jsxs("div",{className:"p-6",children:[e.jsx(R,{metric:h,setMetric:I,period:m}),e.jsx(g,{children:e.jsx(k,{className:"py-6",children:e.jsx(_,{label:"Aksiyon Planı"})})})]});if(!E||!b)return e.jsxs("div",{className:"p-6",children:[e.jsx(R,{metric:h,setMetric:I,period:m}),e.jsx(g,{children:e.jsx(k,{className:"py-6 text-sm text-muted-foreground",children:"Bu dönem için karÅılaÅtırılacak veri yok."})})]});const S=b.f.total/E.f.total,v=S>1,ie=Math.abs(b.f.total-E.f.total),M=ve(h),$=[["inf",M.inf],["cpi",M.cpi],["rpc",M.rpc],...h==="emv"?[["vpr",M.vpr]]:[]].map(([s,l])=>{const p=Number(E.f[s]??0),u=Number(b.f[s]??0);return{key:s,label:l,mine:p,theirs:u,r:p>0?u/p:0}}),D=$.reduce((s,l)=>l.r>s.r?l:s,$[0]),le=v?(S-1)*100:0,H=we.filter(s=>s.k!=="vpr"||h==="emv"),F=te.filter(s=>H.some(l=>l.k===s)),Y=F.reduce((s,l)=>s*(1+(P[l]??0)/100),1),T=E.f.total*Y,de=[...B.map(s=>s.id===t?T:s.f.total)].sort((s,l)=>l-s).indexOf(T)+1,G=T>=b.f.total,O=s=>{const l=Number(E.f[s]??0);return{now:l,need:l*S,applied:l*(1+(P[s]??0)/100)}};return e.jsxs("div",{className:"p-6 space-y-5",children:[e.jsx(R,{metric:h,setMetric:I,period:m}),e.jsx(Fe,{step:L,setStep:V,canGo:s=>s===1||F.length>0||s===2}),L===1&&e.jsxs(e.Fragment,{children:[e.jsx(g,{children:e.jsxs(k,{className:"py-4",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-3",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-wider font-semibold text-muted-foreground",children:"Kimi geçmek istiyorsun"}),e.jsx("div",{className:"inline-flex bg-muted rounded-full p-[3px]",children:U.map(s=>e.jsx("button",{onClick:()=>se(s.id),className:`px-3 py-1 rounded-full text-xs font-semibold transition ${b.id===s.id?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"}`,children:s.name},s.id))})]}),e.jsxs("div",{className:"flex items-end gap-6 flex-wrap",children:[e.jsx(K,{label:`${d(t)} · ${N.label}`,value:N.fmt(E.f.total)}),e.jsx(K,{label:`${b.name} · ${N.label}`,value:N.fmt(b.f.total)}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:"Fark"}),e.jsxs("div",{className:`text-2xl font-bold tabular-nums inline-flex items-center gap-1.5 ${v?"text-rose-500":"text-emerald-500"}`,children:[v?e.jsx(ge,{className:"size-5"}):e.jsx(me,{className:"size-5"}),v?S.toFixed(2):(1/S).toFixed(2),"Ã",e.jsx("span",{className:"text-sm font-normal text-muted-foreground",children:v?"geride":"önde"})]}),e.jsxs("div",{className:"text-[11px] text-muted-foreground tabular-nums mt-0.5",children:[N.fmt(ie)," ",v?"eksik":"fazla"]})]})]})]})}),e.jsx(g,{children:e.jsxs(k,{className:"py-4",children:[e.jsx("h2",{className:"text-base font-semibold",children:"Fark aÄacı â bu fark nereden geliyor?"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 mb-3",children:[N.label,", Åu çarpanların çarpımıdır: ",e.jsx("span",{className:"font-mono text-[11px]",children:[M.inf,M.cpi,M.rpc,...h==="emv"?[M.vpr]:[]].join(" à ")}),". AÅaÄıdaki oranların çarpımı, üstteki toplam farkı birebir verir â yani fark tam olarak bu ç
1arpanlardan doÄuyor."]}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b text-[10px] uppercase tracking-wider text-muted-foreground",children:[e.jsx("th",{className:"px-3 py-2 text-left font-semibold",children:"Ãarpan"}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:d(t)}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:b.name}),e.jsx("th",{className:"px-3 py-2 text-center font-semibold",children:"Durum"})]})}),e.jsxs("tbody",{children:[$.map(s=>{const l=s.r>1.05,p=s.r<.95,u=s.key===D.key&&l;return e.jsxs("tr",{className:`border-b last:border-0 ${u?"bg-rose-500/[0.06]":""}`,children:[e.jsxs("td",{className:"px-3 py-2.5 font-medium",children:[s.label,u&&e.jsx("span",{className:"ml-2 rounded-full bg-rose-500/10 px-2 py-0.5 text-[10px] font-semibold text-rose-500",children:"en büyük fark"})]}),e.jsx("td",{className:"px-3 py-2.5 text-right tabular-nums",children:z(s.mine)}),e.jsx("td",{className:"px-3 py-2.5 text-right tabular-nums",children:z(s.theirs)}),e.jsx("td",{className:"px-3 py-2.5 text-center tabular-nums font-semibold",children:l?e.jsxs("span",{className:"text-rose-500",children:[s.r.toFixed(2),"à geride"]}):p?e.jsxs("span",{className:"text-emerald-500",children:[(1/s.r).toFixed(2),"à önde"]}):e.jsx("span",{className:"text-muted-foreground",children:"eÅit"})})]},s.key)}),e.jsxs("tr",{className:"font-semibold",style:{backgroundColor:"rgba(69,69,129,0.08)"},children:[e.jsxs("td",{className:"px-3 py-2.5",children:[N.label," (çarpanların çarpımı)"]}),e.jsx("td",{className:"px-3 py-2.5 text-right tabular-nums",children:N.fmt(E.f.total)}),e.jsx("td",{className:"px-3 py-2.5 text-right tabular-nums",children:N.fmt(b.f.total)}),e.jsx("td",{className:`px-3 py-2.5 text-center tabular-nums ${v?"text-rose-500":"text-emerald-500"}`,children:v?`${S.toFixed(2)}à geride`:`${(1/S).toFixed(2)}à önde`})]})]})]})}),v&&e.jsxs("p",{className:"mt-3 text-xs leading-relaxed",children:[e.jsx("strong",{children:"Okuma:"})," ",b.name,"'a göre en büyük fark ",e.jsx("strong",{children:D.label.toLowerCase()})," (",D.r.toFixed(2),"Ã).",$.some(s=>s.r<.95)&&e.jsxs(e.Fragment,{children:[" ","Buna karÅılık ",e.jsx("strong",{children:$.filter(s=>s.r<.95).map(s=>s.label.toLowerCase()).join(" ve ")})," tarafında öndesin â yani sorun içeriÄin performansı deÄil."]})]})]})}),e.jsx("div",{className:"flex justify-end",children:e.jsxs("button",{onClick:()=>V(2),className:"rounded-full px-5 py-2.5 text-sm font-semibold text-white shadow-sm transition hover:brightness-110",style:{backgroundImage:"linear-gradient(135deg, #5851FF, #454581)"},children:["Nasıl kapatmak istersin? ",e.jsx(Q,{className:"inline size-4 ml-1"})]})})]}),L===2&&e.jsx(e.Fragment,{children:e.jsx(g,{children:e.jsxs(k,{className:"py-4",children:[e.jsx("h2",{className:"text-base font-semibold",children:"Nasıl kapatmak istersin?"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 mb-4",children:["Farkı kapatmanın ",e.jsxs("strong",{children:[H.length," yolu"]})," var ve hepsi aynı özdeÅlikten çıkar â hangisini seçersen seç",e.jsxs("strong",{className:"text-foreground",children:[" %",le.toFixed(0)]})," artıŠfarkı kapatır. Birden fazla seçersen etkileri çarpılır (ör. kadro +%25 à eriÅim +%29 = 1,61Ã)."]}),e.jsx("div",{className:"grid gap-3 md:grid-cols-2",children:H.map(s=>{const l=O(s.k),p=F.includes(s.k);return e.jsxs("div",{className:`rounded-xl border p-3.5 transition ${p?"border-primary bg-primary/[0.04]":"border-border"}`,children:[e.jsxs("button",{onClick:()=>ae(u=>u.includes(s.k)?u.filter(f=>f!==s.k):[...u,s.k]),className:"flex w-full items-start gap-2.5 text-left",children:[e.jsx("span",{className:`mt-0.5 grid size-4 shrink-0 place-items-center rounded border ${p?"border-primary bg-primary text-white":"border-muted-foreground/40"}`,children:p&&e.jsx(ce,{className:"size-3"})}),e.jsxs("span",{className:"min-w-0",children:[e.jsx("span",{className:"block text-sm font-semibold",children:s.title}),e.jsx("span",{className:"block text-[11px] text-muted-foreground leading-snug mt-0.5",children:s.sub})]})]}),e.jsxs("div",{className:"mt-2.5 text-[11px] tabular-nums text-muted-foreground",children:["Tek baÅına kapatmak için: ",e.jsxs("span",{className:"font-semibold text-foreground",children:[z(l.now)," â ",z(l.need)]}),s.k==="inf"&&v&&e.jsxs("span",{className:"text-foreground",children:[" (+",Math.ceil(l.need-l.now)," kiÅi)"]})]}),p&&e.jsx("div",{className:"mt-2.5 border-t pt-2.5",children:e.jsx(Ce,{label:"Ne kadar artıracaksın",pct:P[s.k]??0,onChange:u=>re(f=>({...f,[s.k]:u})),from:l.now,to:l.applied})})]},s.k)})}),F.length===0?e.jsx("p",{className:"mt-4 text-xs text-muted-foreground",children:"Devam etmek için en az bir yol seç â bir sonraki adımda seçimine göre kadro önerisi çıkaracaÄım."}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mt-4 flex items-end gap-6 flex-wrap border-t pt-4",children:[e.jsx(K,{label:`Yeni ${N.label}`,value:N.fmt(T)}),e.jsx(K,{label:"Yeni pazar sırası",value:`#${de} / ${B.length}`}),e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:"BileÅik etki"}),e.jsxs("div",{className:"text-2xl font-bold tabular-nums",children:[Y.toFixed(2),"Ã"]}),e.jsxs("div",{className:"text-[11px] text-muted-foreground tabular-nums mt-0.5",children:["gereken: ",S.toFixed(2),"Ã"]})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:[b.name,"'ı geçtin mi"]}),e.jsx("div",{className:`text-2xl font-bold ${G?"text-emerald-500":"text-muted-foreground"}`,children:G?"Evet":"Henüz"})]})]}),e.jsxs("p",{className:"mt-3 text-[11px] text-muted-foreground",children:[e.jsx("strong",{children:"Varsayım:"}),' oynatmadıÄın çarpanlar bugünkü seviyesinde kalır; eklenen kadro/içerik bugünkü ortalamanla aynı performansı gösterir. Bu bir tahmin deÄil, "bu girdiyle bu çıktı" hesabıdır.']}),e.jsx("div",{className:"mt-4 flex justify-end",children:e.jsxs("button",{onClick:()=>V(3),className:"rounded-full px-5 py-2.5 text-sm font-semibold text-white shadow-sm transition hover:brightness-110",style:{backgroundImage:"linear-gradient(135deg, #5851FF, #454581)"},children:["Kimlerle yapacaÄım? ",e.jsx(Q,{className:"inline size-4 ml-1"})]})})]})]})})}),L===3&&e.jsxs(e.Fragment,{children:[F.length===0?e.jsx(g,{children:e.jsxs(k,{className:"py-6 text-sm text-muted-foreground",children:["Ãnce bir strateji seç."," ",e.jsx("button",{onClick:()=>V(2),className:"text-primary font-semibold hover:underline",children:"Strateji adımına dön"})]})}):F.map(s=>{var p,u,f,w,A,C;const l=O(s);return s==="inf"?e.jsx(Be,{target:b,rows:((p=r.data)==null?void 0:p.discovery)??[],loading:r.isLoading,needCount:Math.ceil(l.applied-l.n
1ow),behind:v},s):s==="rpc"?e.jsx(Ee,{target:b,scatter:((u=a.data)==null?void 0:u.scatter)??[],disc:((f=r.data)==null?void 0:f.discovery)??[],loading:r.isLoading||a.isLoading,needRpc:l.applied,nowRpc:l.now},s):s==="cpi"?e.jsx(Me,{selfBrand:t,scatter:((w=a.data)==null?void 0:w.scatter)??[],loading:a.isLoading,nowCpi:l.now,needCpi:l.applied},s):e.jsx(_e,{kpi:(C=(A=n.data)==null?void 0:A.kpi)==null?void 0:C[String(t)],nowVpr:l.now,needVpr:l.applied},s)}),(F.includes("inf")||F.includes("rpc"))&&e.jsx(Se,{data:x.data,loading:x.isLoading,needRpc:F.includes("rpc")?O("rpc").applied:null,selfName:d(t)}),e.jsx($e,{campaigns:((q=c.data)==null?void 0:q.campaigns)??[],loading:c.isLoading,selfName:d(t)})]}),e.jsxs("div",{className:"rounded-xl border border-amber-300/70 bg-amber-50 dark:border-amber-500/30 dark:bg-amber-950/25 px-4 py-3 text-xs leading-relaxed text-amber-900 dark:text-amber-200 flex gap-2.5 items-start",children:[e.jsx(ke,{className:"size-4 shrink-0 mt-0.5 text-amber-500"}),e.jsxs("p",{children:[e.jsx("strong",{className:"font-semibold",children:"Bu ekran yapım aÅamasında"})," ve EMV & Insights'tan henüz baÄlanmadı. Buradaki her sayı ölçülen veriden hesaplanır; hiçbir yerde tahmin/projeksiyon yoktur."]})]})]})}function Fe({step:t,setStep:m,canGo:o}){return e.jsx("div",{className:"flex items-center gap-1.5 flex-wrap",children:ze.map((i,d)=>{const n=t===i.n,a=o(i.n);return e.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[d>0&&e.jsx("span",{className:"text-muted-foreground/40",children:"âº"}),e.jsxs("button",{onClick:()=>a&&m(i.n),disabled:!a,className:`inline-flex items-center gap-1.5 rounded-full px-3 py-1.5 text-xs font-semibold transition ${n?"bg-primary text-primary-foreground shadow-sm":a?"text-muted-foreground hover:text-foreground":"text-muted-foreground/40 cursor-not-allowed"}`,children:[e.jsx("span",{className:`grid size-4 place-items-center rounded-full text-[9px] ${n?"bg-white/25":"bg-muted"}`,children:i.n}),i.label]})]},i.n)})})}function Ee({target:t,scatter:m,disc:o,loading:i,needRpc:d,nowRpc:n}){const a=j.useMemo(()=>{const c=new Set(o.map(x=>x.username));return m.filter(x=>x.brand_id===t.id&&x.content>0&&c.has(x.username)).map(x=>({...x,rpc:x.reach/x.content})).sort((x,h)=>h.rpc-x.rpc)},[m,o,t.id]),r=a.filter(c=>c.rpc>=d);return e.jsx(g,{children:e.jsxs(k,{className:"py-4",children:[e.jsx("h2",{className:"text-base font-semibold",children:"EriÅim yolu â hedefi taÅıyabilecek isimler"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 mb-3",children:["İçerik baÅına eriÅimini ",e.jsxs("strong",{className:"text-foreground",children:[z(n)," â ",z(d)]})," çıkarman gerekiyor. AÅaÄıdakiler ",t.name," ile çalıÅmıÅ, seninle çalıÅmamıŠve"," ",e.jsxs("strong",{children:["içerik baÅına ",z(d)," üstü eriÅim"]})," getiren isimler â havuzda ",e.jsx("strong",{className:"text-foreground",children:r.length})," kiÅi bu eÅiÄi taÅıyor."]}),i?e.jsx(_,{label:"Macro Havuzu",className:"h-24"}):a.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Uygun isim bulunamadı."}):e.jsxs("div",{className:"overflow-x-auto",children:[e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b text-[10px] uppercase tracking-wider text-muted-foreground",children:[e.jsx("th",{className:"px-3 py-2 text-left font-semibold",children:"Influencer"}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"İçerik"}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"EriÅim / içerik"}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"ÃrettiÄi EMV"}),e.jsx("th",{className:"px-3 py-2 text-center font-semibold",children:"EÅiÄi taÅır mı"})]})}),e.jsx("tbody",{children:a.slice(0,10).map(c=>e.jsxs("tr",{className:"border-b last:border-0",children:[e.jsxs("td",{className:"px-3 py-2 font-medium",children:["@",c.username]}),e.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:c.content}),e.jsx("td",{className:"px-3 py-2 text-right tabular-nums font-semibold",children:y(c.rpc)}),e.jsxs("td",{className:"px-3 py-2 text-right tabular-nums",children:["$",y(c.emv)]}),e.jsx("td",{className:"px-3 py-2 text-center",children:c.rpc>=d?e.jsx("span",{className:"text-emerald-500 font-semibold text-xs",children:"Evet"}):e.jsx("span",{className:"text-muted-foreground text-xs",children:"Hayır"})})]},c.username))})]}),e.jsxs("p",{className:"mt-2 text-[11px] text-muted-foreground",children:["EriÅim/içerik en yüksek 10 isim. EriÅim verisi, bu kiÅilerin ",t.name," için ürettiÄi içeriklerden ölçülmüÅtür."]})]})]})})}function Se({data:t,loading:m,needRpc:o,selfName:i}){const d=(t==null?void 0:t.untapped)??[],n=o?d.filter(a=>a.reach_per_content>=o):[];return e.jsx(g,{children:e.jsxs(k,{className:"py-4",children:[e.jsx("h2",{className:"text-base font-semibold",children:"Bakir havuz â ne senin ne rakiplerinin çalıÅtıÄı isimler"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 mb-3",children:[e.jsx("strong",{children:(t==null?void 0:t.sector)||"â"})," sektöründe üretim yapan, ama ",i," dâhil izlenen markaların ",e.jsx("strong",{children:"hiçbiriyle"})," çalıÅmamıŠcreator'lar.",o&&n.length>0&&e.jsxs(e.Fragment,{children:[" ",e.jsx("strong",{className:"text-foreground",children:n.length})," tanesi seçtiÄin eriÅim eÅiÄini (",z(o),") taÅıyor."]})," ",'Rakibin kadrosunu kopyalamadan büyümenin yolu â ve Sadakat ekranının "rakiple paylaÅılan creator = risk" tanımıyla çeliÅmeyen tek havuz.']}),m?e.jsx(_,{label:"Bakir Havuz",className:"h-24"}):d.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Bu dönem için bakir aday bulunamadı."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b text-[10px] uppercase tracking-wider text-muted-foreground",children:[e.jsx("th",{className:"px-3 py-2 text-left font-semibold",children:"Influencer"}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Takipçi"}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"EriÅim / içerik"}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Skor"}),e.jsx("th",{className:"px-3 py-2 text-left font-semibold",children:"Sektörleri"})]})}),e.jsx("tbody",{children:d.slice(0,10).map(a=>e.jsxs("tr",{className:"border-b last:border-0",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.pp?e.jsx(X,{src:a.pp,className:"size-6 rounded-full object-cover shrink-0"}):e.jsx("span",{className:"size-6 rounded-full bg-muted shrink-0"}),e.jsxs("span",{className:"font-medium",children:["@",a.username]}),a.inf_class&&e.jsx("span",{className:"rounded-full border px-1.5 py-0.5 text-[9px] text-muted-foreground",children:a.inf_class})]})}),e.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:y(a.followers)}),e.jsx("td",{className:`px-3 py-2 text-right tabular-nums font-semibold ${o&&a.reach_per_content>=o?"text-emerald-500":""}`,children:y(a.reach_per_content)}),e.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:a.person_score>0?a.person_score.toFixed(0):"â"}),e.jsx("td",{className:"px-3 py-2 text-[10px] text-muted-foreground truncate max-w-[220px]",children:a.category_tags})]},a.username))})]})}),e.jsxs("p",{className:"mt-2 text-[11px] text-muted-foreground leading-relaxed",children:["Sektör, marka tanımından deÄil ",e.jsx("strong",{children:"kendi kadronun"})," baskın etiketinden türetildi. Taranan bakir aday: ",(t==null?void 0:t.pool_scanned)??0,"; izlenen evren: ",(t==null?void 0:t.universe_size)??0," isim.",e.jsx("br",{}),e.jsx("strong",{children:"Dikkat:"})," buradaki eriÅim/içerik, bu kiÅilerin ",e.jsx("em",{children:"tüm"})," içeriklerinden ölçülür (henüz kimseyle marka iÅi yapmadıkları için); kendi kadronun eriÅim/içeriÄi ise yalnız marka etiketli içeriklerden. Aynı paydada deÄiller â üst sınır olarak okunmalı."]})]})]})})}function Me({selfBrand:t,scatter:m,loading:o,nowCpi:i,needCpi:d}){const n=j.useMemo(()=>m.filter(r=>r.brand_id===t&&r.content>0).map(r=>({...r,rpc:r.reach/r.content})).sort((r,c)=>r.content-c.content||c.rpc-r.rpc),[m,t]),a=n.filter(r=>r.content<d);return e.jsx(g,{children:e.jsxs(k,{className:"py-4",children:[e.jsx("h2",{className:"text-base font-semibold",children:"Ãretkenlik yolu â az çalıÅtırdıÄın isimler"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 mb-3",children:["İnfluencer baÅına içeriÄi ",e.jsxs("strong",{className:"text-foreground",children:[i.toFixed(2)," â ",d.toFixed(2)]})," çıkarman gerekiyor. Kadronda"," ",e.jsx("strong",{className:"text-foreground",children:a.length})," isim bu hedefin altında üretiyor. AÅaÄıdakiler en az içerik üretmiÅ ama içerik baÅına eriÅimi en yüksek olanlar â yeni isim aramadan en ucuz kazanç burada."]}),o?e.jsx(_,{label:"Kadro ÃretkenliÄi",className:"h-24"}):n.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Kadro verisi yok."}):e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b text-[10px] uppercase tracking-wider text-muted-foreground",children:[e.jsx("th",{className:"px-3 py-2 text-left font-semibold",children:"Influencer"}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"İçerik"}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"EriÅim / içerik"}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"ÃrettiÄi EMV"})]})}),e.jsx("tbody",{children:n.slice(0,10).map(r=>e.jsxs("tr",{className:"border-b last:border-0",children:[e.jsxs("td",{className:"px-3 py-2 font-medium",children:["@",r.username]}),e.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:r.content}),e.jsx("td",{className:"px-3 py-2 text-right tabular-nums font-semibold",children:y(r.rpc)}),e.jsxs("td",{className:"px-3 py-2 text-right tabular-nums",children:["$",y(r.emv)]})]},r.username))})]})})]})})}
1function _e({kpi:t,nowVpr:m,needVpr:o}){const i=j.useMemo(()=>{const r=t==null?void 0:t.all;return r?["ig","tk"].map(c=>{const x=t==null?void 0:t[c];return!x||!x.reach?null:{key:c,label:c==="ig"?"Instagram":"TikTok",vpr:x.emv/x.reach,share:x.reach/r.reach}}).filter(Boolean):[]},[t]),d=i.length?i.reduce((r,c)=>c.vpr>r.vpr?c:r):null,n=i.length?i.reduce((r,c)=>c.vpr<r.vpr?c:r):null,a=d&&n&&n.vpr>0?d.vpr/n.vpr:null;return e.jsx(g,{children:e.jsxs(k,{className:"py-4",children:[e.jsx("h2",{className:"text-base font-semibold",children:"Verim yolu â karmayı nereye kaydırmalısın"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 mb-3",children:["EriÅim baÅına EMV'ni ",e.jsxs("strong",{className:"text-foreground",children:[m.toFixed(4)," â ",o.toFixed(4)]})," çıkarman gerekiyor. Bu, yeni influencer deÄil ",e.jsx("strong",{children:"karma"})," meselesi: aynı eriÅimi daha verimli bir platformdan almak."]}),i.length<2||!d||!n?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Platform kırılımı için yeterli veri yok."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:i.map(r=>e.jsxs("div",{className:`rounded-xl border p-3.5 ${r.key===d.key?"border-emerald-500/40 bg-emerald-500/[0.04]":"border-border"}`,children:[e.jsx("div",{className:"text-sm font-semibold",children:r.label}),e.jsx("div",{className:"mt-1.5 text-2xl font-bold tabular-nums",children:r.vpr.toFixed(4)}),e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground",children:"EMV / eriÅim"}),e.jsxs("div",{className:"mt-2 text-[11px] text-muted-foreground tabular-nums",children:["eriÅiminin %",(r.share*100).toFixed(0),"'i burada"]})]},r.key))}),a?e.jsxs("p",{className:"mt-3 text-xs leading-relaxed",children:[e.jsx("strong",{children:"Okuma:"})," ",d.label,", ",n.label,"'ın ",e.jsxs("strong",{className:"text-emerald-600 dark:text-emerald-400",children:[a.toFixed(1)," katı"]})," verimli â aynı eriÅim orada ",a.toFixed(1)," kat EMV üretiyor. Ama eriÅiminin yalnız ",e.jsxs("strong",{children:["%",(d.share*100).toFixed(0)]}),"'i ",d.label,"'da. Karmayı oraya kaydırmak, tek bir yeni influencer eklemeden bu çarpanı yükseltir."]}):e.jsxs("p",{className:"mt-3 text-xs leading-relaxed",children:[e.jsx("strong",{children:"Okuma:"})," ",n.label," markalı EMV üretmiyor, o yüzden asıl kaldıraç eriÅimini ",d.label,"'a kaydırmak. EriÅiminin Åu an yalnız ",e.jsxs("strong",{children:["%",(d.share*100).toFixed(0)]}),"'i ",d.label,"'da."]})]})]})})}function Be({target:t,rows:m,loading:o,needCount:i,behind:d}){const n=j.useMemo(()=>m.filter(a=>(a.brands_collaborated??[]).includes(String(t.id))).sort((a,r)=>r.emv-a.emv),[m,t.id]);return e.jsx(g,{children:e.jsxs(k,{className:"py-4",children:[e.jsxs("h2",{className:"text-base font-semibold",children:[t.name,"'ın kadrosundan sana açık olanlar"]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 mb-3",children:[t.name," ile çalıÅmıÅ, ",e.jsx("strong",{children:"seninle hiç çalıÅmamıÅ"})," influencer'lar â seçili dönemde ürettikleri EMV'ye göre sıralı.",d&&i>0&&e.jsxs(e.Fragment,{children:[" ","Simülatöre göre farkı yalnız kadroyla kapatmak ",e.jsxs("strong",{className:"text-foreground",children:["â",i," kiÅi"]})," gerektiriyor."]})]}),o?e.jsx(_,{label:"Kadro Havuzu",className:"h-24"}):n.length===0?e.jsxs("p",{className:"text-xs text-muted-foreground",children:[t.name,"'ın çalıÅıp senin çalıÅmadıÄın influencer bulunamadı."]}):e.jsxs("div",{className:"overflow-x-auto",children:[e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b text-[10px] uppercase tracking-wider text-muted-foreground",children:[e.jsx("th",{className:"px-3 py-2 text-left font-semibold",children:"Influencer"}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Takipçi"}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"İçerik"}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"ÃrettiÄi EMV"}),e.jsx("th",{className:"px-3 py-2 text-center font-semibold",children:"Tip"})]})}),e.jsx("tbody",{children:n.slice(0,10).map(a=>e.jsxs("tr",{className:"border-b last:border-0",children:[e.jsx("td",{className:"px-3 py-2",children:e.jsxs("span",{className:"inline-flex items-center gap-2",children:[a.pp?e.jsx(X,{src:a.pp,className:"size-6 rounded-full object-cover shrink-0"}):e.jsx("span",{className:"size-6 rounded-full bg-muted shrink-0"}),e.jsxs("span",{className:"font-medium",children:["@",a.username]})]})}),e.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:y(a.followers)}),e.jsx("td",{className:"px-3 py-2 text-right tabular-nums",children:a.content}),e.jsxs("td",{className:"px-3 py-2 text-right tabular-nums font-semibold",children:["$",y(a.emv)]}),e.jsx("td",{className:"px-3 py-2 text-center",children:e.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[11px] ${a.category==="swipeup"?"text-[#ef5b0c] border-[#ef5b0c]/30 bg-[#ef5b0c]/10":"text-primary border-primary/30 bg-primary/10"}`,children:[a.category==="swipeup"?e.jsx(xe,{className:"size-3"}):e.jsx(ye,{className:"size-3"}),a.category==="swipeup"?"Swipe-Up":"Branding"]})})]},a.username))})]}),e.jsxs("p",{className:"mt-2 text-[11px] text-muted-foreground",children:["KeÅif listesinin ilk 100'ünde ",t.name," ile çalıÅan ",n.length," kiÅi var; en verimli 10'u gösteriliyor. Gerçek havuz daha geniÅ â tamamı için Yeni Influencer KeÅfi ekranı."]})]})]})})}function $e({campaigns:t,loading:m,selfName:o}){const i=j.useMemo(()=>t.map(n=>{var a,r;return{c:n,pp:((r=(a=n.self_impact)==null?void 0:a.share_delta_pp)==null?void 0:r.emv)??0}}).filter(n=>n.pp<-.05).sort((n,a)=>n.pp-a.pp),[t]),d=i[0];return e.jsx(g,{children:e.jsxs(k,{className:"py-4",children:[e.jsx("h2",{className:"text-base font-semibold",children:"Kanıt â kampanya yapmak pazarı gerçekten oynatıyor"}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-1 mb-3",children:["Bu dönem rakiplerin yaptıÄı kampanyaların ",e.jsx("strong",{children:o}),"'nın EMV payına ölçülmüŠetkisi. Her satır: o kampanya olmasaydı payın ne olurdu â gerçekte ne oldu. Tahmin deÄil, ölçüm."]}),m?e.jsx(_,{label:"Kanıt",className:"h-24"}):i.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Bu dönemde payını ölçülebilir Åekilde düÅüren rakip kampanyası yok."}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b text-[10px] uppercase tracking-wider text-muted-foreground",children:[e.jsx("th",{className:"px-3 py-2 text-left font-semibold",children:"Rakip kampanyası"}),e.jsx("th",{className:"px-3 py-2 text-center font-semibold",children:"Tarih"}),e.jsx("th",{className:"px-3 py-2 text-center font-semibold",children:"Åiddet"}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Payın olurdu"}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Payın oldu"}),e.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Etki"})]})}),e.jsx("tbody",{children:i.slice(0,6).map(({c:n,pp:a},r)=>
1{var x,h;const c=n.self_impact;return e.jsxs("tr",{className:"border-b last:border-0",children:[e.jsxs("td",{className:"px-3 py-2.5",children:[e.jsx("span",{className:"font-semibold",children:n.brand_name}),e.jsx("span",{className:`ml-2 inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-[10px] ${n.type==="swipeup"?"text-[#ef5b0c] border-[#ef5b0c]/30 bg-[#ef5b0c]/10":"text-primary border-primary/30 bg-primary/10"}`,children:n.type==="swipeup"?"Swipe-Up":"Branding"})]}),e.jsxs("td",{className:"px-3 py-2.5 text-center text-[11px] tabular-nums whitespace-nowrap",children:[J(n.start_date)," â ",J(n.end_date),e.jsxs("div",{className:"text-[10px] text-muted-foreground",children:[n.days," gün"]})]}),e.jsxs("td",{className:"px-3 py-2.5 text-center tabular-nums font-semibold text-[11px]",children:[n.peak_ratio.toFixed(1),"Ã"]}),e.jsxs("td",{className:"px-3 py-2.5 text-right tabular-nums text-muted-foreground",children:["%",(x=c.hypo_share.emv)==null?void 0:x.toFixed(1)]}),e.jsxs("td",{className:"px-3 py-2.5 text-right tabular-nums font-semibold",children:["%",(h=c.real_share.emv)==null?void 0:h.toFixed(1)]}),e.jsxs("td",{className:"px-3 py-2.5 text-right tabular-nums font-bold text-rose-500",children:[a.toFixed(1)," pp"]})]},r)})})]})}),e.jsxs("p",{className:"mt-3 text-xs leading-relaxed",children:[e.jsx("strong",{children:"Okuma:"})," bu dönem payını düÅüren ",e.jsxs("strong",{children:[i.length," rakip kampanyası"]})," var; en pahalısı ",e.jsx("strong",{children:d.c.brand_name}),"'ın ",d.c.days," günlük kampanyası: tek baÅına EMV payından ",e.jsxs("strong",{className:"text-rose-500",children:[d.pp.toFixed(1)," puan"]})," götürdü. Yani kampanya yapmak pazarı ölçülebilir Åekilde oynatıyor â yukarıdaki kadro havuzu, aynı hamleyi senin yapabilmen için var."]}),e.jsx("p",{className:"mt-1.5 text-[11px] text-muted-foreground",children:'Not: satırlar toplanmaz. Her biri "yalnız o kampanya olmasaydı" varsayımıyla ayrı hesaplanır ve dönemleri örtüÅür.'})]})]})})}function R({metric:t,setMetric:m,period:o}){return e.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap mb-5",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold tracking-tight",children:"Aksiyon Planı"}),e.jsxs("p",{className:"text-xs uppercase tracking-wider text-muted-foreground mt-1",children:["Rakibi geçmek için ne gerekiyor · ",o.start," â ",o.end]})]}),e.jsx("div",{className:"inline-flex bg-muted rounded-full p-[3px]",children:Z.map(i=>e.jsx("button",{onClick:()=>m(i.k),className:`px-3.5 py-1.5 rounded-full text-xs font-semibold transition ${t===i.k?"bg-background shadow-sm text-foreground":"text-muted-foreground hover:text-foreground"}`,children:i.label},i.k))})]})}function K({label:t,value:m}){return e.jsxs("div",{children:[e.jsx("div",{className:"text-[10px] uppercase tracking-wider text-muted-foreground mb-0.5",children:t}),e.jsx("div",{className:"text-2xl font-bold tabular-nums",children:m})]})}function Ce({label:t,pct:m,onChange:o,from:i,to:d}){return e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-2 mb-1.5",children:[e.jsx("span",{className:"text-xs font-medium",children:t}),e.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground",children:[z(i)," â ",e.jsx("strong",{className:"text-foreground",children:z(d)})," ",e.jsxs("span",{className:"text-primary font-semibold",children:["(+%",m,")"]})]})]}),e.jsx("input",{type:"range",min:0,max:200,step:5,value:m,onChange:n=>o(+n.target.value),className:"w-full accent-primary"})]})}export{De as ActionPlan};
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.