UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

4 lines 14.8 kB
export const __rspack_esm_id=57497;export const __rspack_esm_ids=[57497];export const __webpack_modules__={93421(t,o,e){e.d(o,{IW:()=>h,dH:()=>l,fI:()=>c});e(44114);var i=e(35211),s=e(22792),a=e(32172);const r=(t,o)=>{let e=t;for(const t of o){if(null==e)return;e=e[t]}return e},n=(t,o,e)=>{const s=(0,a.p)({transformer:function(t){return e.call(this,t)},watch:o?[o]:[]}),r=(0,i.Fg)({context:t,subscribe:!0});return(t,o)=>{s(t,o),r(t,o)}},c=t=>n(s.iN,t.entityIdPath[0],function(o){const e=r(this,t.entityIdPath);return"string"==typeof e?o?.[e]:void 0}),l=t=>n(s.X1,t.entityIdPath[0],function(o){const e=r(this,t.entityIdPath);return"string"==typeof e?o?.[e]:void 0}),h=()=>n(s.D5,void 0,({localize:t})=>t)},32172(t,o,e){e.d(o,{p:()=>i});e(18111),e(7588),e(45367),e(92731),e(17642),e(58004),e(33853),e(45876),e(32475),e(15024),e(31698);function i(t){return(o,e)=>{if("object"==typeof e)throw new Error("This decorator does not support this compilation type.");const i=String(e),s=o;if(s._transformers){if(!s.hasOwnProperty("_transformers")){const t=s._transformers;s._transformers=new Map,t.forEach((t,o)=>s._transformers.set(o,t))}}else{s._transformers=new Map,s._watching=new Map;const t=s.willUpdate;s.willUpdate=function(o){t.call(this,o);const e=new Set;o.forEach((t,o)=>{const i=this._watching.get(o);void 0!==i&&i.forEach(t=>e.add(t))}),e.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}s._transformers.set(e,t.transformer),t.watch&&t.watch.forEach(t=>{let o=s._watching.get(t);o||(o=new Set,s._watching.set(t,o)),o.add(e)});const a=Object.getOwnPropertyDescriptor(o,e);let r;if(void 0===a)r={get(){return this[`__transform_${i}`]},set(t){const o=this[`__transform_${i}`],e=this._transformers.get(i);this[`__transform_${i}`]=e?e.call(this,t):t,this[`__original_${i}`]=t,this.requestUpdate(i,o)},configurable:!0,enumerable:!0};else{const t=a.set;r={...a,set(o){const e=this[`__transform_${i}`],s=this._transformers.get(i);this[`__transform_${i}`]=s?s.call(this,o):o,this[`__original_${i}`]=o,this.requestUpdate(i,e),t?.call(this,o)}}}Object.defineProperty(o,e,r)}}},38962(t,o,e){e.a(t,async function(t,i){try{e.r(o);var s=e(62826),a=e(5124),r=e(22441),n=e(6412),c=e(93421),l=e(1087),h=e(26300),d=(e(67094),t([h]));h=(d.then?(await d)():d)[0];const p="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",u={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 g extends a.WF{render(){return a.qy` <div class="issue-type ${(0,n.H)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${u[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,n.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?a.qy`<div class="title">${this.title}</div>`:a.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?a.qy`<ha-icon-button @click="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${p}"></ha-icon-button>`:a.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,l.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}g.styles=a.AH`.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,s.Cg)([(0,r.MZ)()],g.prototype,"title",void 0),(0,s.Cg)([(0,r.MZ)({attribute:"alert-type"})],g.prototype,"alertType",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],g.prototype,"dismissable",void 0),(0,s.Cg)([(0,r.wk)(),(0,c.IW)()],g.prototype,"_localize",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],g.prototype,"narrow",void 0),g=(0,s.Cg)([(0,r.EM)("ha-alert")],g),i()}catch(t){i(t)}})},90248(t,o,e){e.a(t,async function(t,i){try{e.r(o),e.d(o,{HaIconButtonArrowPrev:()=>p});var s=e(62826),a=e(5124),r=e(22441),n=e(63091),c=e(26300),l=t([c]);c=(l.then?(await l)():l)[0];const h="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",d="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class p extends a.WF{render(){return a.qy` <ha-icon-button .disabled="${this.disabled}" .label="${this.label||this.hass?.localize("ui.common.back")||"Back"}" .path="${this._icon}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"></ha-icon-button> `}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===n.G.document.dir?d:h}}(0,s.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],p.prototype,"disabled",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"label",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"href",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"target",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"rel",void 0),(0,s.Cg)([(0,r.MZ)()],p.prototype,"download",void 0),(0,s.Cg)([(0,r.wk)()],p.prototype,"_icon",void 0),p=(0,s.Cg)([(0,r.EM)("ha-icon-button-arrow-prev")],p),i()}catch(t){i(t)}})},26300(t,o,e){e.a(t,async function(t,i){try{e.r(o),e.d(o,{HaIconButton:()=>h});var s=e(62826),a=e(5124),r=e(22441),n=e(63672),c=e(18350),l=(e(67094),t([c]));c=(l.then?(await l)():l)[0];class h extends a.WF{render(){return a.qy` <ha-button appearance="plain" variant="neutral" aria-label="${(0,n.J)(this.label)}" title="${(0,n.J)(this.hideTitle?void 0:this.label)}" aria-haspopup="${(0,n.J)(this.ariaHasPopup)}" .disabled="${this.disabled}" .iconTag="${this.path?"ha-svg-icon":"span"}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"> ${this.path?a.qy`<ha-svg-icon aria-hidden="true" .path="${this.path}"></ha-svg-icon>`:a.qy`<span><slot></slot></span>`} </ha-button> `}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}h.shadowRootOptions={mode:"open",delegatesFocus:!0},h.styles=a.AH`: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}@media (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`,(0,s.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],h.prototype,"disabled",void 0),(0,s.Cg)([(0,r.MZ)({type:String})],h.prototype,"path",void 0),(0,s.Cg)([(0,r.MZ)({type:String})],h.prototype,"label",void 0),(0,s.Cg)([(0,r.MZ)({type:String,attribute:"aria-haspopup"})],h.prototype,"ariaHasPopup",void 0),(0,s.Cg)([(0,r.MZ)({attribute:"hide-title",type:Boolean})],h.prototype,"hideTitle",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],h.prototype,"selected",void 0),(0,s.Cg)([(0,r.MZ)()],h.prototype,"href",void 0),(0,s.Cg)([(0,r.MZ)()],h.prototype,"target",void 0),(0,s.Cg)([(0,r.MZ)()],h.prototype,"rel",void 0),(0,s.Cg)([(0,r.MZ)()],h.prototype,"download",void 0),h=(0,s.Cg)([(0,r.EM)("ha-icon-button")],h),i()}catch(t){i(t)}})},2054(t,o,e){e.a(t,async function(t,o){try{var i=e(62826),s=e(5124),a=e(22441),r=e(1087),n=e(44249),c=e(26300),l=t([c]);c=(l.then?(await l)():l)[0];const h="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class d extends s.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 s.s6;const t=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return s.qy` <ha-icon-button .label="${this.hass.localize("ui.sidebar.sidebar_toggle")}" .path="${h}" @click="${this._toggleMenu}"></ha-icon-button> ${t?s.qy`<div class="dot"></div>`:""} `}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const o=t.has("hass")?t.get("hass"):this.hass,e=t.has("narrow")?t.get("narrow"):this.narrow,i=!1===o?.kioskMode&&(e||"always_hidden"===o?.dockedSidebar),s=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&i===s||(this._show=s||this._alwaysVisible,s?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}_subscribeNotifications(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,n.V)(this.hass.connection,t=>{this._hasNotifications=t.length>0})}_toggleMenu(){(0,r.r)(this,"hass-toggle-menu")}constructor(...t){super(...t),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}d.styles=s.AH`: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,i.Cg)([(0,a.MZ)({type:Boolean})],d.prototype,"narrow",void 0),(0,i.Cg)([(0,a.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,i.Cg)([(0,a.wk)()],d.prototype,"_hasNotifications",void 0),(0,i.Cg)([(0,a.wk)()],d.prototype,"_show",void 0),d=(0,i.Cg)([(0,a.EM)("ha-menu-button")],d),o()}catch(t){o(t)}})},67094(t,o,e){e.r(o),e.d(o,{HaSvgIcon:()=>r});var i=e(62826),s=e(5124),a=e(22441);class r extends s.WF{render(){return s.JW` <svg viewBox="${this.viewBox||"0 0 24 24"}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${this.path?s.JW`<path class="primary-path" d="${this.path}"></path>`:s.s6} ${this.secondaryPath?s.JW`<path class="secondary-path" d="${this.secondaryPath}"></path>`:s.s6} </g> </svg>`}}r.styles=s.AH`: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,i.Cg)([(0,a.MZ)()],r.prototype,"path",void 0),(0,i.Cg)([(0,a.MZ)({attribute:!1})],r.prototype,"secondaryPath",void 0),(0,i.Cg)([(0,a.MZ)({attribute:!1})],r.prototype,"viewBox",void 0),r=(0,i.Cg)([(0,a.EM)("ha-svg-icon")],r)},44249(t,o,e){e.d(o,{V:()=>i});const i=(t,o)=>{const e=new s,i=t.subscribeMessage(t=>o(e.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{i.then(t=>t?.())}};class s{processMessage(t){if("removed"===t.type)for(const o of Object.keys(t.notifications))delete this.notifications[o];else this.notifications={...this.notifications,...t.notifications};return Object.values(this.notifications)}constructor(){this.notifications={}}}},28019(t,o,e){e.a(t,async function(t,i){try{e.r(o);var s=e(62826),a=e(5124),r=e(22441),n=e(99774),c=e(29994),l=t([c]);c=(l.then?(await l)():l)[0];class h extends a.WF{willUpdate(t){if(this.hasUpdated){if(t.has("hass")){const o=t.get("hass");o&&o.localize!==this.hass.localize&&this._setLovelace()}}else this._setup()}async _setup(){await this.hass.loadFragmentTranslation("lovelace"),this._setLovelace()}render(){return this._lovelace?a.qy` <hui-root .hass="${this.hass}" .narrow="${this.narrow}" .lovelace="${this._lovelace}" .route="${this.route}" .panel="${this.panel}" no-edit></hui-root> `:a.s6}_setLovelace(){const t={views:[{type:"panel",cards:[{type:"empty-state",content_only:!0,icon:"mdi:lock",title:this.hass.localize("ui.panel.notfound.no_access_title"),content:this.hass.localize("ui.panel.notfound.no_access_content"),buttons:[{text:this.hass.localize("ui.panel.notfound.no_access_go_to_profile"),tap_action:{action:"navigate",navigation_path:"/profile/general"}}]}]}]};this._lovelace={config:t,rawConfig:t,editMode:!1,urlPath:n.Oi,mode:"generated",locale:this.hass.locale,enableFullEditMode:()=>{},saveConfig:async()=>{},deleteConfig:async()=>{},setEditMode:()=>{},showToast:()=>{}}}constructor(...t){super(...t),this.narrow=!1}}(0,s.Cg)([(0,r.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,s.Cg)([(0,r.MZ)({type:Boolean})],h.prototype,"narrow",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],h.prototype,"route",void 0),(0,s.Cg)([(0,r.MZ)({attribute:!1})],h.prototype,"panel",void 0),(0,s.Cg)([(0,r.wk)()],h.prototype,"_lovelace",void 0),h=(0,s.Cg)([(0,r.EM)("ha-panel-notfound")],h),i()}catch(t){i(t)}})}};