import{r as t,d as i,h as s,a as o}from"./p-a599f720.js";import{e,i as a,L as r}from"./p-9811c98c.js";import{S as n}from"./p-af705ed1.js";var l=function(t,i,s,o){var e,a=arguments.length,r=a<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,s):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,i,s,o);else for(var n=t.length-1;n>=0;n--)(e=t[n])&&(r=(a<3?e(r):a>3?e(i,s,r):e(i,s))||r);return a>3&&r&&Object.defineProperty(i,s,r),r};const c=class{constructor(s){t(this,s),this.stateUpdate=i(this,"rtkStateUpdate",7),this.variant="button",this.iconPack=e,this.t=a(),this.canToggle=!1,this.permissionsUpdateListener=()=>{this.canToggle=r(this.meeting)},this.breakoutRoomToggle=()=>{var t,i;this.stateUpdate.emit({activeBreakoutRoomsManager:{active:!(null===(i=null===(t=this.states)||void 0===t?void 0:t.activeBreakoutRoomsManager)||void 0===i?void 0:i.active),mode:this.meeting.connectedMeetings.isActive?"view":"create"}})}}connectedCallback(){this.meetingChanged(this.meeting)}disconnectedCallback(){var t,i,s;null===(s=null===(i=null===(t=this.meeting)||void 0===t?void 0:t.self)||void 0===i?void 0:i.permissions)||void 0===s||s.off("permissionsUpdate",this.permissionsUpdateListener)}meetingChanged(t){t&&(this.canToggle=r(t),t.self.permissions.on("permissionsUpdate",this.permissionsUpdateListener))}render(){return this.meeting?this.canToggle?s(o,{title:this.t("breakout_rooms")},s("rtk-controlbar-button",{part:"controlbar-button",size:this.size,iconPack:this.iconPack,onClick:this.breakoutRoomToggle,icon:this.iconPack.breakout_rooms,label:this.t("breakout_rooms"),variant:this.variant})):void 0:null}static get watchers(){return{meeting:["meetingChanged"]}}};l([n()],c.prototype,"meeting",void 0),l([n()],c.prototype,"states",void 0),l([n()],c.prototype,"iconPack",void 0),l([n()],c.prototype,"t",void 0),c.style=":host{line-height:initial;font-family:var(--rtk-font-family, sans-serif);font-feature-settings:normal;font-variation-settings:normal}p{margin:var(--rtk-space-0, 0px);padding:var(--rtk-space-0, 0px)}:host{display:block}";export{c as rtk_breakout_rooms_toggle}