iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
64 lines • 34 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[17493],{380:function(t,e,a){a.a(t,async function(t,o){try{a.d(e,{D:function(){return d},P:function(){return c}});a(74423);var r=a(74487),i=a(27734),n=a(46927),s=a(96029),l=t([r]);r=(l.then?(await l)():l)[0];const c=t=>t.first_weekday===n.zt.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(t.language).weekInfo.firstDay%7:(0,i.S)(t.language)%7:s.Z.includes(t.first_weekday)?s.Z.indexOf(t.first_weekday):1,d=t=>{const e=c(t);return s.Z[e]};o()}catch(c){o(c)}})},98975:function(t,e,a){a.a(t,async function(t,o){try{a.d(e,{K:function(){return c}});var r=a(74487),i=a(22786),n=a(63927),s=t([r,n]);[r,n]=s.then?(await s)():s;const l=(0,i.A)(t=>new Intl.RelativeTimeFormat(t.language,{numeric:"auto"})),c=(t,e,a,o=!0)=>{const r=(0,n.x)(t,a,e);return o?l(e).format(r.value,r.unit):Intl.NumberFormat(e.language,{style:"unit",unit:r.unit,unitDisplay:"long"}).format(Math.abs(r.value))};o()}catch(l){o(l)}})},96029:function(t,e,a){a.d(e,{Tq:function(){return n},Z:function(){return r},ZV:function(){return o},sj:function(){return i}});const o=["sun","mon","tue","wed","thu","fri","sat"],r=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],i={0:"sun",1:"mon",2:"tue",3:"wed",4:"thu",5:"fri",6:"sat"},n={sun:"sunday",mon:"monday",tue:"tuesday",wed:"wednesday",thu:"thursday",fri:"friday",sat:"saturday"}},93905:function(t,e,a){a.d(e,{I:function(){return i}});a(16280),a(44114),a(18111),a(7588),a(69112),a(33110);class o{addFromStorage(t){if(!this._storage[t]){const e=this.storage.getItem(t);e&&(this._storage[t]=JSON.parse(e))}}subscribeChanges(t,e){return this._listeners[t]?this._listeners[t].push(e):this._listeners[t]=[e],()=>{this.unsubscribeChanges(t,e)}}unsubscribeChanges(t,e){if(!(t in this._listeners))return;const a=this._listeners[t].indexOf(e);-1!==a&&this._listeners[t].splice(a,1)}hasKey(t){return t in this._storage}getValue(t){return this._storage[t]}setValue(t,e){const a=this._storage[t];this._storage[t]=e;try{void 0===e?this.storage.removeItem(t):this.storage.setItem(t,JSON.stringify(e))}catch(o){}finally{this._listeners[t]&&this._listeners[t].forEach(t=>t(a,e))}}constructor(t=window.localStorage){this._storage={},this._listeners={},this.storage=t,this.storage===window.localStorage&&window.addEventListener("storage",t=>{t.key&&this.hasKey(t.key)&&(this._storage[t.key]=t.newValue?JSON.parse(t.newValue):t.newValue,this._listeners[t.key]&&this._listeners[t.key].forEach(e=>e(t.oldValue?JSON.parse(t.oldValue):t.oldValue,this._storage[t.key])))})}}const r={};function i(t){return(e,a)=>{if("object"==typeof a)throw new Error("This decorator does not support this compilation type.");const i=t.storage||"localStorage";let n;i&&i in r?n=r[i]:(n=new o(window[i]),r[i]=n);const s=t.key||String(a);n.addFromStorage(s);const l=!1!==t.subscribe?t=>n.subscribeChanges(s,(e,o)=>{t.requestUpdate(a,e)}):void 0,c=()=>n.hasKey(s)?t.deserializer?t.deserializer(n.getValue(s)):n.getValue(s):void 0,d=(e,o)=>{let r;t.state&&(r=c()),n.setValue(s,t.serializer?t.serializer(o):o),t.state&&e.requestUpdate(a,r)},h=e.performUpdate;if(e.performUpdate=function(){this.__initialized=!0,h.call(this)},t.subscribe){const t=e.connectedCallback,a=e.disconnectedCallback;e.connectedCallback=function(){t.call(this);const e=this;e.__unbsubLocalStorage||(e.__unbsubLocalStorage=null==l?void 0:l(this))},e.disconnectedCallback=function(){var t;a.call(this);const e=this;null===(t=e.__unbsubLocalStorage)||void 0===t||t.call(e),e.__unbsubLocalStorage=void 0}}const u=Object.getOwnPropertyDescriptor(e,a);let p;if(void 0===u)p={get(){return c()},set(t){(this.__initialized||void 0===c())&&d(this,t)},configurable:!0,enumerable:!0};else{const t=u.set;p=Object.assign(Object.assign({},u),{},{get(){return c()},set(e){(this.__initialized||void 0===c())&&d(this,e),null==t||t.call(this,e)}})}Object.defineProperty(e,a,p)}}},68348:function(t,e,a){a.d(e,{u:function(){return o}});a(18111),a(13579);const o=t=>{var e,a;if(t.some(t=>"tagName"in t&&("HA-MENU"===t.tagName||"HA-CODE-EDITOR"===t.tagName)))return!1;const o=t[0];if("TEXTAREA"===o.tagName||"HA-SELECT"===(null===(e=o.parentElement)||void 0===e?void 0:e.tagName)||"HA-DROPDOWN"===(null===(a=o.parentElement)||void 0===a?void 0:a.tagName))return!1;if("INPUT"!==o.tagName)return!0;switch(o.type){case"button":case"checkbox":case"hidden":case"radio":case"range":return!0;default:return!1}}},76830:function(t,e,a){a.d(e,{d:function(){return o}});a(18111),a(20116);const o=(t,e=!0)=>{if(t.defaultPrevented||0!==t.button||t.metaKey||t.ctrlKey||t.shiftKey)return;const a=t.composedPath().find(t=>"A"===t.tagName);if(!a||a.target||a.hasAttribute("download")||"external"===a.getAttribute("rel"))return;let o=a.href;if(!o||-1!==o.indexOf("mailto:"))return;const r=window.location,i=r.origin||r.protocol+"//"+r.host;return o.startsWith(i)&&(o=o.slice(i.length),"#"!==o)?(e&&t.preventDefault(),o):void 0}},52943:function(t,e,a){a.d(e,{Z:function(){return o}});const o=t=>t.charAt(0).toUpperCase()+t.slice(1)},63927:function(t,e,a){a.a(t,async function(t,o){try{a.d(e,{x:function(){return p}});var r=a(6946),i=a(52640),n=a(38684),s=a(380),l=t([s]);s=(l.then?(await l)():l)[0];const d=1e3,h=60,u=60*h;function p(t,e=Date.now(),a,o={}){const l=Object.assign(Object.assign({},v),o||{}),c=(+t-+e)/d;if(Math.abs(c)<l.second)return{value:Math.round(c),unit:"second"};const p=c/h;if(Math.abs(p)<l.minute)return{value:Math.round(p),unit:"minute"};const g=c/u;if(Math.abs(g)<l.hour)return{value:Math.round(g),unit:"hour"};const b=new Date(t),f=new Date(e);b.setHours(0,0,0,0),f.setHours(0,0,0,0);const m=(0,r.c)(b,f);if(0===m)return{value:Math.round(g),unit:"hour"};if(Math.abs(m)<l.day)return{value:m,unit:"day"};const y=(0,s.P)(a),w=(0,i.k)(b,{weekStartsOn:y}),_=(0,i.k)(f,{weekStartsOn:y}),C=(0,n.I)(w,_);if(0===C)return{value:m,unit:"day"};if(Math.abs(C)<l.week)return{value:C,unit:"week"};const k=b.getFullYear()-f.getFullYear(),x=12*k+b.getMonth()-f.getMonth();return 0===x?{value:C,unit:"week"}:Math.abs(x)<l.month||0===k?{value:x,unit:"month"}:{value:Math.round(k),unit:"year"}}const v={second:59,minute:59,hour:22,day:5,week:4,month:11};o()}catch(c){o(c)}})},64481:function(t,e,a){a.d(e,{D:function(){return r},J:function(){return n}});a(16280),a(3362),a(55815),a(64979),a(79739);let o=!1;try{o="true"===window.localStorage.getItem("disableViewTransition")}catch(s){}const r=t=>{o=t},i=t=>{if(!(t=>(t instanceof DOMException||t instanceof Error)&&"AbortError"===t.name)(t))throw t},n=t=>{if(!document.startViewTransition||o)return t(!1),Promise.resolve();let e=!1;try{const a=document.startViewTransition(()=>{e=!0,t(!0)});return a.ready.catch(i),a.finished.catch(i)}catch(a){return console.warn("View transition failed, falling back to direct execution.",a),e?Promise.reject(a):(t(!1),Promise.resolve())}}},34296:function(t,e,a){a(62953);var o=a(40445),r=a(96229),i=a(26069),n=a(91735),s=a(42034),l=a(5124),c=a(67576);let d,h,u,p,v=t=>t;class g extends r.k{renderOutline(){return this.filled?(0,l.qy)(d||(d=v`<span class="filled"></span>`)):super.renderOutline()}getContainerClasses(){return Object.assign(Object.assign({},super.getContainerClasses()),{},{active:this.active})}renderPrimaryContent(){return(0,l.qy)(h||(h=v` <span class="leading icon" aria-hidden="true"> ${0} </span> <span class="label">${0}</span> <span class="touch"></span> <span class="trailing leading icon" aria-hidden="true"> ${0} </span> `),this.renderLeadingIcon(),this.label,this.renderTrailingIcon())}renderTrailingIcon(){return(0,l.qy)(u||(u=v`<slot name="trailing-icon"></slot>`))}constructor(...t){super(...t),this.filled=!1,this.active=!1}}g.styles=[n.R,s.R,i.R,(0,l.AH)(p||(p=v`:host{--md-sys-color-primary:var(--primary-text-color);--md-sys-color-on-surface:var(--primary-text-color);--md-assist-chip-container-shape:var(
--ha-assist-chip-container-shape,
16px
);--md-assist-chip-outline-color:var(--outline-color);--md-assist-chip-label-text-weight:400}.filled{display:flex;pointer-events:none;border-radius:inherit;inset:0;position:absolute;background-color:var(--ha-assist-chip-filled-container-color)}::slotted([slot=icon]),::slotted([slot=trailing-icon]){display:flex;--mdc-icon-size:var(--md-input-chip-icon-size, 18px);font-size:var(--_label-text-size)!important}.trailing.icon ::slotted(*),.trailing.icon svg{margin-inline-end:unset;margin-inline-start:var(--_icon-label-space)}::before{background:var(--ha-assist-chip-container-color,transparent);opacity:var(--ha-assist-chip-container-opacity, 1)}:where(.active)::before{background:var(--ha-assist-chip-active-container-color);opacity:var(--ha-assist-chip-active-container-opacity)}.label{font-family:var(--ha-font-family-body)}`))],(0,o.Cg)([(0,c.MZ)({type:Boolean,reflect:!0})],g.prototype,"filled",void 0),(0,o.Cg)([(0,c.MZ)({type:Boolean})],g.prototype,"active",void 0),g=(0,o.Cg)([(0,c.EM)("ha-assist-chip")],g)},13513:function(t,e,a){a(62953);var o=a(40445),r=a(5124),i=a(67576),n=a(36240);let s,l,c=t=>t;class d extends r.WF{render(){const t=(0,n.gN)((0,n.NN)((0,n.S8)(this.value,this.min,this.max),this.min,this.max));return(0,r.JW)(s||(s=c` <svg> <g> <rect/> <rect width="${0}%"/> </g> </svg> `),t)}constructor(...t){super(...t),this.min=0,this.max=100}}d.styles=(0,r.AH)(l||(l=c`rect{height:100%}rect:first-child{width:100%;fill:var(--ha-bar-background-color,var(--secondary-background-color))}rect:last-child{fill:var(--ha-bar-primary-color,var(--primary-color))}svg{border-radius:var(--ha-bar-border-radius,var(--ha-border-radius-sm));height:12px;width:100%}`)),(0,o.Cg)([(0,i.MZ)({type:Number})],d.prototype,"min",void 0),(0,o.Cg)([(0,i.MZ)({type:Number})],d.prototype,"max",void 0),(0,o.Cg)([(0,i.MZ)({type:Number})],d.prototype,"value",void 0),d=(0,o.Cg)([(0,i.EM)("ha-bar")],d)},9503:function(t,e,a){var o=a(40445),r=a(97577),i=a(5124),n=a(67576);let s,l=t=>t;class c extends r.A{get value(){var t;return null!==(t=this._value)&&void 0!==t?t:null}set value(t){this._value=t}static get styles(){return[r.A.styles,(0,i.AH)(s||(s=l`:host{--wa-form-control-toggle-size:var(--ha-checkbox-size, 20px);--wa-form-control-border-color:var(
--ha-checkbox-border-color,
var(--ha-color-border-neutral-normal)
);--wa-form-control-background-color:var(
--ha-checkbox-background-color,
var(--wa-form-control-background-color)
);--checked-icon-color:var(
--ha-checkbox-checked-icon-color,
var(--wa-color-brand-on-loud)
);--wa-form-control-activated-color:var(
--ha-checkbox-checked-background-color,
var(--ha-color-fill-primary-loud-resting)
);-webkit-tap-highlight-color:transparent;--checked-icon-scale:var(--ha-checkbox-checked-icon-scale, 0.9);--wa-form-control-required-content:var(
--ha-checkbox-required-marker,
var(--ha-input-required-marker, "*")
);--wa-form-control-required-content-offset:var(
--ha-checkbox-required-marker-offset,
0.1rem
)}[part~=base]{align-items:center;gap:var(--ha-space-2)}[part~=control]{border-radius:var(--ha-checkbox-border-radius,var(--ha-border-radius-sm));border-width:var(--ha-checkbox-border-width,var(--ha-border-width-md));margin-inline-end:0}[part~=label]{line-height:1}#hint{font-size:var(--ha-font-size-xs);color:var(--ha-color-text-secondary)}label:has(input:not(:disabled)):hover{--wa-form-control-border-color:var(
--ha-checkbox-border-color-hover,
var(--ha-checkbox-border-color, var(--ha-color-border-neutral-loud))
)}label:has(input:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-background-color-hover,var(--ha-color-form-background-hover))}label:has(input:checked:not(:disabled)):hover [part~=control],label:has(input:indeterminate:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover));border-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover))}`))]}}c=(0,o.Cg)([(0,n.EM)("ha-checkbox")],c)},70947:function(t,e,a){a(62953);var o=a(40445),r=a(50759),i=(a(38625),a(5124)),n=a(67576);a(67094);let s,l,c=t=>t;class d extends r.A{renderCheckboxIcon(){return(0,i.qy)(s||(s=c` <ha-svg-icon id="check" part="checkmark" .path="${0}"></ha-svg-icon> `),this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z":"M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3M19,5V19H5V5H19Z")}static get styles(){return[r.A.styles,(0,i.AH)(l||(l=c`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`))]}constructor(...t){super(...t),this.selected=!1}}(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],d.prototype,"selected",void 0),d=(0,o.Cg)([(0,n.EM)("ha-dropdown-item")],d)},29823:function(t,e,a){a.a(t,async function(t,e){try{a(3362),a(62953);var o=a(40445),r=a(52254),i=a(5124),n=a(67576),s=t([r]);r=(s.then?(await s)():s)[0];let l,c=t=>t;class d extends r.A{get anchorElement(){var t;return null===(t=this.popup)||void 0===t?void 0:t.anchor}set anchorElement(t){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=t)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!0)}async hideMenu(){const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!1),await super.hideMenu()}static get styles(){return[r.A.styles,(0,i.AH)(l||(l=c`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var(
--card-background-color,
var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)),
)}#menu{padding:var(--ha-space-1)}wa-popup::part(popup){z-index:200}`))]}constructor(...t){super(...t),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],d.prototype,"dropdownTag",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],d.prototype,"dropdownItemTag",void 0),d=(0,o.Cg)([(0,n.EM)("ha-dropdown")],d),e()}catch(l){e(l)}})},98:function(t,e,a){var o=a(40445),r=a(5124),i=a(67576),n=a(6412),s=a(36240);a(13513),a(8034);let l,c,d=t=>t;class h extends r.WF{render(){var t;const e=(0,s.gN)(this.value);return(0,r.qy)(l||(l=d` <ha-settings-row> <span slot="heading"> ${0} </span> <div slot="description" .title="${0}"> <span class="value"> <div>${0} %</div> </span> <ha-bar class="${0}" .value="${0}"></ha-bar> </div> </ha-settings-row> `),this.heading,null!==(t=this.tooltip)&&void 0!==t?t:"",e,(0,n.H)({"target-warning":e>50,"target-critical":e>85}),this.value)}}h.styles=(0,r.AH)(c||(c=d`ha-settings-row{padding:0;height:54px;width:100%}ha-settings-row>div[slot=description]{white-space:normal;color:var(--secondary-text-color);display:flex;justify-content:space-between}ha-bar{--ha-bar-primary-color:var(--metric-bar-ok-color, var(--success-color))}.target-warning{--ha-bar-primary-color:var(
--metric-bar-warning-color,
var(--warning-color)
)}.target-critical{--ha-bar-primary-color:var(
--metric-bar-critical-color,
var(--error-color)
)}.value{width:48px;padding-right:4px;padding-inline-end:4px;padding-inline-start:initial;flex-shrink:0}.value>div{direction:ltr;text-align:var(--float-start)}`)),(0,o.Cg)([(0,i.MZ)({type:Number})],h.prototype,"value",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],h.prototype,"heading",void 0),(0,o.Cg)([(0,i.MZ)({type:String})],h.prototype,"tooltip",void 0),h=(0,o.Cg)([(0,i.EM)("ha-metric")],h)},36158:function(t,e,a){a.a(t,async function(t,e){try{a(62953);var o=a(40445),r=a(25625),i=a(5124),n=a(67576),s=a(98975),l=a(52943),c=t([s]);s=(c.then?(await c)():c)[0];class d extends i.mN{disconnectedCallback(){super.disconnectedCallback(),this._clearInterval()}connectedCallback(){super.connectedCallback(),this.datetime&&this._startInterval()}createRenderRoot(){return this}firstUpdated(t){super.firstUpdated(t),this._updateRelative()}update(t){super.update(t),this._updateRelative()}_clearInterval(){this._interval&&(window.clearInterval(this._interval),this._interval=void 0)}_startInterval(){this._clearInterval(),this._interval=window.setInterval(()=>this._updateRelative(),6e4)}_updateRelative(){if(this.datetime){const t="string"==typeof this.datetime?(0,r.H)(this.datetime):this.datetime,e=(0,s.K)(t,this.hass.locale);this.innerHTML=this.capitalize?(0,l.Z)(e):e}else this.innerHTML=this.hass.localize("ui.components.relative_time.never")}constructor(...t){super(...t),this.capitalize=!1}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],d.prototype,"datetime",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],d.prototype,"capitalize",void 0),d=(0,o.Cg)([(0,n.EM)("ha-relative-time")],d),e()}catch(d){e(d)}})},54276:function(t,e,a){a(62953);var o=a(40445),r=a(76482),i=a(91382),n=a(96245),s=a(5124),l=a(67576);let c;class d extends i.n{attach(t){super.attach(t),this.attachableTouchController.attach(t)}disconnectedCallback(){super.disconnectedCallback(),this.hovered=!1,this.pressed=!1}detach(){super.detach(),this.attachableTouchController.detach()}_onTouchControlChange(t,e){null==t||t.removeEventListener("touchend",this._handleTouchEnd),null==e||e.addEventListener("touchend",this._handleTouchEnd)}constructor(...t){super(...t),this.attachableTouchController=new r.i(this,this._onTouchControlChange.bind(this)),this._handleTouchEnd=()=>{this.disabled||super.endPressAnimation()}}}d.styles=[n.R,(0,s.AH)(c||(c=(t=>t)`:host{--md-ripple-hover-opacity:var(--ha-ripple-hover-opacity, 0.08);--md-ripple-pressed-opacity:var(--ha-ripple-pressed-opacity, 0.12);--md-ripple-hover-color:var(
--ha-ripple-hover-color,
var(--ha-ripple-color, var(--secondary-text-color))
);--md-ripple-pressed-color:var(
--ha-ripple-pressed-color,
var(--ha-ripple-color, var(--secondary-text-color))
)}`))],d=(0,o.Cg)([(0,l.EM)("ha-ripple")],d)},8034:function(t,e,a){a(27495),a(62953);var o=a(40445),r=a(92070),i=a(5124),n=a(67576);let s,l,c,d=t=>t;class h extends i.WF{render(){const t=this._hasSlotController.test("description");return(0,i.qy)(s||(s=d` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" part="heading" ?two-line="${0}" ?three-line="${0}"> <slot name="heading"></slot> ${0} </div> </div> <div class="content"> <slot></slot> </div> `),!this.threeLine&&t,this.threeLine,t?(0,i.qy)(l||(l=d`<span class="secondary"><slot name="description"></slot></span>`)):i.s6)}constructor(...t){super(...t),this.narrow=!1,this.slim=!1,this.threeLine=!1,this.wrapHeading=!1,this.empty=!1,this._hasSlotController=new r.X(this,"description")}}h.styles=(0,i.AH)(c||(c=d`:host{display:flex;padding:0 var(--ha-space-4);align-content:normal;align-self:auto;align-items:center}.body{padding-top:var(--settings-row-body-padding-top,var(--ha-space-2));padding-bottom:var(--settings-row-body-padding-bottom,var(--ha-space-2));padding-left:0;padding-inline-start:0;padding-right:var(--ha-space-4);padding-inline-end:var(--ha-space-4);overflow:hidden;display:var(--layout-vertical_-_display,flex);flex-direction:var(--layout-vertical_-_flex-direction,column);justify-content:var(--layout-center-justified_-_justify-content,center);flex:var(--layout-flex_-_flex,1);flex-basis:var(--layout-flex_-_flex-basis,0.000000001px)}.body[three-line]{min-height:88px}:host(:not([wrap-heading])) body>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.body>.secondary{display:block;padding-top:var(--ha-space-1);font-family:var(
--mdc-typography-body2-font-family,
var(--mdc-typography-font-family, var(--ha-font-family-body))
);font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-weight:var(--mdc-typography-body2-font-weight,var(--ha-font-weight-normal));line-height:normal;color:var(--secondary-text-color)}.body[two-line]{min-height:calc(72px - 16px);flex:1}.content{display:contents}:host(:not([narrow])) .content{display:var(--settings-row-content-display,flex);justify-content:flex-end;flex:1;min-width:0;padding:var(--settings-row-content-padding-block,var(--ha-space-4)) 0}:host([empty]) .content{display:none}.content ::slotted(*){width:var(--settings-row-content-width)}:host([narrow]){align-items:normal;flex-direction:column;border-top:1px solid var(--divider-color);padding-bottom:var(--ha-space-2)}::slotted(ha-switch){padding:var(--settings-row-switch-padding-block,var(--ha-space-4)) 0}.secondary{white-space:normal}.prefix-wrap{flex:var(--settings-row-prefix-flex,1);display:var(--settings-row-prefix-display)}:host([narrow]) .prefix-wrap{display:flex;align-items:center}:host([slim]),:host([slim]) .content,:host([slim]) ::slotted(ha-switch){padding:0}:host([slim]) .body{min-height:0}`)),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],h.prototype,"narrow",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],h.prototype,"slim",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,attribute:"three-line"})],h.prototype,"threeLine",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,attribute:"wrap-heading",reflect:!0})],h.prototype,"wrapHeading",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],h.prototype,"empty",void 0),h=(0,o.Cg)([(0,n.EM)("ha-settings-row")],h)},34127:function(t,e,a){a.a(t,async function(t,e){try{a(62953);var o=a(40445),r=a(52630),i=a(5124),n=a(67576),s=t([r]);r=(s.then?(await s)():s)[0];let l,c=t=>t;class d extends r.A{static get styles(){return[r.A.styles,(0,i.AH)(l||(l=c`:host{--wa-tooltip-background-color:var(
--ha-tooltip-background-color,
var(--ha-color-surface-default)
);--wa-tooltip-content-color:var(
--ha-tooltip-text-color,
var(--primary-text-color)
);--wa-tooltip-font-family:var(
--ha-tooltip-font-family,
var(--ha-font-family-body)
);--wa-tooltip-font-size:var(
--ha-tooltip-font-size,
var(--ha-font-size-m)
);--wa-tooltip-font-weight:var(
--ha-tooltip-font-weight,
var(--ha-font-weight-medium)
);--wa-tooltip-line-height:var(
--ha-tooltip-line-height,
var(--ha-line-height-condensed)
);--wa-tooltip-padding:var(--ha-tooltip-padding, var(--ha-space-2));--wa-tooltip-border-radius:var(
--ha-tooltip-border-radius,
var(--ha-border-radius-md)
);--wa-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 0px);--wa-tooltip-border-width:0px;--wa-z-index-tooltip:1000}.tooltip::part(popup){animation-duration:var(--ha-tooltip-animation-duration, 0)}.body{box-shadow:var(--ha-tooltip-box-shadow,var(--ha-box-shadow-m))}`))]}constructor(...t){super(...t),this.showDelay=350,this.hideDelay=150}}(0,o.Cg)([(0,n.MZ)({attribute:"show-delay",type:Number})],d.prototype,"showDelay",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"hide-delay",type:Number})],d.prototype,"hideDelay",void 0),d=(0,o.Cg)([(0,n.EM)("ha-tooltip")],d),e()}catch(l){e(l)}})},36866:function(t,e,a){a.a(t,async function(t,e){try{a(62953);var o=a(40445),r=a(5124),i=a(67576),n=a(91485),s=t([n]);n=(s.then?(await s)():s)[0];let l,c,d=t=>t;const h="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z";class u extends n.U{willUpdate(t){var e,a;(super.willUpdate(t),this.label||this.placeholder||this.hasUpdated&&!t.has("_i18n"))||(this.placeholder=(null===(e=this.i18n)||void 0===e||null===(a=e.localize)||void 0===a?void 0:a.call(e,"ui.common.search"))||"Search")}renderStartDefault(){return(0,r.qy)(l||(l=d`<ha-svg-icon slot="start" .path="${0}"></ha-svg-icon>`),h)}constructor(){super(),this.withClear=!0,this.autocomplete=this.autocomplete||"off"}}u.styles=[...n.U.styles,(0,r.AH)(c||(c=d`:host([appearance=outlined]) wa-input.no-label::part(base){height:40px}`))],u=(0,o.Cg)([(0,i.EM)("ha-input-search")],u),e()}catch(l){e(l)}})},59992:function(t,e,a){a.a(t,async function(t,o){try{a.d(e,{V:function(){return v}});a(62953);var r=a(40445),i=a(88696),n=a(5124),s=a(6412),l=a(67576),c=t([i]);i=(c.then?(await c)():c)[0];let d,h,u=t=>t;const p=t=>void 0===t?[]:Array.isArray(t)?t:[t],v=t=>{class e extends t{get scrollableElement(){return e.DEFAULT_SCROLLABLE_ELEMENT}firstUpdated(t){var e;null===(e=super.firstUpdated)||void 0===e||e.call(this,t),this.scrollableElement&&this._updateScrollableState(this.scrollableElement),this._attachScrollableElement()}updated(t){var e;null===(e=super.updated)||void 0===e||e.call(this,t),this._attachScrollableElement()}disconnectedCallback(){this._detachScrollableElement(),this._contentScrolled=!1,this._contentScrollable=!1,super.disconnectedCallback()}renderScrollableFades(t=!1){return(0,n.qy)(d||(d=u` <div class="${0}"></div> <div class="${0}"></div> `),(0,s.H)({"fade-top":!0,rounded:t,visible:this._contentScrolled}),(0,s.H)({"fade-bottom":!0,rounded:t,visible:this._contentScrollable}))}static get styles(){var t;const e=Object.getPrototypeOf(this);return[...p(null!==(t=null==e?void 0:e.styles)&&void 0!==t?t:[]),(0,n.AH)(h||(h=u`.fade-bottom,.fade-top{position:absolute;left:0;right:0;height:var(--ha-space-2);pointer-events:none;transition:opacity 180ms ease-in-out;border-radius:var(--ha-border-radius-square);opacity:0;background:linear-gradient(to bottom,var(--ha-color-shadow-scrollable-fade),transparent)}.fade-top{top:0}.fade-bottom{bottom:0;transform:rotate(180deg)}.fade-bottom.visible,.fade-top.visible{opacity:1}.fade-bottom.rounded,.fade-top.rounded{border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}.fade-top.rounded{border-top-left-radius:var(--ha-border-radius-square);border-top-right-radius:var(--ha-border-radius-square)}.fade-bottom.rounded{border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square)}`))]}_attachScrollableElement(){const t=this.scrollableElement;t!==this._scrollTarget&&(this._detachScrollableElement(),t&&(this._scrollTarget=t,t.addEventListener("scroll",this._onScroll,{passive:!0}),this._resize.observe(t),this._updateScrollableState(t)))}_detachScrollableElement(){var t,e;this._scrollTarget&&(this._scrollTarget.removeEventListener("scroll",this._onScroll),null===(t=(e=this._resize).unobserve)||void 0===t||t.call(e,this._scrollTarget),this._scrollTarget=void 0)}_updateScrollableState(t){const e=parseFloat(getComputedStyle(t).getPropertyValue("--safe-area-inset-bottom"))||0,{scrollHeight:a=0,clientHeight:o=0,scrollTop:r=0}=t;this._contentScrollable=a-o>r+e+this.scrollFadeSafeAreaPadding}constructor(...t){super(...t),this._contentScrolled=!1,this._contentScrollable=!1,this._onScroll=t=>{var e;const a=t.currentTarget;this._contentScrolled=(null!==(e=a.scrollTop)&&void 0!==e?e:0)>this.scrollFadeThreshold,this._updateScrollableState(a)},this._resize=new i.P(this,{target:null,callback:t=>{var e;const a=null===(e=t[0])||void 0===e?void 0:e.target;a&&this._updateScrollableState(a)}}),this.scrollFadeSafeAreaPadding=4,this.scrollFadeThreshold=4}}return e.DEFAULT_SCROLLABLE_ELEMENT=null,(0,r.Cg)([(0,l.wk)()],e.prototype,"_contentScrolled",void 0),(0,r.Cg)([(0,l.wk)()],e.prototype,"_contentScrollable",void 0),e};o()}catch(d){o(d)}})},10066:function(t,e,a){a.a(t,async function(t,o){try{a.r(e),a.d(e,{BluetoothConnectionMonitorPanel:function(){return y}});a(44114),a(18111),a(22489),a(20116),a(61701),a(53921),a(3362),a(62953);var r=a(40445),i=a(5124),n=a(67576),s=a(22786),l=a(93905),c=a(6030),d=a(26300),h=(a(98),a(36158)),u=a(21030),p=a(72553),v=a(14503),g=t([d,h,p]);[d,h,p]=g.then?(await g)():g;let b,f,m=t=>t;class y extends i.WF{connectedCallback(){if(super.connectedCallback(),this.hass){this._unsubScanners=(0,u.mj)(this.hass.connection,t=>{this._scanners=t}),this._unsub_advertisements=(0,u.Ht)(this.hass.connection,t=>{for(const e of t)this._addressNames[e.address]=e.name});const t=Object.values(this.hass.devices).filter(t=>t.connections.find(t=>"bluetooth"===t[0]));this._sourceDevices=Object.fromEntries(t.map(t=>[t.connections.find(t=>"bluetooth"===t[0])[1],t])),this._subscribeBluetoothConnectionAllocations()}}async _subscribeBluetoothConnectionAllocations(){this._unsubConnectionAllocations||(this._unsubConnectionAllocations=await(0,u.gO)(this.hass.connection,t=>{for(const a of t)this._connectionAllocationData[a.source]=a;const e=[];for(const a of Object.values(this._connectionAllocationData))for(const t of a.allocated)e.push({address:t,source:a.source});this._data=e}))}disconnectedCallback(){super.disconnectedCallback(),this._unsub_advertisements&&(this._unsub_advertisements(),this._unsub_advertisements=void 0),this._unsubConnectionAllocations&&(this._unsubConnectionAllocations(),this._unsubConnectionAllocations=void 0),this._unsubScanners&&(this._unsubScanners(),this._unsubScanners=void 0)}willUpdate(t){if(super.willUpdate(t),this.hasUpdated)return;const e=(0,c.px)();e.source&&(this._filter=e.source)}render(){return(0,i.qy)(b||(b=m` <hass-tabs-subpage-data-table .hass="${0}" .narrow="${0}" .route="${0}" .tabs="${0}" back-path="/config/bluetooth/dashboard" .columns="${0}" .data="${0}" .initialGroupColumn="${0}" .initialCollapsedGroups="${0}" .noDataText="${0}" -changed="${0}" -changed="${0}" filter="${0}"></hass-tabs-subpage-data-table> `),this.hass,this.narrow,this.route,this._tabs,this._columns(this.hass.localize),this._dataWithNamedSourceAndIds(this._data),this._activeGrouping,this._activeCollapsed,this.hass.localize("ui.panel.config.bluetooth.no_connections"),this._handleGroupingChanged,this._handleCollapseChanged,this._filter||"")}_handleGroupingChanged(t){this._activeGrouping=t.detail.value}_handleCollapseChanged(t){this._activeCollapsed=t.detail.value}constructor(...t){super(...t),this.narrow=!1,this.isWide=!1,this._tabs=[{translationKey:"ui.panel.config.bluetooth.navigation.connections",path:"/config/bluetooth/connection-monitor"}],this._data=[],this._scanners={},this._addressNames={},this._sourceDevices={},this._activeGrouping="source",this._activeCollapsed=[],this._connectionAllocationData={},this._columns=(0,s.A)(t=>({address:{title:t("ui.panel.config.bluetooth.address"),sortable:!0,filterable:!0,showNarrow:!0,main:!0,hideable:!1,moveable:!1,direction:"asc",flex:1},name:{title:t("ui.panel.config.bluetooth.name"),filterable:!0,sortable:!0},device:{title:t("ui.panel.config.bluetooth.device"),filterable:!0,sortable:!0,template:t=>(0,i.qy)(f||(f=m`${0}`),t.device||"-")},source:{title:t("ui.panel.config.bluetooth.source"),filterable:!0,sortable:!0,groupable:!0},source_address:{title:t("ui.panel.config.bluetooth.source_address"),filterable:!0,sortable:!0,defaultHidden:!0}})),this._dataWithNamedSourceAndIds=(0,s.A)(t=>t.map(t=>{var e;const a=this._sourceDevices[t.address],o=this._sourceDevices[t.source],r=this._scanners[t.source],i=this._addressNames[t.address]||t.address,n=(null==o?void 0:o.name_by_user)||(null==o?void 0:o.name)||(null==r?void 0:r.name)||t.source,s=null!=o&&o.area_id?null===(e=this.hass.areas[o.area_id])||void 0===e?void 0:e.name:void 0;return Object.assign(Object.assign({},t),{},{id:t.address,name:i,source_address:t.source,source:s?`${n} (${s})`:n,device:(null==a?void 0:a.name_by_user)||(null==a?void 0:a.name)||void 0})}))}}y.styles=v.RF,(0,r.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,r.Cg)([(0,n.MZ)({attribute:!1})],y.prototype,"route",void 0),(0,r.Cg)([(0,n.MZ)({type:Boolean})],y.prototype,"narrow",void 0),(0,r.Cg)([(0,n.MZ)({attribute:"is-wide",type:Boolean})],y.prototype,"isWide",void 0),(0,r.Cg)([(0,n.wk)()],y.prototype,"_filter",void 0),(0,r.Cg)([(0,n.wk)()],y.prototype,"_data",void 0),(0,r.Cg)([(0,n.wk)()],y.prototype,"_scanners",void 0),(0,r.Cg)([(0,n.wk)()],y.prototype,"_addressNames",void 0),(0,r.Cg)([(0,n.wk)()],y.prototype,"_sourceDevices",void 0),(0,r.Cg)([(0,l.I)({key:"bluetooth-connection-table-grouping",state:!1,subscribe:!1})],y.prototype,"_activeGrouping",void 0),(0,r.Cg)([(0,l.I)({key:"bluetooth-connection-table-collapsed",state:!1,subscribe:!1})],y.prototype,"_activeCollapsed",void 0),(0,r.Cg)([(0,n.wk)()],y.prototype,"_connectionAllocationData",void 0),y=(0,r.Cg)([(0,n.EM)("bluetooth-connection-monitor")],y),o()}catch(b){o(b)}})},69235:function(t,e,a){a.a(t,async function(t,e){try{a(3362),a(62953);"function"!=typeof window.ResizeObserver&&(window.ResizeObserver=(await a.e(71055).then(a.bind(a,52370))).default),e()}catch(o){e(o)}},1)},85614:function(t,e,a){a.d(e,{i:function(){return o}});a(3362),a(62953);const o=async()=>{await Promise.all([a.e(38085),a.e(22309)]).then(a.bind(a,40772))}},36240:function(t,e,a){a.d(e,{NN:function(){return r},S8:function(){return o},gN:function(){return i}});const o=(t,e,a)=>isNaN(t)||isNaN(e)||isNaN(a)?0:t>a?a:t<e?e:t,r=(t,e,a)=>100*(t-e)/(a-e),i=t=>Math.round(10*t)/10},22348:function(t,e,a){a.d(e,{V:function(){return r}});var o=a(37177);const r=t=>!!t&&o.n},37177:function(t,e,a){a.d(e,{n:function(){return o}});a(27495);const o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}}]);