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