1import{_ as A}from"./CBPBhA67.js";import{_ as I,r as i,o as P,D as H,c as q,a as l,w as V,b as t,i as C,e as d,f as _,s as S,aw as O,g as o,v as f,x as F,F as U,l as B,q as R,t as g,I as Y}from"./Doh7wyz3.js";import{_ as z}from"./q1X9LmLh.js";import{_ as G}from"./B6kSMQXm.js";import{u as J}from"./D8ECuS5d.js";import{u as K}from"./BIQEdKOo.js";import"./CST-3RD9.js";import"./BTeyGgDR.js";import"./BVff-v6L.js";import"./e975K9Yd.js";const Q={class:"d-flex justify-content-center"},W={class:"d-flex justify-content-center flex-column border-1 login-card rounded-1 gap-3"},X={style:{"margin-bottom":"30px"}},Z={class:"card p-10",style:{width:"700px"}},ee={class:"card-body"},te={class:"mb-5 mt-5"},ne={id:"imports"},oe={class:"content-wrapper"},se={key:1,class:"suggestions"},ae=["onMousedown"],le=["disabled"],re={key:0},ie={key:1},de={__name:"create",setup(ue){const a=J(),u=K(),r=i(""),p=i(""),c=i(""),E=i(""),m=i(""),M=i([]),y=i(!1),v=i(null);P(async()=>{await a.runFetch(),h()}),H(r,async n=>{if(y.value){y.value=!1;return}n.length>1?await u.searchContentByTitle(n):u.contents=[]});function N(n){r.value=n.title,v.value=n.id,u.contents=[],y.value=!0}const $=()=>{r.value="",v.value=null,u.contents=[]};function h(){M.value=a.events.data.map(n=>({key:`event-${n.id}`,highlight:{color:"blue",fillMode:"solid"},dates:n.date,popover:{label:n.link_text}}))}function L(n){const e=new Date(n.date),b=e.getFullYear(),w=String(e.getMonth()+1).padStart(2,"0"),x=String(e.getDate()).padStart(2,"0"),k=`${b}-${w}-${x}`;c.value=k}const T={holiday:3,anniversary:4};async function j(){const n=new FormData;n.append("content_id",v.value),n.append("link_text",p.value),n.append("date",c.value),n.append("news_id",T[m.value]??"");const e=await a.createPage(Object.fromEntries(n.entries()));e.success?(await a.runFetch(),h(),r.value="",v.value=null,p.value="",c.value="",m.value=""):E.value=e.message??"An error occurred"}return(n,e)=>{const b=A,w=O,x=z,k=G;return l(),q(k,{class:"rounded-3"},{default:V(()=>[e[9]||(e[9]=t("title",null,"Create Event",-1)),C(b,{title:"Calendar"}),t("div",Q,[t("div",W,[t("div",null,[t("div",X,[t("div",Z,[t("div",ee,[e[7]||(e[7]=t("h5",{class:"card-title"},"Add a New Event",-1)),t("div",te,[t("div",ne,[C(x,null,{default:V(()=>[C(w,{modelValue:o(c),"onUpdate:modelValue":e[0]||(e[0]=s=>f(c)?c.value=s:null),attributes:o(M),onDayclick:L,class:"w-full"},null,8,["modelValue","attributes"])]),_:1})])]),t("div",oe,[e[4]||(e[4]=t("label",null,"Search Content",-1)),S(t("input",{type:"text","onUpdate:modelValue":e[1]||(e[1]=s=>f(r)?r.value=s:null)},null,512),[[F,o(r)]]),o(r)?(l(),d("span",{key:0,class:"clear-btn",onClick:$},"x")):_("",!0),o(u).contents?(l(),d("div",se,[(l(!0),d(U,null,B(o(u).contents,s=>(l(),d("div",{key:s.id,class:"suggestion-item",onMousedown:R(D=>N(s),["prevent"])},g(s.title),41,ae))),128))])):_("",!0)]),t("div",null,[e[5]||(e[5]=t("label",null,"Link Text",-1)),S(t("input",{type:"text","onUpdate:modelValue":e[2]||(e[2]=s=>f(p)?p.value=s:null)},null,512),[[F,o(p)]])]),e[8]||(e[8]=t("label",null,"Type",-1)),S(t("select",{id:"news_type","onUpdate:modelValue":e[3]||(e[3]=s=>f(m)?m.value=s:null),class:"select-field"},e[6]||(e[6]=[t("option",{disabled:"",value:""},"-- Select --",-1),t("option",{value:"holiday"},"Upcoming Holidays and Commemorations",-1),t("option",{value:"anniversary"},"Upcoming Anniversaries",-1)]),512),[[Y,o(m)]]),t("button",{disabled:o(a).isLoading,onClick:j,class:"btn-small bg-new-blue",style:{"margin-top":"10px"}},g(o(a).isLoading?"Saving...":"Save"),9,le)])]),o(a).errorMessage?(l(),d("p",re,g(o(a).errorMessage.message),1)):_("",!0),o(a).errorMessage?(l(),d("ul",ie,[(l(!0),d(U,null,B(o(a).errorMessage.data,(s,D)=>(l(),d("li",{key:D},g(s[0]),1))),128))])):_("",!0)])])])])]),_:1,__:[9]})}}},xe=I(de,[["__scopeId","data-v-766d84fb"]]);export{xe 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.