import{T as _,c as u,a as r,b as e,w as f,t as o,d as i,v as d,u as a,f as v,F as h,r as y,y as V,g as S,o as p,q as M}from"./app-13978987.js";import{_ as U}from"./RichEditor-132d6d13.js";import{_ as q}from"./SpinnerBtn-cb152833.js";import{_ as k}from"./AdminLayout-bd13ff9d.js";import{_ as w}from"./PageHeader-8c638686.js";import{s as g}from"./multiselect-4ccf8c7b.js";import"./FloatingDropdown-0be3e47c.js";import"./dropdown-45d66330.js";const C={class:"container flex-grow p-4 sm:p-6"},T={class:"space-y-6"},B={class:"flex"},x={class:"card mx-auto max-w-[800px]"},D={class:"card-body"},E={class:"mb-2"},O={class:"mb-2 mt-2"},I={class:"mb-2 mt-2"},$={class:"mb-2 mt-2"},F={class:"mb-2 mt-3"},L={class:"mb-2 mt-3"},N={class:"mb-2 mt-2"},P={class:"mb-2 mt-2"},j=["value"],z=e("hr",null,null,-1),A={class:"mb-2 mt-3"},G={class:"mb-2 mt-2"},H={class:"mb-2 mt-2"},J={class:"mb-2 mt-2"},K={class:"mb-2 mt-3"},Q={for:"toggle-status",class:"toggle toggle-sm"},R=e("div",{class:"toggle-body"},null,-1),W={class:"label label-md"},X={class:"mb-2 mt-3"},Y=S({layout:k}),ie=Object.assign(Y,{__name:"Create",props:["categories","languages","tags"],setup(m){const l=_({title:"",short_description:"",main_description:"",categories:[],tags:[],language:"",featured:!1,status:!1,meta_title:"",meta_description:"",meta_tags:"",meta_image:"",preview:"",banner:""}),c=()=>{l.post(route("admin.blog.store"),{onSuccess:()=>{M.success("Blog Post has been added successfully")}})};return(n,s)=>(p(),u("main",C,[r(w),e("div",T,[e("div",B,[e("div",x,[e("div",D,[e("form",{onSubmit:f(c,["prevent"])},[e("div",E,[e("label",null,o(n.trans("Blog Title")),1),i(e("input",{"onUpdate:modelValue":s[0]||(s[0]=t=>a(l).title=t),type:"text",name:"title",required:"",class:"input"},null,512),[[d,a(l).title]])]),e("div",O,[e("label",null,o(n.trans("Preview Image")),1),e("input",{onChange:s[1]||(s[1]=t=>a(l).preview=t.target.files[0]),type:"file",class:"input",required:"",accept:"image/*"},null,32)]),e("div",I,[e("label",null,o(n.trans("Banner Image")),1),e("input",{onChange:s[2]||(s[2]=t=>a(l).banner=t.target.files[0]),type:"file",class:"input",required:"",accept:"image/*"},null,32)]),e("div",$,[e("label",null,o(n.trans("Short Description")),1),i(e("textarea",{"onUpdate:modelValue":s[3]||(s[3]=t=>a(l).short_description=t),name:"short_description",required:"",class:"textarea",maxlength:"500"},null,512),[[d,a(l).short_description]])]),e("div",F,[e("label",null,o(n.trans("Main Description")),1),r(U,{modelValue:a(l).main_description,"onUpdate:modelValue":s[4]||(s[4]=t=>a(l).main_description=t)},null,8,["modelValue"])]),e("div",L,[e("label",null,o(n.trans("Select Category")),1),r(a(g),{class:"multiselect-dark",searchable:!0,modelValue:a(l).categories,"onUpdate:modelValue":s[5]||(s[5]=t=>a(l).categories=t),mode:"tags",options:m.categories,placeholder:"Select Main Category"},null,8,["modelValue","options"])]),e("div",N,[e("label",null,o(n.trans("Select Tags")),1),r(a(g),{class:"multiselect-dark",modelValue:a(l).tags,"onUpdate:modelValue":s[6]||(s[6]=t=>a(l).tags=t),mode:"tags",options:m.tags,searchable:!0,placeholder:"Select Tags"},null,8,["modelValue","options"])]),e("div",P,[e("label",null,o(n.trans("Select Language")),1),i(e("select",{"onUpdate:modelValue":s[7]||(s[7]=t=>a(l).language=t),name:"language",class:"select"},[(p(!0),u(h,null,y(m.languages,(t,b)=>(p(),u("option",{key:t,value:b},o(t),9,j))),128))],512),[[v,a(l).language]])]),z,e("div",A,[e("label",null,o(n.trans("SEO Meta Title")),1),i(e("input",{"onUpdate:modelValue":s[8]||(s[8]=t=>a(l).meta_title=t),type:"text",name:"meta_title",required:"",class:"input"},null,512),[[d,a(l).meta_title]])]),e("div",G,[e("label",null,o(n.trans("SEO Meta Image")),1),e("input",{onInput:s[9]||(s[9]=t=>a(l).meta_image=t.target.files[0]),type:"file",class:"input",name:"meta_image",required:"",accept:"image/*"},null,32)]),e("div",H,[e("label",null,o(n.trans("SEO Meta Description")),1),i(e("textarea",{"onUpdate:modelValue":s[10]||(s[10]=t=>a(l).meta_description=t),name:"meta_description",required:"",class:"input h-100"},null,512),[[d,a(l).meta_description]])]),e("div",J,[e("label",null,o(n.trans("SEO Meta Tags")),1),i(e("input",{"onUpdate:modelValue":s[11]||(s[11]=t=>a(l).meta_tags=t),type:"text",name:"meta_tags",required:"",class:"input"},null,512),[[d,a(l).meta_tags]])]),e("div",K,[e("div",null,[e("label",Q,[i(e("input",{"onUpdate:modelValue":s[12]||(s[12]=t=>a(l).status=t),class:"toggle-input peer sr-only",id:"toggle-status",type:"checkbox"},null,512),[[V,a(l).status]]),R,e("span",W,o(n.trans("Make it publish?")),1)])])]),e("div",X,[e("div",null,[r(q,{classes:"btn btn-primary",processing:a(l).processing,"btn-text":n.trans("Create")},null,8,["processing","btn-text"])])])],32)])])])])]))}});export{ie as default};
