import{T as v,c as l,a as f,b as e,w as h,t as a,d as c,v as m,u as t,e as u,f as k,F as y,r as w,y as p,o as r,q as x}from"./app-13978987.js";import{_ as V}from"./PageHeader-8c638686.js";import{_ as M}from"./AdminLayout-bd13ff9d.js";import"./dropdown-45d66330.js";const S={class:"container flex-grow p-4 sm:p-6"},U={class:"space-y-6"},I={class:"grid lg:grid-cols-5"},q={class:"lg:col-span-2"},B={class:"lg:col-span-3"},D={class:"card"},E={class:"card-body"},F={class:"mb-2"},N={class:""},T={class:""},j={key:0,class:"invalid-feedback text-danger d-block"},C={class:"mb-2 mt-2"},L={class:""},$={class:""},A={key:0,class:"invalid-feedback text-danger d-block"},O={class:"mb-2 mt-2"},P={class:""},z={class:""},G={key:0,class:"invalid-feedback text-danger d-block"},H={class:"mb-2 mt-2"},J={class:""},K={class:""},Q={key:0,class:"invalid-feedback text-danger d-block"},R={class:"mb-2 mt-3"},W={class:""},X={class:""},Y={key:0,class:"invalid-feedback text-danger d-block"},Z={class:"mb-2 mt-2"},ee={class:""},se={class:""},te=["value"],ae={key:0,class:"invalid-feedback text-danger d-block"},oe={class:"mb-2 mt-2"},ie={for:"toggle-featured",class:"toggle toggle-sm"},ne=e("div",{class:"toggle-body"},null,-1),le={class:"label label-md"},re={for:"toggle-status",class:"toggle toggle-sm"},de=e("div",{class:"toggle-body"},null,-1),ce={class:"label label-md"},ue={class:"mb-2 mt-3"},_e={class:"btn btn-primary"},me={layout:M},fe=Object.assign(me,{__name:"Edit",props:["languages","segments","buttons","info"],setup(_){const d=_,s=v({title:d.info.title,preview_image:"",banner_image:"",description:d.info.excerpt.value,main_description:d.info.long_description.value,language:d.info.lang,featured:d.info.featured==1,status:d.info.status==1}),b=()=>{const n=route("admin.features.update",d.info.id);s.put(n,{onSuccess:()=>{x.success(trans("Item has been updated successfully"))}})};return(n,i)=>(r(),l("main",S,[f(V,{title:n.trans("Edit Feature"),buttons:_.buttons},null,8,["title","buttons"]),e("div",U,[e("form",{onSubmit:h(b,["prevent"]),class:"ajaxform_instant_reload",enctype:"multipart/form-data"},[e("div",I,[e("div",q,[e("strong",null,a(n.trans("Edit a features post")),1),e("p",null,a(n.trans("Add your features details and necessary information from here")),1)]),e("div",B,[e("div",D,[e("div",E,[e("div",F,[e("label",N,a(n.trans("Features Title")),1),e("div",T,[c(e("input",{type:"text","onUpdate:modelValue":i[0]||(i[0]=o=>t(s).title=o),name:"title",required:"",class:"input"},null,512),[[m,t(s).title]]),t(s).errors.title?(r(),l("div",j,a(t(s).errors.title),1)):u("",!0)])]),e("div",C,[e("label",L,a(n.trans("Preview Image")),1),e("div",$,[e("input",{onInput:i[1]||(i[1]=o=>t(s).preview_image=o.target.files[0]),type:"file",class:"input",name:"preview_image",accept:"image/*"},null,32),t(s).errors.preview_image?(r(),l("div",A,a(t(s).errors.preview_image),1)):u("",!0)])]),e("div",O,[e("label",P,a(n.trans("Banner Image")),1),e("div",z,[e("input",{onInput:i[2]||(i[2]=o=>t(s).banner_image=o.target.files[0]),type:"file",class:"input",name:"banner_image",accept:"image/*"},null,32),t(s).errors.banner_image?(r(),l("div",G,a(t(s).errors.banner_image),1)):u("",!0)])]),e("div",H,[e("label",J,a(n.trans("Short Description")),1),e("div",K,[c(e("textarea",{"onUpdate:modelValue":i[3]||(i[3]=o=>t(s).description=o),name:"description",required:"",class:"textarea h-100",maxlength:"500"},null,512),[[m,t(s).description]]),t(s).errors.description?(r(),l("div",Q,a(t(s).errors.description),1)):u("",!0)])]),e("div",R,[e("label",W,a(n.trans("Main Description")),1),e("div",X,[c(e("textarea",{"onUpdate:modelValue":i[4]||(i[4]=o=>t(s).main_description=o),name:"main_description",required:"",class:"h-200 textarea"},null,512),[[m,t(s).main_description]]),t(s).errors.main_description?(r(),l("div",Y,a(t(s).errors.main_description),1)):u("",!0)])]),e("div",Z,[e("label",ee,a(n.trans("Select Langauge")),1),e("div",se,[c(e("select",{"onUpdate:modelValue":i[5]||(i[5]=o=>t(s).language=o),name:"language",class:"select"},[(r(!0),l(y,null,w(_.languages,(o,g)=>(r(),l("option",{key:g,value:g},a(o),9,te))),128))],512),[[k,t(s).language]]),t(s).errors.language?(r(),l("div",ae,a(t(s).errors.language),1)):u("",!0)])]),e("div",oe,[e("div",null,[e("label",ie,[c(e("input",{"onUpdate:modelValue":i[6]||(i[6]=o=>t(s).featured=o),class:"toggle-input peer sr-only",id:"toggle-featured",type:"checkbox"},null,512),[[p,t(s).featured]]),ne,e("span",le,a(n.trans("Make it featured?")),1)])]),e("div",null,[e("label",re,[c(e("input",{"onUpdate:modelValue":i[7]||(i[7]=o=>t(s).status=o),class:"toggle-input peer sr-only",id:"toggle-status",type:"checkbox"},null,512),[[p,t(s).status]]),de,e("span",ce,a(n.trans("Make it publish?")),1)])]),e("div",ue,[e("button",_e,a(n.trans("Submit")),1)])])])])])])],32)])]))}});export{fe as default};
