UNPKG

iobroker.lovelace

Version:

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

1 lines 11.6 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[39570],{93421:function(t,o,i){i.d(o,{IW:function(){return h},dH:function(){return l},fI:function(){return c}});i(44114),i(62953);var e=i(35211),s=i(22792),r=i(32172);const n=(t,o)=>{let i=t;for(const e of o){if(null==i)return;i=i[e]}return i},a=(t,o,i)=>{const s=(0,r.p)({transformer:function(t){return i.call(this,t)},watch:o?[o]:[]}),n=(0,e.Fg)({context:t,subscribe:!0});return(t,o)=>{s(t,o),n(t,o)}},c=t=>a(s.iN,t.entityIdPath[0],function(o){const i=n(this,t.entityIdPath);return"string"==typeof i?null==o?void 0:o[i]:void 0}),l=t=>a(s.X1,t.entityIdPath[0],function(o){const i=n(this,t.entityIdPath);return"string"==typeof i?null==o?void 0:o[i]:void 0}),h=()=>a(s.D5,void 0,({localize:t})=>t)},32172:function(t,o,i){i.d(o,{p:function(){return e}});i(16280),i(18111),i(7588),i(45367),i(92731),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);function e(t){return(o,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const e=String(i),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 i=new Set;o.forEach((t,o)=>{const e=this._watching.get(o);void 0!==e&&e.forEach(t=>i.add(t))}),i.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}s._transformers.set(i,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(i)});const r=Object.getOwnPropertyDescriptor(o,i);let n;if(void 0===r)n={get(){return this[`__transform_${e}`]},set(t){const o=this[`__transform_${e}`],i=this._transformers.get(e);this[`__transform_${e}`]=i?i.call(this,t):t,this[`__original_${e}`]=t,this.requestUpdate(e,o)},configurable:!0,enumerable:!0};else{const t=r.set;n=Object.assign(Object.assign({},r),{},{set(o){const i=this[`__transform_${e}`],s=this._transformers.get(e);this[`__transform_${e}`]=s?s.call(this,o):o,this[`__original_${e}`]=o,this.requestUpdate(e,i),null==t||t.call(this,o)}})}Object.defineProperty(o,i,n)}}},69093:function(t,o,i){i.d(o,{t:function(){return s}});var e=i(71727);const s=t=>(0,e.m)(t.entity_id)},82286:function(t,o,i){i.d(o,{$:function(){return e}});const e=(t,o)=>s(t.attributes,o),s=(t,o)=>0!==(t.supported_features&o)},38962:function(t,o,i){i.a(t,async function(t,e){try{i.r(o);i(62953);var s=i(40445),r=i(5124),n=i(67576),a=i(6412),c=i(93421),l=i(1087),h=i(26300),d=(i(67094),t([h]));h=(d.then?(await d)():d)[0];let u,p,f,_,g=t=>t;const m="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",v={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 r.WF{render(){var t;return(0,r.qy)(u||(u=g` <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,a.H)({[this.alertType]:!0}),this.title?"":"no-title",v[this.alertType],(0,a.H)({content:!0,narrow:this.narrow}),this.title?(0,r.qy)(p||(p=g`<div class="title">${0}</div>`),this.title):r.s6,this.dismissable?(0,r.qy)(f||(f=g`<ha-icon-button @click="${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"),m):r.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,r.AH)(_||(_=g`.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,n.MZ)()],w.prototype,"title",void 0),(0,s.Cg)([(0,n.MZ)({attribute:"alert-type"})],w.prototype,"alertType",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],w.prototype,"dismissable",void 0),(0,s.Cg)([(0,n.wk)(),(0,c.IW)()],w.prototype,"_localize",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],w.prototype,"narrow",void 0),w=(0,s.Cg)([(0,n.EM)("ha-alert")],w),e()}catch(u){e(u)}})},24367:function(t,o,i){i.d(o,{L:function(){return s},z:function(){return r}});var e=i(23832);const s=["input_boolean","input_button","input_text","input_number","input_datetime","input_select","counter","timer","schedule"],r=(0,e.g)(s)},56660:function(t,o,i){i.a(t,async function(t,e){try{i.r(o);i(3362),i(62953);var s=i(40445),r=i(5124),n=i(67576),a=i(1087),c=(i(93444),i(52763)),l=i(18350),h=i(72554),d=i(82e3),u=i(14503),p=i(81619),f=t([c,l,h]);[c,l,h]=f.then?(await f)():f;let _,g,m,v,w=t=>t;const y=[{name:"new_password",required:!0,selector:{text:{type:"password",autocomplete:"new-password"}}},{name:"password_confirm",required:!0,selector:{text:{type:"password",autocomplete:"new-password"}}}];class b extends r.WF{showDialog(t){this._params=t,this._userId=t.userId,this._data=void 0,this._error=void 0,this._open=!0}closeDialog(){this._open=!1}_dialogClosed(){this._params=void 0,this._userId=void 0,this._data=void 0,this._error=void 0,this._submitting=!1,this._success=!1,(0,a.r)(this,"dialog-closed",{dialog:this.localName})}_validate(){this._data&&this._data.new_password&&this._data.password_confirm&&this._data.new_password!==this._data.password_confirm?this._error={password_confirm:"password_no_match"}:this._error=void 0}render(){var t,o;if(!this._params)return r.s6;const i=Boolean((null===(t=this._data)||void 0===t?void 0:t.new_password)&&(null===(o=this._data)||void 0===o?void 0:o.password_confirm)&&!this._error);return(0,r.qy)(_||(_=w` <ha-dialog .open="${0}" prevent-scrim-close header-title="${0}" @closed="${0}"> ${0} </ha-dialog> `),this._open,this.hass.localize("ui.panel.config.users.change_password.caption"),this._dialogClosed,this._success?(0,r.qy)(g||(g=w` <p> ${0} </p> <ha-dialog-footer slot="footer"> <ha-button slot="primaryAction" @click="${0}"> ${0} </ha-button> </ha-dialog-footer> `),this.hass.localize("ui.panel.config.users.change_password.password_changed"),this.closeDialog,this.hass.localize("ui.common.ok")):(0,r.qy)(m||(m=w` <ha-form autofocus .hass="${0}" .data="${0}" .error="${0}" .schema="${0}" .computeLabel="${0}" .computeError="${0}" @value-changed="${0}" .disabled="${0}"></ha-form> <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" appearance="plain" @click="${0}"> ${0} </ha-button> <ha-button slot="primaryAction" @click="${0}" .disabled="${0}"> ${0} </ha-button> </ha-dialog-footer> `),this.hass,this._data,this._error,y,this._computeLabel,this._computeError,this._valueChanged,this._submitting,this.closeDialog,this.hass.localize("ui.common.cancel"),this._changePassword,this._submitting||!i,this.hass.localize("ui.panel.config.users.change_password.change")))}_valueChanged(t){this._data=t.detail.value,this._validate()}async _changePassword(){var t;if(this._userId&&null!==(t=this._data)&&void 0!==t&&t.new_password)try{this._submitting=!0,await(0,d.ds)(this.hass,this._userId,this._data.new_password),this._success=!0}catch(i){var o;(0,p.P)(this,{message:(null===(o=i.body)||void 0===o?void 0:o.message)||i.message||i})}finally{this._submitting=!1}}static get styles(){return[u.nA,(0,r.AH)(v||(v=w``))]}constructor(...t){super(...t),this._open=!1,this._submitting=!1,this._success=!1,this._computeLabel=t=>this.hass.localize(`ui.panel.config.users.change_password.${t.name}`),this._computeError=t=>this.hass.localize(`ui.panel.config.users.change_password.${t}`)||t}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_params",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_open",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_userId",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_data",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_error",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_submitting",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_success",void 0),b=(0,s.Cg)([(0,n.EM)("dialog-admin-change-password")],b),e()}catch(_){e(_)}})},48646:function(t,o,i){var e=i(69565),s=i(28551),r=i(1767),n=i(50851);t.exports=function(t,o){o&&"string"==typeof t||s(t);var i=n(t);return r(s(void 0!==i?e(i,t):t))}},78350:function(t,o,i){var e=i(46518),s=i(70259),r=i(79306),n=i(48981),a=i(26198),c=i(1469);e({target:"Array",proto:!0},{flatMap:function(t){var o,i=n(this),e=a(i);return r(t),o=c(i,0),s(o,i,i,e,0,1,t,arguments.length>1?arguments[1]:void 0),o}})},30237:function(t,o,i){i(6469)("flatMap")},30531:function(t,o,i){var e=i(46518),s=i(69565),r=i(79306),n=i(28551),a=i(1767),c=i(48646),l=i(19462),h=i(9539),d=i(96395),u=i(30684),p=i(84549);var f=!d&&!u("flatMap",function(){}),_=!d&&!f&&p("flatMap",TypeError),g=d||f||_||function(){try{var t=Iterator.prototype.flatMap.call(new Map([[4,5]]).entries(),function(t){return t});t.next(),t.return()}catch(o){return!0}}(),m=l(function(){for(var t,o,i=this.iterator,e=this.mapper;;){if(o=this.inner)try{if(!(t=n(s(o.next,o.iterator))).done)return t.value;this.inner=null}catch(r){h(i,"throw",r)}if(t=n(s(this.next,i)),this.done=!!t.done)return;try{this.inner=c(e(t.value,this.counter++),!1)}catch(r){h(i,"throw",r)}}});e({target:"Iterator",proto:!0,real:!0,forced:g},{flatMap:function(t){n(this);try{r(t)}catch(o){h(this,"throw",o)}return _?s(_,this,t):new m(a(this),{mapper:t,inner:null})}})},54495:function(t,o,i){i.d(o,{OA:function(){return e.OA},WL:function(){return e.WL},u$:function(){return e.u$}});var e=i(42017)}}]);