"use strict";const e=require("../../../../common/vendor.js");require("../../../adapter-vue.js");const t=require("../../../../common/assets.js"),u=require("../../common/Toast/index.js"),r=require("../../../utils/env.js"),n=require("../../common/Toast/type.js");Math||a();const a=()=>"../../common/Icon.js",o=e.defineComponent({__name:"manage-name",props:{data:{type:Object,default:()=>({})},isAuthor:{type:Boolean,default:!1}},emits:["update"],setup(a,{emit:o}){const s=a,f=e.ref({}),i=e.ref(""),l=e.ref(!1),m=e.ref(null);e.watchEffect((()=>{f.value=s.data}));const p=o,c=()=>{i.value?(i.value!==f.value.name&&(p("update",{key:"name",value:i.value}),f.value.name=i.value,i.value="",u.Toast({message:e.Wt.t("TUIGroup.群名称修改成功"),type:n.TOAST_TYPE.SUCCESS})),v()):u.Toast({message:e.Wt.t("TUIGroup.群名称不能为空"),type:n.TOAST_TYPE.ERROR})},v=()=>{s.isAuthor&&(l.value=!l.value),l.value&&(i.value=f.value.name)};return e.watch((()=>l.value),(t=>{t&&e.nextTick$1((()=>{var e;null==(e=m.value)||e.focus()}))})),(u,n)=>e.e({a:e.t(e.unref(e.Wt).t("TUIGroup.群名称")),b:e.unref(l)},e.unref(l)?e.e({c:!e.unref(r.isPC)},e.unref(r.isPC)?{}:{d:e.t(e.unref(e.Wt).t("TUIGroup.修改群聊名称")),e:e.t(e.unref(e.Wt).t("TUIGroup.修改群聊名称后，将在群内通知其他成员")),f:e.t(e.unref(e.Wt).t("关闭")),g:e.o$1(v)},{h:e.unref(l)},e.unref(l)?{i:e.o$1(c),j:e.unref(i),k:e.o$1((t=>e.isRef(i)?i.value=t.detail.value:null))}:{},{l:!e.unref(r.isPC)},e.unref(r.isPC)?{}:{m:e.t(e.unref(e.Wt).t("TUIGroup.仅限中文、字母、数字和下划线，2-20个字"))},{n:!e.unref(r.isPC)},e.unref(r.isPC)?{}:{o:e.t(e.unref(e.Wt).t("确认")),p:e.o$1(c)},{q:e.unref(r.isMobile)?1:""}):{},{r:!e.unref(l)||!e.unref(r.isPC)},e.unref(l)&&e.unref(r.isPC)?{}:e.e({s:e.t(e.unref(f).name),t:a.isAuthor},a.isAuthor?{v:e.p({file:e.unref(t.editIcon),width:"14px",height:"14px"})}:{},{w:e.o$1(v)}))}}),s=e._export_sfc(o,[["__scopeId","data-v-5f0c4190"]]);wx.createComponent(s);
