iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 8.32 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[62740],{93421:function(t,e,r){r.d(e,{IW:function(){return h},dH:function(){return l},fI:function(){return c}});r(44114),r(62953);var i=r(35211),o=r(22792),s=r(32172);const a=(t,e)=>{let r=t;for(const i of e){if(null==r)return;r=r[i]}return r},n=(t,e,r)=>{const o=(0,s.p)({transformer:function(t){return r.call(this,t)},watch:e?[e]:[]}),a=(0,i.Fg)({context:t,subscribe:!0});return(t,e)=>{o(t,e),a(t,e)}},c=t=>n(o.iN,t.entityIdPath[0],function(e){const r=a(this,t.entityIdPath);return"string"==typeof r?null==e?void 0:e[r]:void 0}),l=t=>n(o.X1,t.entityIdPath[0],function(e){const r=a(this,t.entityIdPath);return"string"==typeof r?null==e?void 0:e[r]:void 0}),h=()=>n(o.D5,void 0,({localize:t})=>t)},32172:function(t,e,r){r.d(e,{p:function(){return i}});r(16280),r(18111),r(7588),r(45367),r(92731),r(17642),r(58004),r(33853),r(45876),r(32475),r(15024),r(31698),r(62953);function i(t){return(e,r)=>{if("object"==typeof r)throw new Error("This decorator does not support this compilation type.");const i=String(r),o=e;if(o._transformers){if(!o.hasOwnProperty("_transformers")){const t=o._transformers;o._transformers=new Map,t.forEach((t,e)=>o._transformers.set(e,t))}}else{o._transformers=new Map,o._watching=new Map;const t=o.willUpdate;o.willUpdate=function(e){t.call(this,e);const r=new Set;e.forEach((t,e)=>{const i=this._watching.get(e);void 0!==i&&i.forEach(t=>r.add(t))}),r.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}o._transformers.set(r,t.transformer),t.watch&&t.watch.forEach(t=>{let e=o._watching.get(t);e||(e=new Set,o._watching.set(t,e)),e.add(r)});const s=Object.getOwnPropertyDescriptor(e,r);let a;if(void 0===s)a={get(){return this[`__transform_${i}`]},set(t){const e=this[`__transform_${i}`],r=this._transformers.get(i);this[`__transform_${i}`]=r?r.call(this,t):t,this[`__original_${i}`]=t,this.requestUpdate(i,e)},configurable:!0,enumerable:!0};else{const t=s.set;a=Object.assign(Object.assign({},s),{},{set(e){const r=this[`__transform_${i}`],o=this._transformers.get(i);this[`__transform_${i}`]=o?o.call(this,e):e,this[`__original_${i}`]=e,this.requestUpdate(i,r),null==t||t.call(this,e)}})}Object.defineProperty(e,r,a)}}},38962:function(t,e,r){r.a(t,async function(t,i){try{r.r(e);r(62953);var o=r(40445),s=r(5124),a=r(67576),n=r(6412),c=r(93421),l=r(1087),h=r(26300),d=(r(67094),t([h]));h=(d.then?(await d)():d)[0];let p,u,g,m,f=t=>t;const v="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",y={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class w extends s.WF{render(){var t;return(0,s.qy)(p||(p=f` <div class="issue-type ${0}" role="alert"> <div class="icon ${0}"> <slot name="icon"> <ha-svg-icon .path="${0}"></ha-svg-icon> </slot> </div> <div class="${0}"> <div class="main-content"> ${0} <slot></slot> </div> <div class="action"> <slot name="action"> ${0} </slot> </div> </div> </div> `),(0,n.H)({[this.alertType]:!0}),this.title?"":"no-title",y[this.alertType],(0,n.H)({content:!0,narrow:this.narrow}),this.title?(0,s.qy)(u||(u=f`<div class="title">${0}</div>`),this.title):s.s6,this.dismissable?(0,s.qy)(g||(g=f`<ha-icon-button ="${0}" .label="${0}" .path="${0}"></ha-icon-button>`),this._dismissClicked,null===(t=this._localize)||void 0===t?void 0:t.call(this,"ui.common.dismiss_alert"),v):s.s6)}_dismissClicked(){(0,l.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}w.styles=(0,s.AH)(m||(m=f`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`)),(0,o.Cg)([(0,a.MZ)()],w.prototype,"title",void 0),(0,o.Cg)([(0,a.MZ)({attribute:"alert-type"})],w.prototype,"alertType",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean})],w.prototype,"dismissable",void 0),(0,o.Cg)([(0,a.wk)(),(0,c.IW)()],w.prototype,"_localize",void 0),(0,o.Cg)([(0,a.MZ)({type:Boolean})],w.prototype,"narrow",void 0),w=(0,o.Cg)([(0,a.EM)("ha-alert")],w),i()}catch(p){i(p)}})},60543:function(t,e,r){r.a(t,async function(t,i){try{r.r(e),r.d(e,{HaQrCode:function(){return m}});r(18111),r(61701),r(62953);var o=r(40445),s=r(5124),a=r(67576),n=r(81298),c=r(38962),l=r(79468),h=t([c]);c=(h.then?(await h)():h)[0];let d,p,u,g=t=>t;class m extends s.WF{willUpdate(t){super.willUpdate(t),(t.has("data")||t.has("scale")||t.has("width")||t.has("margin")||t.has("maskPattern")||t.has("errorCorrectionLevel"))&&this._error&&(this._error=void 0)}updated(t){const e=this._canvas;if(e&&this.data&&(t.has("data")||t.has("scale")||t.has("width")||t.has("margin")||t.has("maskPattern")||t.has("errorCorrectionLevel")||t.has("centerImage"))){const t=getComputedStyle(this),r=t.getPropertyValue("--rgb-primary-text-color"),i=t.getPropertyValue("--rgb-card-background-color"),o=(0,l.v2)(r.split(",").map(t=>parseInt(t,10))),s=(0,l.v2)(i.split(",").map(t=>parseInt(t,10)));if(n.toCanvas(e,this.data,{errorCorrectionLevel:this.errorCorrectionLevel||(this.centerImage?"Q":"M"),width:this.width,scale:this.scale,margin:this.margin,maskPattern:this.maskPattern,color:{light:s,dark:o}}).catch(t=>{this._error=t.message}),this.centerImage){const t=this._canvas.getContext("2d"),r=new Image;r.src=this.centerImage,r.onload=()=>{null==t||t.drawImage(r,.375*e.width,.375*e.height,e.width/4,e.height/4)}}}}render(){return this.data?this._error?(0,s.qy)(d||(d=g`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):(0,s.qy)(p||(p=g`<canvas></canvas>`)):s.s6}constructor(...t){super(...t),this.errorCorrectionLevel="medium",this.width=4,this.scale=4,this.margin=4}}m.styles=(0,s.AH)(u||(u=g`:host{display:block}`)),(0,o.Cg)([(0,a.MZ)()],m.prototype,"data",void 0),(0,o.Cg)([(0,a.MZ)({attribute:"error-correction-level"})],m.prototype,"errorCorrectionLevel",void 0),(0,o.Cg)([(0,a.MZ)({type:Number})],m.prototype,"width",void 0),(0,o.Cg)([(0,a.MZ)({type:Number})],m.prototype,"scale",void 0),(0,o.Cg)([(0,a.MZ)({type:Number})],m.prototype,"margin",void 0),(0,o.Cg)([(0,a.MZ)({attribute:!1})],m.prototype,"maskPattern",void 0),(0,o.Cg)([(0,a.MZ)({attribute:"center-image"})],m.prototype,"centerImage",void 0),(0,o.Cg)([(0,a.wk)()],m.prototype,"_error",void 0),(0,o.Cg)([(0,a.P)("canvas")],m.prototype,"_canvas",void 0),m=(0,o.Cg)([(0,a.EM)("ha-qr-code")],m),i()}catch(d){i(d)}})}}]);