iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
24 lines • 31.7 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[36180],{26218:function(t,e,i){i.d(e,{a:function(){return o}});i(16280);const a=(0,i(77796).n)(t=>{history.replaceState({scrollPosition:t},"")},300);function o(t){return(e,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const o=e.connectedCallback;e.connectedCallback=function(){o.call(this);const e=this[i];e&&this.updateComplete.then(()=>{const i=this.renderRoot.querySelector(t);i&&setTimeout(()=>{i.scrollTop=e},0)})};const r=Object.getOwnPropertyDescriptor(e,i);let n;if(void 0===r)n={get(){var t;return this[`__${String(i)}`]||(null===(t=history.state)||void 0===t?void 0:t.scrollPosition)},set(t){a(t),this[`__${String(i)}`]=t},configurable:!0,enumerable:!0};else{const t=r.set;n=Object.assign(Object.assign({},r),{},{set(e){a(e),this[`__${String(i)}`]=e,null==t||t.call(this,e)}})}Object.defineProperty(e,i,n)}}},77796:function(t,e,i){i.d(e,{n:function(){return a}});i(62953);const a=(t,e,i=!0,a=!0)=>{let o,r=0;const n=(...n)=>{const s=()=>{r=!1===i?0:Date.now(),o=void 0,t(...n)},l=Date.now();r||!1!==i||(r=l);const c=e-(l-r);c<=0||c>e?(o&&(clearTimeout(o),o=void 0),r=l,t(...n)):o||!1===a||(o=window.setTimeout(s,c))};return n.cancel=()=>{clearTimeout(o),o=void 0,r=0},n}},33062:function(t,e,i){i(62953);var a=i(40445),o=i(5124),r=i(67576);let n;class s extends o.WF{willUpdate(t){t.has("color")&&(this.style.backgroundColor=this.color)}render(){return o.s6}constructor(...t){super(...t),this.color="",this.rtl=!1}}s.styles=(0,o.AH)(n||(n=(t=>t)`:host{display:inline-block;margin-inline-end:4px;margin-inline-start:initial;border-radius:10px;width:10px;height:10px;vertical-align:middle}:host([rtl]){direction:rtl}`)),(0,a.Cg)([(0,r.MZ)()],s.prototype,"color",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],s.prototype,"rtl",void 0),s=(0,a.Cg)([(0,r.EM)("ha-chart-tooltip-marker")],s)},90248:function(t,e,i){i.a(t,async function(t,a){try{i.r(e),i.d(e,{HaIconButtonArrowPrev:function(){return _}});i(62953);var o=i(40445),r=i(5124),n=i(67576),s=i(63091),l=i(26300),c=t([l]);l=(c.then?(await c)():c)[0];let d,u=t=>t;const h="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",p="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class _ extends r.WF{render(){var t;return(0,r.qy)(d||(d=u` <ha-icon-button .disabled="${0}" .label="${0}" .path="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"></ha-icon-button> `),this.disabled,this.label||(null===(t=this.hass)||void 0===t?void 0:t.localize("ui.common.back"))||"Back",this._icon,this.href,this.target,this.rel,this.download)}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===s.G.document.dir?p:h}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"disabled",void 0),(0,o.Cg)([(0,n.MZ)()],_.prototype,"label",void 0),(0,o.Cg)([(0,n.MZ)()],_.prototype,"href",void 0),(0,o.Cg)([(0,n.MZ)()],_.prototype,"target",void 0),(0,o.Cg)([(0,n.MZ)()],_.prototype,"rel",void 0),(0,o.Cg)([(0,n.MZ)()],_.prototype,"download",void 0),(0,o.Cg)([(0,n.wk)()],_.prototype,"_icon",void 0),_=(0,o.Cg)([(0,n.EM)("ha-icon-button-arrow-prev")],_),a()}catch(d){a(d)}})},26300:function(t,e,i){i.a(t,async function(t,a){try{i.r(e),i.d(e,{HaIconButton:function(){return v}});i(62953);var o=i(40445),r=i(5124),n=i(67576),s=i(63672),l=i(18350),c=(i(67094),t([l]));l=(c.then?(await c)():c)[0];let d,u,h,p,_=t=>t;class v extends r.WF{render(){return(0,r.qy)(d||(d=_` <ha-button appearance="plain" variant="neutral" aria-label="${0}" title="${0}" aria-haspopup="${0}" .disabled="${0}" .iconTag="${0}" .href="${0}" .target="${0}" .rel="${0}" .download="${0}"> ${0} </ha-button> `),(0,s.J)(this.label),(0,s.J)(this.hideTitle?void 0:this.label),(0,s.J)(this.ariaHasPopup),this.disabled,this.path?"ha-svg-icon":"span",this.href,this.target,this.rel,this.download,this.path?(0,r.qy)(u||(u=_`<ha-svg-icon aria-hidden="true" .path="${0}"></ha-svg-icon>`),this.path):(0,r.qy)(h||(h=_`<span><slot></slot></span>`)))}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}v.shadowRootOptions={mode:"open",delegatesFocus:!0},v.styles=(0,r.AH)(p||(p=_`:host{display:inline-block;outline:0;--ha-button-height:var(--ha-icon-button-size, 48px)}ha-button{position:relative;isolation:isolate;--wa-form-control-padding-inline:var(
--ha-icon-button-padding-inline,
--ha-space-2
);--wa-color-on-normal:currentColor;--wa-color-fill-quiet:transparent;--ha-button-label-overflow:visible}ha-button::after{content:"";position:absolute;inset:0;z-index:-1;border-radius:50%;background-color:currentColor;opacity:0;pointer-events:none}ha-button::part(base){width:var(--wa-form-control-height);aspect-ratio:1;outline-offset:-4px}ha-button::part(label){display:flex}:host([selected]) ha-button::after{opacity:.1} (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`)),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],v.prototype,"disabled",void 0),(0,o.Cg)([(0,n.MZ)({type:String})],v.prototype,"path",void 0),(0,o.Cg)([(0,n.MZ)({type:String})],v.prototype,"label",void 0),(0,o.Cg)([(0,n.MZ)({type:String,attribute:"aria-haspopup"})],v.prototype,"ariaHasPopup",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"hide-title",type:Boolean})],v.prototype,"hideTitle",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],v.prototype,"selected",void 0),(0,o.Cg)([(0,n.MZ)()],v.prototype,"href",void 0),(0,o.Cg)([(0,n.MZ)()],v.prototype,"target",void 0),(0,o.Cg)([(0,n.MZ)()],v.prototype,"rel",void 0),(0,o.Cg)([(0,n.MZ)()],v.prototype,"download",void 0),v=(0,o.Cg)([(0,n.EM)("ha-icon-button")],v),a()}catch(d){a(d)}})},2054:function(t,e,i){i.a(t,async function(t,e){try{i(16280),i(62953);var a=i(40445),o=i(5124),r=i(67576),n=i(1087),s=i(44249),l=i(26300),c=t([l]);l=(c.then?(await c)():c)[0];let d,u,h,p=t=>t;const _="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class v extends o.WF{connectedCallback(){super.connectedCallback(),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}disconnectedCallback(){super.disconnectedCallback(),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}render(){if(!this._show)return o.s6;const t=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return(0,o.qy)(d||(d=p` <ha-icon-button .label="${0}" .path="${0}" ="${0}"></ha-icon-button> ${0} `),this.hass.localize("ui.sidebar.sidebar_toggle"),_,this._toggleMenu,t?(0,o.qy)(u||(u=p`<div class="dot"></div>`)):"")}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const e=t.has("hass")?t.get("hass"):this.hass,i=t.has("narrow")?t.get("narrow"):this.narrow,a=!1===(null==e?void 0:e.kioskMode)&&(i||"always_hidden"===(null==e?void 0:e.dockedSidebar)),o=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&a===o||(this._show=o||this._alwaysVisible,o?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}_subscribeNotifications(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,s.V)(this.hass.connection,t=>{this._hasNotifications=t.length>0})}_toggleMenu(){(0,n.r)(this,"hass-toggle-menu")}constructor(...t){super(...t),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}v.styles=(0,o.AH)(h||(h=p`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:var(--ha-border-radius-circle);border:2px solid var(--app-header-background-color)}`)),(0,a.Cg)([(0,r.MZ)({type:Boolean})],v.prototype,"narrow",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,a.Cg)([(0,r.wk)()],v.prototype,"_hasNotifications",void 0),(0,a.Cg)([(0,r.wk)()],v.prototype,"_show",void 0),v=(0,a.Cg)([(0,r.EM)("ha-menu-button")],v),e()}catch(d){e(d)}})},67094:function(t,e,i){i.r(e),i.d(e,{HaSvgIcon:function(){return u}});var a=i(40445),o=i(5124),r=i(67576);let n,s,l,c,d=t=>t;class u extends o.WF{render(){return(0,o.JW)(n||(n=d` <svg viewBox="${0}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${0} ${0} </g> </svg>`),this.viewBox||"0 0 24 24",this.path?(0,o.JW)(s||(s=d`<path class="primary-path" d="${0}"></path>`),this.path):o.s6,this.secondaryPath?(0,o.JW)(l||(l=d`<path class="secondary-path" d="${0}"></path>`),this.secondaryPath):o.s6)}}u.styles=(0,o.AH)(c||(c=d`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`)),(0,a.Cg)([(0,r.MZ)()],u.prototype,"path",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"secondaryPath",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"viewBox",void 0),u=(0,a.Cg)([(0,r.EM)("ha-svg-icon")],u)},44249:function(t,e,i){i.d(e,{V:function(){return a}});i(62953);const a=(t,e)=>{const i=new o,a=t.subscribeMessage(t=>e(i.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{a.then(t=>null==t?void 0:t())}};class o{processMessage(t){if("removed"===t.type)for(const e of Object.keys(t.notifications))delete this.notifications[e];else this.notifications=Object.assign(Object.assign({},this.notifications),t.notifications);return Object.values(this.notifications)}constructor(){this.notifications={}}}},72001:function(t,e,i){i.d(e,{$D:function(){return nt},$O:function(){return ot},Bm:function(){return b},Cr:function(){return K},Cy:function(){return r},DE:function(){return d},DJ:function(){return m},El:function(){return J},Eo:function(){return V},GP:function(){return l},Hz:function(){return n},Is:function(){return g},JZ:function(){return M},Lx:function(){return D},MY:function(){return v},PY:function(){return G},RE:function(){return F},S0:function(){return R},SG:function(){return f},TH:function(){return j},Tx:function(){return L},U:function(){return Y},VA:function(){return q},VL:function(){return c},Ve:function(){return rt},W6:function(){return H},YG:function(){return u},YP:function(){return x},Yn:function(){return S},Z1:function(){return et},Zp:function(){return k},aG:function(){return C},aL:function(){return s},au:function(){return h},dZ:function(){return p},fC:function(){return O},i4:function(){return I},iK:function(){return z},in:function(){return at},jF:function(){return U},jT:function(){return P},lz:function(){return y},m:function(){return $},mQ:function(){return E},mR:function(){return X},mX:function(){return Q},of:function(){return tt},pN:function(){return it},qN:function(){return W},re:function(){return A},sb:function(){return Z},tj:function(){return T},u1:function(){return o},wI:function(){return w},zI:function(){return _},zP:function(){return B},zb:function(){return N}});i(16280),i(3362);var a=i(37619),o=function(t){return t[t.Idle=0]="Idle",t[t.Including=1]="Including",t[t.Excluding=2]="Excluding",t[t.Busy=3]="Busy",t[t.SmartStart=4]="SmartStart",t}({}),r=function(t){return t[t.Default=0]="Default",t[t.SmartStart=1]="SmartStart",t[t.Insecure=2]="Insecure",t[t.Security_S0=3]="Security_S0",t[t.Security_S2=4]="Security_S2",t}({}),n=function(t){return t[t.Temporary=-2]="Temporary",t[t.None=-1]="None",t[t.S2_Unauthenticated=0]="S2_Unauthenticated",t[t.S2_Authenticated=1]="S2_Authenticated",t[t.S2_AccessControl=2]="S2_AccessControl",t[t.S0_Legacy=7]="S0_Legacy",t}({}),s=function(t){return t[t.SmartStart=0]="SmartStart",t}({}),l=function(t){return t[t.ZWave=0]="ZWave",t[t.ZWaveLongRange=1]="ZWaveLongRange",t}({}),c=function(t){return t[t.Error_Timeout=-1]="Error_Timeout",t[t.Error_Checksum=0]="Error_Checksum",t[t.Error_TransmissionFailed=1]="Error_TransmissionFailed",t[t.Error_InvalidManufacturerID=2]="Error_InvalidManufacturerID",t[t.Error_InvalidFirmwareID=3]="Error_InvalidFirmwareID",t[t.Error_InvalidFirmwareTarget=4]="Error_InvalidFirmwareTarget",t[t.Error_InvalidHeaderInformation=5]="Error_InvalidHeaderInformation",t[t.Error_InvalidHeaderFormat=6]="Error_InvalidHeaderFormat",t[t.Error_InsufficientMemory=7]="Error_InsufficientMemory",t[t.Error_InvalidHardwareVersion=8]="Error_InvalidHardwareVersion",t[t.OK_WaitingForActivation=253]="OK_WaitingForActivation",t[t.OK_NoRestart=254]="OK_NoRestart",t[t.OK_RestartPending=255]="OK_RestartPending",t}({}),d=function(t){return t[t.Error_Timeout=0]="Error_Timeout",t[t.Error_RetryLimitReached=1]="Error_RetryLimitReached",t[t.Error_Aborted=2]="Error_Aborted",t[t.Error_NotSupported=3]="Error_NotSupported",t[t.OK=255]="OK",t}({}),u=function(t){return t[t.Active=0]="Active",t[t.Inactive=1]="Inactive",t}({});var h=function(t){return t[t.NotAvailable=127]="NotAvailable",t[t.ReceiverSaturated=126]="ReceiverSaturated",t[t.NoSignalDetected=125]="NoSignalDetected",t}({}),p=function(t){return t[t.ZWave_9k6=1]="ZWave_9k6",t[t.ZWave_40k=2]="ZWave_40k",t[t.ZWave_100k=3]="ZWave_100k",t[t.LongRange_100k=4]="LongRange_100k",t}({}),_=function(t){return t[t.Unknown=0]="Unknown",t[t.Asleep=1]="Asleep",t[t.Awake=2]="Awake",t[t.Dead=3]="Dead",t[t.Alive=4]="Alive",t}({});const v=(t,e,i,a,o,r,n)=>t.callWS({type:"zwave_js/invoke_cc_api",device_id:e,command_class:i,endpoint:a,method_name:o,parameters:r,wait_for_result:n}),g=(t,e)=>{if(e.device_id&&e.entry_id)throw new Error("Only one of device or entry ID should be supplied.");if(!e.device_id&&!e.entry_id)throw new Error("Either device or entry ID should be supplied.");return(0,a.X)(t,{type:"zwave_js/network_status",device_id:e.device_id,entry_id:e.entry_id})},f=(t,e)=>t.callWS({type:"zwave_js/data_collection_status",entry_id:e}),y=(t,e,i)=>t.callWS({type:"zwave_js/update_data_collection_preference",entry_id:e,opted_in:i}),b=(t,e)=>t.callWS({type:"zwave_js/get_provisioning_entries",entry_id:e}),m=(t,e,i,a,o,r,n,s=0)=>t.connection.subscribeMessage(t=>i(t),{type:"zwave_js/add_node",entry_id:e,inclusion_strategy:s,qr_code_string:o,qr_provisioning_information:a,planned_provisioning_entry:r,dsk:n}),w=(t,e)=>t.callWS({type:"zwave_js/stop_inclusion",entry_id:e}),z=(t,e,i,a)=>t.callWS({type:"zwave_js/grant_security_classes",entry_id:e,securityClasses:i,clientSideAuth:a}),S=(t,e,i)=>t.callWS({type:"zwave_js/try_parse_dsk_from_qr_code_string",entry_id:e,qr_code_string:i}),x=(t,e,i)=>t.callWS({type:"zwave_js/validate_dsk_and_enter_pin",entry_id:e,pin:i}),k=(t,e,i)=>t.callWS({type:"zwave_js/supports_feature",entry_id:e,feature:i}),j=(t,e,i)=>t.callWS({type:"zwave_js/parse_qr_code_string",entry_id:e,qr_code_string:i}),$=(t,e,i,a,o,r)=>t.callWS({type:"zwave_js/lookup_device",entry_id:e,manufacturerId:i,productType:a,productId:o,applicationVersion:r}),C=(t,e,i,a,o,r)=>t.callWS({type:"zwave_js/provision_smart_start_node",entry_id:e,qr_provisioning_information:i,protocol:a,device_name:o,area_id:r}),M=(t,e,i,a)=>t.callWS({type:"zwave_js/unprovision_smart_start_node",entry_id:e,dsk:i,node_id:a}),W=(t,e,i)=>t.connection.subscribeMessage(t=>i(t),{type:"zwave_js/subscribe_new_devices",entry_id:e}),E=(t,e)=>t.callWS({type:"zwave_js/node_status",device_id:e}),I=(t,e)=>t.callWS({type:"zwave_js/node_capabilities",device_id:e}),Z=(t,e,i)=>t.connection.subscribeMessage(t=>i(t),{type:"zwave_js/subscribe_node_status",device_id:e}),A=(t,e)=>t.callWS({type:"zwave_js/node_metadata",device_id:e}),N=(t,e)=>t.callWS({type:"zwave_js/node_alerts",device_id:e}),H=(t,e)=>t.callWS({type:"zwave_js/get_config_parameters",device_id:e}),O=(t,e,i,a,o,r)=>{const n={type:"zwave_js/set_config_parameter",device_id:e,property:i,endpoint:a,value:o,property_key:r};return t.callWS(n)},q=(t,e,i,a,o,r)=>{const n={type:"zwave_js/set_raw_config_parameter",device_id:e,property:i,value:a,value_size:o,value_format:r};return t.callWS(n)},F=(t,e,i)=>t.callWS({type:"zwave_js/get_raw_config_parameter",device_id:e,property:i}).then(t=>t.value),V=(t,e,i)=>t.connection.subscribeMessage(t=>i(t),{type:"zwave_js/refresh_node_info",device_id:e}),P=(t,e)=>t.callWS({type:"zwave_js/rebuild_node_routes",device_id:e}),T=(t,e,i)=>t.connection.subscribeMessage(t=>i(t),{type:"zwave_js/remove_failed_node",device_id:e}),D=(t,e)=>(0,a.X)(t,{type:"zwave_js/begin_rebuilding_routes",entry_id:e}),L=(t,e)=>(0,a.X)(t,{type:"zwave_js/stop_rebuilding_routes",entry_id:e}),R=(t,e,i)=>t.subscribeMessage(t=>i(t),{type:"zwave_js/subscribe_rebuild_routes_progress",entry_id:e}),B=(t,e,i)=>t.connection.subscribeMessage(t=>i(t),{type:"zwave_js/subscribe_controller_statistics",entry_id:e}),U=(t,e,i)=>t.connection.subscribeMessage(t=>i(t),{type:"zwave_js/subscribe_node_statistics",device_id:e}),J=(t,e,i)=>t.connection.subscribeMessage(t=>i(t),{type:"zwave_js/subscribe_s2_inclusion",entry_id:e}),K=(t,e)=>t.callWS({type:"zwave_js/is_node_firmware_update_in_progress",device_id:e}),Y=(t,e)=>t.callWS({type:"zwave_js/is_any_ota_firmware_update_in_progress",entry_id:e}),G=(t,e)=>t.callWS({type:"zwave_js/hard_reset_controller",entry_id:e}),X=async(t,e,i,a,o)=>{const r=new FormData;r.append("file",i),void 0!==a&&r.append("target",a.toString());const n=await t.fetchWithAuth(`/api/zwave_js/firmware/upload/${e}`,{method:"POST",body:r,signal:o});if(200!==n.status)throw new Error(n.statusText)},Q=(t,e,i)=>t.connection.subscribeMessage(t=>i(t),{type:"zwave_js/subscribe_firmware_update_status",device_id:e}),tt=(t,e)=>t.callWS({type:"zwave_js/abort_firmware_update",device_id:e}),et=(t,e,i)=>t.connection.subscribeMessage(i,{type:"zwave_js/backup_nvm",entry_id:e}),it=(t,e,i,a)=>t.connection.subscribeMessage(a,{type:"zwave_js/restore_nvm",entry_id:e,data:i}),at=(t,e,i)=>t.connection.subscribeMessage(i,{type:"zwave_js/subscribe_log_updates",entry_id:e}),ot=(t,e)=>t.callWS({type:"zwave_js/get_log_config",entry_id:e}),rt=(t,e,i)=>t.callWS({type:"zwave_js/update_log_config",entry_id:e,config:{level:i}}),nt=(t,e)=>t.callWS({type:"zwave_js/cancel_secure_bootstrap_s2",entry_id:e})},77158:function(t,e,i){i.a(t,async function(t,a){try{i.r(e),i.d(e,{ZWaveJSNetworkVisualization:function(){return W}});i(44114),i(18111),i(22489),i(20116),i(7588),i(61701),i(13579),i(3362),i(62953);var o=i(40445),r=i(5124),n=i(67576),s=i(22786),l=i(76774),c=i(91926),d=i(9899),u=i(7358),h=(i(33062),i(36866)),p=i(72001),_=i(81310),v=i(54706),g=t([u,h,_]);[u,h,_]=g.then?(await g)():g;let f,y,b,m,w,z,S,x,k,j,$,C,M=t=>t;class W extends((0,v.E)(r.WF)){hassSubscribe(){return Object.values(this.hass.devices).filter(t=>t.config_entries.some(t=>t===this.configEntryId)).map(t=>(0,p.jF)(this.hass,t.id,e=>{var i;const a=null!==(i=e.nodeId)&&void 0!==i?i:e.node_id;this._devices[a]=t,this._nodeStatistics[a]=e,this._handleUpdatedNodeStatistics()}))}connectedCallback(){super.connectedCallback(),this._fetchNetworkStatus()}render(){return(0,r.qy)(f||(f=M` <hass-subpage .hass="${0}" .narrow="${0}" .header="${0}" back-path="/config/zwave_js/dashboard?config_entry=${0}"> ${0} <ha-network-graph .hass="${0}" .searchFilter="${0}" .data="${0}" .searchableAttributes="${0}" .tooltipFormatter="${0}" -click="${0}"> ${0} </ha-network-graph> </hass-subpage> `),this.hass,this.narrow,this.hass.localize("ui.panel.config.zwave_js.navigation.visualization"),this.configEntryId,this.narrow?(0,r.qy)(y||(y=M`<div slot="header">${0}</div>`),this._renderInputSearch()):r.s6,this.hass,this._searchFilter,this._getNetworkData(this._nodeStatuses,this._nodeStatistics),this._getSearchableAttributes,this._tooltipFormatter,this._handleChartClick,this.narrow?r.s6:this._renderInputSearch("search"))}_renderInputSearch(t=""){return(0,r.qy)(b||(b=M`<ha-input-search appearance="outlined" slot="${0}" .value="${0}" ="${0}"></ha-input-search>`),t,this._searchFilter,this._handleSearchChange)}async _fetchNetworkStatus(){const t=await(0,p.Is)(this.hass.connection,{entry_id:this.configEntryId}),e={};t.controller.nodes.forEach(t=>{e[t.node_id]=t}),this._nodeStatuses=e}_handleSearchChange(t){var e;this._searchFilter=null!==(e=t.target.value)&&void 0!==e?e:""}_handleChartClick(t){if("node"===t.detail.dataType&&"pointer"===t.detail.event.target.cursor){const{id:e}=t.detail.data,i=this._devices[e];i&&(0,c.oo)(`/config/devices/device/${i.id}`)}}_getLineWidth(t){return t>-50?3:t>-75?2:1}static get styles(){return[(0,r.AH)(m||(m=M`ha-network-graph{height:100%}[slot=header]{display:flex;align-items:center}ha-input-search{flex:1}`))]}constructor(...t){super(...t),this.isWide=!1,this.narrow=!1,this._nodeStatuses={},this._nodeStatistics={},this._devices={},this._searchFilter="",this._getSearchableAttributes=t=>{const e=this._devices[Number(t)],i=this._nodeStatuses[Number(t)],a=[];if(null!=e&&e.manufacturer&&a.push(e.manufacturer),null!=e&&e.model&&a.push(e.model),i){const t=this.hass.localize(`ui.panel.config.zwave_js.node_status.${i.status}`);t&&a.push(t)}return a},this._tooltipFormatter=t=>{var e;const{dataType:i,data:a}=t;if("edge"===i){var o,n,s,c,d,u;const{source:t,target:e,value:i}=a,l=this._devices[t],h=this._devices[e],p=null!==(o=null!==(n=null==l?void 0:l.name_by_user)&&void 0!==n?n:null==l?void 0:l.name)&&void 0!==o?o:t,_=null!==(s=null!==(c=null==h?void 0:h.name_by_user)&&void 0!==c?c:null==h?void 0:h.name)&&void 0!==s?s:e,v=(null===(d=this._nodeStatistics[t])||void 0===d?void 0:d.lwr)||(null===(u=this._nodeStatistics[t])||void 0===u?void 0:u.nlwr);return(0,r.qy)(w||(w=M`${0} → ${0}${0}${0}`),p,_,null!=v&&v.protocol_data_rate?(0,r.qy)(z||(z=M`<br><b>${0}:</b> ${0}`),this.hass.localize("ui.panel.config.zwave_js.visualization.data_rate"),this.hass.localize(`ui.panel.config.zwave_js.protocol_data_rate.${v.protocol_data_rate}`)):r.s6,i?(0,r.qy)(S||(S=M`<br><b>RSSI:</b> ${0}`),i):r.s6)}const{id:h,name:p}=a,_=this._devices[h],v=this._nodeStatuses[h],g=_?(0,l.q)(_,this.hass.areas):void 0;return(0,r.qy)(x||(x=M`<ha-chart-tooltip-marker .color="${0}"></ha-chart-tooltip-marker> ${0}<br><b>${0}:</b> ${0}${0}${0}${0}`),String(null!==(e=t.color)&&void 0!==e?e:""),p,this.hass.localize("ui.panel.config.zwave_js.visualization.node_id"),h,_?(0,r.qy)(k||(k=M`<br><b>${0}:</b> ${0}<br><b>${0}:</b> ${0}`),this.hass.localize("ui.panel.config.zwave_js.visualization.manufacturer"),_.manufacturer||"-",this.hass.localize("ui.panel.config.zwave_js.visualization.model"),_.model||"-"):r.s6,v?(0,r.qy)(j||(j=M`<br><b>${0}:</b> ${0}${0}`),this.hass.localize("ui.panel.config.zwave_js.visualization.status"),this.hass.localize(`ui.panel.config.zwave_js.node_status.${v.status}`),v.zwave_plus_version?(0,r.qy)($||($=M`<br><b>Z-Wave Plus:</b> ${0} ${0}`),this.hass.localize("ui.panel.config.zwave_js.visualization.version"),v.zwave_plus_version):r.s6):r.s6,g?(0,r.qy)(C||(C=M`<br><b>${0}:</b> ${0}`),this.hass.localize("ui.panel.config.zwave_js.visualization.area"),g.name):r.s6)},this._getNetworkData=(0,s.A)((t,e)=>{const i=getComputedStyle(this),a=[],o=[],r=[{name:this.hass.localize("ui.panel.config.zwave_js.visualization.controller"),symbol:"roundRect",itemStyle:{color:i.getPropertyValue("--primary-color")}},{name:this.hass.localize("ui.panel.config.zwave_js.visualization.node"),symbol:"circle",itemStyle:{color:i.getPropertyValue("--cyan-color")}},{name:this.hass.localize("ui.panel.config.zwave_js.visualization.asleep_node"),symbol:"circle",itemStyle:{color:i.getPropertyValue("--disabled-color")}},{name:this.hass.localize("ui.panel.config.zwave_js.visualization.dead_node"),symbol:"circle",itemStyle:{color:i.getPropertyValue("--error-color")}}];if(!Object.keys(t).length)return{nodes:a,links:o,categories:r};let n;return Object.values(t).forEach(t=>{var e,o;t.is_controller_node&&(n=t.node_id);const r=this._devices[t.node_id],s=r?(0,l.q)(r,this.hass.areas):void 0;a.push({id:String(t.node_id),name:null!==(e=null!==(o=null==r?void 0:r.name_by_user)&&void 0!==o?o:null==r?void 0:r.name)&&void 0!==e?e:String(t.node_id),context:null==s?void 0:s.name,value:t.is_controller_node?3:t.is_routing?2:1,category:t.status===p.zI.Dead?3:t.status===p.zI.Asleep?2:t.is_controller_node?0:1,symbolSize:t.is_controller_node?40:t.is_routing?30:20,symbol:t.is_controller_node?"roundRect":"circle",itemStyle:{color:t.status===p.zI.Dead?i.getPropertyValue("--error-color"):t.status===p.zI.Asleep?i.getPropertyValue("--disabled-color"):t.is_controller_node?i.getPropertyValue("--primary-color"):i.getPropertyValue("--cyan-color")},polarDistance:t.is_controller_node?0:t.status===p.zI.Dead?.9:.5,fixed:t.is_controller_node})}),Object.entries(e).forEach(([t,e])=>{const a=e.lwr||e.nlwr;if(a){const e=[...a.repeaters.map((t,e)=>{var i;return[null===(i=Object.keys(this._devices).find(e=>{var i;return(null===(i=this._devices[e])||void 0===i?void 0:i.id)===t}))||void 0===i?void 0:i[0],a.repeater_rssi[e]]}),[n,a.rssi]];let r=t;e.forEach(([t,e])=>{const s="number"==typeof e&&e<=0?e:-100,l=o.find(e=>e.source===r&&e.target===String(t)),c=this._getLineWidth(s);l?(l.value=Math.max(l.value,s),l.lineStyle=Object.assign(Object.assign({},l.lineStyle),{},{width:Math.max(l.lineStyle.width,c),type:a.protocol_data_rate>1?"solid":l.lineStyle.type})):o.push({source:r,target:String(t),value:s,lineStyle:{width:c,color:t===n?i.getPropertyValue("--primary-color"):i.getPropertyValue("--disabled-color"),type:a.protocol_data_rate>1?"solid":"dotted"},symbolSize:3*c}),r=String(t)})}}),{nodes:a,links:o,categories:r}}),this._handleUpdatedNodeStatistics=(0,d.s)(()=>{this._nodeStatistics=Object.assign({},this._nodeStatistics)},500)}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],W.prototype,"route",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"is-wide",type:Boolean})],W.prototype,"isWide",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],W.prototype,"narrow",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],W.prototype,"configEntryId",void 0),(0,o.Cg)([(0,n.wk)()],W.prototype,"_nodeStatuses",void 0),(0,o.Cg)([(0,n.wk)()],W.prototype,"_nodeStatistics",void 0),(0,o.Cg)([(0,n.wk)()],W.prototype,"_devices",void 0),(0,o.Cg)([(0,n.wk)()],W.prototype,"_searchFilter",void 0),W=(0,o.Cg)([(0,n.EM)("zwave_js-network-visualization")],W),a()}catch(f){a(f)}})},14503:function(t,e,i){i.d(e,{RF:function(){return h},dp:function(){return v},kO:function(){return _},nA:function(){return p},og:function(){return u}});var a=i(5124);let o,r,n,s,l,c,d=t=>t;const u=(0,a.AH)(o||(o=d`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`)),h=(0,a.AH)(r||(r=d`:host{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}.header{transition:box-shadow .2s linear,width var(--ha-animation-duration-normal) ease,padding-left var(--ha-animation-duration-normal) ease,padding-right var(--ha-animation-duration-normal) ease} (prefers-reduced-motion:reduce){.header{transition:box-shadow .2s linear}}h1{font-family:var(--ha-font-family-heading);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed)}h2{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-normal)}h3{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-l);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}${0} .card-actions a{text-decoration:none}.card-actions .warning{--mdc-theme-primary:var(--error-color)}.layout.horizontal,.layout.vertical{display:flex}.layout.inline{display:inline-flex}.layout.horizontal{flex-direction:row}.layout.vertical{flex-direction:column}.layout.wrap{flex-wrap:wrap}.layout.no-wrap{flex-wrap:nowrap}.layout.center,.layout.center-center{align-items:center}.layout.bottom{align-items:flex-end}.layout.center-center,.layout.center-justified{justify-content:center}.flex{flex:1;flex-basis:0.000000001px}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.layout.justified{justify-content:space-between}`),u),p=(0,a.AH)(n||(n=d`ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:400px;--mdc-dialog-max-width:600px;--mdc-dialog-max-width:min(600px, 95vw);--justify-action-buttons:space-between;--dialog-container-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--dialog-surface-padding:0px}ha-adaptive-dialog .form,ha-dialog .form{color:var(--primary-text-color)}a{color:var(--primary-color)} all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:100vw;--mdc-dialog-max-width:100vw;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--dialog-container-padding:0px;--dialog-surface-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--vertical-align-dialog:flex-end}ha-dialog{--ha-dialog-border-radius:var(--ha-border-radius-square)}}.error{color:var(--error-color)}`)),_=(0,a.AH)(s||(s=d`ha-adaptive-dialog,ha-dialog{--vertical-align-dialog:flex-start;--dialog-surface-margin-top:var(--ha-space-10);--mdc-dialog-max-height:calc(
100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--mdc-dialog-max-height:calc(
100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--ha-dialog-max-height:calc(
100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
);--ha-dialog-max-height:calc(
100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
--safe-area-inset-y,
0px
)
)} all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--dialog-surface-margin-top:0px;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--ha-dialog-max-height:100vh;--ha-dialog-max-height:100svh}}`)),v=(0,a.AH)(l||(l=d`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{border-radius:var(--ha-border-radius-sm);background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`));(0,a.AH)(c||(c=d`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`))}}]);