import{_ as a}from"./index-jVSJWteM.chunk.mjs";import{A as r}from"./AvatarWrapper-C-XXcH-V.chunk.mjs";import{d as o}from"./MediaHandler.provider-i78Kd03y.chunk.mjs";import{n as i}from"./_plugin-vue2_normalizer-Dv5JCS6y.chunk.mjs";import"./vue.runtime.esm-BrouV0Mr.chunk.mjs";import"./modulepreload-polyfill-DCUwxYMh.chunk.mjs";import"./emoji-picker-Coav-X6q.chunk.mjs";import"./public-C42pM6E9.chunk.mjs";import"./index-CJ7wDv5l.chunk.mjs";import"./logger-YW53u4Eu.chunk.mjs";import"./index-DtTpkYe5.chunk.mjs";const u={name:"GuestNameDialog",components:{AvatarWrapper:r},mixins:[o],props:{session:{type:Object,required:!0}},data(){return{guestName:"",guestNameBuffered:""}},computed:{avatarUrl(){const e=a("/avatar/guest/{user}/{size}",{user:this.guestNameBuffered,size:32});return window.location.protocol+"//"+window.location.host+e}},beforeMount(){this.guestName=this.$syncService.guestName,this.updateBufferedGuestName()},methods:{setGuestName(){const e=this.$syncService.guestName;this.$syncService.updateSession(this.guestName).then(()=>{localStorage.setItem("nick",this.guestName),this.updateBufferedGuestName()}).catch(t=>{this.guestName=e})},updateBufferedGuestName(){this.guestNameBuffered=this.guestName}}};var m=function(){var e=this,t=e._self._c;return t("form",{staticClass:"guest-name-dialog",attrs:{title:e.t("text","Enter your name so other people can see who is editing")},on:{submit:function(s){return s.preventDefault(),e.setGuestName()}}},[t("label",[t("AvatarWrapper",{attrs:{session:e.session,size:32}})],1),t("input",{directives:[{name:"model",rawName:"v-model",value:e.guestName,expression:"guestName"}],attrs:{type:"text","aria-label":e.t("text","Edit guest name"),placeholder:e.t("text","Guest")},domProps:{value:e.guestName},on:{input:function(s){s.target.composing||(e.guestName=s.target.value)}}}),t("input",{staticClass:"icon-confirm",attrs:{type:"submit","aria-label":e.t("text","Save guest name"),value:""}})])},n=[],p=i(u,m,n,!1,null,"b4bfe8cd");const G=p.exports;export{G as default};
