1import{c8 as t,cF as ce,q as de,ce as ze,cr as He,t as we,cV as ke,c9 as e,cH as Ue,cI as qe,cJ as Ke,cK as Xe,ci as Ge,cL as Qe,cM as F,cQ as Le,cy as $,de as Te,cz as Ve,cP as Se,cb as M,cs as se,cN as Ye,ck as We,cl as Ze,cm as Je,cE as es,cn as ss,cZ as ts,di as as,dj as ns,dk as re,dl as Q,dm as ls,dn as H,co as ie,d8 as rs,d9 as is,da as cs,cG as ds,db as os,cj as ms,cp as us,c7 as Ds,cd as _s,cT as $s,ca as Is,cc as Ms}from"./index-B9fS4Gmf.js";import{S as oe,a as me,b as ue,c as xe,d as C}from"./select-G6e_BQkf.js";import{A as xs,a as hs,b as ps,c as gs,d as js,e as fs,f as Ns,g as vs}from"./alert-dialog-BYMrL4Ug.js";import{S as bs}from"./scroll-area-DV4BiEqc.js";import{u as Ae}from"./useMutation-C_rfsYCG.js";import{d as Cs}from"./date-utils-BhVms15i.js";import{U as ys}from"./users-DTvyKjqV.js";import{S as Ne}from"./send-DvVDNRZH.js";import{T as Rs,a as Bs,b as $e,c as Ie}from"./tabs-DdWmXYjZ.js";import{T as Os}from"./textarea-BzjYJ_Ae.js";import{S as Ss}from"./smartphone-CeK1XvxH.js";import{B as zs}from"./bell-5W13VsJ5.js";import{C as ws}from"./circle-check-big-CmS1prDt.js";import{C as ks}from"./circle-x-CL4-DUTq.js";import{f as Ts}from"./format-CWJRN84p.js";import{k as As}from"./ko-BEh1PYC-.js";import"./chevron-down-BR81Mjc9.js";const Hs=20;function Us(s={}){const{enabled:a=!0,campaignId:o}=s,[m,g]=t.useState(1),[c,N]=t.useState(""),[f,S]=t.useState("all"),[u,w]=t.useState("all"),{data:x,isLoading:v,refetch:j}=ce({queryKey:["alimtalk-logs",m,c,f,u,o??""],queryFn:async()=>{const r=new URLSearchParams;return r.set("page",m.toString()),r.set("limit",String(Hs)),c&&r.set("search",c),f!=="all"&&r.set("sendType",f),u!=="all"&&r.set("success",u),o&&r.set("campaignId",o),de(`/admin/alimtalk/logs?${r}`)},enabled:a}),h=t.useCallback(r=>{N(r),g(1)},[]),b=t.useCallback(r=>{S(r),g(1)},[]),E=t.useCallback(r=>{w(r),g(1)},[]),p=t.useCallback(r=>{g(r)},[]),T=t.useCallback(()=>{j()},[j]);return{data:x,isLoading:v,page:m,search:c,sendTypeFilter:f,successFilter:u,handleSearchChange:h,handleSendTypeFilterChange:b,handleSuccessFilterChange:E,handlePageChange:p,handleRefresh:T}}function ne(s){return s.visitInfo?.companyName||s.visitCompanyName||""}function qs(s){return s.visitInfo?.experienceBenefits||s.visitExperienceBenefits||""}const je=128,Ks=/^01[016789]\d{7,8}$/,Xs={blog:"ë¸ë¡ê·¸",instagram:"ì¸ì¤íê·¸ë¨",youtube:"ì íë¸",naverClip:"ë¤ì´ë² í´ë¦½",threads:"ì¤ë ë",tiktok:"í±í¡"},Gs="ìì모ì§";function Qs(s){if(s.isAlwaysAnnouncement)return Gs;const a=s.announcementDate||s.deadline||s.recruitDeadline||"";if(!a)return"";const o=new Date(a);return Number.isNaN(o.getTime())?a:Cs(a)}function Vs(s){return`ddok.it/campaigns/${s.dealNumber||s.id}`}function Ys(s={}){const{enabled:a=!0,onSuccess:o}=s,{toast:m}=ze(),g=He(),[c,N]=t.useState(""),[f,S]=t.useState(""),[u,w]=t.useState({note1:"",note2:"",note3:""}),[x,v]=t.useState(""),[j,h]=t.useState(""),[b,E]=t.useState(!1),[p,T]=t.useState(""),{data:r}=ce({queryKey:["sendable-campaigns-for-alimtalk"],queryFn:async()=>{const l=await de("/admin/campaigns/sendable");return Array.isArray(l)?l:[]},staleTime:3e4,enabled:a}),{data:k,isFetching:P}=ce({queryKey:["alimtalk-target-count",x,j,c],queryFn:async()=>{const l=new URLSearchParams;x&&l.set("region",x),j&&l.set("channel",j),c&&l.set("campaignId",c);const R=l.toString();return de(`/admin/alimtalk/target-count${R?`?${R}`:""}`)},enabled:a}),A=t.useMemo(()=>r?.find(l=>l.id===c),[r,c]),L=t.useRef(null);t.useEffect(()=>{A&&L.current!==A.id&&(L.current=A.id,w({note1:(ne(A)||A.title||"").slice(0,je),note2:qs(A).slice(0,je),note3:Qs(A).slice(0,je)}))},[A]);const q=Ae({mutationFn:async()=>{const l={};return x.trim()&&(l.region=x.trim()),j&&(l.channel=j),we("/admin/alimtalk/send",{campaignId:c,targetFilter:l,notes:K(),resendToAlreadySent:b})},onSuccess:l=>{m({title:"ë°ì¡ ìì² ìë£",description:l?.message||"ìë¦¼í¡ ë°ì¡ì ììíìµëë¤."}),g.invalidateQueries({queryKey:["alimtalk-logs"]}),g.invalidateQueries({queryKey:["alimtalk-target-count"]}),o?.()},onError:l=>{m({title:"ë°ì¡ ì¤í¨",description:l.message,variant:"destructive"})}}),U=Ae({mutationFn:async l=>we("/admin/alimtalk/test-send",{campaignId:c,notes:K(),phone:l}),onSuccess:l=>{if(l&&l.success===!1){m({title:"í
ì¤í¸ ë°ì¡ ì¤í¨",description:l.message,variant:"destructive"});return}
1m({title:"í
ì¤í¸ ë°ì¡ ìë£",description:l?.message||"ì
ë ¥íì ë²í¸ë¡ ë°ì¡íìµëë¤."}),g.invalidateQueries({queryKey:["alimtalk-logs"]})},onError:l=>{m({title:"í
ì¤í¸ ë°ì¡ ì¤í¨",description:l.message,variant:"destructive"})}});function K(){const l={note1:u.note1.trim(),note2:u.note2.trim(),note3:u.note3.trim()};return A&&(l.note4=Vs(A)),l}const D=t.useCallback(l=>{N(l)},[]),O=t.useCallback((l,R)=>{w(Y=>({...Y,[l]:R.slice(0,je)}))},[]),I=t.useCallback(()=>{N(""),S(""),w({note1:"",note2:"",note3:""}),v(""),h(""),E(!1),T(""),L.current=null},[]),z=t.useMemo(()=>{if(!r)return[];const l=f.trim().toLowerCase();return l?r.filter(R=>{const Y=R.title?.toLowerCase()||"",he=ne(R).toLowerCase(),Z=R.dealNumber?.toLowerCase()||"";return Y.includes(l)||he.includes(l)||Z.includes(l)}):r},[r,f]),y=t.useCallback(()=>c?!u.note1.trim()||!u.note2.trim()||!u.note3.trim()?(m({title:"ë³ì ì
ë ¥ íì",description:"ìíëª
·체ííí·ë§ê°ì¼ì 모ë ì
ë ¥í´ì£¼ì¸ì.",variant:"destructive"}),!1):!0:(m({title:"ìº íì¸ ì í íì",description:"ë°ì¡í ìº íì¸ì ì íí´ì£¼ì¸ì.",variant:"destructive"}),!1),[c,u,m]),X=t.useCallback(()=>{y()&&q.mutate()},[y,q]),B=t.useCallback(()=>{if(!y())return;const l=p.replace(/[^0-9]/g,"");if(!Ks.test(l)){m({title:"ì íë²í¸ë¥¼ íì¸í´ì£¼ì¸ì.",description:"í´ëí° ë²í¸ë¥¼ íì´í ìì´ ì
ë ¥í´ì£¼ì¸ì. (ì: 01012345678)",variant:"destructive"});return}U.mutate(l)},[y,p,U,m]),d=t.useCallback(()=>{const l=[];return x.trim()&&l.push(`ì§ì: ${x.trim()}`),j&&l.push(`ì±ë: ${Xs[j]||j}`),l.length>0?l.join(" + "):"ì ì²´ ë§ì¼í
ëìì"},[x,j]);return{campaigns:r,filteredCampaigns:z,campaignSearch:f,setCampaignSearch:S,selectedCampaignId:c,selectedCampaign:A,selectCampaign:D,notes:u,setNote:O,targetRegion:x,setTargetRegion:v,targetChannel:j,setTargetChannel:h,resendToAlreadySent:b,setResendToAlreadySent:E,targetCount:k?.count??0,alreadySentCount:k?.alreadySentCount??0,effectiveTargetCount:b?k?.dedupedCount??k?.count??0:k?.effectiveCount??k?.count??0,excludedTargetCount:Math.max(0,(k?.dedupedCount??k?.count??0)-(k?.effectiveCount??k?.count??0)),isTargetCountLoading:P,testPhone:p,setTestPhone:T,handleTestSend:B,isTestSending:U.isPending,handleSend:X,isSending:q.isPending,resetState:I,getTargetLabel:d,NOTE_MAX_LENGTH:je}}const Ws=ke.memo(function({open:a,onOpenChange:o}){const[m,g]=t.useState(!1),c=ke.useRef(null),{filteredCampaigns:N,campaignSearch:f,setCampaignSearch:S,selectedCampaignId:u,selectedCampaign:w,selectCampaign:x,notes:v,setNote:j,targetRegion:h,setTargetRegion:b,targetChannel:E,setTargetChannel:p,resendToAlreadySent:T,setResendToAlreadySent:r,effectiveTargetCount:k,excludedTargetCount:P,alreadySentCount:A,testPhone:L,setTestPhone:q,handleTestSend:U,isTestSending:K,handleSend:D,isSending:O,resetState:I,getTargetLabel:z,NOTE_MAX_LENGTH:y}=Ys({enabled:a,onSuccess:()=>{g(!1),o(!1),c.current?.()}});c.current=I;const X=()=>{o(!1),I()};if(!a)return null;const B=w?ne(w)?`${ne(w)} (${w.title})`:w.title:"";return e.jsx(Ue,{open:a,onOpenChange:d=>{d||X()},children:e.jsxs(qe,{className:"max-w-3xl max-h-[92vh] flex flex-col overflow-hidden","data-testid":"dialog-alimtalk-send",children:[e.jsxs(Ke,{className:"pb-1",children:[e.jsxs(Xe,{className:"flex items-center gap-2",children:[e.jsx(Ge,{className:"h-5 w-5 text-yellow-500"}),"ìë¦¼í¡ ë°ì¡ (ì ê· ìº íì¸ ì림)"]}),e.jsx(Qe,{children:"모ì§ì¤ì´ê±°ë ìì ëª¨ì§ ì¤ì¸ ìº íì¸ì ì ííê³ ë³ì를 íì¸í ë¤, ë§ì¼í
ìì ëìììê² ì림í¡ì ë°ì¡í©ëë¤. ì± í¸ìë í¨ê» ëê°ì§ ììµëë¤ â íìíë©´ 'ì± í¸ì¬ ë°ì¡'ìì ë°ë¡ ë³´ë´ì¸ì."})]}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto pr-1 space-y-4",children:[e.jsxs("section",{className:"space-y-2",children:[e.jsx(F,{className:"text-xs font-semibold",children:"â ìº íì¸ ì í (모ì§ì¤ · ìì)"}),e.jsxs("div",{className:"relative",children:[e.jsx(Le,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),e.jsx($,{placeholder:"ìº íì¸ëª
·ì
ì²´ëª
·ëë²í¸ ê²ì",value:f,onChange:d=>S(d.target.value),className:"pl-8 h-9 text-sm","data-testid":"input-campaign-search"})]}),e.jsx(bs,{className:"h-44 border rounded-lg p-1.5","data-testid":"list-campaigns",children:N.length===0?e.jsx("div",{className:"text-center py-10 text-muted-foreground text-sm",children:f?"ì¡°ê±´ì ë§ë ìº íì¸ì´ ììµëë¤.":"ë°ì¡í ì ìë ìº íì¸ì´ ììµëë¤."}):e.jsx("div",{className:"space-y-1",children:N.map(d=>e.jsxs("label",{className:`flex items-center gap-2.5 px-2.5 py-2 border rounded-md cursor-pointer hover:bg-muted/50 transition-colors ${u===d.id?"border-primary bg-primary/5":""}`,"data-testid":`campaign-option-${d.id}`,children:[e.jsx("input",{type:"radio",name:"alimtalk-campaign",className:"h-4 w-4 accent-primary flex-shrink-0",checked:u===d.id,onChange:()=>x(d.id)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:"font-medium text-sm truncate",children:ne(d)?`${ne(d)} (${d.title})`:d.title}
1),d.mainChannel&&e.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium shrink-0 ${Te(d.mainChannel).colorClass}`,"data-testid":`campaign-channel-badge-${d.id}`,children:Te(d.mainChannel).label})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground mt-0.5",children:[d.isAlwaysAnnouncement&&e.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-200 text-[10px] font-medium shrink-0","data-testid":`campaign-always-badge-${d.id}`,children:"ìì"}),d.dealNumber&&e.jsxs("span",{className:"text-primary font-mono",children:["#",d.dealNumber]}),d.region&&e.jsx("span",{children:d.region})]})]})]},d.id))})})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx(F,{className:"text-xs font-semibold",children:"â¡ ìë¦¼í¡ ë³ì (ìë ì±ì · ìì ê°ë¥)"}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-3",children:[e.jsxs("div",{children:[e.jsx(F,{htmlFor:"alimtalk-note1",className:"text-[11px] text-muted-foreground",children:"ìíëª
"}),e.jsx($,{id:"alimtalk-note1",value:v.note1,maxLength:y,onChange:d=>j("note1",d.target.value),placeholder:"ì: ëëì¹´í ê°ë¨ì ",className:"h-9 text-sm","data-testid":"input-note1"})]}),e.jsxs("div",{children:[e.jsx(F,{htmlFor:"alimtalk-note2",className:"text-[11px] text-muted-foreground",children:"ì²´ííí"}),e.jsx($,{id:"alimtalk-note2",value:v.note2,maxLength:y,onChange:d=>j("note2",d.target.value),placeholder:"ì: 2ì¸ ì½ì¤ì리 ë¬´ë£ ì ê³µ",className:"h-9 text-sm","data-testid":"input-note2"})]}),e.jsxs("div",{children:[e.jsx(F,{htmlFor:"alimtalk-note3",className:"text-[11px] text-muted-foreground",children:"ë§ê°ì¼"}),e.jsx($,{id:"alimtalk-note3",value:v.note3,maxLength:y,onChange:d=>j("note3",d.target.value),placeholder:"ì: 2026. 08. 01.",className:"h-9 text-sm","data-testid":"input-note3"})]})]})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx(F,{className:"text-xs font-semibold",children:"⢠ë°ì¡ ëì (ë§ì¼í
ìì ëì · í´ëí° ë±ë¡ 리뷰ì´)"}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-3",children:[e.jsx($,{placeholder:"ì§ì (ì: ìì¸)",value:h,onChange:d=>b(d.target.value),className:"h-9 text-sm","data-testid":"input-target-region"}),e.jsxs(oe,{value:E||"_all",onValueChange:d=>p(d==="_all"?"":d),children:[e.jsx(me,{className:"h-9 text-sm","data-testid":"select-target-channel",children:e.jsx(ue,{placeholder:"ëì ì±ë"})}),e.jsxs(xe,{children:[e.jsx(C,{value:"_all",children:"ì ì²´ ì±ë"}),e.jsx(C,{value:"blog",children:"ë¸ë¡ê·¸"}),e.jsx(C,{value:"instagram",children:"ì¸ì¤íê·¸ë¨"}),e.jsx(C,{value:"youtube",children:"ì íë¸"}),e.jsx(C,{value:"naverClip",children:"ë¤ì´ë² í´ë¦½"}),e.jsx(C,{value:"threads",children:"ì¤ë ë"}),e.jsx(C,{value:"tiktok",children:"í±í¡"})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 h-9 bg-muted rounded-md text-sm","data-testid":"badge-target-count",children:[e.jsx(ys,{className:"h-3.5 w-3.5 text-muted-foreground flex-shrink-0"}),e.jsxs("span",{className:"truncate",children:["ëì ",e.jsxs("strong",{className:"text-primary",children:[k,"ëª
"]}),u&&P>0&&!T&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:[" (ì´ë¯¸ ë°ì¡ ",P,"ëª
ì ì¸)"]})]})]})]}),u&&A>0&&e.jsxs("p",{className:"text-[11px] text-muted-foreground","data-testid":"text-campaign-send-history",children:["íí°ì 무ê´íê² ì´ ìº íì¸ ëì ë°ì¡ ",e.jsxs("strong",{children:[A.toLocaleString(),"ëª
"]})]}),e.jsxs("label",{className:"flex items-start gap-2 text-sm cursor-pointer","data-testid":"label-resend",children:[e.jsx(Ve,{checked:T,onCheckedChange:d=>r(d===!0),className:"mt-0.5","data-testid":"checkbox-resend"}),e.jsxs("span",{children:["ì´ë¯¸ ë°ì¡ë ëì í¬í¨ ì¬ë°ì¡",T&&e.jsxs("span",{className:"text-xs text-destructive mt-0.5 flex items-center gap-1","data-testid":"text-resend-warning",children:[e.jsx(Se,{className:"h-3 w-3"}),"ê°ì ìº íì¸ ì림ì ì´ë¯¸ ë°ì 리뷰ì´ìê² ì¤ë³µ ë°ì¡ë©ëë¤. ì¤í¸ ì ê³ ìíì´ ìì¼ë ê¼ íìí ê²½ì°ìë§ ì¬ì©íì¸ì."]})]})]})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx(F,{className:"text-xs font-semibold",children:"⣠미리보기"}
1),e.jsxs("div",{className:"rounded-lg p-3 bg-[#B2C7D9] dark:bg-slate-800","data-testid":"preview-alimtalk",children:[e.jsxs("div",{className:"max-w-sm rounded-lg overflow-hidden shadow-sm",children:[e.jsx("div",{className:"bg-[#FEE500] text-[#3C1E1E] text-xs font-bold px-3 py-2",children:"ìë¦¼í¡ ëì°©"}),e.jsxs("div",{className:"bg-white dark:bg-zinc-900 text-zinc-900 dark:text-zinc-100 px-3 py-3 text-[13px] leading-relaxed whitespace-pre-line",children:[`[ëë리ìë] ì ê· ìº íì¸ ì림 2 3`,e.jsx("span",{className:"font-medium",children:"íì"}),`ëì ê´ì¬ì¬ì ë§ë ìë¡ì´ ìº íì¸ì´ ì¤íëì´ ìë ¤ë립ëë¤. 4 5â ìº íì¸ ì ë³´ 6- ìíëª : `,e.jsx("span",{className:"font-semibold text-primary","data-testid":"preview-note1",children:v.note1||"(ìíëª )"}),` 7- ì²´ííí: `,e.jsx("span",{className:"font-semibold text-primary","data-testid":"preview-note2",children:v.note2||"(ì²´ííí)"}),` 8- ë§ê°ì¼: `,e.jsx("span",{className:"font-semibold text-primary","data-testid":"preview-note3",children:v.note3||"(ë§ê°ì¼)"}),` 9 10ìíí ì ì ì ìí´ ë§ê° ì ì ì²ì ê¶ì¥ë립ëë¤. 11 12[ìì ìë´] 13í´ë¹ ë©ìì§ë ê³ ê°ëê»ì ìì²íì ê´ì¬ ìº íì¸ ìë¦¼ì´ ìì ê²½ì° ë°ì¡ë©ëë¤. 14(ì림 í´ì : ëìë³´ë > ëì ì±ëê´ë¦¬ > ì림 ì¤ì )`,e.jsx("div",{className:"mt-3 border border-zinc-200 dark:border-zinc-700 rounded-md text-center py-2 text-[13px] font-medium text-zinc-700 dark:text-zinc-200",children:"ìº íì¸ íì¸í기"})]})]}),e.jsx("p",{className:"text-[11px] text-zinc-700 dark:text-zinc-300 mt-2",children:"* ì¤ì ë°ì¡ ì ì´ë¦ì ìì ìë³ë¡ ê°ì¸íëë©°, ë²í¼ì ì íí ìº íì¸ ìì¸ íì´ì§ë¡ ì°ê²°ë©ëë¤."})]})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx(F,{className:"text-xs font-semibold",children:"⤠í ì¤í¸ ë°ì¡ (1ê±´)"}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsx($,{placeholder:"í ì¤í¸ ìì ë²í¸ (íì´í ìì´)",value:L,onChange:d=>q(d.target.value),className:"h-9 text-sm sm:max-w-xs","data-testid":"input-test-phone"}),e.jsxs(M,{variant:"outline",onClick:U,disabled:K||!u,"data-testid":"button-test-send",children:[K?e.jsx(se,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(Ne,{className:"h-4 w-4 mr-2"}),"í ì¤í¸ ë°ì¡"]})]})]})]}),e.jsxs(Ye,{className:"pt-2 flex-shrink-0",children:[e.jsx(M,{variant:"outline",onClick:X,"data-testid":"button-cancel-send",children:"ì·¨ì"}),e.jsx(M,{onClick:()=>g(!0),disabled:O||!u||k===0,"data-testid":"button-open-confirm",children:O?e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"h-4 w-4 mr-2 animate-spin"}),"ë°ì¡ ì¤..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ne,{className:"h-4 w-4 mr-2"}),k,"ëª ìê² ë°ì¡"]})})]}),e.jsx(xs,{open:m,onOpenChange:g,children:e.jsxs(hs,{"data-testid":"dialog-confirm-send",children:[e.jsxs(ps,{children:[e.jsx(gs,{children:"ì림í¡ì ë°ì¡í ê¹ì?"}),e.jsx(js,{asChild:!0,children:e.jsxs("div",{className:"space-y-1.5 text-sm",children:[e.jsxs("div",{children:[e.jsx("strong",{children:"ìº íì¸:"})," ",B||"-"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"ëì:"})," ",z()," · ",e.jsxs("span",{className:"text-primary font-semibold",children:[k,"ëª "]})]}),u&&(T||P>0)&&e.jsx("div",{className:"text-xs text-muted-foreground",children:T?"ì´ë¯¸ ë°ì¡ë ëìë í¬í¨í´ ì¬ë°ì¡í©ëë¤.":`ì´ë¯¸ ë°ì¡ë ${P}ëª ì ì ì¸ë©ëë¤.`}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"ê´ê³ ì± ë©ìì§ë ì¼ê°(21ì~08ì)ìë ë°ì¡í ì ììµëë¤."})]})})]}),e.jsxs(fs,{children:[e.jsx(Ns,{"data-testid":"button-cancel-confirm",children:"ì·¨ì"}),e.jsx(vs,{onClick:d=>{d.preventDefault(),D()},disabled:O,"data-testid":"button-confirm-send",children:O?e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"h-4 w-4 mr-2 animate-spin"}),"ë°ì¡ ì¤..."]}):"ë°ì¡í기"})]})]})})]})})});function le(s){return s.visitInfo?.companyName||s.visitCompanyName||""}function Zs(s){return s.visitInfo?.experienceBenefits||s.visitExperienceBenefits||""}const fe=128,Ps="[ëë리ìë]",Fe=" · ìì ê±°ë¶: ì± >
14 ëì ì±ëê´ë¦¬ > ì림 ì¤ì ",Js=120,Pe=Js-Fe.length,Me=30,Re="",et=/^\/(?![/\\])[^\s\\]*$/;function Ls(s){return et.test(s)}const Fs="ì± ë´ë¶ ê²½ë¡ë§ ë£ì ì ììµëë¤. ì¬ëìë¡ ììíê³ ê³µë°±Â·ìì¬ëìê° ìì´ì¼ í©ëë¤. (ì: /campaigns/D-2608-0212)",Be=/^(?:https?:\/\/)?(?:www\.)?ddok\.it(?=[/?#]|$)/i;function st(s){const a=String(s||"").trim();if(!a||!Be.test(a))return a;const o=a.replace(Be,"");return o.startsWith("/")?o:`/${o}`}const tt={blog:"ë¸ë¡ê·¸",instagram:"ì¸ì¤íê·¸ë¨",youtube:"ì íë¸",naverClip:"ë¤ì´ë² í´ë¦½",threads:"ì¤ë ë",tiktok:"í±í¡"};function ae(s,a){if(s.length<=a)return s;const o=s.slice(0,a);return/[\uD800-\uDBFF]$/.test(o)?o.slice(0,-1):o}const at="ìì모ì§";function nt(s){if(s.isAlwaysAnnouncement)return at;const a=s.announcementDate||s.deadline||s.recruitDeadline||"";if(!a)return"";const o=new Date(a);return Number.isNaN(o.getTime())?a:Cs(a)}function lt(s){return`/campaigns/${s.dealNumber||s.id}`}function Es(s){if(s.length<=Pe)return s;let a=s.slice(0,Pe-1);return/[\uD800-\uDBFF]$/.test(a)&&(a=a.slice(0,-1)),`${a}â¦`}function rt(s,a={}){const o=[a.note1,a.note2].map(c=>String(c||"").trim()).filter(Boolean),m=String(a.note3||"").trim();let g;return o.length>0?(g=o.join(" · "),m&&(g+=s.isAlwaysAnnouncement?` â ${m}`:` â ë§ê° ${m}`),g+=". ì§ê¸ ì ì²í´ ë³´ì¸ì."):g=`${s.title} ì²´íë¨ì´ ìë¡ ì´ë ¸ì´ì. ì§ê¸ ì ì²í´ ë³´ì¸ì.`,{title:`${Ps} ì ì²´íë¨ì´ ì¬ë¼ìì´ì`,body:`${Es(g)}${Fe}`,url:lt(s)}}function it(s){const a=String(s.url||"").trim(),o={title:`${Ps} ${s.title.trim()}`,body:`${Es(s.body.trim())}${Fe}`};return a&&(o.url=a),o}function ct(s){if(s.mode==="custom"){if(!s.customTitle.trim()||!s.customBody.trim())return{title:"ë´ì© ì
ë ¥ íì",description:"ì 목과 본문ì 모ë ì
ë ¥í´ì£¼ì¸ì.",blockLabel:"â ì 목과 ⡠본문ì ì
ë ¥í´ì¼ ë°ì¡í ì ììµëë¤."};const a=s.customUrl.trim();return a&&!Ls(a)?{title:"ë§í¬ë¥¼ íì¸í´ì£¼ì¸ì.",description:Fs,blockLabel:"⢠ë¥ë§í¬ ê²½ë¡ê° ì± ë´ë¶ ê²½ë¡ê° ìëë¼ ë°ì¡í ì ììµëë¤."}:null}return s.selectedCampaignId?!s.notes.note1.trim()||!s.notes.note2.trim()||!s.notes.note3.trim()?{title:"ë³ì ì
ë ¥ íì",description:"ìíëª
·체ííí·ë§ê°ì¼ì 모ë ì
ë ¥í´ì£¼ì¸ì.",blockLabel:"⡠문구 ë³ì(ìíëª
·체ííí·ë§ê°ì¼)를 모ë ì±ìì¼ í©ëë¤."}:null:{title:"ìº íì¸ ì í íì",description:"ë°ì¡í ìº íì¸ì ì íí´ì£¼ì¸ì.",blockLabel:"â ë°ì¡í ìº íì¸ì ì íí´ì¼ í©ëë¤."}}function dt(s={}){const{enabled:a=!0,onSuccess:o}=s,{toast:m}=ze(),g=He(),[c,N]=t.useState("campaign"),[f,S]=t.useState(""),[u,w]=t.useState(""),[x,v]=t.useState({note1:"",note2:"",note3:""}),[j,h]=t.useState(!1),[b,E]=t.useState(""),[p,T]=t.useState(""),[r,k]=t.useState(""),[P,A]=t.useState(""),[L,q]=t.useState(""),[U,K]=t.useState(Re),{data:D}=ce({queryKey:["sendable-campaigns-for-push"],queryFn:async()=>{const n=await de("/admin/campaigns/sendable");return Array.isArray(n)?n:[]},staleTime:3e4,enabled:a}),O=c==="campaign"?f:"",{data:I,isFetching:z}=ce({queryKey:["push-target-count",P,L,O],queryFn:async()=>{const n=new URLSearchParams;P&&n.set("region",P),L&&n.set("channel",L),O&&n.set("campaignId",O);const _=n.toString();return de(`/admin/push/target-count${_?`?${_}`:""}`)},enabled:a}),y=t.useMemo(()=>D?.find(n=>n.id===f),[D,f]),X=t.useRef(null);t.useEffect(()=>{y&&X.current!==y.id&&(X.current=y.id,v({note1:ae(le(y)||y.title||"",fe),note2:ae(Zs(y),fe),note3:ae(nt(y),fe)}))},[y]);const B=t.useCallback(()=>{if(c==="custom"){const n=r.trim(),_={mode:"custom",title:b.trim(),body:p.trim()};return n?{..._,url:n}:_}return{mode:"campaign",campaignId:f,notes:{note1:x.note1.trim(),note2:x.note2.trim(),note3:x.note3.trim()}}},[c,b,p,r,f,x]),d=t.useCallback(()=>{const n={};return P.trim()&&(n.region=P.trim()),L&&(n.channel=L),n},[P,L]),l=Ae({mutationFn:async()=>{const n=B(),_=d(),ee=n.mode==="campaign"?{...n,targetFilter:_,resendToAlreadySent:j}:{...n,targetFilter:_};return we("/admin/push/send",ee)},onSuccess:n=>{m({title:"ë°ì¡ ìì² ìë£",description:n?.message||"ì± í¸ì ë°ì¡ì ììíìµëë¤."}),g.invalidateQueries({queryKey:["push-logs"]}),g.invalidateQueries({queryKey:["push-target-count"]}),o?.()},onError:n=>{m({title:"ë°ì¡ ì¤í¨",description:n.message,variant:"destructive"})}}),R=Ae({mutationFn:async n=>we("/admin/push/test-send",{...B(),targetEmail:n}),onSuccess:n=>{if(n&&n.success===!1){m({title:"í
ì¤í¸ ë°ì¡ ì¤í¨",description:n.message,variant:"destructive"});return}m({title:"í
ì¤í¸ ë°ì¡ ìë£",description:n?.message||"í´ë¹ ê³ì ì ê¸°ê¸°ë¡ ë°ì¡íìµëë¤."}),g.invalidateQueries({queryKey:["push-logs"]})},onError:n=>{m({title:"í
ì¤í¸ ë°ì¡ ì¤í¨",description:n.message,variant:"destructive"})}}),Y=t.useCallback(n=>{S(n)},[]),he=t.useCallback((n,_)=>{v(ee=>({...ee,[n]:ae(_,fe)}))},[]),Z=t.useCallback(n=>{E(ae(n,Me))},[]),Ee=t.useCallback(n=>{T(ae(n,Pe))},[]),ve=t.useCallback(()=>{N("campaign"),S(""),w(""),v({note1:"",note2:"",note3:""}),h(!1),E(""),T(""),k(""),A(""),q(""),K(Re),X.current=null},[]),De=t.useMemo(()=>
14{if(!D)return[];const n=u.trim().toLowerCase();return n?D.filter(_=>{const ee=_.title?.toLowerCase()||"",ge=le(_).toLowerCase(),i=_.dealNumber?.toLowerCase()||"";return ee.includes(n)||ge.includes(n)||i.includes(n)}):D},[D,u]),be=t.useMemo(()=>c==="custom"?!b.trim()&&!p.trim()?null:it({title:b,body:p,url:r}):y?rt(y,x):null,[c,b,p,r,y,x]),G=t.useMemo(()=>ct({mode:c,selectedCampaignId:f,notes:x,customTitle:b,customBody:p,customUrl:r}),[c,f,x,b,p,r]),W=t.useCallback(()=>G?(m({title:G.title,description:G.description,variant:"destructive"}),!1):!0,[G,m]),Ce=t.useCallback(()=>{W()&&l.mutate()},[W,l]),ye=t.useCallback(()=>{if(!W())return;const n=U.trim();if(!n||!n.includes("@")){m({title:"ì´ë©ì¼ì íì¸í´ì£¼ì¸ì.",description:"í
ì¤í¸ í¸ì를 ë°ì ê³ì ì´ë©ì¼ì ì
ë ¥í´ì£¼ì¸ì.",variant:"destructive"});return}R.mutate(n)},[W,U,R,m]),_e=t.useCallback(()=>{const n=[];return P.trim()&&n.push(`ì§ì: ${P.trim()}`),L&&n.push(`ì±ë: ${tt[L]||L}`),n.length>0?n.join(" + "):"ì ì²´ ë§ì¼í
ëìì"},[P,L]),J=I?.dedupedCount??I?.count??0,V=I?.effectiveCount??I?.count??0,te=c==="custom"||j?J:V,pe=t.useMemo(()=>l.isPending?"ë°ì¡ ìì²ì ì²ë¦¬íë ì¤ì
ëë¤.":G?G.blockLabel:z?"ë°ì¡ ëì ì를 íì¸íë ì¤ì
ëë¤.":te===0?c==="campaign"&&!j&&J>0?"ì´ ì¡°ê±´ì ëìì´ ëª¨ë ì´ ìº íì¸ í¸ì를 ì´ë¯¸ ë°ììµëë¤. ë¤ì ë³´ë´ë ¤ë©´ ì¬ë°ì¡ì ì²´í¬íì¸ì.":"ì¡°ê±´ì í´ë¹íë ë°ì¡ ëìì´ ììµëë¤.":null,[l.isPending,G,z,te,c,j,J]);return{sendBlockReason:pe,isSendDisabled:pe!==null,mode:c,setMode:N,campaigns:D,filteredCampaigns:De,campaignSearch:u,setCampaignSearch:w,selectedCampaignId:f,selectedCampaign:y,selectCampaign:Y,notes:x,setNote:he,customTitle:b,setCustomTitle:Z,customBody:p,setCustomBody:Ee,customUrl:r,setCustomUrl:k,normalizeCustomUrl:t.useCallback(()=>{k(n=>st(n))},[]),targetRegion:P,setTargetRegion:A,targetChannel:L,setTargetChannel:q,resendToAlreadySent:j,setResendToAlreadySent:h,targetCount:I?.count??0,alreadySentCount:I?.alreadySentCount??0,effectiveTargetCount:te,excludedTargetCount:c==="custom"?0:Math.max(0,J-V),isTargetCountLoading:z,preview:be,testEmail:U,setTestEmail:K,handleTestSend:ye,isTestSending:R.isPending,handleSend:Ce,isSending:l.isPending,isContentReady:G===null,resetState:ve,getTargetLabel:_e,NOTE_MAX_LENGTH:fe,PUSH_TITLE_MAX_INPUT:Me,PUSH_BODY_MAX_INPUT:Pe,PUSH_OPT_OUT_NOTICE:Fe}}const ot=ke.memo(function({open:a,onOpenChange:o}){const[m,g]=t.useState(!1),c=ke.useRef(null),{mode:N,setMode:f,filteredCampaigns:S,campaignSearch:u,setCampaignSearch:w,selectedCampaignId:x,selectedCampaign:v,selectCampaign:j,notes:h,setNote:b,customTitle:E,setCustomTitle:p,customBody:T,setCustomBody:r,customUrl:k,setCustomUrl:P,normalizeCustomUrl:A,targetRegion:L,setTargetRegion:q,targetChannel:U,setTargetChannel:K,resendToAlreadySent:D,setResendToAlreadySent:O,effectiveTargetCount:I,excludedTargetCount:z,alreadySentCount:y,isTargetCountLoading:X,preview:B,testEmail:d,setTestEmail:l,handleTestSend:R,isTestSending:Y,handleSend:he,isSending:Z,isContentReady:Ee,sendBlockReason:ve,isSendDisabled:De,resetState:be,getTargetLabel:G,NOTE_MAX_LENGTH:W,PUSH_TITLE_MAX_INPUT:Ce,PUSH_BODY_MAX_INPUT:ye,PUSH_OPT_OUT_NOTICE:_e}=dt({enabled:a,onSuccess:()=>{g(!1),o(!1),c.current?.()}});c.current=be;const J=()=>{o(!1),be()};if(!a)return null;const V=N==="custom",te=k.trim(),pe=te&&!Ls(te)?Fs:"",n=Y||!Ee,_=V?E.trim():v?le(v)?`${le(v)} (${v.title})`:v.title:"",ee=_e.trim(),ge=N==="custom"?{target:"â£",preview:"â¤",test:"â¥"}:{target:"â¢",preview:"â£",test:"â¤"};return e.jsx(Ue,{open:a,onOpenChange:i=>{i||J()},children:e.jsxs(qe,{className:"max-w-3xl max-h-[92vh] flex flex-col overflow-hidden","data-testid":"dialog-push-send",children:[e.jsxs(Ke,{className:"pb-1",children:[e.jsxs(Xe,{className:"flex items-center gap-2",children:[e.jsx(Ss,{className:"h-5 w-5 text-blue-500"}),"ì± í¸ì¬ ë°ì¡"]}
14),e.jsx(Qe,{children:"ì±ì ì¤ì¹íê³ ë§ì¼í
ìì ì ëìí íìì ê¸°ê¸°ë¡ ì림ì ë³´ë
ëë¤. ìº íì¸ ì림과 ì§ì ì
ë ¥ ì¤ íë를 ê³ ë¥´ì¸ì."})]}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto pr-1 space-y-4",children:[e.jsxs(Rs,{value:N,onValueChange:i=>f(i==="custom"?"custom":"campaign"),children:[e.jsxs(Bs,{className:"grid w-full grid-cols-2","data-testid":"tabs-push-mode",children:[e.jsx($e,{value:"campaign","data-testid":"tab-push-campaign",children:"ìº íì¸ ì림"}),e.jsx($e,{value:"custom","data-testid":"tab-push-custom",children:"ì§ì ì
ë ¥"})]}),e.jsxs(Ie,{value:"campaign",className:"space-y-4 mt-3",children:[e.jsxs("section",{className:"space-y-2",children:[e.jsx(F,{className:"text-xs font-semibold",children:"â ìº íì¸ ì í (모ì§ì¤ · ìì)"}),e.jsxs("div",{className:"relative",children:[e.jsx(Le,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground"}),e.jsx($,{placeholder:"ìº íì¸ëª
·ì
ì²´ëª
·ëë²í¸ ê²ì",value:u,onChange:i=>w(i.target.value),className:"pl-8 h-9 text-sm","data-testid":"input-push-campaign-search"})]}),e.jsx(bs,{className:"h-44 border rounded-lg p-1.5","data-testid":"list-push-campaigns",children:S.length===0?e.jsx("div",{className:"text-center py-10 text-muted-foreground text-sm",children:u?"ì¡°ê±´ì ë§ë ìº íì¸ì´ ììµëë¤.":"ë°ì¡í ì ìë ìº íì¸ì´ ììµëë¤."}):e.jsx("div",{className:"space-y-1",children:S.map(i=>e.jsxs("label",{className:`flex items-center gap-2.5 px-2.5 py-2 border rounded-md cursor-pointer hover:bg-muted/50 transition-colors ${x===i.id?"border-primary bg-primary/5":""}`,"data-testid":`push-campaign-option-${i.id}`,children:[e.jsx("input",{type:"radio",name:"push-campaign",className:"h-4 w-4 accent-primary flex-shrink-0",checked:x===i.id,onChange:()=>j(i.id)}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[e.jsx("span",{className:"font-medium text-sm truncate",children:le(i)?`${le(i)} (${i.title})`:i.title}),i.mainChannel&&e.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-medium shrink-0 ${Te(i.mainChannel).colorClass}`,"data-testid":`campaign-channel-badge-${i.id}`,children:Te(i.mainChannel).label})]}),e.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-muted-foreground mt-0.5",children:[i.isAlwaysAnnouncement&&e.jsx("span",{className:"px-1.5 py-0.5 rounded bg-amber-100 text-amber-800 dark:bg-amber-900/40 dark:text-amber-200 text-[10px] font-medium shrink-0","data-testid":`campaign-always-badge-${i.id}`,children:"ìì"}),i.dealNumber&&e.jsxs("span",{className:"text-primary font-mono",children:["#",i.dealNumber]}),i.region&&e.jsx("span",{children:i.region})]})]})]},i.id))})})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx(F,{className:"text-xs font-semibold",children:"⡠문구 ë³ì (ìë ì±ì · ìì ê°ë¥)"}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-3",children:[e.jsxs("div",{children:[e.jsx(F,{htmlFor:"push-note1",className:"text-[11px] text-muted-foreground",children:"ìíëª
"}),e.jsx($,{id:"push-note1",value:h.note1,maxLength:W,onChange:i=>b("note1",i.target.value),placeholder:"ì: ëëì¹´í ê°ë¨ì ",className:"h-9 text-sm","data-testid":"input-push-note1"})]}),e.jsxs("div",{children:[e.jsx(F,{htmlFor:"push-note2",className:"text-[11px] text-muted-foreground",children:"ì²´ííí"}),e.jsx($,{id:"push-note2",value:h.note2,maxLength:W,onChange:i=>b("note2",i.target.value),placeholder:"ì: 2ì¸ ì½ì¤ì리 ë¬´ë£ ì ê³µ",className:"h-9 text-sm","data-testid":"input-push-note2"})]}),e.jsxs("div",{children:[e.jsx(F,{htmlFor:"push-note3",className:"text-[11px] text-muted-foreground",children:"ë§ê°ì¼"}),e.jsx($,{id:"push-note3",value:h.note3,maxLength:W,onChange:i=>b("note3",i.target.value),placeholder:"ì: 2026. 08. 01.",className:"h-9 text-sm","data-testid":"input-push-note3"})]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"ì림ì ííë©´ ì íí ìº íì¸ ìì¸ë¡ ì´ëí©ëë¤. ì¸ ë³ìë 모ë ì±ìì¼ ë°ì¡í ì ììµëë¤."})]})]}
14),e.jsxs(Ie,{value:"custom",className:"space-y-4 mt-3",children:[e.jsxs("div",{className:"flex items-start gap-2 text-xs text-destructive border border-destructive/40 rounded-md px-3 py-2","data-testid":"text-push-custom-warning",children:[e.jsx(Se,{className:"h-3.5 w-3.5 mt-0.5 flex-shrink-0"}),e.jsx("span",{children:"ì§ì ì
ë ¥ í¸ì¬ë ì¤ë³µ ë°ì¡ ë°©ì§ ê¸°ë¥ì´ ììµëë¤. ì¤ë¨ í ë¤ì ë³´ë´ë©´ ì´ë¯¸ ë°ì ì¬ëë ë¤ì ë°ìµëë¤."})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(F,{htmlFor:"push-custom-title",className:"text-xs font-semibold",children:"â ì 목"}),e.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[E.length,"/",Ce]})]}),e.jsx($,{id:"push-custom-title",value:E,maxLength:Ce,onChange:i=>p(i.target.value),placeholder:"ì: ì¤ë ë§ê°! ëì¹ë©´ ííí ì²´íë¨",className:"h-9 text-sm","data-testid":"input-push-title"}),e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["ìì ",e.jsx("span",{className:"font-mono",children:"[ëë리ìë]"})," ê° ìëì¼ë¡ ë¶ìµëë¤."]})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(F,{htmlFor:"push-custom-body",className:"text-xs font-semibold",children:"⡠본문"}),e.jsxs("span",{className:"text-[11px] text-muted-foreground",children:[T.length,"/",ye]})]}),e.jsx(Os,{id:"push-custom-body",value:T,maxLength:ye,onChange:i=>r(i.target.value),placeholder:"ì림ì ë³´ì¼ ë¬¸êµ¬ë¥¼ ì ì´ì£¼ì¸ì.",className:"text-sm min-h-[84px]","data-testid":"input-push-body"}),e.jsxs("p",{className:"text-[11px] text-muted-foreground",children:["ë¤ì ìì ê±°ë¶ ìë´(",e.jsx("span",{className:"font-mono",children:ee}),")ê° ìëì¼ë¡ ë§ë¶ìµëë¤. ì§ì¸ ì ììµëë¤."]})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"push-custom-url",className:"text-xs font-semibold",children:"⢠ë¥ë§í¬ ê²½ë¡ (ì í)"}),e.jsx($,{id:"push-custom-url",value:k,onChange:i=>P(i.target.value),onBlur:A,onPaste:()=>window.setTimeout(A,0),placeholder:"/campaigns/D-2608-0212",className:"h-9 text-sm font-mono","data-testid":"input-push-url"}),pe?e.jsx("p",{className:"text-[11px] text-destructive","data-testid":"text-push-url-error",children:pe}):e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"ì± ë´ë¶ ê²½ë¡ë§ ë£ìµëë¤. ì°ë¦¬ ì¬ì´í¸ 주ì(https://ddok.it/â¦)를 ë¶ì¬ë£ì¼ë©´ ë´ë¶ ê²½ë¡ë¡ ìë ë³íë©ëë¤. ë¹ì°ë©´ ì± ì²« íë©´ì¼ë¡ ê°ëë¤."})]})]})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsxs(F,{className:"text-xs font-semibold",children:[ge.target," ë°ì¡ ëì (ë§ì¼í
ìì ëì · ì± ì림 í í° ë³´ì )"]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-3",children:[e.jsx($,{placeholder:"ì§ì (ì: ìì¸)",value:L,onChange:i=>q(i.target.value),className:"h-9 text-sm","data-testid":"input-push-target-region"}),e.jsxs(oe,{value:U||"_all",onValueChange:i=>K(i==="_all"?"":i),children:[e.jsx(me,{className:"h-9 text-sm","data-testid":"select-push-target-channel",children:e.jsx(ue,{placeholder:"ëì ì±ë"})}),e.jsxs(xe,{children:[e.jsx(C,{value:"_all",children:"ì ì²´ ì±ë"}),e.jsx(C,{value:"blog",children:"ë¸ë¡ê·¸"}),e.jsx(C,{value:"instagram",children:"ì¸ì¤íê·¸ë¨"}),e.jsx(C,{value:"youtube",children:"ì íë¸"}),e.jsx(C,{value:"naverClip",children:"ë¤ì´ë² í´ë¦½"}),e.jsx(C,{value:"threads",children:"ì¤ë ë"}),e.jsx(C,{value:"tiktok",children:"í±í¡"})]})]}),e.jsxs("div",{className:"flex items-center gap-1.5 px-3 h-9 bg-muted rounded-md text-sm","data-testid":"badge-push-target-count",children:[X?e.jsx(se,{className:"h-3.5 w-3.5 text-muted-foreground flex-shrink-0 animate-spin"}):e.jsx(ys,{className:"h-3.5 w-3.5 text-muted-foreground flex-shrink-0"}),e.jsxs("span",{className:"truncate",children:["ëì ",e.jsxs("strong",{className:"text-primary",children:[I,"ëª
"]}),!V&&x&&z>0&&!D&&e.jsxs("span",{className:"text-xs text-muted-foreground",children:[" (ì´ë¯¸ ë°ì¡ ",z,"ëª
ì ì¸)"]})]})]})]}),!V&&x&&y>0&&e.jsxs("p",{className:"text-[11px] text-muted-foreground","data-testid":"text-push-campaign-send-history",children:["íí°ì 무ê´íê² ì´ ìº íì¸ ëì ë°ì¡ ",e.jsxs("strong",{children:[y.toLocaleStr
14ing(),"ëª
"]})]}),!V&&e.jsxs("label",{className:"flex items-start gap-2 text-sm cursor-pointer","data-testid":"label-push-resend",children:[e.jsx(Ve,{checked:D,onCheckedChange:i=>O(i===!0),className:"mt-0.5","data-testid":"checkbox-push-resend"}),e.jsxs("span",{children:["ì´ë¯¸ ë°ì¡ë ëì í¬í¨ ì¬ë°ì¡",D&&e.jsxs("span",{className:"text-xs text-destructive mt-0.5 flex items-center gap-1","data-testid":"text-push-resend-warning",children:[e.jsx(Se,{className:"h-3 w-3"}),"ê°ì ìº íì¸ ì림ì ì´ë¯¸ ë°ì 리뷰ì´ìê² ì¤ë³µ ë°ì¡ë©ëë¤. ì± ì림 ì°¨ë¨Â·ìì ìíì´ ìì¼ë ê¼ íìí ê²½ì°ìë§ ì¬ì©íì¸ì."]})]})]})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsxs(F,{className:"text-xs font-semibold",children:[ge.preview," 미리보기 (ì ê¸íë©´ ì림)"]}),e.jsxs("div",{className:"rounded-lg p-3 bg-zinc-200 dark:bg-zinc-800","data-testid":"preview-push",children:[e.jsxs("div",{className:"max-w-sm rounded-xl border border-zinc-300 dark:border-zinc-700 bg-white dark:bg-zinc-900 shadow-sm px-3 py-2.5",children:[e.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-zinc-500 dark:text-zinc-400 mb-1",children:[e.jsx(zs,{className:"h-3 w-3 flex-shrink-0"}),e.jsx("span",{className:"font-medium",children:"ëë리ìë"}),e.jsx("span",{children:"· ì§ê¸"})]}),e.jsx("div",{className:"text-[13px] font-semibold text-zinc-900 dark:text-zinc-100 break-words","data-testid":"push-preview-title",children:B?B.title:"(ì ëª©ì´ ì¬ê¸°ì íìë©ëë¤)"}),e.jsx("div",{className:"text-[12px] text-zinc-700 dark:text-zinc-300 leading-relaxed break-words mt-0.5","data-testid":"push-preview-body",children:B?B.body:"(ë³¸ë¬¸ì´ ì¬ê¸°ì íìë©ëë¤)"})]}),B?.url&&e.jsxs("p",{className:"text-[11px] text-zinc-700 dark:text-zinc-300 mt-2","data-testid":"push-preview-link",children:["ííë©´ ì´ë: ",e.jsx("span",{className:"font-mono",children:B.url})]}),e.jsx("p",{className:"text-[11px] text-zinc-700 dark:text-zinc-300 mt-1",children:"* ì¤ì íìë 기기·OS·ì ê¸íë©´ ì¤ì ì ë°ë¼ ë¬ë¼ì§ ì ììµëë¤(ì¤ ìê° ì¤ê±°ë ì í ì ìì)."})]})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsxs(F,{className:"text-xs font-semibold",children:[ge.test," í
ì¤í¸ ë°ì¡ (1ê±´)"]}),e.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[e.jsx($,{placeholder:"í
ì¤í¸ ìì ê³ì ì´ë©ì¼",value:d,onChange:i=>l(i.target.value),className:"h-9 text-sm sm:max-w-xs","data-testid":"input-push-test-email"}),e.jsxs(M,{variant:"outline",onClick:R,disabled:n,"data-testid":"button-push-test-send",children:[Y?e.jsx(se,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(Ne,{className:"h-4 w-4 mr-2"}),"í
ì¤í¸ ë°ì¡"]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"í´ë¹ ê³ì ì¼ë¡ ì±ì ë¡ê·¸ì¸ë ê¸°ê¸°ë¡ 1ê±´ ë°ì¡ë©ëë¤. ì± ë¯¸ì¤ì¹Â·ë¯¸ë¡ê·¸ì¸ì´ë©´ ì¤í¨í©ëë¤."})]})]}),e.jsx(Ye,{className:"pt-2 flex-shrink-0",children:e.jsxs("div",{className:"flex w-full flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[ve?e.jsxs("p",{className:"flex items-start gap-1.5 text-xs text-destructive min-w-0","data-testid":"text-push-send-blocked",children:[e.jsx(Se,{className:"h-3.5 w-3.5 flex-shrink-0 mt-0.5"}),e.jsx("span",{children:ve})]}):e.jsx("span",{}),e.jsxs("div",{className:"flex gap-2 sm:flex-shrink-0",children:[e.jsx(M,{variant:"outline",onClick:J,"data-testid":"button-push-cancel-send",children:"ì·¨ì"}),e.jsx(M,{onClick:()=>g(!0),disabled:De,"data-testid":"button-open-push-confirm",children:Z?e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"h-4 w-4 mr-2 animate-spin"}),"ë°ì¡ ì¤..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ne,{className:"h-4 w-4 mr-2"}),I,"ëª
ìê² ë°ì¡"]})})]})]})}),e.jsx(xs,{open:m,onOpenChange:g,children:e.jsxs(hs,{"data-testid":"dialog-push-confirm-send",children:[e.jsxs(ps,{children:[e.jsx(gs,{children:"ì± í¸ì¬ë¥¼ ë°ì¡í ê¹ì?"}),e.jsx(js,{asChild:!0,children:e.jsxs("div",{className:"space-y-1.5 text-sm",children:[e.jsxs("div",{children:[e.jsxs("strong",{children:[V?"ì 목":"ìº íì¸",":"]})," ",_||"-"]}),e.jsxs("div",{children:[e.jsx("strong",{children:"ëì:"})," ",G()," · ",e.jsxs("span",{className:"text-primary font-semibold",children:[I,"ëª
"]})]}),V?e.jsx("div",{className:"text-xs text-destructive",children:"ì§ì ì
ë ¥ í¸ì¬ë ì¤ë³µ ë°ì¡ ë°©ì§ ê¸°ë¥ì´ ììµëë¤. ì¤ë¨ í ë¤ì ë³´ë´ë©´ ì´ë¯¸ ë°ì ì¬ëë ë¤ì ë°ìµëë¤."}):x&&(D||z>0)&&e.jsx("div",{className:"text-xs text-muted-foreground",children:D?"ì´ë¯¸ ë°ì¡ë ëìë í¬í¨í´ ì¬ë°ì¡í©ëë¤.":`ì´ë¯¸ ë°ì¡ë ${z}ëª
ì ì ì¸ë©ëë¤.`}),e.jsx("div",{className:"text-xs text-muted-foreground",children:"ê´ê³ ì± ë©ìì§ë ì¼ê°(21ì~08ì)ìë ë°ì¡í ì ììµëë¤."})]})})]}),e.jsxs(fs,{children:[e.jsx(Ns,{"data-testid":"button-push-cancel-confirm",children:"ì·¨ì"}),e.jsx(vs,{onClick:i=>{i.preventDefault(),he()},disabled:Z,"data-testid":"button-push-confirm-send",children:Z?e.jsxs(e.Fragment,{children:[e.jsx(se,{className:"h-4 w-4 mr-2 animate-spin"}),"ë°ì¡ ì¤..."]}):"ë°ì¡í기"})]})]})})]})})}),Oe=20;function mt(s={}){const{enabled:a=!0,campaignId:o}=s,[m,g]=t.useState(1),[c,N]=t.useState(""),[f,S]=t.useState("all"),[u,w]=t.useState("all"),{data:x,isLoading:v,refetch:j}=ce({queryKey:["push-logs",m,c,f,u,o??""],queryFn:async()=>
14{const r=new URLSearchParams;return r.set("page",m.toString()),r.set("limit",String(Oe)),c&&r.set("search",c),f!=="all"&&r.set("sendType",f),u!=="all"&&r.set("success",u),o&&r.set("campaignId",o),de(`/admin/push/logs?${r}`)},enabled:a}),h=t.useCallback(r=>{N(r),g(1)},[]),b=t.useCallback(r=>{S(r),g(1)},[]),E=t.useCallback(r=>{w(r),g(1)},[]),p=t.useCallback(r=>{g(r)},[]),T=t.useCallback(()=>{j()},[j]);return{data:x,isLoading:v,page:m,search:c,sendTypeFilter:f,successFilter:u,handleSearchChange:h,handleSendTypeFilterChange:b,handleSuccessFilterChange:E,handlePageChange:p,handleRefresh:T,PAGE_SIZE:Oe}}function ut(s){if(!s)return"-";const a=new Date(s);return Number.isNaN(a.getTime())?"-":Ts(a,"M/d HH:mm",{locale:As})}function xt(){const{data:s,isLoading:a,page:o,search:m,sendTypeFilter:g,successFilter:c,handleSearchChange:N,handleSendTypeFilterChange:f,handleSuccessFilterChange:S,handlePageChange:u,handleRefresh:w}=mt(),x=Array.isArray(s?.logs)?s.logs:[],v=typeof s?.total=="number"?s.total:0,j=typeof s?.totalPages=="number"?s.totalPages:0;return e.jsxs(We,{children:[e.jsx(Ze,{children:e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[e.jsx(Je,{className:"text-lg",children:"í¸ì¬ ë°ì¡ ë´ì"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Le,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx($,{placeholder:"ìì ì ì´ë¦ ê²ì",value:m,onChange:h=>N(h.target.value),className:"pl-9 w-48","data-testid":"input-push-search"})]}),e.jsxs(oe,{value:g,onValueChange:f,children:[e.jsx(me,{className:"w-28","data-testid":"filter-push-send-type",children:e.jsx(ue,{placeholder:"ì í"})}),e.jsxs(xe,{children:[e.jsx(C,{value:"all",children:"ì ì²´"}),e.jsx(C,{value:"manual",children:"ìë"}),e.jsx(C,{value:"test",children:"í
ì¤í¸"})]})]}),e.jsxs(oe,{value:c,onValueChange:S,children:[e.jsx(me,{className:"w-28","data-testid":"filter-push-success",children:e.jsx(ue,{placeholder:"ê²°ê³¼"})}),e.jsxs(xe,{children:[e.jsx(C,{value:"all",children:"ì ì²´"}),e.jsx(C,{value:"true",children:"ì±ê³µ"}),e.jsx(C,{value:"false",children:"ì¤í¨"})]})]}),e.jsx(M,{variant:"outline",size:"icon",onClick:w,"data-testid":"button-push-refresh",children:e.jsx(es,{className:"h-4 w-4"})})]})]})}),e.jsx(ss,{children:a?e.jsx("div",{className:"space-y-2",children:[...Array(5)].map((h,b)=>e.jsx(ts,{className:"h-12 w-full"},b))}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(as,{"data-testid":"table-push-logs",children:[e.jsx(ns,{children:e.jsxs(re,{children:[e.jsx(Q,{className:"w-36",children:"ë°ì¡ì¼ì"}),e.jsx(Q,{children:"ìì ì"}),e.jsx(Q,{className:"w-24",children:"ì í"}),e.jsx(Q,{children:"ë´ì©"}),e.jsx(Q,{className:"w-20",children:"ê²°ê³¼"})]})}),e.jsx(ls,{children:x.length===0?e.jsx(re,{children:e.jsx(H,{colSpan:5,className:"text-center py-12 text-muted-foreground","data-testid":"text-empty-push-logs",children:"ë°ì¡ ë´ìì´ ììµëë¤."})}):x.map(h=>e.jsxs(re,{"data-testid":`push-log-row-${h.id}`,children:[e.jsx(H,{className:"text-sm whitespace-nowrap",children:ut(h.sentAt)}),e.jsx(H,{children:e.jsx("div",{className:"text-sm font-medium",children:h.userName||"-"})}
14),e.jsxs(H,{children:[e.jsx(ie,{variant:h.sendType==="test"?"secondary":"outline",children:h.sendType==="test"?"í
ì¤í¸":"ìë"}),e.jsx("div",{className:"text-[11px] text-muted-foreground mt-0.5",children:h.mode==="custom"?"ì§ì ì
ë ¥":"ìº íì¸"})]}),e.jsxs(H,{children:[e.jsx("div",{className:"max-w-xs text-sm font-medium truncate",children:h.title||"-"}),e.jsx("div",{className:"max-w-xs text-xs text-muted-foreground truncate",children:h.body||"-"}),h.campaignTitle&&e.jsx("div",{className:"max-w-xs text-[11px] text-muted-foreground truncate",children:h.campaignTitle})]}),e.jsx(H,{children:h.success?e.jsxs(ie,{variant:"default",className:"bg-green-500",children:[e.jsx(ws,{className:"h-3 w-3 mr-1"}),"ì±ê³µ"]}):e.jsx(rs,{children:e.jsxs(is,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(ie,{variant:"destructive",className:"cursor-help",children:[e.jsx(ks,{className:"h-3 w-3 mr-1"}),"ì¤í¨",h.errorMessage&&e.jsx(ds,{className:"h-3 w-3 ml-1"})]})}),h.errorMessage&&e.jsxs(os,{side:"left",className:"max-w-xs",children:[e.jsx("p",{className:"text-xs font-medium mb-1",children:"ì¤í¨ ì¬ì "}),e.jsx("p",{className:"text-xs",children:h.errorMessage})]})]})})})]},h.id))})]})}),j>1&&e.jsxs("div",{className:"flex items-center justify-between mt-4 pt-4 border-t",children:[e.jsxs("div",{className:"text-sm text-muted-foreground","data-testid":"text-push-total-count",children:["ì´ ",v,"ê±´"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{variant:"outline",size:"sm",disabled:o<=1,onClick:()=>u(o-1),"data-testid":"button-push-prev-page",children:e.jsx(ms,{className:"h-4 w-4"})}),e.jsxs("span",{className:"text-sm",children:[o," / ",j]}),e.jsx(M,{variant:"outline",size:"sm",disabled:o>=j,onClick:()=>u(o+1),"data-testid":"button-push-next-page",children:e.jsx(us,{className:"h-4 w-4"})})]})]})]})})]})}function Ft(){const[,s]=Ds(),{user:a}=_s(),[o,m]=t.useState(!1),[g,c]=t.useState(!1),{data:N,isLoading:f,page:S,search:u,sendTypeFilter:w,successFilter:x,handleSearchChange:v,handleSendTypeFilterChange:j,handleSuccessFilterChange:h,handlePageChange:b,handleRefresh:E}=Us({enabled:!!a&&a.role==="admin"});return!a||a.role!=="admin"?null:e.jsxs(e.Fragment,{children:[e.jsx($s,{children:e.jsx("title",{children:"ìë¦¼í¡ ë°ì¡ - ê´ë¦¬ì"})}),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(Is,{}),e.jsxs("main",{className:"container mx-auto px-4 py-6 max-w-7xl",children:[e.jsx("div",{className:"flex items-center gap-4 mb-6",children:e.jsxs(M,{variant:"ghost",size:"sm",onClick:()=>s("/admin/dashboard"),"data-testid":"button-back",children:[e.jsx(Ms,{className:"h-4 w-4 mr-1"}),"ëìê°ê¸°"]})}),e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-6",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[e.jsx(Ge,{className:"h-6 w-6 text-yellow-500"}),"ìë¦¼í¡ ë°ì¡"]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"ì ê· ìº íì¸ ì림(ì¹´ì¹´ì¤ í
í릿 103)ì ë§ì¼í
ìì ëì 리뷰ì´ìê² ìë ë°ì¡í©ëë¤."}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"â» ê´ê³ ì± ë©ìì§ë¼ ì¼ê°(21ì~08ì)ìë ë°ì¡í ì ìì¼ë©°, ê°ì ìº íì¸ì ì´ë¯¸ ë°ì ëìì 기본 ì ì¸ë©ëë¤."})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(M,{onClick:()=>c(!0),"data-testid":"button-open-push-dialog",children:[e.jsx(Ss,{className:"h-4 w-4 mr-2"}),"í¸ì¬ ë°ì¡"]}
14),e.jsxs(M,{variant:"outline",onClick:()=>m(!0),"data-testid":"button-open-send-dialog",children:[e.jsx(Ne,{className:"h-4 w-4 mr-2"}),"ìë¦¼í¡ ë°ì¡"]})]})]}),e.jsx(Ws,{open:o,onOpenChange:m}),e.jsx(ot,{open:g,onOpenChange:c}),e.jsxs(We,{children:[e.jsx(Ze,{children:e.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[e.jsx(Je,{className:"text-lg",children:"ë°ì¡ ë´ì"}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx(Le,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx($,{placeholder:"ìì ì ì´ë¦ ê²ì",value:u,onChange:p=>v(p.target.value),className:"pl-9 w-48","data-testid":"input-search"})]}),e.jsxs(oe,{value:w,onValueChange:j,children:[e.jsx(me,{className:"w-28","data-testid":"filter-send-type",children:e.jsx(ue,{placeholder:"ì í"})}),e.jsxs(xe,{children:[e.jsx(C,{value:"all",children:"ì ì²´"}),e.jsx(C,{value:"manual",children:"ìë"}),e.jsx(C,{value:"test",children:"í
ì¤í¸"})]})]}),e.jsxs(oe,{value:x,onValueChange:h,children:[e.jsx(me,{className:"w-28","data-testid":"filter-success",children:e.jsx(ue,{placeholder:"ê²°ê³¼"})}),e.jsxs(xe,{children:[e.jsx(C,{value:"all",children:"ì ì²´"}),e.jsx(C,{value:"true",children:"ì±ê³µ"}),e.jsx(C,{value:"false",children:"ì¤í¨"})]})]}),e.jsx(M,{variant:"outline",size:"icon",onClick:E,"data-testid":"button-refresh",children:e.jsx(es,{className:"h-4 w-4"})})]})]})}),e.jsx(ss,{children:f?e.jsx("div",{className:"space-y-2",children:[...Array(5)].map((p,T)=>e.jsx(ts,{className:"h-12 w-full"},T))}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"overflow-x-auto",children:e.jsxs(as,{"data-testid":"table-alimtalk-logs",children:[e.jsx(ns,{children:e.jsxs(re,{children:[e.jsx(Q,{className:"w-36",children:"ë°ì¡ì¼ì"}),e.jsx(Q,{children:"ìì ì"}),e.jsx(Q,{className:"w-20",children:"ì í"}),e.jsx(Q,{children:"ìº íì¸"}),e.jsx(Q,{className:"w-20",children:"ê²°ê³¼"})]})}),e.jsx(ls,{children:!N?.logs||N.logs.length===0?e.jsx(re,{children:e.jsx(H,{colSpan:5,className:"text-center py-12 text-muted-foreground","data-testid":"text-empty-logs",children:"ë°ì¡ ë´ìì´ ììµëë¤."})}):N.logs.map(p=>e.jsxs(re,{"data-testid":`log-row-${p.id}`,children:[e.jsx(H,{className:"text-sm whitespace-nowrap",children:Ts(new Date(p.sentAt),"M/d HH:mm",{locale:As})}
14),e.jsxs(H,{children:[e.jsx("div",{className:"text-sm font-medium",children:p.userName||"-"}),e.jsx("div",{className:"text-xs text-muted-foreground",children:p.userPhoneMasked||"-"})]}),e.jsx(H,{children:e.jsx(ie,{variant:p.sendType==="test"?"secondary":"outline",children:p.sendType==="test"?"í
ì¤í¸":"ìë"})}),e.jsx(H,{children:e.jsx("div",{className:"max-w-xs text-xs truncate",children:p.campaignTitle||"-"})}),e.jsx(H,{children:p.success?e.jsxs(ie,{variant:"default",className:"bg-green-500",children:[e.jsx(ws,{className:"h-3 w-3 mr-1"}),"ì±ê³µ"]}):e.jsx(rs,{children:e.jsxs(is,{children:[e.jsx(cs,{asChild:!0,children:e.jsxs(ie,{variant:"destructive",className:"cursor-help",children:[e.jsx(ks,{className:"h-3 w-3 mr-1"}),"ì¤í¨",p.errorMessage&&e.jsx(ds,{className:"h-3 w-3 ml-1"})]})}),p.errorMessage&&e.jsxs(os,{side:"left",className:"max-w-xs",children:[e.jsx("p",{className:"text-xs font-medium mb-1",children:"ì¤í¨ ì¬ì "}),e.jsx("p",{className:"text-xs",children:p.errorMessage})]})]})})})]},p.id))})]})}),N&&N.totalPages>1&&e.jsxs("div",{className:"flex items-center justify-between mt-4 pt-4 border-t",children:[e.jsxs("div",{className:"text-sm text-muted-foreground","data-testid":"text-total-count",children:["ì´ ",N.total,"ê±´"]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{variant:"outline",size:"sm",disabled:S<=1,onClick:()=>b(S-1),"data-testid":"button-prev-page",children:e.jsx(ms,{className:"h-4 w-4"})}),e.jsxs("span",{className:"text-sm",children:[S," / ",N.totalPages]}),e.jsx(M,{variant:"outline",size:"sm",disabled:S>=N.totalPages,onClick:()=>b(S+1),"data-testid":"button-next-page",children:e.jsx(us,{className:"h-4 w-4"})})]})]})]})})]}),e.jsx("div",{className:"mt-6",children:e.jsx(xt,{})})]})]})]})}export{Ft 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.