import{r as t,h as r,a}from"./p-a599f720.js";import{e as o,i}from"./p-9811c98c.js";import{S as e}from"./p-af705ed1.js";var s=function(t,r,a,o){var i,e=arguments.length,s=e<3?r:null===o?o=Object.getOwnPropertyDescriptor(r,a):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,r,a,o);else for(var c=t.length-1;c>=0;c--)(i=t[c])&&(s=(e<3?i(s):e>3?i(r,a,s):i(r,a))||s);return e>3&&s&&Object.defineProperty(r,a,s),s};const c=class{constructor(r){t(this,r),this.iconPack=o,this.t=i(),this.isScreenShare=!1,this.score=10,this.onMediaScoreUpdate=({kind:t,isScreenshare:r,score:a})=>{("video"===t||this.isScreenShare&&r)&&(this.score=a)}}connectedCallback(){this.participantChanged(this.participant)}participantChanged(t){t&&t.addListener("mediaScoreUpdate",this.onMediaScoreUpdate)}disconnectedCallback(){var t;null===(t=this.participant)||void 0===t||t.removeListener("mediaScoreUpdate",this.onMediaScoreUpdate)}render(){let t=Math.round(this.score/2),o="good";if(t>3)return null;switch(t<1&&(t=1),t){case 3:case 2:o="poor";break;case 1:o="poorest"}return r(a,null,r("rtk-icon",{icon:this.iconPack[`signal_${t}`],class:o}),r("rtk-icon",{icon:this.iconPack.signal_5,class:"bg-signal"}))}static get watchers(){return{participant:["participantChanged"]}}};s([e()],c.prototype,"meeting",void 0),s([e()],c.prototype,"iconPack",void 0),s([e()],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{position:relative;display:block;height:var(--rtk-space-7, 28px);width:var(--rtk-space-7, 28px)}rtk-icon{position:absolute;top:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);z-index:10;height:100%;width:100%;--tw-text-opacity:1;color:rgba(var(--rtk-colors-success, 98 165 4) / var(--tw-text-opacity))}rtk-icon.good{--tw-text-opacity:1;color:rgba(var(--rtk-colors-success, 98 165 4) / var(--tw-text-opacity))}rtk-icon.poor{--tw-text-opacity:1;color:rgba(var(--rtk-colors-warning, 255 205 7) / var(--tw-text-opacity))}rtk-icon.poorest{--tw-text-opacity:1;color:rgba(var(--rtk-colors-danger, 255 45 45) / var(--tw-text-opacity))}:host([size='md']){height:var(--rtk-space-6, 24px);width:var(--rtk-space-6, 24px)}:host([size='sm']){height:var(--rtk-space-5, 20px);width:var(--rtk-space-5, 20px)}.bg-signal{position:absolute;top:var(--rtk-space-0, 0px);right:var(--rtk-space-0, 0px);bottom:var(--rtk-space-0, 0px);left:var(--rtk-space-0, 0px);z-index:0;color:rgb(var(--rtk-colors-text-600, 255 255 255 / 0.52))}";export{c as rtk_network_indicator}