import{aX as C,i as t,a5 as V,a6 as I,M,a3 as $,P as h,w as x,f as U,n as D}from"./app-JmgyQoR0.js";import{b as N,a as u,h as W,i as E,j as l,K as s,E as i,u as g,l as c,z as m,I as T,J as X}from"./vue-y3KLWBaS.js";const q=r=>(T("data-v-06b7b099"),r=r(),X(),r),z={class:"_monolithic_"},A={class:"yigymqpb _section"},J=["src"],K=q(()=>g("i",{class:"ph-trash ph-bold ph-lg"},null,-1)),O=N({__name:"emoji-edit-dialog",props:{emoji:{}},emits:["done","closed"],setup(r,{emit:_}){var y;const o=r;let j=u(null),p=u(o.emoji.name),v=u(o.emoji.category),f=u(o.emoji.aliases.join(" ")),b=u(C),n=u((y=o.emoji.license)!=null?y:"");const k=_;function w(){B()}async function B(){await h("admin/emoji/update",{id:o.emoji.id,name:p.value,category:v.value,aliases:f.value.split(" "),license:n.value===""?null:n.value}),k("done",{updated:{id:o.emoji.id,name:p.value,category:v.value,aliases:f.value.split(" "),license:n.value===""?null:n.value}}),j.value.close()}async function S(){const{canceled:d}=await x({type:"warning",text:t.t("removeAreYouSure",{x:p.value})});d||U("admin/emoji/delete",{id:o.emoji.id}).then(()=>{k("done",{deleted:!0}),j.value.close()})}return(d,e)=>(W(),E($,{ref_key:"dialog",ref:j,width:370,"with-ok-button":!0,onClose:e[5]||(e[5]=a=>d.$refs.dialog.close()),onClosed:e[6]||(e[6]=a=>d.$emit("closed")),onOk:e[7]||(e[7]=a=>w())},{header:l(()=>[s(":"+i(d.emoji.name)+":",1)]),default:l(()=>[g("div",z,[g("div",A,[g("img",{src:d.emoji.url,class:"img"},null,8,J),c(V,{modelValue:p.value,"onUpdate:modelValue":e[0]||(e[0]=a=>p.value=a),class:"_formBlock"},{label:l(()=>[s(i(m(t).ts.name),1)]),_:1},8,["modelValue"]),c(V,{modelValue:v.value,"onUpdate:modelValue":e[1]||(e[1]=a=>v.value=a),class:"_formBlock",datalist:b.value},{label:l(()=>[s(i(m(t).ts.category),1)]),_:1},8,["modelValue","datalist"]),c(V,{modelValue:f.value,"onUpdate:modelValue":e[2]||(e[2]=a=>f.value=a),class:"_formBlock"},{label:l(()=>[s(i(m(t).ts.tags),1)]),caption:l(()=>[s(i(m(t).ts.setMultipleBySeparatingWithSpace),1)]),_:1},8,["modelValue"]),c(I,{modelValue:n.value,"onUpdate:modelValue":e[3]||(e[3]=a=>n.value=a),class:"_formBlock"},{label:l(()=>[s(i(m(t).ts.license),1)]),_:1},8,["modelValue"]),c(M,{danger:"",onClick:e[4]||(e[4]=a=>S())},{default:l(()=>[K,s(" "+i(m(t).ts.delete),1)]),_:1})])])]),_:1},512))}}),F=D(O,[["__scopeId","data-v-06b7b099"]]);export{F as default};
