import{_ as T}from"./D_7E8SMU.js";import{_ as A}from"./BOhf1Bbf.js";import{s as v,N as B,j as L,P as N,l as P,d as h,w as R,m as s,o as r,b as o,G as p,c,e as d,t as a,D as u,I as m,f}from"./Bgmy51Qv.js";import{u as I}from"./7pZkuj9N.js";import{u as M}from"./BE7GDBwC.js";import{u as O}from"./DKgjlGGV.js";import"./CNIrc0EA.js";import"./DZl4_Bww.js";import"./AmaTRG5a.js";import"./BHvLfWtM.js";import"./DuSynPle.js";import"./B2895E6R.js";const z={class:"input-wrapper"},F=["placeholder"],G={key:0,class:"error"},H={class:"input-wrapper"},J={class:"dply-felx j-left mb-20 mb-sm-15"},Q={class:"mr-15"},W={class:"input-wrapper"},X=["placeholder"],Y={key:0,class:"error"},Z={class:"input-wrapper"},E=["placeholder"],x={key:0,class:"error"},ee={class:"input-wrapper"},te=["placeholder"],se={key:0,class:"error"},oe={class:"input-wrapper"},le=["placeholder"],ae={key:0,class:"error"},ie={class:"input-wrapper"},ne={class:"dply-felx j-left mb-20 mb-sm-15"},re={class:"mr-15"},de={class:"input-wrapper"},pe={class:"dply-felx j-left mb-20 mb-sm-15"},ce={class:"mr-15"},ue={class:"input-wrapper"},me={class:"dply-felx j-left mb-20 mb-sm-15"},ye={class:"mr-15"},je={__name:"[id]",setup(ge){const $=I(),{getAllList:w,emptyAllList:C}=$,{allCategories:g}=v($),b=B(),{currentLanguage:_e}=v(b),t=L({id:"",title:"",status:2,featured:2,parent:"",slug:"",meta_description:"",meta_keywords:"",in_footer:2,meta_title:"",image:""}),_=N();M();const{statusObj:S,featuredObj:k}=O(),D=e=>{var l;((l=_==null?void 0:_.params)==null?void 0:l.id)==="add"&&C("allCategories"),t.value=e},K=e=>{t.value.in_footer=e.key},V=e=>{t.value.featured=e.key},j=e=>{t.value.parent=e.key},U=e=>{t.value.status=e.key};return P(async()=>{g.value||w({api:"getAllCategories",action:"setAllCategories"})}),(e,l)=>{const y=T,q=A;return r(),h(q,{ref:"dataPage","set-api":"setCategory","get-api":"getCategory","set-image-api":"setCategoryImage","route-name":"categories",name:e.$t("category.catUp"),gate:"category","validation-keys":["title","slug","meta_title","meta_description"],"file-keys":["id","status"],result:s(t),onResult:D},{form:R(({hasError:n})=>[o("div",z,[o("label",null,a(e.$t("index.title")),1),p(o("input",{type:"text",placeholder:e.$t("index.title"),"onUpdate:modelValue":l[0]||(l[0]=i=>s(t).title=i),ref:"title",onChange:l[1]||(l[1]=(...i)=>e.slugChange&&e.slugChange(...i)),class:u({invalid:!s(t).title&&n})},null,42,F),[[m,s(t).title]]),!s(t).title&&n?(r(),c("span",G,a(e.$t("category.req",{type:e.$t("index.title")})),1)):d("",!0)]),o("div",H,[o("div",J,[o("span",Q,a(e.$t("title.pc")),1),s(g)?(r(),h(y,{key:0,"default-null":!0,selectedKey:`${s(t).parent}`,options:s(g),onClicked:j},null,8,["selectedKey","options"])):d("",!0)])]),o("div",W,[o("label",null,a(e.$t("category.slug")),1),p(o("input",{type:"text",placeholder:e.$t("category.slug"),"onUpdate:modelValue":l[2]||(l[2]=i=>s(t).slug=i),ref:"title",class:u({invalid:!s(t).slug&&n})},null,10,X),[[m,s(t).slug]]),!s(t).slug&&n?(r(),c("span",Y,a(e.$t("category.req",{type:e.$t("category.slug")})),1)):d("",!0)]),o("div",Z,[o("label",null,a(e.$t("category.mTitle")),1),p(o("input",{type:"text",placeholder:e.$t("category.mTitle"),"onUpdate:modelValue":l[3]||(l[3]=i=>s(t).meta_title=i),class:u({invalid:!s(t).meta_title&&n})},null,10,E),[[m,s(t).meta_title]]),!s(t).meta_title&&n?(r(),c("span",x,a(e.$t("category.req",{type:e.$t("category.mTitle")})),1)):d("",!0)]),o("div",ee,[o("label",null,a(e.$t("category.mDesc")),1),p(o("textarea",{placeholder:e.$t("category.mDesc"),"onUpdate:modelValue":l[4]||(l[4]=i=>s(t).meta_description=i),class:u({invalid:!s(t).meta_description&&n})},null,10,te),[[m,s(t).meta_description]]),!s(t).meta_description&&n?(r(),c("span",se,a(e.$t("category.req",{type:e.$t("category.mDesc")})),1)):d("",!0)]),o("div",oe,[o("label",null,a(e.$t("ship.mk"))+" ("+a(e.$t("ship.csk"))+")",1),p(o("textarea",{placeholder:e.$t("ship.mk"),"onUpdate:modelValue":l[5]||(l[5]=i=>s(t).meta_keywords=i),class:u({invalid:!s(t).meta_keywords&&n})},null,10,le),[[m,s(t).meta_keywords]]),!s(t).meta_keywords&&n?(r(),c("span",ae,a(e.$t("category.req",{type:e.$t("ship.mk")})),1)):d("",!0)]),o("div",ie,[o("div",ne,[o("span",re,a(e.$t("category.featured")),1),f(y,{selectedKey:`${s(t).featured}`,options:s(k),onClicked:V},null,8,["selectedKey","options"])])]),o("div",de,[o("div",pe,[o("span",ce,a(e.$t("title.sif")),1),f(y,{selectedKey:`${s(t).in_footer}`,options:s(k),onClicked:K},null,8,["selectedKey","options"])])]),o("div",ue,[o("div",me,[o("span",ye,a(e.$t("category.status")),1),f(y,{selectedKey:`${s(t).status}`,options:s(S),onClicked:U},null,8,["selectedKey","options"])])])]),_:1},8,["name","result"])}}};export{je as default};
