import{i as B,m as b,b as c,E as s,a as l,h as a,w as o,g as d,v as n,G as f,B as N,A as V,d as j,e as D,t as E,F as L,s as r,c as M}from"./index-DF5uCdwt.js";import{_ as T}from"./AdminLayout.vue_vue_type_script_setup_true_lang-DtHb-1yq.js";import{_ as k}from"./Button.vue_vue_type_script_setup_true_lang-CKPSvBok.js";import{_}from"./Input.vue_vue_type_script_setup_true_lang-09owoR_-.js";import{_ as i}from"./Card.vue_vue_type_script_setup_true_lang-D4PxcbNb.js";import{_ as S}from"./Select.vue_vue_type_script_setup_true_lang-CygVv_b7.js";import"./cn-2dOUpm6k.js";const A={class:"grid grid-cols-3 gap-6"},F={class:"col-span-2 space-y-6"},G={class:"mt-3 p-3 bg-[var(--wdot-color-primary-50)] rounded text-xs"},H={class:"text-[var(--wdot-color-primary-700)]"},I={class:"space-y-3"},P={class:"space-y-6"},R={class:"space-y-3"},W={class:"flex items-center gap-2 cursor-pointer"},q={class:"flex items-center gap-2 cursor-pointer"},z={class:"space-y-1.5"},J={class:"text-xs space-y-2"},K={class:"flex justify-between"},O="{{name}}",Q="{{email}}",X="{{unsubscribe_url}}",ae=B({__name:"Compose",setup(Y){const x=r(""),g=r(`안녕하세요, {{name}}님

W·Dot Easybox 운영팀입니다.

`),m=r("all"),u=r("now"),w=r(""),y=[{value:"all",label:"전체 회원 (1,247명)",count:1247},{value:"active",label:"활성 회원 (1,124명)",count:1124},{value:"vip",label:"VIP 이상 (42명)",count:42},{value:"dormant",label:"휴면 회원 (123명)",count:123},{value:"new",label:"신규 가입 30일 (847명)",count:847},{value:"custom",label:"커스텀 세그먼트 작성",count:0}],v=M(()=>{var p;return((p=y.find(e=>e.value===m.value))==null?void 0:p.count)??0}),C=[{id:1,name:"환영 메일"},{id:2,name:"이벤트 안내"},{id:3,name:"휴면 복귀"},{id:4,name:"공지"}],U=()=>alert(`${v.value}명에게 메일 발송!`),$=()=>alert("초안으로 저장되었습니다.");return(p,e)=>(b(),c(T,null,{breadcrumb:s(()=>[...e[6]||(e[6]=[d("메일링 · ",-1),l("b",null,"메일 작성",-1)])]),title:s(()=>[...e[7]||(e[7]=[d("메일 작성",-1)])]),actions:s(()=>[a(o(k),{variant:"outline",onClick:$},{default:s(()=>[...e[8]||(e[8]=[d("초안 저장",-1)])]),_:1}),a(o(k),{variant:"primary",onClick:U},{default:s(()=>[d(n(u.value==="now"?"지금 발송":"예약 발송"),1)]),_:1})]),default:s(()=>[l("div",A,[l("div",F,[a(o(i),null,{header:s(()=>[...e[9]||(e[9]=[l("b",null,"받는 사람",-1)])]),default:s(()=>[a(o(S),{modelValue:m.value,"onUpdate:modelValue":e[0]||(e[0]=t=>m.value=t),options:y.map(t=>({value:t.value,label:t.label}))},null,8,["modelValue","options"]),l("div",G,[e[10]||(e[10]=d(" 예상 발송 대상: ",-1)),l("b",H,n(v.value.toLocaleString())+"명",1)])]),_:1}),a(o(i),null,{header:s(()=>[...e[11]||(e[11]=[l("b",null,"제목·본문",-1)])]),default:s(()=>[l("div",I,[l("div",null,[e[12]||(e[12]=l("label",{class:"text-xs font-bold text-[var(--wdot-fg-muted)] block mb-1.5"},"제목",-1)),a(o(_),{modelValue:x.value,"onUpdate:modelValue":e[1]||(e[1]=t=>x.value=t),placeholder:"메일 제목을 입력하세요"},null,8,["modelValue"])]),l("div",null,[e[14]||(e[14]=l("label",{class:"text-xs font-bold text-[var(--wdot-fg-muted)] block mb-1.5"},"본문 (HTML 지원)",-1)),f(l("textarea",{"onUpdate:modelValue":e[2]||(e[2]=t=>g.value=t),class:"w-full px-3 py-3 border border-[var(--wdot-border)] rounded-lg text-sm font-mono",rows:"14"},null,512),[[N,g.value]]),l("div",{class:"mt-2 text-[10px] text-[var(--wdot-fg-muted)]"},[e[13]||(e[13]=l("span",null,"변수:",-1)),l("code",{class:"bg-[var(--wdot-bg-subtle)] px-1.5 py-0.5 rounded"},n(O)),l("code",{class:"bg-[var(--wdot-bg-subtle)] px-1.5 py-0.5 rounded ml-1"},n(Q)),l("code",{class:"bg-[var(--wdot-bg-subtle)] px-1.5 py-0.5 rounded ml-1"},n(X))])])])]),_:1})]),l("div",P,[a(o(i),null,{header:s(()=>[...e[15]||(e[15]=[l("b",null,"발송 시점",-1)])]),default:s(()=>[l("div",R,[l("label",W,[f(l("input",{type:"radio","onUpdate:modelValue":e[3]||(e[3]=t=>u.value=t),value:"now"},null,512),[[V,u.value]]),e[16]||(e[16]=l("span",{class:"text-sm"},"즉시 발송",-1))]),l("label",q,[f(l("input",{type:"radio","onUpdate:modelValue":e[4]||(e[4]=t=>u.value=t),value:"later"},null,512),[[V,u.value]]),e[17]||(e[17]=l("span",{class:"text-sm"},"예약 발송",-1))]),u.value==="later"?(b(),c(o(_),{key:0,modelValue:w.value,"onUpdate:modelValue":e[5]||(e[5]=t=>w.value=t),type:"datetime-local"},null,8,["modelValue"])):j("",!0)])]),_:1}),a(o(i),null,{header:s(()=>[...e[18]||(e[18]=[l("b",null,"템플릿",-1)])]),default:s(()=>[l("div",z,[(b(),D(L,null,E(C,t=>l("button",{key:t.id,class:"w-full text-left px-3 py-2 rounded text-sm hover:bg-[var(--wdot-bg-subtle)] cursor-pointer"},n(t.name),1)),64))])]),_:1}),a(o(i),null,{header:s(()=>[...e[19]||(e[19]=[l("b",null,"발송 정보",-1)])]),default:s(()=>[l("div",J,[e[21]||(e[21]=l("div",{class:"flex justify-between"},[l("span",{class:"text-[var(--wdot-fg-muted)]"},"발신자"),l("b",null,"noreply@w-websoftsrv.kr")],-1)),l("div",K,[e[20]||(e[20]=l("span",{class:"text-[var(--wdot-fg-muted)]"},"예상 비용",-1)),l("b",null,"₩"+n(Math.floor(v.value*2).toLocaleString()),1)]),e[22]||(e[22]=l("div",{class:"flex justify-between"},[l("span",{class:"text-[var(--wdot-fg-muted)]"},"잔액"),l("b",null,"₩148,200")],-1))])]),_:1})])])]),_:1}))}});export{ae as default};
