iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
8 lines • 32.3 kB
JavaScript
/*! For license information please see 94296.6920edf454be3f38.js.LICENSE.txt */
;(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[94296],{93421:function(t,e,i){i.d(e,{IW:function(){return h},dH:function(){return c},fI:function(){return l}});i(44114),i(62953);var a=i(35211),o=i(22792),r=i(32172);const s=(t,e)=>{let i=t;for(const a of e){if(null==i)return;i=i[a]}return i},n=(t,e,i)=>{const o=(0,r.p)({transformer:function(t){return i.call(this,t)},watch:e?[e]:[]}),s=(0,a.Fg)({context:t,subscribe:!0});return(t,e)=>{o(t,e),s(t,e)}},l=t=>n(o.iN,t.entityIdPath[0],function(e){const i=s(this,t.entityIdPath);return"string"==typeof i?null==e?void 0:e[i]:void 0}),c=t=>n(o.X1,t.entityIdPath[0],function(e){const i=s(this,t.entityIdPath);return"string"==typeof i?null==e?void 0:e[i]:void 0}),h=()=>n(o.D5,void 0,({localize:t})=>t)},32172:function(t,e,i){i.d(e,{p:function(){return a}});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 a(t){return(e,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const a=String(i),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 i=new Set;e.forEach((t,e)=>{const a=this._watching.get(e);void 0!==a&&a.forEach(t=>i.add(t))}),i.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}o._transformers.set(i,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(i)});const r=Object.getOwnPropertyDescriptor(e,i);let s;if(void 0===r)s={get(){return this[`__transform_${a}`]},set(t){const e=this[`__transform_${a}`],i=this._transformers.get(a);this[`__transform_${a}`]=i?i.call(this,t):t,this[`__original_${a}`]=t,this.requestUpdate(a,e)},configurable:!0,enumerable:!0};else{const t=r.set;s=Object.assign(Object.assign({},r),{},{set(e){const i=this[`__transform_${a}`],o=this._transformers.get(a);this[`__transform_${a}`]=o?o.call(this,e):e,this[`__original_${a}`]=e,this.requestUpdate(a,i),null==t||t.call(this,e)}})}Object.defineProperty(e,i,s)}}},86836:function(t,e,i){function a(){return Math.floor(65536*(1+Math.random())).toString(16).substring(1)}function o(){return a()+a()+a()+a()+a()}i.d(e,{L:function(){return o}})},38962:function(t,e,i){i.a(t,async function(t,a){try{i.r(e);i(62953);var o=i(40445),r=i(5124),s=i(67576),n=i(6412),l=i(93421),c=i(1087),h=i(26300),d=(i(67094),t([h]));h=(d.then?(await d)():d)[0];let u,p,g,m,v=t=>t;const b="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",f={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=v` <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",f[this.alertType],(0,n.H)({content:!0,narrow:this.narrow}),this.title?(0,r.qy)(p||(p=v`<div class="title">${0}</div>`),this.title):r.s6,this.dismissable?(0,r.qy)(g||(g=v`<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"),b):r.s6)}_dismissClicked(){(0,c.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)(m||(m=v`.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,s.MZ)()],w.prototype,"title",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"alert-type"})],w.prototype,"alertType",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],w.prototype,"dismissable",void 0),(0,o.Cg)([(0,s.wk)(),(0,l.IW)()],w.prototype,"_localize",void 0),(0,o.Cg)([(0,s.MZ)({type:Boolean})],w.prototype,"narrow",void 0),w=(0,o.Cg)([(0,s.EM)("ha-alert")],w),a()}catch(u){a(u)}})},23430:function(t,e,i){i.a(t,async function(t,a){try{i.d(e,{l:function(){return m}});i(89463),i(42762),i(62953);var o=i(40445),r=i(5124),s=i(67576),n=i(78870),l=i(79622),c=i(86836),h=i(34127),d=t([h]);h=(d.then?(await d)():d)[0];let u,p,g=t=>t;const m=t=>{const e=t?(0,n.MP)(t):void 0;return e?`--ha-label-background-color: ${e};\n --primary-text-color: ${(0,l.gJ)(t)};`:"--ha-label-background-color: rgba(var(--rgb-primary-text-color), 0.15);"};class v extends r.WF{willUpdate(t){super.willUpdate(t),t.has("color")&&(this.style.cssText=m(this.color))}render(){var t;return(0,r.qy)(u||(u=g` <ha-tooltip .for="${0}" .disabled="${0}"> ${0} </ha-tooltip> <div class="container" .id="${0}"> <span class="content"> <slot name="icon"></slot> <slot></slot> </span> </div> `),this._elementId,!(null!==(t=this.description)&&void 0!==t&&t.trim()),this.description,this._elementId)}static get styles(){return[(0,r.AH)(p||(p=g`:host{--ha-label-text-color:var(--primary-text-color);--ha-label-icon-color:var(--primary-text-color);--ha-label-background-opacity:1;border:1px solid var(--outline-color);position:relative;box-sizing:border-box;display:inline-flex;flex-direction:row;align-items:center;font-size:var(--ha-font-size-s);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-condensed);letter-spacing:.1px;height:32px;border-radius:var(--ha-border-radius-xl);color:var(--ha-label-text-color);--mdc-icon-size:12px;text-wrap:nowrap}.content>*{position:relative;display:inline-flex;flex-direction:row;align-items:center}:host:before{position:absolute;content:"";inset:0;border-radius:inherit;background-color:var(--ha-label-background-color);opacity:var(--ha-label-background-opacity)}::slotted([slot=icon]){margin-right:8px;margin-left:-8px;margin-inline-start:-8px;margin-inline-end:8px;display:flex}.container{display:flex;align-items:center;position:relative;height:100%;padding:0 16px}span{display:inline-flex}:host([dense]){height:20px;border-radius:var(--ha-border-radius-md)}:host([dense]) .container{padding:0 12px}:host([dense]) ::slotted([slot=icon]){margin-right:4px;margin-left:-4px;margin-inline-start:-4px;margin-inline-end:4px}`))]}constructor(...t){super(...t),this.dense=!1,this._elementId="label-"+(0,c.L)()}}(0,o.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],v.prototype,"dense",void 0),(0,o.Cg)([(0,s.MZ)()],v.prototype,"color",void 0),(0,o.Cg)([(0,s.MZ)({attribute:"description"})],v.prototype,"description",void 0),v=(0,o.Cg)([(0,s.EM)("ha-label")],v),a()}catch(u){a(u)}})},59646:function(t,e,i){i.a(t,async function(t,e){try{i(62953);var a=i(40445),o=i(29344),r=i(5124),s=i(67576),n=i(88360),l=t([o]);o=(l.then?(await l)():l)[0];let c,h=t=>t;class d extends o.A{updated(t){super.updated(t),t.has("haptic")&&(this.haptic?this.addEventListener("change",this._forwardHaptic):this.removeEventListener("change",this._forwardHaptic))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("change",this._forwardHaptic)}static get styles(){return[o.A.styles,(0,r.AH)(c||(c=h`:host{--wa-form-control-toggle-size:var(--ha-switch-size, 24px);--wa-form-control-required-content:var(
--ha-switch-required-marker,
var(--ha-input-required-marker, "*")
);--wa-form-control-required-content-offset:var(
--ha-switch-required-marker-offset,
0.1rem
);--thumb-size:var(--ha-switch-thumb-size, 18px);--width:var(--ha-switch-width, 48px)}label{position:relative;height:max(var(--thumb-size),var(--wa-form-control-toggle-size))}label::before{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:100%;height:100%;min-width:var(--ha-switch-min-touch-size,40px);min-height:var(--ha-switch-min-touch-size,40px)}label.disabled::before{pointer-events:none}.switch{background-color:var(--ha-switch-background-color,var(--ha-color-fill-disabled-quiet-resting));border-color:var(--ha-switch-border-color,var(--ha-color-border-neutral-normal))}label:not(.disabled) .input:focus-visible~.switch,label:not(.disabled):hover .switch{background-color:var(--ha-switch-background-color-hover,var(--ha-switch-background-color,var(--ha-color-fill-disabled-quiet-hover)))}.checked .switch{background-color:var(--ha-switch-checked-background-color,var(--ha-color-fill-primary-normal-resting));border-color:var(--ha-switch-checked-border-color,var(--ha-color-border-primary-loud))}label:not(.disabled).checked .input:focus-visible~.switch,label:not(.disabled).checked:hover .switch{background-color:var(--ha-switch-checked-background-color-hover,var(--ha-switch-checked-background-color,var(--ha-color-fill-primary-normal-hover)));border-color:var(--ha-switch-checked-border-color-hover,var(--ha-switch-checked-border-color,var(--ha-color-border-primary-loud)))}.switch .thumb{background-color:var(--ha-switch-thumb-background-color,var(--ha-color-on-neutral-normal));border-color:var(--ha-switch-thumb-border-color,var(--ha-color-on-neutral-normal));border-style:var(--wa-form-control-border-style);border-width:var(--wa-form-control-border-width);box-shadow:var(--ha-switch-thumb-box-shadow,var(--ha-box-shadow-s))}label:not(.disabled) .input:focus-visible~.switch .thumb,label:not(.disabled):hover .switch .thumb{background-color:var(--ha-switch-thumb-background-color-hover,var(--ha-switch-thumb-background-color,var(--ha-color-on-neutral-normal)));border-color:var(--ha-switch-thumb-border-color-hover,var(--ha-switch-thumb-border-color,var(--ha-color-on-neutral-normal)))}.checked .switch .thumb{background-color:var(--ha-switch-checked-thumb-background-color,var(--ha-color-on-primary-normal));border-color:var(--ha-switch-checked-thumb-border-color,var(--ha-color-on-primary-normal))}label:not(.disabled).checked .input:focus-visible~.switch .thumb,label:not(.disabled).checked:hover .switch .thumb{background-color:var(--ha-switch-checked-thumb-background-color-hover,var(--ha-switch-checked-thumb-background-color,var(--ha-color-on-primary-normal)));border-color:var(--ha-switch-checked-thumb-border-color-hover,var(--ha-switch-checked-thumb-border-color,var(--ha-color-on-primary-normal)))}label.disabled{opacity:var(--ha-switch-disabled-opacity, .3);cursor:not-allowed}label:not(.disabled) .input:focus-visible~.switch .thumb{outline:0;outline-offset:none}label:not(.disabled) .input:focus-visible~.switch{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}:host(:empty) slot.label{display:none}`))]}constructor(...t){super(...t),this.haptic=!1,this._forwardHaptic=()=>{(0,n.j)(this,"light")}}}(0,a.Cg)([(0,s.MZ)({type:Boolean})],d.prototype,"haptic",void 0),d=(0,a.Cg)([(0,s.EM)("ha-switch")],d),e()}catch(c){e(c)}})},83892:function(t,e,i){i.d(e,{x:function(){return m}});i(18111),i(13579),i(27495),i(42762),i(62953);var a=i(40445),o=i(92070),r=i(5124),s=i(67576);let n,l,c,h,d,u,p,g=t=>t;class m extends r.WF{_onSlotChange(t){return e=>{const i=e.target.assignedNodes({flatten:!0}).some(t=>{var e;return t.nodeType===Node.ELEMENT_NODE||t.nodeType===Node.TEXT_NODE&&""!==(null===(e=t.textContent)||void 0===e?void 0:e.trim())});"start"===t?this._hasStart=i:this._hasEnd=i}}render(){return this._renderBase(this._renderInner())}_renderBase(t){return(0,r.qy)(n||(n=g`<div part="base" class="base" id="item">${0}</div>`),t)}_renderInner(){const t=this._slotController.test("content");return(0,r.qy)(l||(l=g` <div part="start" class="start" ?hidden="${0}"> <slot name="start" @slotchange="${0}"></slot> </div> <div part="content" class="content"> ${0} </div> <div part="end" class="end" ?hidden="${0}"> <slot name="end" @slotchange="${0}"></slot> </div> `),!this._hasStart,this._onSlotChange("start"),t?(0,r.qy)(c||(c=g`<slot name="content"></slot>`)):this._renderDefaultContent(),!this._hasEnd,this._onSlotChange("end"))}_renderDefaultContent(){var t,e;const i=this._slotController.test("headline"),a=this._slotController.test("supporting-text"),o=i||void 0!==this.headline,s=a||void 0!==this.supportingText;return(0,r.qy)(h||(h=g` ${0} ${0} `),o?(0,r.qy)(d||(d=g`<div part="headline" class="headline"> <slot name="headline">${0}</slot> </div>`),null!==(t=this.headline)&&void 0!==t?t:r.s6):r.s6,s?(0,r.qy)(u||(u=g`<div part="supporting-text" class="supporting"> <slot name="supporting-text">${0}</slot> </div>`),null!==(e=this.supportingText)&&void 0!==e?e:r.s6):r.s6)}constructor(...t){super(...t),this.disabled=!1,this._slotController=new o.X(this,"headline","supporting-text","content"),this._hasStart=!1,this._hasEnd=!1}}m.styles=(0,r.AH)(p||(p=g`:host{display:block;color:var(--primary-text-color);font-size:var(--ha-font-size-m);line-height:var(--ha-line-height-normal)}:host([disabled]){color:var(--disabled-text-color);pointer-events:none}.base{position:relative;display:flex;flex-direction:row;align-items:center;gap:var(--ha-row-item-gap,var(--ha-space-4));padding-block:var(--ha-row-item-padding-block,var(--ha-space-3));padding-inline:var(--ha-row-item-padding-inline,var(--ha-space-4));min-height:var(--ha-row-item-min-height,48px);box-sizing:border-box}.content{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;justify-content:center}.end,.start{display:flex;align-items:center;flex:0 0 auto}.end[hidden],.start[hidden]{display:none}.headline{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.supporting{color:var(--secondary-text-color);font-size:var(--ha-font-size-s);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}`)),(0,a.Cg)([(0,s.MZ)({type:String})],m.prototype,"headline",void 0),(0,a.Cg)([(0,s.MZ)({type:String,attribute:"supporting-text"})],m.prototype,"supportingText",void 0),(0,a.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],m.prototype,"disabled",void 0),(0,a.Cg)([(0,s.wk)()],m.prototype,"_hasStart",void 0),(0,a.Cg)([(0,s.wk)()],m.prototype,"_hasEnd",void 0),m=(0,a.Cg)([(0,s.EM)("ha-row-item")],m)},82e3:function(t,e,i){i.d(e,{D5:function(){return a},Fy:function(){return s},Gk:function(){return c},Hg:function(){return o},Y_:function(){return h},ds:function(){return l},e0:function(){return r},ec:function(){return n}});i(74423),i(18111),i(61701),i(33110),i(3362);const a=14881==i.j?`${location.protocol}//${location.host}`:null,o=t=>t.map(t=>{if("string"!==t.type)return t;switch(t.name){case"username":return Object.assign(Object.assign({},t),{},{autocomplete:"username",autofocus:!0});case"password":return Object.assign(Object.assign({},t),{},{autocomplete:"current-password"});case"code":return Object.assign(Object.assign({},t),{},{autocomplete:"one-time-code",autofocus:!0});default:return t}}),r=(t,e)=>t.callWS({type:"auth/sign_path",path:e}),s=async(t,e,i,a)=>t.callWS({type:"config/auth_provider/homeassistant/create",user_id:e,username:i,password:a}),n=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:e,new_password:i}),l=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:e,password:i}),c=(t,e,i)=>t.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:e,username:i}),h=(t,e,i)=>t.callWS({type:"auth/delete_all_refresh_tokens",token_type:e,delete_current_token:i})},7915:function(t,e,i){i.a(t,async function(t,a){try{i.r(e);i(74423),i(18111),i(20116),i(61701),i(3362),i(42762),i(62953);var o=i(40445),r=i(5124),s=i(67576),n=i(1087),l=i(38962),c=i(18350),h=i(72554),d=(i(93444),i(26300)),u=i(23430),p=(i(67094),i(59646)),g=i(91485),m=(i(83892),i(82e3)),v=i(28669),b=i(65063),f=i(14503),w=i(12176),y=t([l,c,h,d,u,p,g]);[l,c,h,d,u,p,g]=y.then?(await y)():y;let _,k,x,$,C,z,A,M,E,q,H,L=t=>t;const O="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z";class S extends r.WF{async showDialog(t){this._params=t,this._error=void 0,this._name=t.entry.name||"",this._isAdmin=t.entry.group_ids.includes(v.wj),this._localOnly=t.entry.local_only,this._isActive=t.entry.is_active,this._open=!0,await this.updateComplete}render(){var t,e,i;if(!this._params)return r.s6;const a=this._params.entry,o=(0,v.xg)(this.hass,a,!0);return(0,r.qy)(_||(_=L` <ha-dialog .open="${0}" prevent-scrim-close header-title="${0}" @closed="${0}"> <div> ${0} <div class="secondary"> ${0}: ${0}<br> </div> ${0} <div class="form"> ${0} ${0} <ha-row-item> <span slot="headline">${0}</span> <span slot="supporting-text">${0}</span> <ha-switch slot="end" .disabled="${0}" .checked="${0}" @change="${0}"></ha-switch> </ha-row-item> <ha-row-item> <span slot="headline">${0}</span> <span slot="supporting-text">${0}</span> <ha-switch slot="end" .disabled="${0}" .checked="${0}" @change="${0}"></ha-switch> </ha-row-item> <ha-row-item> <span slot="headline">${0}</span> <span slot="supporting-text">${0}</span> <ha-switch slot="end" .disabled="${0}" .checked="${0}" @change="${0}"></ha-switch> </ha-row-item> ${0} </div> ${0} </div> <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" variant="danger" appearance="plain" @click="${0}" .disabled="${0}"> ${0} </ha-button> <ha-button slot="primaryAction" @click="${0}" .disabled="${0}"> ${0} </ha-button> </ha-dialog-footer> </ha-dialog> `),this._open,a.name,this._dialogClosed,this._error?(0,r.qy)(k||(k=L`<div class="error">${0}</div>`),this._error):r.s6,this.hass.localize("ui.panel.config.users.editor.id"),a.id,0===o.length?r.s6:(0,r.qy)(x||(x=L` <div class="badge-container"> ${0} </div> `),o.map(([t,e])=>(0,r.qy)($||($=L` <ha-label> <ha-svg-icon slot="icon" .path="${0}"></ha-svg-icon> ${0} </ha-label> `),t,e))),a.system_generated?r.s6:(0,r.qy)(C||(C=L` <ha-input autofocus .value="${0}" @input="${0}" .label="${0}"></ha-input> <ha-row-item> <span slot="headline">${0}</span> <span slot="supporting-text">${0}</span> ${0} </ha-row-item> `),this._name,this._nameChanged,this.hass.localize("ui.panel.config.users.editor.name"),this.hass.localize("ui.panel.config.users.editor.username"),a.username,null!==(t=this.hass.user)&&void 0!==t&&t.is_owner?(0,r.qy)(z||(z=L` <ha-icon-button slot="end" .path="${0}" @click="${0}" .label="${0}"> </ha-icon-button> `),O,this._changeUsername,this.hass.localize("ui.panel.config.users.editor.change_username")):r.s6),!a.system_generated&&null!==(e=this.hass.user)&&void 0!==e&&e.is_owner?(0,r.qy)(A||(A=L` <ha-row-item> <span slot="headline">${0}</span> <span slot="supporting-text">************</span> ${0} </ha-row-item> `),this.hass.localize("ui.panel.config.users.editor.password"),null!==(i=this.hass.user)&&void 0!==i&&i.is_owner?(0,r.qy)(M||(M=L` <ha-icon-button slot="end" .path="${0}" @click="${0}" .label="${0}"> </ha-icon-button> `),O,this._changePassword,this.hass.localize("ui.panel.config.users.editor.change_password")):r.s6):r.s6,this.hass.localize("ui.panel.config.users.editor.active"),this.hass.localize("ui.panel.config.users.editor.active_description"),a.system_generated||a.is_owner,this._isActive,this._activeChanged,this.hass.localize("ui.panel.config.users.editor.local_access_only"),this.hass.localize("ui.panel.config.users.editor.local_access_only_description"),a.system_generated,this._localOnly,this._localOnlyChanged,this.hass.localize("ui.panel.config.users.editor.admin"),this.hass.localize("ui.panel.config.users.editor.admin_description"),a.system_generated||a.is_owner,this._isAdmin,this._adminChanged,this._isAdmin||a.system_generated?r.s6:(0,r.qy)(E||(E=L` <ha-alert alert-type="info"> ${0} </ha-alert> `),this.hass.localize("ui.panel.config.users.users_privileges_note")),a.system_generated?(0,r.qy)(q||(q=L` <ha-alert alert-type="info"> ${0} </ha-alert> `),this.hass.localize("ui.panel.config.users.editor.system_generated_read_only_users")):r.s6,this._deleteEntry,this._submitting||a.system_generated||a.is_owner,this.hass.localize("ui.panel.config.users.editor.delete_user"),this._updateEntry,!this._name||this._submitting||a.system_generated,this.hass.localize("ui.common.save"))}_nameChanged(t){var e;this._error=void 0,this._name=null!==(e=t.target.value)&&void 0!==e?e:""}_adminChanged(t){this._isAdmin=t.target.checked}_localOnlyChanged(t){this._localOnly=t.target.checked}_activeChanged(t){this._isActive=t.target.checked}async _updateEntry(){this._submitting=!0;try{await this._params.updateEntry({name:this._name.trim(),is_active:this._isActive,group_ids:[this._isAdmin?v.wj:v.eR],local_only:this._localOnly}),this._close()}catch(t){this._error=(null==t?void 0:t.message)||"Unknown error"}finally{this._submitting=!1}}async _deleteEntry(){this._submitting=!0;try{await this._params.removeEntry()&&this._close()}finally{this._submitting=!1}}async _changeUsername(){var t;if(!(null===(t=this._params)||void 0===t?void 0:t.entry.credentials.find(t=>"homeassistant"===t.type)))return void(0,b.showAlertDialog)(this,{title:"No ioBroker credentials found."});const e=await(0,b.an)(this,{inputLabel:this.hass.localize("ui.panel.config.users.change_username.new_username"),confirmText:this.hass.localize("ui.panel.config.users.change_username.change"),title:this.hass.localize("ui.panel.config.users.change_username.caption"),defaultValue:this._params.entry.username});if(e)try{await(0,m.Gk)(this.hass,this._params.entry.id,e),this._params=Object.assign(Object.assign({},this._params),{},{entry:Object.assign(Object.assign({},this._params.entry),{},{username:e})}),this._params.replaceEntry(this._params.entry),(0,b.showAlertDialog)(this,{text:this.hass.localize("ui.panel.config.users.change_username.username_changed")})}catch(i){(0,b.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.users.change_username.failed"),text:i.message})}}async _changePassword(){var t;(null===(t=this._params)||void 0===t?void 0:t.entry.credentials.find(t=>"homeassistant"===t.type))?(0,w.M)(this,{userId:this._params.entry.id}):(0,b.showAlertDialog)(this,{title:"No ioBroker credentials found."})}_close(){this._open=!1}_dialogClosed(){this._params=void 0,(0,n.r)(this,"dialog-closed",{dialog:this.localName})}static get styles(){return[f.nA,(0,r.AH)(H||(H=L`.form{padding-top:16px}.secondary{color:var(--secondary-text-color)}ha-row-item{--ha-row-item-padding-inline:0}.badge-container{margin-top:4px}.badge-container>*{margin-top:4px;margin-bottom:4px;margin-right:4px;margin-left:0;margin-inline-end:4px;margin-inline-start:0}`))]}constructor(...t){super(...t),this._open=!1,this._submitting=!1}}(0,o.Cg)([(0,s.MZ)({attribute:!1})],S.prototype,"hass",void 0),(0,o.Cg)([(0,s.wk)()],S.prototype,"_name",void 0),(0,o.Cg)([(0,s.wk)()],S.prototype,"_isAdmin",void 0),(0,o.Cg)([(0,s.wk)()],S.prototype,"_localOnly",void 0),(0,o.Cg)([(0,s.wk)()],S.prototype,"_isActive",void 0),(0,o.Cg)([(0,s.wk)()],S.prototype,"_error",void 0),(0,o.Cg)([(0,s.wk)()],S.prototype,"_params",void 0),(0,o.Cg)([(0,s.wk)()],S.prototype,"_open",void 0),(0,o.Cg)([(0,s.wk)()],S.prototype,"_submitting",void 0),S=(0,o.Cg)([(0,s.EM)("dialog-user-detail")],S),a()}catch(_){a(_)}})},12176:function(t,e,i){i.d(e,{M:function(){return r}});i(3362),i(62953);var a=i(1087);const o=()=>Promise.all([i.e(53480),i.e(39570)]).then(i.bind(i,56660)),r=(t,e)=>{(0,a.r)(t,"show-dialog",{dialogTag:"dialog-admin-change-password",dialogImport:o,dialogParams:e})}},29344:function(t,e,i){i.a(t,async function(t,a){try{i.d(e,{A:function(){return z}});i(27495),i(62953);var o=i(5124),r=i(67576),s=i(6412),n=i(63672),l=i(34514),c=i(40991),h=i(92070),d=i(41268),u=i(9395),p=i(62676),g=i(15477),m=i(31896),v=i(17060),b=i(19978),f=t([v]);v=(f.then?(await f)():f)[0];let k,x,$,C=t=>t;var w=Object.defineProperty,y=Object.getOwnPropertyDescriptor,_=(t,e,i,a)=>{for(var o,r=a>1?void 0:a?y(e,i):e,s=t.length-1;s>=0;s--)(o=t[s])&&(r=(a?o(e,i,r):o(r))||r);return a&&r&&w(e,i,r),r};let z=class extends p.q{static get validators(){return[...super.validators,(0,d.i)()]}get value(){var t;return null!==(t=this._value)&&void 0!==t?t:"on"}set value(t){this._value=t}handleSizeChange(){(0,c.b)(this.localName,this.size)}get checked(){var t;return this.valueHasChanged?Boolean(this._checked):null!==(t=this._checked)&&void 0!==t?t:this.defaultChecked}set checked(t){this._checked=Boolean(t),this.valueHasChanged=!0}handleClick(){this.hasInteracted=!0,this.checked=!this.checked,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0}))})}handleKeyDown(t){const e="rtl"===this.localize.dir();"ArrowLeft"===t.key&&(t.preventDefault(),this.checked=e,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))})),"ArrowRight"===t.key&&(t.preventDefault(),this.checked=!e,this.updateComplete.then(()=>{this.dispatchEvent(new Event("change",{bubbles:!0,composed:!0})),this.dispatchEvent(new InputEvent("input",{bubbles:!0,composed:!0}))}))}willUpdate(t){super.willUpdate(t),(t.has("value")||t.has("checked")||t.has("defaultChecked"))&&this.handleValueOrCheckedChange()}handleValueOrCheckedChange(){this.setValue(this.checked?this.value:null,this._value),this.updateValidity()}handleStateChange(){this.hasUpdated&&(this.input.checked=this.checked),this.customStates.set("checked",this.checked),this.updateValidity()}handleDisabledChange(){this.updateValidity()}click(){this.input.click()}focus(t){this.input.focus(t)}blur(){this.input.blur()}setValue(t,e){this.checked?this.internals.setFormValue(null!=t?t:"on",e):this.internals.setFormValue(null,null)}formResetCallback(){this._checked=null,super.formResetCallback(),this.handleValueOrCheckedChange()}render(){const t=this.hasUpdated?this.hasSlotController.test("hint"):this.withHint,e=!!this.hint||!!t;return(0,o.qy)(k||(k=C` <label part="base" class="${0}"> <input class="input" type="checkbox" title="${0}" name="${0}" value="${0}" .checked="${0}" .disabled="${0}" .required="${0}" role="switch" aria-checked="${0}" aria-describedby="hint" @click="${0}" @keydown="${0}"> <span part="control" class="switch"> <span part="thumb" class="thumb"></span> </span> <slot part="label" class="label"></slot> </label> <slot id="hint" name="hint" part="hint" class="${0}" aria-hidden="${0}">${0}</slot> `),(0,s.H)({checked:this.checked,disabled:this.disabled}),this.title,(0,n.J)(this.name),(0,n.J)(this.value),(0,l.V)(this.checked),this.disabled,this.required,this.checked?"true":"false",this.handleClick,this.handleKeyDown,(0,s.H)({"has-slotted":e}),e?"false":"true",this.hint)}constructor(){var t;super(...arguments),this.hasSlotController=new h.X(this,"hint"),this.localize=new v.c(this),this.title="",this.name=null,this._value=null!==(t=this.getAttribute("value"))&&void 0!==t?t:null,this.size="m",this.disabled=!1,this._checked=null,this.defaultChecked=this.hasAttribute("checked"),this.required=!1,this.hint="",this.withHint=!1}};z.shadowRootOptions=Object.assign(Object.assign({},p.q.shadowRootOptions),{},{delegatesFocus:!0}),z.css=[g.A,m.A,b.A],_([(0,r.P)('input[type="checkbox"]')],z.prototype,"input",2),_([(0,r.MZ)()],z.prototype,"title",2),_([(0,r.MZ)({reflect:!0})],z.prototype,"name",2),_([(0,r.MZ)({reflect:!0})],z.prototype,"value",1),_([(0,r.MZ)({reflect:!0})],z.prototype,"size",2),_([(0,u.w)("size")],z.prototype,"handleSizeChange",1),_([(0,r.MZ)({type:Boolean})],z.prototype,"disabled",2),_([(0,r.MZ)({type:Boolean,attribute:!1})],z.prototype,"checked",1),_([(0,r.MZ)({type:Boolean,attribute:"checked",reflect:!0})],z.prototype,"defaultChecked",2),_([(0,r.MZ)({type:Boolean,reflect:!0})],z.prototype,"required",2),_([(0,r.MZ)({attribute:"hint"})],z.prototype,"hint",2),_([(0,r.MZ)({attribute:"with-hint",type:Boolean})],z.prototype,"withHint",2),_([(0,u.w)(["checked","defaultChecked"])],z.prototype,"handleStateChange",1),_([(0,u.w)("disabled",{waitUntilFirstUpdate:!0})],z.prototype,"handleDisabledChange",1),z=_([(0,r.EM)("wa-switch")],z),null===(x=($=z).disableWarning)||void 0===x||x.call($,"change-in-update"),a()}catch(k){a(k)}})},19978:function(t,e,i){i.d(e,{A:function(){return o}});let a;var o=(0,i(5124).AH)(a||(a=(t=>t)`:host{--height:var(--wa-form-control-toggle-size);--width:calc(var(--height) * 1.75);--thumb-size:0.75em;display:inline-flex;line-height:var(--wa-form-control-value-line-height)}label{position:relative;display:flex;align-items:center;font:inherit;color:var(--wa-form-control-value-color);vertical-align:middle;cursor:pointer}.switch{flex:0 0 auto;position:relative;display:flex;align-items:center;justify-content:center;width:var(--width);height:var(--height);background-color:var(--wa-form-control-background-color);border-color:var(--wa-form-control-border-color);border-radius:var(--height);border-style:var(--wa-form-control-border-style);border-width:var(--wa-form-control-border-width);transition-property:translate,background,border-color,box-shadow;transition-duration:var(--wa-transition-normal);transition-timing-function:var(--wa-transition-easing)}.switch .thumb{aspect-ratio:1/1;width:var(--thumb-size);height:var(--thumb-size);background-color:var(--wa-form-control-border-color);border-radius:50%;translate:calc((var(--width) - var(--height))/ -2);transition:inherit}.switch .thumb:dir(rtl){translate:calc((var(--width) - var(--height))/ 2)}.input{position:absolute;opacity:0;padding:0;margin:0;pointer-events:none}label:not(.disabled) .input:focus-visible~.switch .thumb{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}.checked .switch{background-color:var(--wa-form-control-activated-color);border-color:var(--wa-form-control-activated-color)}.checked .switch .thumb{background-color:var(--wa-color-surface-default);translate:calc((var(--width) - var(--height))/ 2)}.checked .switch .thumb:dir(rtl){translate:calc((var(--width) - var(--height))/ -2)}label:has(> :disabled){opacity:.5;cursor:not-allowed}[part~=label]{display:inline-block;line-height:var(--height);margin-inline-start:.5em;user-select:none;-webkit-user-select:none}:host([required]) [part~=label]::after{content:var(--wa-form-control-required-content);color:var(--wa-form-control-required-content-color);margin-inline-start:var(--wa-form-control-required-content-offset)}@media (forced-colors:active){:checked+.switch .thumb,:checked:enabled+.switch:hover .thumb{background-color:ButtonText}}`))}}]);