1import"./base-pe7GV1XZ.js";import{E as q}from"./el-dialog-RK4c9NpM.js";import"./el-overlay-CmjqFTe9.js";import{E as B,a as N}from"./el-form-item-CmEqbZso.js";import{E as O}from"./el-button-DJtZds9M.js";import{E as S}from"./el-input-CnmL_t4N.js";import{c as d}from"./CountryService-B6elBd56.js";import{r as T,a as f,x as c,h as k,w as a,g as D,d as l,b as g,e as $,t as y,V as j,m as I}from"./index-yrPBkgLG.js";import"./index-Df5mbpRH.js";import"./vnode-B3H-aSbi.js";import"./scroll-CJo2Uqhl.js";import"./index-cAzKqqYT.js";import"./aria--JZTNrRr.js";import"./index-DaE5gc7w.js";import"./index-pfuQmdwN.js";import"./event-BB_Ol6Sd.js";import"./constants-Dnj8X3EN.js";import"./castArray-BFnFmXfp.js";import"./use-form-common-props-C11eZE7M.js";import"./_baseClone-uLppoVnS.js";import"./index-r5W6hzzQ.js";import"./index-M7Y52XAl.js";import"./index-DNvpQlGu.js";const R=["id"],A={class:"flex justify-end mt-8"},se={__name:"form",props:{isOpen:{type:Boolean,required:!0,default:!1},item:{type:[Object,String],default:null}},emits:["close"],setup(V,{emit:_}){const r=V,b=_,s=T(),e=f({uz:"",ru:"",cyrl:"",eng:""}),z=f({uz:[{required:!0,trigger:"blur"}],ru:[{required:!0,trigger:"blur"}],cyrl:[{required:!0,trigger:"blur"}],eng:[{required:!0,trigger:"blur"}]});function n(){b("close")}function p(i=!1){const t={name:{...e}};return i&&(t.id=r.item.id),t}const w=async i=>{i&&i.validate(async t=>{t?r.item?await E():await v():I.Error("Not Valid")})};async function E(){await d.Update(p(!0)),n()}async function v(){await d.Add(p()),n()}return c(()=>r.item,()=>{r.item&&(e.uz=r.item.name.uz,e.cyrl=r.item.name.cyrl,e.ru=r.item.name.ru,e.eng=r.item.name.eng)}),c(()=>r.isOpen,()=>{e.uz="",e.ru="",e.cyrl="",e.eng=""}),(i,t)=>{const u=S,m=N,x=O,C=B,F=q;return D(),k(F,{modelValue:r.isOpen,"onUpdate:modelValue":t[5]||(t[5]=o=>r.isOpen=o),onClose:n,width:"540",class:"!p-8 !rounded-lg"},{header:a(({titleId:o,titleClass:U})=>[g("h4",{id:o,class:j([U,"!text-2xl text-center"])},y(i.$t("Country Name")),11,R)]),default:a(()=>[l(C,{ref_key:"ruleFormRef",ref:s,model:e,rules:z,"label-position":"top",size:"large"},{default:a(()=>[l(m,{label:"Title uz",prop:"uz"},{default:a(()=>[l(u,{modelValue:e.uz,"onUpdate:modelValue":t[0]||(t[0]=o=>e.uz=o),autocomplete:"off"},null,8,["modelValue"])]),_:1}),l(m,{label:"Title ru",prop:"ru"},{default:a(()=>[l(u,{modelValue:e.ru,"onUpdate:modelValue":t[1]||(t[1]=o=>e.ru=o),autocomplete:"off"},null,8,["modelValue"])]),_:1}),l(m,{label:"Title cyrl",prop:"cyrl"},{default:a(()=>[l(u,{modelValue:e.cyrl,"onUpdate:modelValue":t[2]||(t[2]=o=>e.cyrl=o),autocomplete:"off"},null,8,["modelValue"])]),_:1}),l(m,{label:"Title eng",prop:"eng"},{default:a(()=>[l(u,{modelValue:e.eng,"onUpdate:modelValue":t[3]||(t[3]=o=>e.eng=o),autocomplete:"off"},null,8,["modelValue"])]),_:1}),g("div",A,[l(x,{type:"primary",class:"w-full",onClick:t[4]||(t[4]=o=>w(s.value))},{default:a(()=>[$(y(i.$t("Submit")),1)]),_:1})])]),_:1},8,["model","rules"])]),_:1},8,["modelValue"])}}};export{se 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.