iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
2 lines • 53.3 kB
JavaScript
/*! For license information please see 63206.0cfedeacdf59ef9e.js.LICENSE.txt */
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[63206],{57673:function(t,e,i){i.d(e,{z:function(){return a}});const a=t=>{if(void 0===t)return;if("object"!=typeof t){if("string"==typeof t||isNaN(t)){const e=(null==t?void 0:t.toString().split(":"))||[];if(1===e.length)return{seconds:Number(e[0])};if(e.length>3)return;const i=Number(e[2])||0,a=Math.floor(i);return{hours:Number(e[0])||0,minutes:Number(e[1])||0,seconds:a,milliseconds:Math.floor(1e3*Number((i-a).toFixed(4)))}}return{seconds:t}}if(!("days"in t))return t;const{days:e,minutes:i,seconds:a,milliseconds:s}=t;let o=t.hours||0;return o=(o||0)+24*(e||0),{hours:o,minutes:i,seconds:a,milliseconds:s}}},84446:function(t,e,i){i.d(e,{p:function(){return o},z:function(){return s}});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698),i(62953);var a=i(71727);const s=t=>t.include_domains.length+t.include_entities.length+t.exclude_domains.length+t.exclude_entities.length===0,o=(t,e,i,s)=>{const o=new Set(t),n=new Set(e),r=new Set(i),l=new Set(s),d=o.size>0||n.size>0,h=r.size>0||l.size>0;return d||h?d&&!h?t=>n.has(t)||o.has((0,a.m)(t)):!d&&h?t=>!l.has(t)&&!r.has((0,a.m)(t)):o.size?t=>o.has((0,a.m)(t))?!l.has(t):n.has(t):r.size?t=>r.has((0,a.m)(t))?n.has(t):!l.has(t):t=>n.has(t):()=>!0}},61037:function(t,e,i){var a=i(40445),s=i(67576),o=i(5124),n=i(14503),r=i(14782),l=i(44144);let d,h,u=t=>t;class c extends o.WF{render(){var t;return(0,o.qy)(d||(d=u` <img class="logo" alt="${0}" src="${0}" crossorigin="anonymous" referrerpolicy="no-referrer"> `),r.aK[this.voiceAssistantId].name,(0,l.MR)({domain:r.aK[this.voiceAssistantId].domain,type:"icon",darkOptimized:null===(t=this.hass.themes)||void 0===t?void 0:t.darkMode},this.hass.auth.data.hassUrl))}static get styles(){return[n.RF,(0,o.AH)(h||(h=u`:host{display:inline}.logo{position:relative;vertical-align:middle;height:24px}`))]}}(0,a.Cg)([(0,s.MZ)({attribute:!1})],c.prototype,"hass",void 0),(0,a.Cg)([(0,s.MZ)({attribute:!1})],c.prototype,"voiceAssistantId",void 0),c=(0,a.Cg)([(0,s.EM)("voice-assistant-brand-icon")],c)},53211:function(t,e,i){i.d(e,{Gk:function(){return s},Gq:function(){return a}});const a=t=>t.callWS({type:"cloud/alexa/entities"}),s=(t,e)=>t.callWS({type:"cloud/alexa/entities/get",entity_id:e})},21016:function(t,e,i){i.d(e,{Pu:function(){return s},SB:function(){return n},mk:function(){return o},r1:function(){return a}});const a=t=>t.callWS({type:"counter/list"}),s=(t,e)=>t.callWS(Object.assign({type:"counter/create"},e)),o=(t,e,i)=>t.callWS(Object.assign({type:"counter/update",counter_id:e},i)),n=(t,e)=>t.callWS({type:"counter/delete",counter_id:e})},14782:function(t,e,i){i.d(e,{Gw:function(){return n},Ow:function(){return l},YH:function(){return o},aK:function(){return s},hB:function(){return d},ij:function(){return r}});i(18111),i(22489);var a=i(59241);const s={conversation:{domain:"assist_pipeline",name:"Assist"},"cloud.alexa":{domain:"alexa",name:"Amazon Alexa"},"cloud.google_assistant":{domain:"google_assistant",name:"Google Assistant"}},o=(t,e,i)=>t.callWS({type:"homeassistant/expose_new_entities/set",assistant:e,expose_new:i}),n=(t,e)=>t.callWS({type:"homeassistant/expose_new_entities/get",assistant:e}),r=(t,e,i,a)=>t.callWS({type:"homeassistant/expose_entity",assistants:e,entity_ids:i,should_expose:a}),l=t=>t.callWS({type:"homeassistant/expose_entity/list"}),d=(t,e)=>{const i=(0,a.Ox)(t)[e];return Object.keys(s).filter(t=>{var e;return null==i||null===(e=i.options)||void 0===e||null===(e=e[t])||void 0===e?void 0:e.should_expose})}},56982:function(t,e,i){i.d(e,{ig:function(){return a},kz:function(){return s}});const a=t=>t.callWS({type:"cloud/google_assistant/entities"}),s=(t,e)=>t.callWS({type:"cloud/google_assistant/entities/get",entity_id:e})},41656:function(t,e,i){i.d(e,{n:function(){return c}});var a=i(21016),s=i(2279),o=i(42575),n=i(77738),r=i(6922),l=i(33687),d=i(12284),h=i(2247),u=i(49141);const c={input_boolean:{fetch:s.tT,update:s.iE,delete:s.e1},input_button:{fetch:o.vF,update:o.mC,delete:o.C1},input_text:{fetch:d.MG,update:d.BJ,delete:d.d_},input_number:{fetch:r.kF,update:r.Tv,delete:r.$I},input_datetime:{fetch:n.a2,update:n.fJ,delete:n.Bj},input_select:{fetch:l.HV,update:l.EJ,delete:l.O3},counter:{fetch:a.r1,update:a.mk,delete:a.SB},timer:{fetch:u.kL,update:u.r9,delete:u.pZ},schedule:{fetch:h.YA,update:h.Fs,delete:h.VD}}},2279:function(t,e,i){i.d(e,{e1:function(){return n},iE:function(){return o},nr:function(){return s},tT:function(){return a}});const a=t=>t.callWS({type:"input_boolean/list"}),s=(t,e)=>t.callWS(Object.assign({type:"input_boolean/create"},e)),o=(t,e,i)=>t.callWS(Object.assign({type:"input_boolean/update",input_boolean_id:e},i)),n=(t,e)=>t.callWS({type:"input_boolean/delete",input_boolean_id:e})},42575:function(t,e,i){i.d(e,{C1:function(){return n},L6:function(){return s},mC:function(){return o},vF:function(){return a}});const a=t=>t.callWS({type:"input_button/list"}),s=(t,e)=>t.callWS(Object.assign({type:"input_button/create"},e)),o=(t,e,i)=>t.callWS(Object.assign({type:"input_button/update",input_button_id:e},i)),n=(t,e)=>t.callWS({type:"input_button/delete",input_button_id:e})},77738:function(t,e,i){i.d(e,{Bj:function(){return l},TB:function(){return s},a2:function(){return o},fJ:function(){return r},ke:function(){return n},rv:function(){return a}});const a=t=>`${t.attributes.year||"1970"}-${String(t.attributes.month||"01").padStart(2,"0")}-${String(t.attributes.day||"01").padStart(2,"0")}T${String(t.attributes.hour||"00").padStart(2,"0")}:${String(t.attributes.minute||"00").padStart(2,"0")}:${String(t.attributes.second||"00").padStart(2,"0")}`,s=(t,e,i=void 0,a=void 0)=>{const s={entity_id:e,time:i,date:a};t.callService("input_datetime","set_datetime",s)},o=t=>t.callWS({type:"input_datetime/list"}),n=(t,e)=>t.callWS(Object.assign({type:"input_datetime/create"},e)),r=(t,e,i)=>t.callWS(Object.assign({type:"input_datetime/update",input_datetime_id:e},i)),l=(t,e)=>t.callWS({type:"input_datetime/delete",input_datetime_id:e})},6922:function(t,e,i){i.d(e,{$I:function(){return n},Tv:function(){return o},gO:function(){return s},kF:function(){return a}});const a=t=>t.callWS({type:"input_number/list"}),s=(t,e)=>t.callWS(Object.assign({type:"input_number/create"},e)),o=(t,e,i)=>t.callWS(Object.assign({type:"input_number/update",input_number_id:e},i)),n=(t,e)=>t.callWS({type:"input_number/delete",input_number_id:e})},2247:function(t,e,i){i.d(e,{Fs:function(){return n},VD:function(){return r},YA:function(){return s},mx:function(){return a},sF:function(){return o}});const a=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],s=t=>t.callWS({type:"schedule/list"}),o=(t,e)=>t.callWS(Object.assign({type:"schedule/create"},e)),n=(t,e,i)=>t.callWS(Object.assign({type:"schedule/update",schedule_id:e},i)),r=(t,e)=>t.callWS({type:"schedule/delete",schedule_id:e})},55981:function(t,e,i){i.a(t,async function(t,a){try{i.r(e),i.d(e,{EntitySettingsHelperTab:function(){return I}});i(18111),i(20116),i(33110),i(3362),i(62953);var s=i(40445),o=i(5124),n=i(67576),r=i(36312),l=i(69558),d=i(1087),h=i(81816),u=i(18350),c=i(59241),p=i(41656),g=i(65063),_=i(14503),m=i(46963),v=i(89269),b=i(37018),y=i(837),f=i(76901),$=i(22514),C=i(8431),w=i(84226),k=i(14872),x=i(95341),z=i(72373),S=i(32064),O=t([u,m,v,b,y,f,$,C,w,k,x,z,S]);[u,m,v,b,y,f,$,C,w,k,x,z,S]=O.then?(await O)():O;let M,j,V,F,W,E=t=>t;class I extends o.WF{firstUpdated(t){super.firstUpdated(t),this._componentLoaded=(0,r.x)(this.hass.config,this.entry.platform)}updated(t){var e;(super.updated(t),t.has("entry"))&&(this._error=void 0,this.entry.unique_id!==(null===(e=t.get("entry"))||void 0===e?void 0:e.unique_id)&&(this._item=void 0),this._getItem())}render(){if(void 0===this._item)return o.s6;const t=this.hass.states[this.entry.entity_id];return(0,o.qy)(M||(M=E` <div class="form"> ${0} ${0} ${0} <entity-registry-settings-editor .hass="${0}" .entry="${0}" .disabled="${0}" @change="${0}" hide-name hide-icon></entity-registry-settings-editor> </div> <div class="buttons"> <ha-button variant="danger" appearance="plain" @click="${0}" .disabled="${0}"> ${0} </ha-button> <ha-button @click="${0}" .disabled="${0}"> ${0} </ha-button> </div> `),this._error?(0,o.qy)(j||(j=E`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):"",null===this._item?(0,o.qy)(V||(V=E`<ha-alert alert-type="info">${0}</ha-alert>`),this.hass.localize("ui.dialogs.helper_settings.yaml_not_editable")):o.s6,this._componentLoaded?(0,o.qy)(F||(F=E` <span @value-changed="${0}"> ${0} </span> `),this._valueChanged,(0,l._)(`ha-${this.entry.platform}-form`,{hass:this.hass,item:this._item,entry:this.entry,disabled:null===this._item})):this.hass.localize("ui.dialogs.helper_settings.platform_not_loaded",{platform:this.entry.platform}),this.hass,this.entry,!!this._submitting,this._entityRegistryChanged,this._confirmDeleteItem,this._submitting||!this._item&&!(null!=t&&t.attributes.restored),this.hass.localize("ui.dialogs.entity_registry.editor.delete"),this._updateItem,!this._dirty||!!this._submitting||!(!this._item||this._item.name),this.hass.localize("ui.dialogs.entity_registry.editor.update"))}get _isHelperDirty(){return!(!this._item||!this._originalItemJson)&&JSON.stringify(this._item)!==this._originalItemJson}_updateDirty(){var t,e;this._dirty=null!==(t=null===(e=this._registryEditor)||void 0===e?void 0:e.dirty)&&void 0!==t&&t||this._isHelperDirty}_entityRegistryChanged(){this._error=void 0,this._updateDirty()}_valueChanged(t){null!==this._item&&(this._error=void 0,this._item=t.detail.value,this._updateDirty())}async _getItem(){const t=await p.n[this.entry.platform].fetch(this.hass);this._item=t.find(t=>t.id===this.entry.unique_id)||null,this._originalItemJson=this._item?JSON.stringify(this._item):void 0}async _updateItem(){this._submitting=!0;try{this._componentLoaded&&this._item&&await p.n[this.entry.platform].update(this.hass,this._item.id,this._item);(await this._registryEditor.updateEntry()).close&&(0,d.r)(this,"close-dialog")}catch(t){this._error=t.message||"Unknown error"}finally{this._submitting=!1}}async _confirmDeleteItem(){const t=(0,h.cx)(this.entry,this.hass.devices),e=await(0,S.e)(this.hass,this.entry,t);if(await(0,g.dk)(this,{title:this.hass.localize("ui.dialogs.entity_registry.editor.confirm_delete_title"),text:e,confirmText:this.hass.localize("ui.common.delete"),dismissText:this.hass.localize("ui.common.cancel"),destructive:!0})){this._submitting=!0;try{if(this._componentLoaded&&this._item)await p.n[this.entry.platform].delete(this.hass,this._item.id);else{const t=this.hass.states[this.entry.entity_id];if(null==t||!t.attributes.restored)return;await(0,c.bg)(this.hass,this.entry.entity_id)}(0,d.r)(this,"close-dialog")}finally{this._submitting=!1}}}static get styles(){return[_.RF,(0,o.AH)(W||(W=E`:host{display:block;padding:0!important}ha-alert{display:block;margin-bottom:var(--ha-space-4)}.form{padding:20px 24px}.buttons{box-sizing:border-box;display:flex;justify-content:space-between;padding:16px;background-color:var(--mdc-theme-surface,#fff)}.error{color:var(--error-color);margin-bottom:8px}.row{margin-top:8px;color:var(--primary-text-color)}.secondary{color:var(--secondary-text-color)}`))]}constructor(...t){super(...t),this._submitting=!1,this._dirty=!1}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],I.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({attribute:!1})],I.prototype,"entry",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_error",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_item",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_submitting",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_dirty",void 0),(0,s.Cg)([(0,n.wk)()],I.prototype,"_componentLoaded",void 0),(0,s.Cg)([(0,n.P)("entity-registry-settings-editor")],I.prototype,"_registryEditor",void 0),I=(0,s.Cg)([(0,n.EM)("entity-settings-helper-tab")],I),a()}catch(M){a(M)}})},46963:function(t,e,i){i.a(t,async function(t,a){try{i.r(e);i(62953);var s=i(40445),o=i(5124),n=i(67576),r=i(1087),l=(i(11382),i(64138)),d=i(59646),h=i(91485),u=i(14503),c=t([l,d,h]);[l,d,h]=c.then?(await c)():c;let p,g,_=t=>t;class m extends o.WF{set item(t){var e,i,a,s,o;(this._item=t,t)?(this._name=t.name||"",this._icon=t.icon||"",this._maximum=null!==(e=t.maximum)&&void 0!==e?e:void 0,this._minimum=null!==(i=t.minimum)&&void 0!==i?i:void 0,this._restore=null===(a=t.restore)||void 0===a||a,this._step=null!==(s=t.step)&&void 0!==s?s:1,this._initial=null!==(o=t.initial)&&void 0!==o?o:0):(this._name="",this._icon="",this._maximum=void 0,this._minimum=void 0,this._restore=!0,this._step=1,this._initial=0)}focus(){this.updateComplete.then(()=>{var t;return null===(t=this._focusElement)||void 0===t?void 0:t.focus()})}render(){return this.hass?(0,o.qy)(p||(p=_` <div class="form"> <ha-input .value="${0}" .configValue="${0}" @input="${0}" .label="${0}" auto-validate required .validationMessage="${0}" dialogInitialFocus .disabled="${0}"></ha-input> <ha-icon-picker .value="${0}" .configValue="${0}" @value-changed="${0}" .label="${0}" .disabled="${0}"></ha-icon-picker> <ha-input .value="${0}" .configValue="${0}" type="number" @input="${0}" .label="${0}" .disabled="${0}"></ha-input> <ha-input .value="${0}" .configValue="${0}" type="number" @input="${0}" .label="${0}" .disabled="${0}"></ha-input> <ha-input .value="${0}" .configValue="${0}" type="number" @input="${0}" .label="${0}" .disabled="${0}"></ha-input> <ha-expansion-panel header="${0}" outlined> <ha-input .value="${0}" .configValue="${0}" type="number" @input="${0}" .label="${0}" .disabled="${0}"></ha-input> <div class="row"> <ha-switch .checked="${0}" .configValue="${0}" @change="${0}" .disabled="${0}"> </ha-switch> <div> ${0} </div> </div> </ha-expansion-panel> </div> `),this._name,"name",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.name"),this.hass.localize("ui.dialogs.helper_settings.required_error_msg"),this.disabled,this._icon,"icon",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.icon"),this.disabled,void 0!==this._minimum?String(this._minimum):"","minimum",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.counter.minimum"),this.disabled,void 0!==this._maximum?String(this._maximum):"","maximum",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.counter.maximum"),this.disabled,void 0!==this._initial?String(this._initial):"","initial",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.counter.initial"),this.disabled,this.hass.localize("ui.dialogs.helper_settings.generic.advanced_settings"),void 0!==this._step?String(this._step):"","step",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.counter.step"),this.disabled,this._restore,"restore",this._valueChanged,this.disabled,this.hass.localize("ui.dialogs.helper_settings.counter.restore")):o.s6}_valueChanged(t){var e;if(!this.new&&!this._item)return;t.stopPropagation();const i=t.target,a=i.configValue,s="number"===i.type?""!==i.value?Number(i.value):void 0:"ha-switch"===i.localName?t.target.checked:(null===(e=t.detail)||void 0===e?void 0:e.value)||i.value;if(this[`_${a}`]===s)return;const o=Object.assign({},this._item);void 0===s||""===s?delete o[a]:o[a]=s,(0,r.r)(this,"value-changed",{value:o})}static get styles(){return[u.RF,(0,o.AH)(g||(g=_`.form{color:var(--primary-text-color)}.row{margin-top:12px;margin-bottom:12px;color:var(--primary-text-color);display:flex;align-items:center}.row div{margin-left:16px;margin-inline-start:16px;margin-inline-end:initial}ha-input{margin:var(--ha-space-2) 0}`))]}constructor(...t){super(...t),this.new=!1,this.disabled=!1}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],m.prototype,"new",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],m.prototype,"disabled",void 0),(0,s.Cg)([(0,n.wk)()],m.prototype,"_name",void 0),(0,s.Cg)([(0,n.wk)()],m.prototype,"_icon",void 0),(0,s.Cg)([(0,n.wk)()],m.prototype,"_maximum",void 0),(0,s.Cg)([(0,n.wk)()],m.prototype,"_minimum",void 0),(0,s.Cg)([(0,n.wk)()],m.prototype,"_restore",void 0),(0,s.Cg)([(0,n.wk)()],m.prototype,"_initial",void 0),(0,s.Cg)([(0,n.wk)()],m.prototype,"_step",void 0),(0,s.Cg)([(0,n.P)("[dialogInitialFocus]")],m.prototype,"_focusElement",void 0),m=(0,s.Cg)([(0,n.EM)("ha-counter-form")],m),a()}catch(p){a(p)}})},89269:function(t,e,i){i.a(t,async function(t,a){try{i.r(e);i(62953);var s=i(40445),o=i(5124),n=i(67576),r=i(1087),l=i(64138),d=i(91485),h=i(14503),u=t([l,d]);[l,d]=u.then?(await u)():u;let c,p,g=t=>t;class _ extends o.WF{set item(t){this._item=t,t?(this._name=t.name||"",this._icon=t.icon||""):(this._name="",this._icon="")}focus(){this.updateComplete.then(()=>{var t;return null===(t=this._focusElement)||void 0===t?void 0:t.focus()})}render(){return this.hass?(0,o.qy)(c||(c=g` <div class="form"> <ha-input .value="${0}" .configValue="${0}" @input="${0}" .label="${0}" auto-validate required .validationMessage="${0}" dialogInitialFocus .disabled="${0}"></ha-input> <ha-icon-picker .value="${0}" .configValue="${0}" @value-changed="${0}" .label="${0}" .disabled="${0}"></ha-icon-picker> </div> `),this._name,"name",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.name"),this.hass.localize("ui.dialogs.helper_settings.required_error_msg"),this.disabled,this._icon,"icon",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.icon"),this.disabled):o.s6}_valueChanged(t){var e;if(!this.new&&!this._item)return;t.stopPropagation();const i=t.target.configValue,a=(null===(e=t.detail)||void 0===e?void 0:e.value)||t.target.value;if(this[`_${i}`]===a)return;const s=Object.assign({},this._item);a?s[i]=a:delete s[i],(0,r.r)(this,"value-changed",{value:s})}static get styles(){return[h.RF,(0,o.AH)(p||(p=g`.form{color:var(--primary-text-color)}.row{padding:var(--ha-space-4) 0}ha-input{margin:var(--ha-space-2) 0}`))]}constructor(...t){super(...t),this.new=!1,this.disabled=!1}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"new",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"disabled",void 0),(0,s.Cg)([(0,n.wk)()],_.prototype,"_name",void 0),(0,s.Cg)([(0,n.wk)()],_.prototype,"_icon",void 0),(0,s.Cg)([(0,n.P)("[dialogInitialFocus]")],_.prototype,"_focusElement",void 0),_=(0,s.Cg)([(0,n.EM)("ha-input_boolean-form")],_),a()}catch(c){a(c)}})},37018:function(t,e,i){i.a(t,async function(t,a){try{i.r(e);i(62953);var s=i(40445),o=i(5124),n=i(67576),r=i(1087),l=i(64138),d=i(91485),h=i(14503),u=t([l,d]);[l,d]=u.then?(await u)():u;let c,p,g=t=>t;class _ extends o.WF{set item(t){this._item=t,t?(this._name=t.name||"",this._icon=t.icon||""):(this._name="",this._icon="")}focus(){this.updateComplete.then(()=>{var t;return null===(t=this._focusElement)||void 0===t?void 0:t.focus()})}render(){return this.hass?(0,o.qy)(c||(c=g` <div class="form"> <ha-input .value="${0}" .configValue="${0}" @input="${0}" .label="${0}" auto-validate required .validationMessage="${0}" dialogInitialFocus .disabled="${0}"></ha-input> <ha-icon-picker .hass="${0}" .value="${0}" .configValue="${0}" @value-changed="${0}" .label="${0}" .disabled="${0}"></ha-icon-picker> </div> `),this._name,"name",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.name"),this.hass.localize("ui.dialogs.helper_settings.required_error_msg"),this.disabled,this.hass,this._icon,"icon",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.icon"),this.disabled):o.s6}_valueChanged(t){var e;if(!this.new&&!this._item)return;t.stopPropagation();const i=t.target.configValue,a=(null===(e=t.detail)||void 0===e?void 0:e.value)||t.target.value;if(this[`_${i}`]===a)return;const s=Object.assign({},this._item);a?s[i]=a:delete s[i],(0,r.r)(this,"value-changed",{value:s})}static get styles(){return[h.RF,(0,o.AH)(p||(p=g`.form{color:var(--primary-text-color)}.row{padding:var(--ha-space-4) 0}ha-input{margin:var(--ha-space-2) 0}`))]}constructor(...t){super(...t),this.new=!1,this.disabled=!1}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"new",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"disabled",void 0),(0,s.Cg)([(0,n.wk)()],_.prototype,"_name",void 0),(0,s.Cg)([(0,n.wk)()],_.prototype,"_icon",void 0),(0,s.Cg)([(0,n.P)("[dialogInitialFocus]")],_.prototype,"_focusElement",void 0),_=(0,s.Cg)([(0,n.EM)("ha-input_button-form")],_),a()}catch(c){a(c)}})},837:function(t,e,i){i.a(t,async function(t,a){try{i.r(e);i(74423),i(62953);var s=i(40445),o=i(5124),n=i(67576),r=i(1087),l=i(64138),d=i(91485),h=(i(64013),i(92677),i(14503)),u=t([l,d]);[l,d]=u.then?(await u)():u;let c,p,g=t=>t;class _ extends o.WF{set item(t){this._item=t,t?(this._name=t.name||"",this._icon=t.icon||"",this._mode=t.has_time&&t.has_date?"datetime":t.has_time?"time":"date",this._item.has_date=!t.has_date&&!t.has_time||t.has_date):(this._name="",this._icon="",this._mode="date")}focus(){this.updateComplete.then(()=>{var t;return null===(t=this._focusElement)||void 0===t?void 0:t.focus()})}render(){return this.hass?(0,o.qy)(c||(c=g` <div class="form"> <ha-input .value="${0}" .configValue="${0}" @input="${0}" .label="${0}" auto-validate required .validationMessage="${0}" dialogInitialFocus .disabled="${0}"></ha-input> <ha-icon-picker .hass="${0}" .value="${0}" .configValue="${0}" @value-changed="${0}" .label="${0}" .disabled="${0}"></ha-icon-picker> <ha-radio-group .label="${0}" .value="${0}" .disabled="${0}" name="mode" @change="${0}"> <ha-radio-option value="date"> ${0} </ha-radio-option> <ha-radio-option value="time"> ${0} </ha-radio-option> <ha-radio-option value="datetime"> ${0} </ha-radio-option> </ha-radio-group> </div> `),this._name,"name",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.name"),this.hass.localize("ui.dialogs.helper_settings.required_error_msg"),this.disabled,this.hass,this._icon,"icon",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.icon"),this.disabled,this.hass.localize("ui.dialogs.helper_settings.input_datetime.mode"),this._mode,this.disabled,this._modeChanged,this.hass.localize("ui.dialogs.helper_settings.input_datetime.date"),this.hass.localize("ui.dialogs.helper_settings.input_datetime.time"),this.hass.localize("ui.dialogs.helper_settings.input_datetime.datetime")):o.s6}_modeChanged(t){const e=String(t.currentTarget.value);(0,r.r)(this,"value-changed",{value:Object.assign(Object.assign({},this._item),{},{has_time:["time","datetime"].includes(e),has_date:["date","datetime"].includes(e)})})}_valueChanged(t){var e;if(!this.new&&!this._item)return;t.stopPropagation();const i=t.target.configValue,a=(null===(e=t.detail)||void 0===e?void 0:e.value)||t.target.value;if(this[`_${i}`]===a)return;const s=Object.assign({},this._item);a?s[i]=a:delete s[i],(0,r.r)(this,"value-changed",{value:s})}static get styles(){return[h.RF,(0,o.AH)(p||(p=g`.form{color:var(--primary-text-color)}.row{padding:var(--ha-space-4) 0}ha-input{margin:var(--ha-space-2) 0}ha-radio-group{margin-top:var(--ha-space-5)}`))]}constructor(...t){super(...t),this.new=!1,this.disabled=!1}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],_.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"new",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],_.prototype,"disabled",void 0),(0,s.Cg)([(0,n.wk)()],_.prototype,"_name",void 0),(0,s.Cg)([(0,n.wk)()],_.prototype,"_icon",void 0),(0,s.Cg)([(0,n.wk)()],_.prototype,"_mode",void 0),(0,s.Cg)([(0,n.P)("[dialogInitialFocus]")],_.prototype,"_focusElement",void 0),_=(0,s.Cg)([(0,n.EM)("ha-input_datetime-form")],_),a()}catch(c){a(c)}})},76901:function(t,e,i){i.a(t,async function(t,a){try{i.r(e);i(62953);var s=i(40445),o=i(5124),n=i(67576),r=i(1087),l=i(64138),d=(i(64013),i(92677),i(856)),h=i(91485),u=i(70407),c=i(14503),p=t([l,d,h]);[l,d,h]=p.then?(await p)():p;let g,_,m=t=>t;const v={select:{mode:"dropdown",translation_key:"sensor_unit_of_measurement",custom_value:!0,sort:!0,options:u.e}};class b extends o.WF{set item(t){var e,i,a;(this._item=t,t)?(this._name=t.name||"",this._icon=t.icon||"",this._max=null!==(e=t.max)&&void 0!==e?e:100,this._min=null!==(i=t.min)&&void 0!==i?i:0,this._mode=t.mode||"slider",this._step=null!==(a=t.step)&&void 0!==a?a:1,this._unit_of_measurement=t.unit_of_measurement):(this._item={min:0,max:100},this._name="",this._icon="",this._max=100,this._min=0,this._mode="slider",this._step=1)}focus(){this.updateComplete.then(()=>{var t;return null===(t=this._focusElement)||void 0===t?void 0:t.focus()})}render(){return this.hass?(0,o.qy)(g||(g=m` <div class="form"> <ha-input .value="${0}" .configValue="${0}" @input="${0}" .label="${0}" auto-validate required .validationMessage="${0}" dialogInitialFocus .disabled="${0}"></ha-input> <ha-icon-picker .value="${0}" .configValue="${0}" @value-changed="${0}" .label="${0}" .disabled="${0}"></ha-icon-picker> <ha-input .value="${0}" .configValue="${0}" type="number" step="any" @input="${0}" .label="${0}" .disabled="${0}"></ha-input> <ha-input .value="${0}" .configValue="${0}" type="number" step="any" @input="${0}" .label="${0}" .disabled="${0}"></ha-input> <ha-radio-group orientation="horizontal" class="mode" .label="${0}" .value="${0}" .disabled="${0}" name="mode" @change="${0}"> <ha-radio-option value="slider"> ${0} </ha-radio-option> <ha-radio-option value="box"> ${0} </ha-radio-option> </ha-radio-group> <ha-input .value="${0}" .configValue="${0}" type="number" step="any" @input="${0}" .label="${0}" .disabled="${0}"></ha-input> <ha-selector-select .hass="${0}" .label="${0}" .selector="${0}" .disabled="${0}" .value="${0}" .configValue="${0}" @value-changed="${0}"> </ha-selector-select> </div> `),this._name,"name",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.name"),this.hass.localize("ui.dialogs.helper_settings.required_error_msg"),this.disabled,this._icon,"icon",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.icon"),this.disabled,void 0!==this._min?String(this._min):"","min",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.input_number.min"),this.disabled,void 0!==this._max?String(this._max):"","max",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.input_number.max"),this.disabled,this.hass.localize("ui.dialogs.helper_settings.input_number.mode"),this._mode,this.disabled,this._modeChanged,this.hass.localize("ui.dialogs.helper_settings.input_number.slider"),this.hass.localize("ui.dialogs.helper_settings.input_number.box"),void 0!==this._step?String(this._step):"","step",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.input_number.step"),this.disabled,this.hass,this.hass.localize("ui.dialogs.helper_settings.input_number.unit_of_measurement"),v,this.disabled,this._unit_of_measurement||"","unit_of_measurement",this._valueChanged):o.s6}_modeChanged(t){(0,r.r)(this,"value-changed",{value:Object.assign(Object.assign({},this._item),{},{mode:t.currentTarget.value})})}_valueChanged(t){var e;if(!this.new&&!this._item)return;t.stopPropagation();const i=t.target,a=i.configValue,s="number"===i.type?Number(i.value):(null===(e=t.detail)||void 0===e?void 0:e.value)||i.value;if(this[`_${a}`]===s)return;const o=Object.assign({},this._item);void 0===s||""===s?delete o[a]:o[a]=s,(0,r.r)(this,"value-changed",{value:o})}static get styles(){return[c.RF,(0,o.AH)(_||(_=m`.form{color:var(--primary-text-color)}ha-input{--ha-input-padding-bottom:0}ha-icon-picker,ha-input:not([required]){display:block;margin-bottom:var(--ha-space-5);--ha-input-padding-bottom:0}.mode{margin-bottom:var(--ha-space-4)}`))]}constructor(...t){super(...t),this.new=!1,this.disabled=!1}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],b.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],b.prototype,"new",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],b.prototype,"disabled",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_name",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_icon",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_max",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_min",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_mode",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_step",void 0),(0,s.Cg)([(0,n.wk)()],b.prototype,"_unit_of_measurement",void 0),(0,s.Cg)([(0,n.P)("[dialogInitialFocus]")],b.prototype,"_focusElement",void 0),b=(0,s.Cg)([(0,n.EM)("ha-input_number-form")],b),a()}catch(g){a(g)}})},22514:function(t,e,i){i.a(t,async function(t,a){try{i.r(e);i(3362),i(62953);var s=i(40445),o=i(5124),n=i(67576),r=i(75751),l=i(1087),d=i(18350),h=i(26300),u=i(64138),c=(i(8630),i(28732),i(85938),i(67094),i(91485)),p=i(65063),g=i(14503),_=t([d,h,u,c]);[d,h,u,c]=_.then?(await _)():_;let m,v,b,y=t=>t;const f="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",$="M21 11H3V9H21V11M21 13H3V15H21V13Z",C="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";class w extends o.WF{_optionMoved(t){t.stopPropagation();const{oldIndex:e,newIndex:i}=t.detail,a=this._options.concat(),s=a.splice(e,1)[0];a.splice(i,0,s),(0,l.r)(this,"value-changed",{value:Object.assign(Object.assign({},this._item),{},{options:a})})}set item(t){this._item=t,t?(this._name=t.name||"",this._icon=t.icon||"",this._options=t.options||[]):(this._name="",this._icon="",this._options=[])}focus(){this.updateComplete.then(()=>{var t;return null===(t=this._focusElement)||void 0===t?void 0:t.focus()})}render(){return this.hass?(0,o.qy)(m||(m=y` <div class="form"> <ha-input dialogInitialFocus auto-validate required .validationMessage="${0}" .value="${0}" .label="${0}" .configValue="${0}" @input="${0}" .disabled="${0}"></ha-input> <ha-icon-picker .value="${0}" .configValue="${0}" @value-changed="${0}" .label="${0}" .disabled="${0}"></ha-icon-picker> <div class="header"> ${0}: </div> <ha-sortable @item-moved="${0}" handle-selector=".handle" .disabled="${0}"> <ha-list class="options"> ${0} </ha-list> </ha-sortable> <div class="layout horizontal center"> <ha-input class="flex-auto" id="option_input" .label="${0}" @keydown="${0}" .disabled="${0}"></ha-input> <ha-button size="small" appearance="filled" @click="${0}" .disabled="${0}">${0} <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> </ha-button> </div> </div> `),this.hass.localize("ui.dialogs.helper_settings.required_error_msg"),this._name,this.hass.localize("ui.dialogs.helper_settings.generic.name"),"name",this._valueChanged,this.disabled,this._icon,"icon",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.icon"),this.disabled,this.hass.localize("ui.dialogs.helper_settings.input_select.options"),this._optionMoved,this.disabled,this._options.length?(0,r.u)(this._options,t=>t,(t,e)=>(0,o.qy)(v||(v=y` <ha-list-item class="option" hasMeta> <div class="optioncontent"> <div class="handle"> <ha-svg-icon .path="${0}"></ha-svg-icon> </div> ${0} </div> <ha-icon-button slot="meta" .index="${0}" .label="${0}" @click="${0}" .disabled="${0}" .path="${0}"></ha-icon-button> </ha-list-item> `),$,t,e,this.hass.localize("ui.dialogs.helper_settings.input_select.remove_option"),this._removeOption,this.disabled,f)):o.s6,this.hass.localize("ui.dialogs.helper_settings.input_select.add_option"),this._handleKeyAdd,this.disabled,this._addOption,this.disabled,this.hass.localize("ui.dialogs.helper_settings.input_select.add"),C):o.s6}_handleKeyAdd(t){t.stopPropagation(),"Enter"===t.key&&this._addOption()}_addOption(){const t=this._optionInput;null!=t&&t.value&&((0,l.r)(this,"value-changed",{value:Object.assign(Object.assign({},this._item),{},{options:[...this._options,t.value]})}),t.value="")}async _removeOption(t){const e=t.target.index;if(!(await(0,p.dk)(this,{title:this.hass.localize("ui.dialogs.helper_settings.input_select.confirm_delete.delete"),text:this.hass.localize("ui.dialogs.helper_settings.input_select.confirm_delete.prompt"),destructive:!0})))return;const i=[...this._options];i.splice(e,1),(0,l.r)(this,"value-changed",{value:Object.assign(Object.assign({},this._item),{},{options:i})})}_valueChanged(t){var e;if(!this.new&&!this._item)return;t.stopPropagation();const i=t.target.configValue,a=(null===(e=t.detail)||void 0===e?void 0:e.value)||t.target.value;if(this[`_${i}`]===a)return;const s=Object.assign({},this._item);a?s[i]=a:delete s[i],(0,l.r)(this,"value-changed",{value:s})}static get styles(){return[g.RF,(0,o.AH)(b||(b=y`.form{color:var(--primary-text-color)}.option{border:1px solid var(--divider-color);border-radius:var(--ha-border-radius-sm);margin-top:var(--ha-space-1);--ha-icon-button-size:24px;--mdc-ripple-color:transparent;--mdc-list-side-padding:var(--ha-space-4);cursor:default;background-color:var(--card-background-color)}ha-input{--ha-input-padding-bottom:0}#option_input{margin-top:var(--ha-space-2)}.header{margin-top:var(--ha-space-2)}.handle{cursor:move;cursor:grab;padding-right:var(--ha-space-3);padding-inline-end:var(--ha-space-3);padding-inline-start:initial}.handle ha-svg-icon{pointer-events:none;height:24px}.optioncontent{display:flex;align-items:center}ha-icon-picker{display:block;margin-bottom:var(--ha-space-5)}ha-button{margin-inline-start:var(--ha-space-3);margin-top:var(--ha-space-1)}`))]}constructor(...t){super(...t),this.new=!1,this.disabled=!1,this._options=[]}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],w.prototype,"new",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],w.prototype,"disabled",void 0),(0,s.Cg)([(0,n.wk)()],w.prototype,"_name",void 0),(0,s.Cg)([(0,n.wk)()],w.prototype,"_icon",void 0),(0,s.Cg)([(0,n.wk)()],w.prototype,"_options",void 0),(0,s.Cg)([(0,n.P)("#option_input",!0)],w.prototype,"_optionInput",void 0),(0,s.Cg)([(0,n.P)("[dialogInitialFocus]")],w.prototype,"_focusElement",void 0),w=(0,s.Cg)([(0,n.EM)("ha-input_select-form")],w),a()}catch(m){a(m)}})},8431:function(t,e,i){i.a(t,async function(t,a){try{i.r(e);i(62953);var s=i(40445),o=i(5124),n=i(67576),r=i(1087),l=(i(11382),i(52763)),d=i(64138),h=(i(64013),i(92677),i(91485)),u=i(14503),c=t([l,d,h]);[l,d,h]=c.then?(await c)():c;let p,g,_=t=>t;class m extends o.WF{set item(t){this._item=t,t?(this._name=t.name||"",this._icon=t.icon||"",this._max=t.max||100,this._min=t.min||0,this._mode=t.mode||"text",this._pattern=t.pattern):(this._name="",this._icon="",this._max=100,this._min=0,this._mode="text")}focus(){this.updateComplete.then(()=>{var t;return null===(t=this._focusElement)||void 0===t?void 0:t.focus()})}render(){return this.hass?(0,o.qy)(p||(p=_` <div class="form"> <ha-input .value="${0}" .configValue="${0}" @input="${0}" .label="${0}" auto-validate required .validationMessage="${0}" dialogInitialFocus .disabled="${0}"></ha-input> <ha-icon-picker .hass="${0}" .value="${0}" .configValue="${0}" @value-changed="${0}" .label="${0}" .disabled="${0}"></ha-icon-picker> <ha-expansion-panel header="${0}" outlined> <ha-input .value="${0}" .configValue="${0}" type="number" min="0" max="255" @input="${0}" .label="${0}" .disabled="${0}"></ha-input> <ha-input .value="${0}" .configValue="${0}" min="0" max="255" type="number" @input="${0}" .label="${0}"></ha-input> <ha-radio-group orientation="horizontal" .label="${0}" .value="${0}" .disabled="${0}" name="mode" @change="${0}"> <ha-radio-option value="text"> ${0} </ha-radio-option> <ha-radio-option value="password"> ${0} </ha-radio-option> </ha-radio-group> <ha-input .value="${0}" .configValue="${0}" @input="${0}" .label="${0}" .hint="${0}" .disabled="${0}"></ha-input> </ha-expansion-panel> </div> `),this._name,"name",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.name"),this.hass.localize("ui.dialogs.helper_settings.required_error_msg"),this.disabled,this.hass,this._icon,"icon",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.icon"),this.disabled,this.hass.localize("ui.dialogs.helper_settings.generic.advanced_settings"),void 0!==this._min?String(this._min):"","min",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.input_text.min"),this.disabled,void 0!==this._max?String(this._max):"","max",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.input_text.max"),this.hass.localize("ui.dialogs.helper_settings.input_text.mode"),this._mode,this.disabled,this._modeChanged,this.hass.localize("ui.dialogs.helper_settings.input_text.text"),this.hass.localize("ui.dialogs.helper_settings.input_text.password"),this._pattern||"","pattern",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.input_text.pattern_label"),this.hass.localize("ui.dialogs.helper_settings.input_text.pattern_helper"),this.disabled):o.s6}_modeChanged(t){(0,r.r)(this,"value-changed",{value:Object.assign(Object.assign({},this._item),{},{mode:t.currentTarget.value})})}_valueChanged(t){var e;if(!this.new&&!this._item)return;t.stopPropagation();const i=t.target.configValue,a=(null===(e=t.detail)||void 0===e?void 0:e.value)||t.target.value;if(this[`_${i}`]===a)return;const s=Object.assign({},this._item);a?s[i]=a:delete s[i],(0,r.r)(this,"value-changed",{value:s})}static get styles(){return[u.RF,(0,o.AH)(g||(g=_`.form{color:var(--primary-text-color)}.row{padding:16px 0}ha-input{--ha-input-padding-bottom:0}ha-icon-picker,ha-input:not([required]){display:block;margin-bottom:var(--ha-space-5)}ha-expansion-panel ha-input:first-child{margin-top:var(--ha-space-4)}`))]}constructor(...t){super(...t),this.new=!1,this.disabled=!1}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],m.prototype,"new",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],m.prototype,"disabled",void 0),(0,s.Cg)([(0,n.wk)()],m.prototype,"_name",void 0),(0,s.Cg)([(0,n.wk)()],m.prototype,"_icon",void 0),(0,s.Cg)([(0,n.wk)()],m.prototype,"_max",void 0),(0,s.Cg)([(0,n.wk)()],m.prototype,"_min",void 0),(0,s.Cg)([(0,n.wk)()],m.prototype,"_mode",void 0),(0,s.Cg)([(0,n.wk)()],m.prototype,"_pattern",void 0),(0,s.Cg)([(0,n.P)("[dialogInitialFocus]")],m.prototype,"_focusElement",void 0),m=(0,s.Cg)([(0,n.EM)("ha-input_text-form")],m),a()}catch(p){a(p)}})},84226:function(t,e,i){i.a(t,async function(t,a){try{i.r(e);i(44114),i(18111),i(7588),i(3362),i(62953);var s=i(40445),o=i(3398),n=i(78871),r=i(29851),l=i(93464),d=i(66360),h=i(63723),u=i(92913),c=i(83309),p=i(5124),g=i(67576),_=i(380),m=i(30162),v=i(69543),b=i(1087),y=i(64138),f=i(91485),$=i(2247),C=i(46927),w=i(14503),k=i(18625),x=t([y,f,l,r,o,_,m]);[y,f,l,r,o,_,m]=x.then?(await x)():x;let z,S,O,M=t=>t;const j={plugins:[l.A,r.Ay],headerToolbar:!1,initialView:"timeGridWeek",editable:!0,selectable:!0,selectMirror:!0,selectOverlap:!1,eventOverlap:!1,allDaySlot:!1,height:"parent",locales:n.A,firstDay:1,dayHeaderFormat:{weekday:"short",month:void 0,day:void 0}};class V extends p.WF{set item(t){this._item=t,t?(this._name=t.name||"",this._icon=t.icon||"",this._monday=t.monday||[],this._tuesday=t.tuesday||[],this._wednesday=t.wednesday||[],this._thursday=t.thursday||[],this._friday=t.friday||[],this._saturday=t.saturday||[],this._sunday=t.sunday||[]):(this._name="",this._icon="",this._monday=[],this._tuesday=[],this._wednesday=[],this._thursday=[],this._friday=[],this._saturday=[],this._sunday=[])}disconnectedCallback(){var t,e;super.disconnectedCallback(),null===(t=this.calendar)||void 0===t||t.destroy(),this.calendar=void 0,null===(e=this._fullCalendarStyle)||void 0===e||e.remove()}connectedCallback(){super.connectedCallback(),this.hasUpdated&&!this.calendar&&this._setupCalendar()}focus(){this.updateComplete.then(()=>{var t;return null===(t=this._focusElement)||void 0===t?void 0:t.focus()})}render(){return this.hass?(0,p.qy)(z||(z=M` <div class="form"> <ha-input .value="${0}" .configValue="${0}" @input="${0}" .label="${0}" auto-validate required .validationMessage="${0}" dialogInitialFocus .disabled="${0}"></ha-input> <ha-icon-picker .value="${0}" .configValue="${0}" @value-changed="${0}" .label="${0}" .disabled="${0}"></ha-icon-picker> ${0} </div> `),this._name,"name",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.name"),this.hass.localize("ui.dialogs.helper_settings.required_error_msg"),this.disabled,this._icon,"icon",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.icon"),this.disabled,this.disabled?p.s6:(0,p.qy)(S||(S=M`<div id="calendar"></div>`))):p.s6}willUpdate(t){if(super.willUpdate(t),!this.calendar)return;(t.has("_sunday")||t.has("_monday")||t.has("_tuesday")||t.has("_wednesday")||t.has("_thursday")||t.has("_friday")||t.has("_saturday")||t.has("calendar"))&&(this.calendar.removeAllEventSources(),this.calendar.addEventSource(this._events));const e=t.get("hass");e&&e.language!==this.hass.language&&this.calendar.setOption("locale",this.hass.language)}firstUpdated(){this.disabled||this._setupCalendar()}_setupCalendar(){const t=Object.assign(Object.assign({},j),{},{locale:this.hass.language,firstDay:(0,_.P)(this.hass.locale),slotLabelFormat:{hour:"numeric",minute:void 0,hour12:(0,v.J)(this.hass.locale),meridiem:!!(0,v.J)(this.hass.locale)&&"narrow"},eventTimeFormat:{hour:(0,v.J)(this.hass.locale)?"numeric":"2-digit",minute:(0,v.J)(this.hass.locale)?"numeric":"2-digit",hour12:(0,v.J)(this.hass.locale),meridiem:!!(0,v.J)(this.hass.locale)&&"narrow"}});t.eventClick=t=>this._handleEventClick(t),t.select=t=>this._handleSelect(t),t.eventResize=t=>this._handleEventResize(t),t.eventDrop=t=>this._handleEventDrop(t),this.calendar=new o.Vv(this.shadowRoot.getElementById("calendar"),t),this.calendar.render()}get _events(){const t=[];for(const[e,i]of $.mx.entries())this[`_${i}`].length&&this[`_${i}`].forEach((a,s)=>{let o=(0,d.s)(new Date,e);(0,h.R)(o,new Date,{weekStartsOn:(0,_.P)(this.hass.locale)})||(o=(0,u.f)(o,-7));const n=new Date(o),r=a.from.split(":");n.setHours(parseInt(r[0]),parseInt(r[1]),0,0);const l=new Date(o),c=a.to.split(":");l.setHours(parseInt(c[0]),parseInt(c[1]),0,0),t.push({id:`${i}-${s}`,start:n.toISOString(),end:l.toISOString()})});return t}_handleSelect(t){const{start:e,end:i}=t,a=$.mx[e.getDay()],s=[...this[`_${a}`]],o=Object.assign({},this._item),n=(0,m.LW)(i,Object.assign(Object.assign({},this.hass.locale),{},{time_zone:C.Wj.local}),this.hass.config);s.push({from:(0,m.LW)(e,Object.assign(Object.assign({},this.hass.locale),{},{time_zone:C.Wj.local}),this.hass.config),to:(0,c.r)(e,i)&&"0:00"!==n?n:"24:00"}),o[a]=s,(0,b.r)(this,"value-changed",{value:o}),(0,c.r)(e,i)||this.calendar.unselect()}_handleEventResize(t){const{id:e,start:i,end:a}=t.event,[s,o]=e.split("-"),n=this[`_${s}`][parseInt(o)],r=Object.assign({},this._item),l=(0,m.LW)(a,this.hass.locale,this.hass.config);r[s][o]=Object.assign(Object.assign({},r[s][o]),{},{from:n.from,to:(0,c.r)(i,a)&&"0:00"!==l?l:"24:00"}),(0,b.r)(this,"value-changed",{value:r}),(0,c.r)(i,a)||(this.requestUpdate(`_${s}`),t.revert())}_handleEventDrop(t){const{id:e,start:i,end:a}=t.event,[s,o]=e.split("-"),n=$.mx[i.getDay()],r=Object.assign({},this._item),l=(0,m.LW)(a,this.hass.locale,this.hass.config),d=Object.assign(Object.assign({},r[s][o]),{},{from:(0,m.LW)(i,this.hass.locale,this.hass.config),to:(0,c.r)(i,a)&&"0:00"!==l?l:"24:00"});if(n===s)r[s][o]=d;else{r[s].splice(o,1);const t=[...this[`_${n}`]];t.push(d),r[n]=t}(0,b.r)(this,"value-changed",{value:r}),(0,c.r)(i,a)||(this.requestUpdate(`_${s}`),t.revert())}async _handleEventClick(t){const[e,i]=t.event.id.split("-"),a=[...this[`_${e}`]][i];(0,k.c)(this,{block:a,updateBlock:t=>this._updateBlock(e,i,t),deleteBlock:()=>this._deleteBlock(e,i)})}_updateBlock(t,e,i){const[a,s,o]=i.from.split(":");i.from=`${a}:${s}`;const[n,r,l]=i.to.split(":");i.to=`${n}:${r}`,0===Number(n)&&0===Number(r)&&(i.to="24:00");const d=Object.assign({},this._item);d[t]=[...this._item[t]],d[t][e]=i,(0,b.r)(this,"value-changed",{value:d})}_deleteBlock(t,e){const i=[...this[`_${t}`]],a=Object.assign({},this._item);i.splice(parseInt(e),1),a[t]=i,(0,b.r)(this,"value-changed",{value:a})}_valueChanged(t){var e;if(!this.new&&!this._item)return;t.stopPropagation();const i=t.target.configValue,a=(null===(e=t.detail)||void 0===e?void 0:e.value)||t.target.value;if(this[`_${i}`]===a)return;const s=Object.assign({},this._item);a?s[i]=a:delete s[i],(0,b.r)(this,"value-changed",{value:s})}static get styles(){return[w.RF,(0,p.AH)(O||(O=M`.form{color:var(--primary-text-color)}ha-input{margin:var(--ha-space-2) 0;--ha-input-padding-bottom:0}#calendar{margin:var(--ha-space-2) 0;height:450px;width:100%;-webkit-user-select:none;-ms-user-select:none;user-select:none;--fc-border-color:var(--divider-color);--fc-event-border-color:var(--divider-color)}.fc-v-event .fc-event-time{white-space:inherit}.fc-theme-standard .fc-scrollgrid{border:1px solid var(--divider-color);border-radius:var(--mdc-shape-small,4px)}.fc-scrollgrid-section-header td{border:none}:host([narrow]) .fc-scrollgrid-sync-table{overflow:hidden}table.fc-scrollgrid-sync-table tbody tr:first-child .fc-daygrid-day-top{padding-top:0}.fc-scroller::-webkit-scrollbar{width:.4rem;height:.4rem}.fc-scroller::-webkit-scrollbar-thumb{border-radius:var(--ha-border-radius-sm);background:var(--scrollbar-thumb-color)}.fc-scroller{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}.fc-timegrid-event-short .fc-event-time:after{content:""}a{color:inherit!important}th.fc-col-header-cell.fc-day{background-color:var(--table-header-background-color);color:var(--primary-text-color);font-size:var(--ha-font-size-xs);font-weight:var(--ha-font-weight-bold);text-transform:uppercase}`))]}constructor(...t){super(...t),this.new=!1,this.disabled=!1}}(0,s.Cg)([(0,g.MZ)({attribute:!1})],V.prototype,"hass",void 0),(0,s.Cg)([(0,g.MZ)({type:Boolean})],V.prototype,"new",void 0),(0,s.Cg)([(0,g.MZ)({type:Boolean})],V.prototype,"disabled",void 0),(0,s.Cg)([(0,g.wk)()],V.prototype,"_name",void 0),(0,s.Cg)([(0,g.wk)()],V.prototype,"_icon",void 0),(0,s.Cg)([(0,g.wk)()],V.prototype,"_monday",void 0),(0,s.Cg)([(0,g.wk)()],V.prototype,"_tuesday",void 0),(0,s.Cg)([(0,g.wk)()],V.prototype,"_wednesday",void 0),(0,s.Cg)([(0,g.wk)()],V.prototype,"_thursday",void 0),(0,s.Cg)([(0,g.wk)()],V.prototype,"_friday",void 0),(0,s.Cg)([(0,g.wk)()],V.prototype,"_saturday",void 0),(0,s.Cg)([(0,g.wk)()],V.prototype,"_sunday",void 0),(0,s.Cg)([(0,g.wk)()],V.prototype,"calendar",void 0),(0,s.Cg)([(0,g.P)("style[data-fullcalendar]")],V.prototype,"_fullCalendarStyle",void 0),(0,s.Cg)([(0,g.P)("[dialogInitialFocus]")],V.prototype,"_focusElement",void 0),V=(0,s.Cg)([(0,g.EM)("ha-schedule-form")],V),a()}catch(z){a(z)}})},14872:function(t,e,i){i.a(t,async function(t,a){try{i.r(e);i(62953);var s=i(40445),o=i(5124),n=i(67576),r=i(57673),l=i(1087),d=(i(9503),i(39927)),h=i(64138),u=i(91485),c=i(14503),p=t([d,h,u]);[d,h,u]=p.then?(await p)():p;let g,_,m=t=>t;class v extends o.WF{set item(t){this._item=t,t?(this._name=t.name||"",this._icon=t.icon||"",this._duration=t.duration||"00:00:00",this._restore=t.restore||!1):(this._name="",this._icon="",this._duration="00:00:00",this._restore=!1),this._setDurationData()}focus(){this.updateComplete.then(()=>{var t;return null===(t=this._focusElement)||void 0===t?void 0:t.focus()})}render(){return this.hass?(0,o.qy)(g||(g=m` <div class="form"> <ha-input .value="${0}" .configValue="${0}" @input="${0}" .label="${0}" auto-validate required .validationMessage="${0}" dialogInitialFocus .disabled="${0}"></ha-input> <ha-icon-picker .hass="${0}" .value="${0}" .configValue="${0}" @value-changed="${0}" .label="${0}" .disabled="${0}"></ha-icon-picker> <ha-duration-input .configValue="${0}" .data="${0}" @value-changed="${0}" .disabled="${0}"></ha-duration-input> <ha-checkbox .configValue="${0}" .checked="${0}" @change="${0}" .disabled="${0}"> ${0} </ha-checkbox> </div> `),this._name,"name",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.name"),this.hass.localize("ui.dialogs.helper_settings.required_error_msg"),this.disabled,this.hass,this._icon,"icon",this._valueChanged,this.hass.localize("ui.dialogs.helper_settings.generic.icon"),this.disabled,"duration",this._duration_data,this._valueChanged,this.disabled,"restore",this._restore,this._toggleRestore,this.disabled,this.hass.localize("ui.dialogs.helper_settings.timer.restore")):o.s6}_valueChanged(t){var e;if(!this.new&&!this._item)return;t.stopPropagation();const i=t.target.configValue,a=(null===(e=t.detail)||void 0===e?void 0:e.value)||t.target.value;if(this[`_${i}`]===a)return;const s=Object.assign({},this._item);a?s[i]=a:delete s[i],(0,l.r)(this,"value-changed",{value:s})}_toggleRestore(t){this._restore=t.target.checked,(0,l.r)(this,"value-changed",{value:Object.assign(Object.assign({},this._item),{},{restore:this._restore})})}_setDurationData(){let t;if("object"==typeof this._duration&&null!==this._duration){const e=this._duration;t={hours:"string"==typeof e.hours?parseFloat(e.hours):e.hours,minutes:"string"==typeof e.minutes?parseFloat(e.minutes):e.minutes,seconds:"string"==typeof e.seconds?parseFloat(e.seconds):e.seconds}}else t=this._duration;this._duration_data=(0,r.z)(t)}static get styles(){return[c.RF,(0,o.AH)(_||(_=m`.form{color:var(--primary-text-color)}ha-duration-input{display:block;margin:8px 0}ha-checkbox{min-height:40px;justify-content:center}`))]}constructor(...t){super(...t),this.new=!1,this.disabled=!1}}(0,s.Cg)([(0,n.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],v.prototype,"new",void 0),(0,s.Cg)([(0,n.MZ)({type:Boolean})],v.prototype,"disabled",void 0),(0,s.Cg)([(0,n.wk)()],v.prototype,"_name",void 0),(0,s.Cg)([(0,n.wk)()],v.prototype,"_icon",void 0),(0,s.Cg)([(0,n.wk)()],v.prototype,"_duration",void 0),(0,s.Cg)([(0,n.wk)()],v.prototype,"_duration_data",void 0),(0,s.Cg)([(0,n.wk)()],v.prototype,"_restore",void 0),(0,s.Cg)([(0,n.P)("[dialogInitialFocus]")],v.prototype,"_focusElement",void 0),v=(0,s.Cg)([(0,n.EM)("ha-timer-form")],v),a()}catch(g){a(g)}})},18625:function(t,e,i){i.d(e,{c:function(){return o}});i(3362),i(62953);var a=i(1087);const s=()=>i.e(81476).then(i.bind(i,70319)),o=(t,e)=>{(0,a.r)(t,"show-dialog",{dialogTag:"dialog-schedule-block-info",dialogImport:s,dialogParams:e})}},22395:function(t,e,i){i(62953);var a=i(5124),s=i(67576),o=i(717);let n;var r=(0,a.AH)(n||(n=(t=>t)`:host{display:inline-flex}.button-group{display:flex;position:relative;isolation:isolate;flex-wrap:wrap}@media (hover:hover){.button-group::slotted(:hover),.button-group>:hover{z-index:1}}.button-group::slotted(:focus),.button-group::slotted([aria-checked=true]),.button-group::slotted([checked]),.button-group>:focus,.button-group>[aria-checked=true],.button-group>[checked]{z-index:2!important}:host([orientation=horizontal]) .button-group{flex-direction:row}:host([orientation=vertical]) .button-group{flex-direction:column}:host([orientation=horizontal]){--_button-horizontal-indent:var(--wa-form-control-border-width);--_button-horizontal-indent-outlined:calc(var(--wa-form-control-border-width) * -1)}:host([orientation=vertical]){--_button-vertical-indent:var(--wa-form-control-border-width);--_button-vertical-indent-outlined:calc(var(--wa-form-control-border-width) * -1)}::slotted(:not(:first-child):not(:last-child)){--_button-start-start-radius:0;--_button-start-end-radius:0;--_button-end-start-radius:0;--_button-end-end-radius:0}:host([orientation=horizontal]) ::slotted(:first-child:not(:last-child)){--_button-start-end-radius:0;--_button-end-end-radius:0}:host([orientation=horizontal]) ::slotted(:last-child:not(:first-child)){--_button-start-start-radius:0;--_button-end-start-radius:0}:host([orientation=vertical]) ::slotted(:first-child:not(:last-child)){--_button-end-start-radius:0;--_button-end-end-radius:0}:host([orientation=vertical]) ::slotted(:last-child:not(:first-child)){--_button-start-start-radius:0;--_button-start-end-radius:0}`));let l,d=t=>t;var h=Object.defineProperty,u=Object.getOwnPropertyDescriptor,c=(t,e,i,a)=>{for(var s,o=a>1?void 0:a?u(e,i):e,n=t.length-1;n>=0;n--)(s=t[n])&&(o=(a?s(e,i,o):s(o))||o);return a&&o&&h(e,i,o),o};let p=class extends o.A{updated(t){super.updated(t),t.has("orientation")&&this.setAttribute("aria-orientation",this.orientation)}handleFocus(t){const e=g(t.target,this.childSelector);null==e||e.classList.add("button-focus")}handleBlur(t){const e=g(t.target,this.childSelector);null==e||e.classList.remove("button-focus")}handleMouseOver(t){const e=g(t.target,this.childSelector);null==e||e.classList.add("button-hover")}handleMouseOut(t){const e=g(t.target,this.childSelector);null==e||e.classList.remove("button-hover")}render(){return(0,a.qy)(l||(l=d` <slot part="base" class="button-group" role="${0}" aria-label="${0}" aria-orientation="${0}" @focusout="${0}" @focusin="${0}" @mouseover="${0}" @mouseout="${0}"></slot> `),this.disableRole?"presentation":"group",this.label,this.orientation,this.handleBlur,this.handleFocus,this.handleMouseOver,this.handleMouseOut)}constructor(){super(...arguments),this.disableRole=!1,this.hasOutlined=!1,this.label="",this.orientation="horizontal",this.childSelector="wa-button, wa-radio-button"}};function g(t,e){var i;return null!==(i=t.closest(e))&&void 0!==i?i:t.querySelector(e)}p.css=[r],c([(0,s.P)("slot")],p.prototype,"defaultSlot",2),c([(0,s.wk)()],p.prototype,"disableRole",2),c([(0,s.wk)()],p.prototype,"hasOutlined",2),c([(0,s.MZ)()],p.prototype,"label",2),c([(0,s.MZ)({reflect:!0})],p.prototype,"orientation",2),c([(0,s.MZ)()],p.prototype,"childSelector",2),p=c([(0,s.EM)("wa-button-group")],p)}}]);