1import{_ as ye,M as ge}from"./DAO-TjI4.js";import{c as _e,d as he,x as ke,y as we,B as Ce,P as De,a6 as Te,C as xe,T as Ee,a as Ae,b as r,f as b,e as o,k as h,i as t,t as d,h as y,N as E,g,F as Z,I as ee,r as Ie,M as te,D as A,E as F,K as ae,V as Ne,A as c,S as k,j as M,X as Se,o as n,Q as oe,p as ze}from"./DrlufBBD.js";import{u as Me}from"./XAl1oJda.js";import{u as Ue}from"./WDUnacGD.js";import{u as se}from"./BYDppTfa.js";import{P as $e}from"./B_pInIwK.js";import{U as Le}from"./Otm7Gi5C.js";import{L as P}from"./DTjZY--c.js";import{C as Oe}from"./COn_dm41.js";import{T as Re}from"./yH6OnAzg.js";import{X as Ve}from"./BMBNO0uF.js";import{S as Be}from"./tnS9CuL2.js";import"./CxMLhyG2.js";import"./BiJ_nWCi.js";import"./IKHjXg6d.js";import"./Cev5nn2e.js";import"./3cZfB477.js";import"./BHU64gSO.js";const Fe=_e("pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]),Pe={class:"notice-manage-page"},qe={class:"page-heading"},Ke=["disabled"],je={class:"publisher-guide","aria-labelledby":"publisher-guide-title"},He={id:"publisher-guide-title"},Xe={key:0,class:"page-state",role:"status","aria-live":"polite","aria-busy":"true"},Je={key:0},Qe=["disabled"],We=["role","tabindex"],Ge={key:1,class:"notice-list","aria-label":"ë±ë¡ë ì ë¬ì¬í"},Ye={class:"notice-top"},Ze={key:0,class:"important-badge"},et={class:"user-badge"},tt={key:1,class:"inactive-badge"},at=["datetime"],ot={class:"notice-actions"},st=["aria-label","onClick"],nt=["disabled","aria-label","onClick"],it={key:2,class:"page-state empty","aria-labelledby":"empty-title"},lt=["aria-describedby","aria-busy"],rt=["disabled"],dt={class:"modal-kicker"},ut={id:"notice-dialog-title"},ct=["disabled"],pt={id:"notice-title-count",class:"field-count"},mt=["disabled"],ft={id:"notice-content-count",class:"field-count"},vt={class:"form-row"},bt={class:"date-field"},yt=["disabled"],gt={class:"checks"},_t=["disabled"],ht=["disabled"],kt={key:0,class:"dirty-state",role:"status"},wt={class:"form-actions"},Ct=["disabled"],Dt=["disabled"],Tt=he({__name:"notices",async setup(xt){let I,q;const ne=ke(),ie=Me(),f=M(()=>String(ne.params.id)),le=Ue(),{data:K,pending:U,error:N,refresh:re}=([I,q]=we(()=>Se(()=>`studio-content-notices:${f.value}`,()=>le(`/api/manage/contents/${encodeURIComponent(f.value)}/notices?includeMeta=1`),{watch:[f],dedupe:"defer"})),I=await I,q(),I),p=c([]),D=c(!1),_=c(""),l=c(!1),m=c(""),S=c(""),v=c(new Set),$=c(""),T=c(!1),j=c(null),L=E("noticeDialog"),O=E("titleInput"),R=E("formErrorAlert"),H=E("loadErrorAlert"),X=E("pageMessageAlert"),de=M(()=>K.value?.content.name||f.value),V=M(()=>Number(N.value?.statusCode)===403);Ce(K,a=>{a&&(p.value=a.notices)},{immediate:!0});const J=(a=new Date)=>{const e=a instanceof Date?a:new Date(a);if(Number.isNaN(e.getTime()))return"";const u=e.getTimezoneOffset()*6e4;return new Date(e.getTime()-u).toISOString().slice(0,16)},Q=()=>({title:"",content:"",noticeDate:J(),important:!1,isActive:!0}),i=De(Q()),z=()=>JSON.stringify({...i}),w=M(()=>D.value&&z()!==S.value),W=a=>{const e=a?.currentTarget;j.value=e instanceof HTMLElement?e:null},G=async a=>{W(a),_.value="",Object.assign(i,Q()),S.value=z(),m.value="",D.value=!0,await k(),O.value?.focus()},ue=async(a,e)=>{W(e),_.value=a.id,Object.assign(i,{title:a.title,content:a.content,noticeDate:a.notice_date?J(a.notice_date):"",important:a.type==="important",isActive:a.is_active}),S.value=z(),m.value="",D.value=!0,await k(),O.value?.focus()},x=async(a=!1)=>{l.value&&!a||!a&&w.value&&!window.confirm("ì ì¥íì§ ìì ë³ê²½ì¬íì´ ììµëë¤. ìì± ì°½ì ë«ìê¹ì?")||(D.value=!1,m.value="",await k(),j.value?.focus())},ce=()=>{p.value.sort((a,e)=>new Date(e.notice_date).getTime()-new Date(a.notice_date).getTime())},B=async(a,e=!1)=>{$.value=a,T.value=e,e&&(await k(),X.value?.focus())},pe=async()=>{if(!(l.value||!w.value)){if(!i.title.trim()||!i.content.trim()){m.value="ì 목과 ë´ì©ì ì
ë ¥í´ ì£¼ì¸ì.",await k(),R.value?.focus();return}l.value=!0,m.value="";try{const a={title:i.title,content:i.content,noticeDate:i.noticeDate,type:i.important?"important":"info",isActive:i.isActive},e=_.value?`/api/manage/contents/${encodeURIComponent(f.value)}/notices/${encodeURIComponent(_.value)}`:`/api/manage/contents/${encodeURIComponent(f.value)}/notices`,u=await $fetch(e,{method:_.value?"PUT":"POST",body:a}),s=p.value.findIndex(C=>C.id===u.notice.id);s>=0?p.value.splice(s,1,u.notice):p.value.unshift(u.notice),ce(),S.value=z(),await x(!0),await B("ì ë¬ì¬íì ì ì¥íìµëë¤."),se().success("ì ë¬ì¬íì ì ì¥íìµëë¤.")}catch(a){m.value=a.data?.message||"ì ì¥íì§ ëª»íìµëë¤. ì
ë ¥í ë´ì©ì ì ì§ë©ëë¤.",await k(),R.value?.focus()}finally{l.value=!1}}},me=async a=>{if(!v.value.has(a.id)&&window.confirm(`'${a.title}' ì ë¬ì¬íì ìì í ê¹ì?`)){v.value=new Set(v.value).add(a.id);try{await $fetch(`/api/manage/contents/${encodeURIComponent(f.value)}/notices/${encodeURIComponent(a.id)}`,{method:"DELETE"}),p.value=p.value.filter(e=>e.id!==a.id),await B("ì ë¬ì¬íì ìì íìµëë¤."),se().success("ì ë¬ì¬íì ìì íìµëë¤.")}catch(e){await B(e.data?.message||"ì ë¬ì¬íì ìì íì§ ëª»íìµëë¤. ë¤ì ìëí´ ì£¼ì¸ì.",!0)}finally{const e=new Set(v.value);e.delete(a.id),v.value=e}}},fe=async()=>
1{await re(),N.value&&(await k(),H.value?.focus())},ve=a=>{if(a.key==="Escape"){a.preventDefault(),x();return}if(a.key!=="Tab"||!L.value)return;const e=[...L.value.querySelectorAll('button:not(:disabled), input:not(:disabled), textarea:not(:disabled), [href], [tabindex]:not([tabindex="-1"])')].filter(C=>!C.hasAttribute("hidden"));if(!e.length)return;const u=e[0],s=e[e.length-1];a.shiftKey&&document.activeElement===u?(a.preventDefault(),s.focus()):!a.shiftKey&&document.activeElement===s&&(a.preventDefault(),u.focus())},Y=a=>{!w.value||l.value||(a.preventDefault(),a.returnValue="")};Te(()=>!w.value||l.value?!0:window.confirm("ì ì¥íì§ ìì ì ë¬ì¬í ë³ê²½ì´ ììµëë¤. ì´ íì´ì§ë¥¼ ëê°ê¹ì?")),xe(()=>window.addEventListener("beforeunload",Y)),Ee(()=>window.removeEventListener("beforeunload",Y));const be=a=>a?new Date(a).toLocaleString("ko-KR"):"";return Ae({title:"ì ë¬ì¬í ê´ë¦¬ | ë°©íµì¤",meta:[{name:"robots",content:"noindex, nofollow"}]}),(a,e)=>{const u=ye;return n(),r("div",Pe,[b(u,{"content-id":t(f),active:"notices"},null,8,["content-id"]),o("header",qe,[o("div",null,[e[8]||(e[8]=o("span",null,"CONTENT NOTICE",-1)),e[9]||(e[9]=o("h1",null,"ì ë¬ì¬í ê´ë¦¬",-1)),o("p",null,d(t(de))+" ìì²ììê² ë³´ì¬ì¤ ì ë¬ì¬íì ë±ë¡í©ëë¤.",1)]),o("button",{type:"button",disabled:t(U)||!!t(N),onClick:G},[b(t($e),{size:17,"aria-hidden":"true"}),e[10]||(e[10]=y(" ì ì ë¬ì¬í ",-1))],8,Ke)]),o("section",je,[b(t(Le),{size:20,"aria-hidden":"true"}),o("div",null,[o("strong",He,d(t(ie).displayName)+" ê´ë¦¬ì ê²ì",1),e[11]||(e[11]=o("p",null,"ìì±í ì ë¬ì¬íì âì ì ê´ë¦¬ìâë¡ êµ¬ë¶ëë©° ë°©íµì¤ ê³µì ê³µì§ê° ìëì í¨ê» íìí©ëë¤.",-1))])]),t(U)?(n(),r("div",Xe,[b(t(P),{size:23,class:"spin","aria-hidden":"true"}),e[12]||(e[12]=y(" ì ë¬ì¬íì ë¶ë¬ì¤ë ì¤... ",-1))])):t(N)?(n(),r("div",{key:1,ref_key:"loadErrorAlert",ref:H,class:"page-state state-error",role:"alert",tabindex:"-1"},[b(t(oe),{size:24,"aria-hidden":"true"}),o("strong",null,d(t(V)?"ì ë¬ì¬íì ê´ë¦¬í ê¶íì´ ììµëë¤.":"ì ë¬ì¬íì ë¶ë¬ì¤ì§ 못íìµëë¤."),1),t(V)?g("",!0):(n(),r("p",Je,"ì ì í ë¤ì ìëí´ ì£¼ì¸ì.")),t(V)?g("",!0):(n(),r("button",{key:1,type:"button",disabled:t(U),onClick:fe}," ë¤ì ìë ",8,Qe))],512)):(n(),r(Z,{key:2},[t($)?(n(),r("div",{key:0,ref_key:"pageMessageAlert",ref:X,class:ee(["page-message",{error:t(T)}]),role:t(T)?"alert":"status",tabindex:t(T)?-1:void 0,"aria-live":"polite"},[t(T)?(n(),h(t(oe),{key:0,size:18,"aria-hidden":"true"})):(n(),h(t(Oe),{key:1,size:18,"aria-hidden":"true"})),y(" "+d(t($)),1)],10,We)):g("",!0),t(p).length?(n(),r("section",Ge,[(n(!0),r(Z,null,Ie(t(p),s=>(n(),r("article",{key:s.id,class:ee({inactive:!s.is_active,important:s.type==="important"})},[o("div",Ye,[o("div",null,[s.type==="important"?(n(),r("span",Ze,"ì¤ì")):g("",!0),o("span",et,d(s.publisher_name||"ì½í
ì¸ ê´ë¦¬ì")+" · ì ì ê´ë¦¬ì",1),s.is_active?g("",!0):(n(),r("span",tt,"ê²ì ì¤ë¨"))]),o("time",{datetime:s.notice_date},d(be(s.notice_date)),9,at)]),o("h2",null,d(s.title),1),o("p",null,d(s.content),1),o("div",ot,[o("button",{type:"button","aria-label":`${s.title} ìì `,onClick:C=>ue(s,C)},[b(t(Fe),{size:15,"aria-hidden":"true"}),e[13]||(e[13]=y(" ìì ",-1))],8,st),o("button",{type:"button",disabled:t(v).has(s.id),"aria-label":`${s.title} ìì `,onClick:C=>me(s)},[t(v).has(s.id)?(n(),h(t(P),{key:0,size:15,class:"spin","aria-hidden":"true"})):(n(),h(t(Re),{key:1,size:15,"aria-hidden":"true"})),y(" "+d(t(v).has(s.id)?"ìì ì¤...":"ìì "),1)],8,nt)])],2))),128))])):(n(),r("section",it,[b(t(ge),{size:28,"aria-hidden":"true"}),e[14]||(e[14]=o("strong",{id:"empty-title"},"ë±ë¡ë ì ë¬ì¬íì´ ììµëë¤.",-1)),e[15]||(e[15]=o("p",null,"첫 ì ë¬ì¬íì ìì±í´ ìì²ììê² ì´ì ììì ìë ¤ë³´ì¸ì.",-1)),o("button",{type:"button",onClick:G},"ì ë¬ì¬í ë±ë¡")]))],64)),(n(),h(Ne,{to:"body"},[t(D)?(n(),r("div",{key:0,class:"modal-backdrop",onClick:e[7]||(e[7]=te(s=>x(),["self"])),onKeydown:ve},[o("form",{ref_key:"noticeDialog",ref:L,class:"notice-modal",role:"dialog","aria-modal":"true","aria-labelledby":"notice-dialog-title","aria-describedby":t(m)?"notice-form-error":void 0,"aria-busy":t(l),onSubmit:te(pe,["prevent"])},[o("button",{type:"button",class:"modal-close","aria-label":"ì ë¬ì¬í ìì± ì°½ ë«ê¸°",disabled:t(l),onClick:e[0]||(e[0]=s=>x())},[b(t(Ve),{size:19,"aria-hidden":"true"})],8,rt),o("span",dt,d(t(_)?"EDIT NOTICE":"NEW NOTICE"),1),o("h2",ut,d(t(_)?"ì ë¬ì¬í ìì ":"ì ì ë¬ì¬í ë±ë¡"),1),e[20]||(e[20]=o("label",{for:"notice-title"},"ì 목",-1)),A(o("input",{id:"notice-title",ref_key:"titleInput",ref:O,"onUpdate:modelValue":e[1]||(e[1]=s=>t(i).title=s),required:"",maxlength:"80",disabled:t(l),"aria-describedby":"notice-title-count"},null,8,ct),[[F,t(i).title,void 0,{trim:!0}]]),o("small",pt,d(t(i).title.length)+" / 80ì",1),e[21]||(e[21]=o("label",{for:"notice-content"},"ë´ì©",-1)),A(o("textarea",{id:"notice-content","onUpdate:modelValue":e[2]||(e[2]=s=>t(i).content=s),required:"",maxlength:"3000",rows:"7",disabled:t(l),"aria-describedby":"notice-content-count"},null,8,mt),[[F,t(i).content]]),o("small",ft,d(t(i).content.length)+" / 3,000ì",1),o("div",vt,[o("div",bt,[e[16]||(e[16]=o("label",{for:"notice-date"},"ê²ìì¼",-1)),A(o("input",{id:"notice-date","onUpdate:modelValue":e[3]||(e[3]=s=>t(i).noticeDate=s),type:"datetime-local",disabled:t(l)},null,8,yt),[[F,t(i).noticeDate]])]),o("fieldset",gt,[e[19]||(e[19]=o("legend",null,"ê²ì ì¤ì ",-1)),o("label",null,[A(o("input",{"onUpdate:modelValue":e[4]||(e[4]=s=>t(i).important=s),type:"checkbox",disabled:t(l)},null,8,_t),[[ae,t(i).important]]),e[17]||(e[17]=y(" ì¤ì",-1))]),o("label",null,[A(o("input",{"onUpdate:modelValue":e[5]||(e[5]=s=>t(i).isActive=s),type:"checkbox",disabled:t(l)},null,8,ht),[[ae,t(i).isActive]]),e[18]||(e[18]=y(" ê²ì ì¤",-1))])])]),t(w)?(n(),r("p",kt,"ì ì¥íì§ ìì ë³ê²½ì¬íì´ ììµëë¤.")):g("",!0),t(m)?(n(),r("p",{key:1,id:"notice-form-error",ref_key:"formErrorAlert",ref:R,class:"form-error",role:"alert",tabindex:"-1"},d(t(m)),513)):g("",!0),o("div",wt,[o("button",{type:"button",disabled:t(l),onClick:e[6]||(e[6]=s=>x())},"ì·¨ì",8,Ct),o("button",{type:"submit",disabled:t(l)||!t(w)},[t(l)?(n(),h(t(P),{key:0,size:16,class:"spin","aria-hidden":"true"})):(n(),h(t(Be),{key:1,size:16,"aria-hidden":"true"})),y(" "+d(t(l)?"ì ì¥ ì¤...":"ì ì¥"),1)],8,Dt)])],40,lt)],32)):g("",!0)]))])}}}),jt=ze(Tt,[["__scopeId","data-v-d559ae73"]]);export{jt 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.