3 lines
No EOL
86 KiB
JavaScript
3 lines
No EOL
86 KiB
JavaScript
/*! For license information please see 1848.7Ao7gG4SlpU.js.LICENSE.txt */
|
||
export const id=1848;export const ids=[1848];export const modules={13426:(e,t,i)=>{i.d(t,{J:()=>o,_:()=>r});const a=/{%|{{/,o=e=>a.test(e),r=e=>{if(!e)return!1;if("string"==typeof e)return o(e);if("object"==typeof e){return(Array.isArray(e)?e:Object.values(e)).some((e=>e&&r(e)))}return!1}},96400:(e,t,i)=>{var a=i(309),o=i(34541),r=i(47838),s=i(5095),n=i(43204),d=i(95260),l=i(58417),c=i(39274);let u=class extends l.A{};u.styles=[c.W],u=(0,n.__decorate)([(0,d.Mo)("mwc-checkbox")],u);var h=i(53180),g=i(61092);class p extends g.K{constructor(){super(...arguments),this.left=!1,this.graphic="control"}render(){const e={"mdc-deprecated-list-item__graphic":this.left,"mdc-deprecated-list-item__meta":!this.left},t=this.renderText(),i=this.graphic&&"control"!==this.graphic&&!this.left?this.renderGraphic():s.dy``,a=this.hasMeta&&this.left?this.renderMeta():s.dy``,o=this.renderRipple();return s.dy` ${o} ${i} ${this.left?"":t} <span class="${(0,h.$)(e)}"> <mwc-checkbox reducedTouchTarget tabindex="${this.tabindex}" .checked="${this.selected}" ?disabled="${this.disabled}" @change="${this.onChange}"> </mwc-checkbox> </span> ${this.left?t:""} ${a}`}async onChange(e){const t=e.target;this.selected===t.checked||(this._skipPropRequest=!0,this.selected=t.checked,await this.updateComplete,this._skipPropRequest=!1)}}(0,n.__decorate)([(0,d.IO)("slot")],p.prototype,"slotElement",void 0),(0,n.__decorate)([(0,d.IO)("mwc-checkbox")],p.prototype,"checkboxElement",void 0),(0,n.__decorate)([(0,d.Cb)({type:Boolean})],p.prototype,"left",void 0),(0,n.__decorate)([(0,d.Cb)({type:String,reflect:!0})],p.prototype,"graphic",void 0);const m=s.iv`:host(:not([twoline])){height:56px}:host(:not([left])) .mdc-deprecated-list-item__meta{height:40px;width:40px}`;var v=i(96762),f=i(18394);(0,a.Z)([(0,d.Mo)("ha-check-list-item")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"onChange",value:async function(e){(0,o.Z)((0,r.Z)(i.prototype),"onChange",this).call(this,e),(0,f.B)(this,e.type)}},{kind:"field",static:!0,key:"styles",value:()=>[v.W,m,s.iv`:host{--mdc-theme-secondary:var(--primary-color)}:host([graphic=avatar]) .mdc-deprecated-list-item__graphic,:host([graphic=control]) .mdc-deprecated-list-item__graphic,:host([graphic=large]) .mdc-deprecated-list-item__graphic,:host([graphic=medium]) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,16px);margin-inline-start:0px;direction:var(--direction)}.mdc-deprecated-list-item__meta{flex-shrink:0;direction:var(--direction);margin-inline-start:auto;margin-inline-end:0}.mdc-deprecated-list-item__graphic{margin-top:var(--check-list-item-graphic-margin-top)}`]}]}}),p)},48950:(e,t,i)=>{var a=i(309),o=i(8485),r=i(92038),s=i(5095),n=i(95260),d=i(18394);(0,a.Z)([(0,n.Mo)("ha-formfield")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"method",key:"_labelClick",value:function(){const e=this.input;if(e&&(e.focus(),!e.disabled))switch(e.tagName){case"HA-CHECKBOX":e.checked=!e.checked,(0,d.B)(e,"change");break;case"HA-RADIO":e.checked=!0,(0,d.B)(e,"change");break;default:e.click()}}},{kind:"field",static:!0,key:"styles",value:()=>[r.W,s.iv`:host(:not([alignEnd])) ::slotted(ha-switch){margin-right:10px;margin-inline-end:10px;margin-inline-start:inline}.mdc-form-field>label{direction:var(--direction);margin-inline-start:0;margin-inline-end:auto;padding-inline-start:4px;padding-inline-end:0}`]}]}}),o.a)},14017:(e,t,i)=>{var a=i(309),o=i(34541),r=i(47838),s=i(5095),n=i(95260),d=i(32982),l=i(16616);const c={},u=(0,l.XM)(class extends l.Xe{constructor(){super(...arguments),this.st=c}render(e,t){return t()}update(e,[t,i]){if(Array.isArray(t)){if(Array.isArray(this.st)&&this.st.length===t.length&&t.every(((e,t)=>e===this.st[t])))return d.Jb}else if(this.st===t)return d.Jb;return this.st=Array.isArray(t)?Array.from(t):t,this.render(t,i)}});var h=i(14516),g=i(18394);const p=async e=>e.callWS({type:"config/auth/list"});i(54371),i(44577);var m=i(28858),v=(i(71133),i(53180)),f=i(86634),y=i(3850);(0,a.Z)([(0,n.Mo)("ha-user-badge")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"user",value:void 0},{kind:"field",decorators:[(0,n.SB)()],key:"_personPicture",value:void 0},{kind:"field",key:"_personEntityId",value:void 0},{kind:"method",key:"willUpdate",value:function(e){if((0,o.Z)((0,r.Z)(i.prototype),"willUpdate",this).call(this,e),e.has("user"))return void this._getPersonPicture();const t=e.get("hass");if(this._personEntityId&&t&&this.hass.states[this._personEntityId]!==t.states[this._personEntityId]){const e=this.hass.states[this._personEntityId];e?this._personPicture=e.attributes.entity_picture:this._getPersonPicture()}else!this._personEntityId&&t&&this._getPersonPicture()}},{kind:"method",key:"render",value:function(){if(!this.hass||!this.user)return s.Ld;const e=this._personPicture;if(e)return s.dy`<div style="${(0,f.V)({backgroundImage:`url(${e})`})}" class="picture"></div>`;const t=(i=this.user.name)?i.trim().split(" ").slice(0,3).map((e=>e.substring(0,1))).join(""):"?";var i;return s.dy`<div class="initials ${(0,v.$)({long:t.length>2})}"> ${t} </div>`}},{kind:"method",key:"_getPersonPicture",value:function(){if(this._personEntityId=void 0,this._personPicture=void 0,this.hass&&this.user)for(const e of Object.values(this.hass.states))if(e.attributes.user_id===this.user.id&&"person"===(0,y.N)(e)){this._personEntityId=e.entity_id,this._personPicture=e.attributes.entity_picture;break}}},{kind:"get",static:!0,key:"styles",value:function(){return s.iv`:host{display:contents}.picture{width:40px;height:40px;background-size:cover;border-radius:50%}.initials{display:inline-block;box-sizing:border-box;width:40px;line-height:40px;border-radius:50%;text-align:center;background-color:var(--light-primary-color);text-decoration:none;color:var(--text-light-primary-color,var(--primary-text-color));overflow:hidden}.initials.long{font-size:80%}`}}]}}),s.oi);i(90532);let _=(0,a.Z)(null,(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"noUserLabel",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"value",value:()=>""},{kind:"field",decorators:[(0,n.Cb)()],key:"users",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",key:"_sortedUsers",value(){return(0,h.Z)((e=>e?e.filter((e=>!e.system_generated)).sort(((e,t)=>(0,m.$)(e.name,t.name,this.hass.locale.language))):[]))}},{kind:"method",key:"render",value:function(){var e,t;return s.dy` <ha-select .label="${this.label}" .disabled="${this.disabled}" .value="${this.value}" @selected="${this._userChanged}"> ${0===(null===(e=this.users)||void 0===e?void 0:e.length)?s.dy`<mwc-list-item value=""> ${this.noUserLabel||(null===(t=this.hass)||void 0===t?void 0:t.localize("ui.components.user-picker.no_user"))} </mwc-list-item>`:""} ${this._sortedUsers(this.users).map((e=>s.dy` <ha-list-item graphic="avatar" .value="${e.id}"> <ha-user-badge .hass="${this.hass}" .user="${e}" slot="graphic"></ha-user-badge> ${e.name} </ha-list-item> `))} </ha-select> `}},{kind:"method",key:"firstUpdated",value:function(e){(0,o.Z)((0,r.Z)(i.prototype),"firstUpdated",this).call(this,e),void 0===this.users&&p(this.hass).then((e=>{this.users=e}))}},{kind:"method",key:"_userChanged",value:function(e){const t=e.target.value;t!==this.value&&(this.value=t,setTimeout((()=>{(0,g.B)(this,"value-changed",{value:t}),(0,g.B)(this,"change")}),0))}},{kind:"get",static:!0,key:"styles",value:function(){return s.iv`:host{display:inline-block}mwc-list{display:block}`}}]}}),s.oi);customElements.define("ha-user-picker",_);(0,a.Z)([(0,n.Mo)("ha-users-picker")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"picked-user-label"})],key:"pickedUserLabel",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:"pick-user-label"})],key:"pickUserLabel",value:void 0},{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"users",value:void 0},{kind:"method",key:"firstUpdated",value:function(e){(0,o.Z)((0,r.Z)(i.prototype),"firstUpdated",this).call(this,e),void 0===this.users&&p(this.hass).then((e=>{this.users=e}))}},{kind:"method",key:"render",value:function(){if(!this.hass||!this.users)return s.Ld;const e=this._notSelectedUsers(this.users,this.value);return s.dy` ${u([e],(()=>{var t;return null===(t=this.value)||void 0===t?void 0:t.map(((t,i)=>s.dy` <div> <ha-user-picker .label="${this.pickedUserLabel}" .noUserLabel="${this.hass.localize("ui.components.user-picker.remove_user")}" .index="${i}" .hass="${this.hass}" .value="${t}" .users="${this._notSelectedUsersAndSelected(t,this.users,e)}" @value-changed="${this._userChanged}"></ha-user-picker> <ha-icon-button .userId="${t}" .label="${this.hass.localize("ui.components.user-picker.remove_user")}" .path="${"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"}" @click="${this._removeUser}"> ></ha-icon-button> </div> `))}))} <ha-user-picker .label="${this.pickUserLabel||this.hass.localize("ui.components.user-picker.add_user")}" .hass="${this.hass}" .users="${e}" .disabled="${!(null!=e&&e.length)}" @value-changed="${this._addUser}"></ha-user-picker> `}},{kind:"field",key:"_notSelectedUsers",value:()=>(0,h.Z)(((e,t)=>t?null==e?void 0:e.filter((e=>!e.system_generated&&!t.includes(e.id))):null==e?void 0:e.filter((e=>!e.system_generated))))},{kind:"field",key:"_notSelectedUsersAndSelected",value:()=>(e,t,i)=>{const a=null==t?void 0:t.find((t=>t.id===e));return a?i?[...i,a]:[a]:i}},{kind:"get",key:"_currentUsers",value:function(){return this.value||[]}},{kind:"method",key:"_updateUsers",value:async function(e){this.value=e,(0,g.B)(this,"value-changed",{value:e})}},{kind:"method",key:"_userChanged",value:function(e){e.stopPropagation();const t=e.currentTarget.index,i=e.detail.value,a=[...this._currentUsers];""===i?a.splice(t,1):a.splice(t,1,i),this._updateUsers(a)}},{kind:"method",key:"_addUser",value:async function(e){e.stopPropagation();const t=e.detail.value;if(e.currentTarget.value="",!t)return;const i=this._currentUsers;i.includes(t)||this._updateUsers([...i,t])}},{kind:"method",key:"_removeUser",value:function(e){const t=e.currentTarget.userId;this._updateUsers(this._currentUsers.filter((e=>e!==t)))}},{kind:"get",static:!0,key:"styles",value:function(){return s.iv`:host{display:block}div{display:flex;align-items:center}`}}]}}),s.oi)},93034:(e,t,i)=>{i.d(t,{h:()=>o,u:()=>a});const a={calendar:"M19,19H5V8H19M16,1V3H8V1H6V3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3H18V1M17,12H12V17H17V12Z",device:"M3 6H21V4H3C1.9 4 1 4.9 1 6V18C1 19.1 1.9 20 3 20H7V18H3V6M13 12H9V13.78C8.39 14.33 8 15.11 8 16C8 16.89 8.39 17.67 9 18.22V20H13V18.22C13.61 17.67 14 16.88 14 16S13.61 14.33 13 13.78V12M11 17.5C10.17 17.5 9.5 16.83 9.5 16S10.17 14.5 11 14.5 12.5 15.17 12.5 16 11.83 17.5 11 17.5M22 8H16C15.5 8 15 8.5 15 9V19C15 19.5 15.5 20 16 20H22C22.5 20 23 19.5 23 19V9C23 8.5 22.5 8 22 8M21 18H17V10H21V18Z",event:"M10,9A1,1 0 0,1 11,8A1,1 0 0,1 12,9V13.47L13.21,13.6L18.15,15.79C18.68,16.03 19,16.56 19,17.14V21.5C18.97,22.32 18.32,22.97 17.5,23H11C10.62,23 10.26,22.85 10,22.57L5.1,18.37L5.84,17.6C6.03,17.39 6.3,17.28 6.58,17.28H6.8L10,19V9M11,5A4,4 0 0,1 15,9C15,10.5 14.2,11.77 13,12.46V11.24C13.61,10.69 14,9.89 14,9A3,3 0 0,0 11,6A3,3 0 0,0 8,9C8,9.89 8.39,10.69 9,11.24V12.46C7.8,11.77 7,10.5 7,9A4,4 0 0,1 11,5M11,3A6,6 0 0,1 17,9C17,10.7 16.29,12.23 15.16,13.33L14.16,12.88C15.28,11.96 16,10.56 16,9A5,5 0 0,0 11,4A5,5 0 0,0 6,9C6,11.05 7.23,12.81 9,13.58V14.66C6.67,13.83 5,11.61 5,9A6,6 0 0,1 11,3Z",state:"M6.27 17.05C6.72 17.58 7 18.25 7 19C7 20.66 5.66 22 4 22S1 20.66 1 19 2.34 16 4 16C4.18 16 4.36 16 4.53 16.05L7.6 10.69L5.86 9.7L9.95 8.58L11.07 12.67L9.33 11.68L6.27 17.05M20 16C18.7 16 17.6 16.84 17.18 18H11V16L8 19L11 22V20H17.18C17.6 21.16 18.7 22 20 22C21.66 22 23 20.66 23 19S21.66 16 20 16M12 8C12.18 8 12.36 8 12.53 7.95L15.6 13.31L13.86 14.3L17.95 15.42L19.07 11.33L17.33 12.32L14.27 6.95C14.72 6.42 15 5.75 15 5C15 3.34 13.66 2 12 2S9 3.34 9 5 10.34 8 12 8Z",geo_location:"M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z",homeassistant:i(19844).T,mqtt:"M21,9L17,5V8H10V10H17V13M7,11L3,15L7,19V16H14V14H7V11Z",numeric_state:"M4,17V9H2V7H6V17H4M22,15C22,16.11 21.1,17 20,17H16V15H20V13H18V11H20V9H16V7H20A2,2 0 0,1 22,9V10.5A1.5,1.5 0 0,1 20.5,12A1.5,1.5 0 0,1 22,13.5V15M14,15V17H8V13C8,11.89 8.9,11 10,11H12V9H8V7H12A2,2 0 0,1 14,9V11C14,12.11 13.1,13 12,13H10V15H14Z",sun:"M12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,2L14.39,5.42C13.65,5.15 12.84,5 12,5C11.16,5 10.35,5.15 9.61,5.42L12,2M3.34,7L7.5,6.65C6.9,7.16 6.36,7.78 5.94,8.5C5.5,9.24 5.25,10 5.11,10.79L3.34,7M3.36,17L5.12,13.23C5.26,14 5.53,14.78 5.95,15.5C6.37,16.24 6.91,16.86 7.5,17.37L3.36,17M20.65,7L18.88,10.79C18.74,10 18.47,9.23 18.05,8.5C17.63,7.78 17.1,7.15 16.5,6.64L20.65,7M20.64,17L16.5,17.36C17.09,16.85 17.62,16.22 18.04,15.5C18.46,14.77 18.73,14 18.87,13.21L20.64,17M12,22L9.59,18.56C10.33,18.83 11.14,19 12,19C12.82,19 13.63,18.83 14.37,18.56L12,22Z",conversation:"M8,7A2,2 0 0,1 10,9V14A2,2 0 0,1 8,16A2,2 0 0,1 6,14V9A2,2 0 0,1 8,7M14,14C14,16.97 11.84,19.44 9,19.92V22H7V19.92C4.16,19.44 2,16.97 2,14H4A4,4 0 0,0 8,18A4,4 0 0,0 12,14H14M21.41,9.41L17.17,13.66L18.18,10H14A2,2 0 0,1 12,8V4A2,2 0 0,1 14,2H20A2,2 0 0,1 22,4V8C22,8.55 21.78,9.05 21.41,9.41Z",tag:"M18,6H13A2,2 0 0,0 11,8V10.28C10.41,10.62 10,11.26 10,12A2,2 0 0,0 12,14C13.11,14 14,13.1 14,12C14,11.26 13.6,10.62 13,10.28V8H16V16H8V8H10V6H8L6,6V18H18M20,20H4V4H20M20,2H4A2,2 0 0,0 2,4V20A2,2 0 0,0 4,22H20C21.11,22 22,21.1 22,20V4C22,2.89 21.11,2 20,2Z",template:"M8,3A2,2 0 0,0 6,5V9A2,2 0 0,1 4,11H3V13H4A2,2 0 0,1 6,15V19A2,2 0 0,0 8,21H10V19H8V14A2,2 0 0,0 6,12A2,2 0 0,0 8,10V5H10V3M16,3A2,2 0 0,1 18,5V9A2,2 0 0,0 20,11H21V13H20A2,2 0 0,0 18,15V19A2,2 0 0,1 16,21H14V19H16V14A2,2 0 0,1 18,12A2,2 0 0,1 16,10V5H14V3H16Z",time:"M12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22C6.47,22 2,17.5 2,12A10,10 0 0,1 12,2M12.5,7V12.25L17,14.92L16.25,16.15L11,13V7H12.5Z",time_pattern:"M11,17A1,1 0 0,0 12,18A1,1 0 0,0 13,17A1,1 0 0,0 12,16A1,1 0 0,0 11,17M11,3V7H13V5.08C16.39,5.57 19,8.47 19,12A7,7 0 0,1 12,19A7,7 0 0,1 5,12C5,10.32 5.59,8.78 6.58,7.58L12,13L13.41,11.59L6.61,4.79V4.81C4.42,6.45 3,9.05 3,12A9,9 0 0,0 12,21A9,9 0 0,0 21,12A9,9 0 0,0 12,3M18,12A1,1 0 0,0 17,11A1,1 0 0,0 16,12A1,1 0 0,0 17,13A1,1 0 0,0 18,12M6,12A1,1 0 0,0 7,13A1,1 0 0,0 8,12A1,1 0 0,0 7,11A1,1 0 0,0 6,12Z",webhook:"M10.46,19C9,21.07 6.15,21.59 4.09,20.15C2.04,18.71 1.56,15.84 3,13.75C3.87,12.5 5.21,11.83 6.58,11.77L6.63,13.2C5.72,13.27 4.84,13.74 4.27,14.56C3.27,16 3.58,17.94 4.95,18.91C6.33,19.87 8.26,19.5 9.26,18.07C9.57,17.62 9.75,17.13 9.82,16.63V15.62L15.4,15.58L15.47,15.47C16,14.55 17.15,14.23 18.05,14.75C18.95,15.27 19.26,16.43 18.73,17.35C18.2,18.26 17.04,18.58 16.14,18.06C15.73,17.83 15.44,17.46 15.31,17.04L11.24,17.06C11.13,17.73 10.87,18.38 10.46,19M17.74,11.86C20.27,12.17 22.07,14.44 21.76,16.93C21.45,19.43 19.15,21.2 16.62,20.89C15.13,20.71 13.9,19.86 13.19,18.68L14.43,17.96C14.92,18.73 15.75,19.28 16.75,19.41C18.5,19.62 20.05,18.43 20.26,16.76C20.47,15.09 19.23,13.56 17.5,13.35C16.96,13.29 16.44,13.36 15.97,13.53L15.12,13.97L12.54,9.2H12.32C11.26,9.16 10.44,8.29 10.47,7.25C10.5,6.21 11.4,5.4 12.45,5.44C13.5,5.5 14.33,6.35 14.3,7.39C14.28,7.83 14.11,8.23 13.84,8.54L15.74,12.05C16.36,11.85 17.04,11.78 17.74,11.86M8.25,9.14C7.25,6.79 8.31,4.1 10.62,3.12C12.94,2.14 15.62,3.25 16.62,5.6C17.21,6.97 17.09,8.47 16.42,9.67L15.18,8.95C15.6,8.14 15.67,7.15 15.27,6.22C14.59,4.62 12.78,3.85 11.23,4.5C9.67,5.16 8.97,7 9.65,8.6C9.93,9.26 10.4,9.77 10.97,10.11L11.36,10.32L8.29,15.31C8.32,15.36 8.36,15.42 8.39,15.5C8.88,16.41 8.54,17.56 7.62,18.05C6.71,18.54 5.56,18.18 5.06,17.24C4.57,16.31 4.91,15.16 5.83,14.67C6.22,14.46 6.65,14.41 7.06,14.5L9.37,10.73C8.9,10.3 8.5,9.76 8.25,9.14Z",persistent_notification:"M13 11H11V5H13M13 15H11V13H13M20 2H4C2.9 2 2 2.9 2 4V22L6 18H20C21.1 18 22 17.1 22 16V4C22 2.9 21.1 2 20 2Z",zone:"M12,2C15.31,2 18,4.66 18,7.95C18,12.41 12,19 12,19C12,19 6,12.41 6,7.95C6,4.66 8.69,2 12,2M12,6A2,2 0 0,0 10,8A2,2 0 0,0 12,10A2,2 0 0,0 14,8A2,2 0 0,0 12,6M20,19C20,21.21 16.42,23 12,23C7.58,23 4,21.21 4,19C4,17.71 5.22,16.56 7.11,15.83L7.75,16.74C6.67,17.19 6,17.81 6,18.5C6,19.88 8.69,21 12,21C15.31,21 18,19.88 18,18.5C18,17.81 17.33,17.19 16.25,16.74L16.89,15.83C18.78,16.56 20,17.71 20,19Z"},o={device:{},entity:{icon:"M11,13.5V21.5H3V13.5H11M12,2L17.5,11H6.5L12,2M17.5,13C20,13 22,15 22,17.5C22,20 20,22 17.5,22C15,22 13,20 13,17.5C13,15 15,13 17.5,13Z",members:{state:{},numeric_state:{}}},time_location:{icon:"M15,12H16.5V16.25L19.36,17.94L18.61,19.16L15,17V12M23,16A7,7 0 0,1 16,23C13,23 10.4,21.08 9.42,18.4L8,17.9L2.66,19.97L2.5,20A0.5,0.5 0 0,1 2,19.5V4.38C2,4.15 2.15,3.97 2.36,3.9L8,2L14,4.1L19.34,2H19.5A0.5,0.5 0 0,1 20,2.5V10.25C21.81,11.5 23,13.62 23,16M9,16C9,12.83 11.11,10.15 14,9.29V6.11L8,4V15.89L9,16.24C9,16.16 9,16.08 9,16M16,11A5,5 0 0,0 11,16A5,5 0 0,0 16,21A5,5 0 0,0 21,16A5,5 0 0,0 16,11Z",members:{calendar:{},sun:{},time:{},time_pattern:{},zone:{}}},other:{icon:"M16,12A2,2 0 0,1 18,10A2,2 0 0,1 20,12A2,2 0 0,1 18,14A2,2 0 0,1 16,12M10,12A2,2 0 0,1 12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12M4,12A2,2 0 0,1 6,10A2,2 0 0,1 8,12A2,2 0 0,1 6,14A2,2 0 0,1 4,12Z",members:{event:{},geo_location:{},homeassistant:{},mqtt:{},conversation:{},tag:{},template:{},webhook:{},persistent_notification:{}}}}},276:(e,t,i)=>{i.a(e,(async(e,a)=>{try{i.d(t,{a:()=>S});var o=i(309),r=i(34541),s=i(47838),n=i(22264),d=(i(44577),i(5095)),l=i(95260),c=i(53180),u=i(3747),h=i(17267),g=i(18394),p=i(930),m=i(92482),v=i(72218),f=(i(23860),i(85878),i(68336),i(31360),i(54371),i(51520),i(19418)),y=i(44553),_=i(59449),k=i(38149),b=i(93034),C=i(11285),$=i(29950),x=(i(98618),i(84119),i(10622)),A=(i(50155),i(14810),i(15527),i(21695),i(46891),i(37025),i(67626),i(92430),i(73240),i(75975),i(57068),i(79664),i(82749)),L=(i(13503),i(77251)),w=e([y,x,A]);[y,x,A]=w.then?(await w)():w;const V="M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z",M="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",H="M19,3L13,9L15,11L22,4V3M12,12.5A0.5,0.5 0 0,1 11.5,12A0.5,0.5 0 0,1 12,11.5A0.5,0.5 0 0,1 12.5,12A0.5,0.5 0 0,1 12,12.5M6,20A2,2 0 0,1 4,18C4,16.89 4.9,16 6,16A2,2 0 0,1 8,18C8,19.11 7.1,20 6,20M6,8A2,2 0 0,1 4,6C4,4.89 4.9,4 6,4A2,2 0 0,1 8,6C8,7.11 7.1,8 6,8M9.64,7.64C9.87,7.14 10,6.59 10,6A4,4 0 0,0 6,2A4,4 0 0,0 2,6A4,4 0 0,0 6,10C6.59,10 7.14,9.87 7.64,9.64L10,12L7.64,14.36C7.14,14.13 6.59,14 6,14A4,4 0 0,0 2,18A4,4 0 0,0 6,22A4,4 0 0,0 10,18C10,17.41 9.87,16.86 9.64,16.36L12,14L19,21H22V20L9.64,7.64Z",z="M11,17H4A2,2 0 0,1 2,15V3A2,2 0 0,1 4,1H16V3H4V15H11V13L15,16L11,19V17M19,21V7H8V13H6V7A2,2 0 0,1 8,5H19A2,2 0 0,1 21,7V21A2,2 0 0,1 19,23H8A2,2 0 0,1 6,21V19H8V21H19Z",Z="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",B="M12,16A2,2 0 0,1 14,18A2,2 0 0,1 12,20A2,2 0 0,1 10,18A2,2 0 0,1 12,16M12,10A2,2 0 0,1 14,12A2,2 0 0,1 12,14A2,2 0 0,1 10,12A2,2 0 0,1 12,10M12,4A2,2 0 0,1 14,6A2,2 0 0,1 12,8A2,2 0 0,1 10,6A2,2 0 0,1 12,4Z",U="M10 7V9H9V15H10V17H6V15H7V9H6V7H10M16 7C17.11 7 18 7.9 18 9V15C18 16.11 17.11 17 16 17H12V7M16 9H14V15H16V9Z",I="M12,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,2M10,16.5L16,12L10,7.5V16.5Z",T="M18,17H10.5L12.5,15H18M6,17V14.5L13.88,6.65C14.07,6.45 14.39,6.45 14.59,6.65L16.35,8.41C16.55,8.61 16.55,8.92 16.35,9.12L8.47,17M19,3H5C3.89,3 3,3.89 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19V5C21,3.89 20.1,3 19,3Z",P="M18 21L14 17H17V7H14L18 3L22 7H19V17H22M2 19V17H12V19M2 13V11H9V13M2 7V5H6V7H2Z",E="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4M9,9V15H15V9",S=(e,t)=>{var i,a;t.stopPropagation();const o=null===(i=t.currentTarget)||void 0===i?void 0:i.name;if(!o)return;const r=null===(a=t.target)||void 0===a?void 0:a.value;if((e.trigger[o]||"")===r)return;let s;void 0===r||""===r?(s={...e.trigger},delete s[o]):s={...e.trigger,[o]:r},(0,g.B)(e,"value-changed",{value:s})},O=e=>e.preventDefault();(0,o.Z)([(0,l.Mo)("ha-automation-trigger-row")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"trigger",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"hideMenu",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)()],key:"path",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_warnings",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_yamlMode",value:()=>!1},{kind:"field",decorators:[(0,l.SB)()],key:"_requestShowId",value:()=>!1},{kind:"field",decorators:[(0,l.SB)()],key:"_triggered",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_triggerColor",value:()=>!1},{kind:"field",decorators:[(0,l.IO)("ha-yaml-editor")],key:"_yamlEditor",value:void 0},{kind:"field",decorators:[(0,u.t)({key:"automationClipboard",state:!1,subscribe:!0,storage:"sessionStorage"})],key:"_clipboard",value:void 0},{kind:"field",decorators:[(0,l.SB)(),(0,n.F)({context:k.we,subscribe:!0})],key:"_entityReg",value:void 0},{kind:"field",decorators:[(0,l.SB)(),(0,n.F)({context:L.T,subscribe:!0})],key:"_reorderMode",value:void 0},{kind:"field",key:"_triggerUnsub",value:void 0},{kind:"method",key:"render",value:function(){if(!this.trigger)return d.Ld;const e=void 0===this._reorderMode,t=void 0!==customElements.get(`ha-automation-trigger-${this.trigger.platform}`),i=this._yamlMode||!t,a="id"in this.trigger||this._requestShowId;return d.dy` <ha-card outlined> ${!1===this.trigger.enabled?d.dy` <div class="disabled-bar"> ${this.hass.localize("ui.panel.config.automation.editor.actions.disabled")} </div> `:""} <ha-expansion-panel leftChevron> <h3 slot="header"> <ha-svg-icon class="trigger-icon" .path="${b.u[this.trigger.platform]}"></ha-svg-icon> ${(0,y.R)(this.trigger,this.hass,this._entityReg)} </h3> <slot name="icons" slot="icons"></slot> ${this.hideMenu?"":d.dy` <ha-button-menu slot="icons" @action="${this._handleAction}" @click="${O}" fixed> <ha-icon-button slot="trigger" .label="${this.hass.localize("ui.common.menu")}" .path="${B}"></ha-icon-button> <mwc-list-item graphic="icon" .disabled="${this.disabled}"> ${this.hass.localize("ui.panel.config.automation.editor.triggers.rename")} <ha-svg-icon slot="graphic" .path="${T}"></ha-svg-icon> </mwc-list-item> <mwc-list-item graphic="icon" .disabled="${this.disabled}" class="${(0,c.$)({hidden:e})}"> ${this.hass.localize("ui.panel.config.automation.editor.triggers.re_order")} <ha-svg-icon slot="graphic" .path="${P}"></ha-svg-icon> </mwc-list-item> <mwc-list-item graphic="icon" .disabled="${this.disabled}"> ${this.hass.localize("ui.panel.config.automation.editor.triggers.edit_id")} <ha-svg-icon slot="graphic" .path="${U}"></ha-svg-icon> </mwc-list-item> <li divider role="separator"></li> <mwc-list-item graphic="icon" .disabled="${this.disabled}"> ${this.hass.localize("ui.panel.config.automation.editor.triggers.duplicate")} <ha-svg-icon slot="graphic" .path="${z}"></ha-svg-icon> </mwc-list-item> <mwc-list-item graphic="icon" .disabled="${this.disabled}"> ${this.hass.localize("ui.panel.config.automation.editor.triggers.copy")} <ha-svg-icon slot="graphic" .path="${M}"></ha-svg-icon> </mwc-list-item> <mwc-list-item graphic="icon" .disabled="${this.disabled}"> ${this.hass.localize("ui.panel.config.automation.editor.triggers.cut")} <ha-svg-icon slot="graphic" .path="${H}"></ha-svg-icon> </mwc-list-item> <li divider role="separator"></li> <mwc-list-item .disabled="${!t}" graphic="icon"> ${this.hass.localize("ui.panel.config.automation.editor.edit_ui")} ${i?"":d.dy`<ha-svg-icon class="selected_menu_item" slot="graphic" .path="${V}"></ha-svg-icon>`} </mwc-list-item> <mwc-list-item .disabled="${!t}" graphic="icon"> ${this.hass.localize("ui.panel.config.automation.editor.edit_yaml")} ${i?d.dy`<ha-svg-icon class="selected_menu_item" slot="graphic" .path="${V}"></ha-svg-icon>`:""} </mwc-list-item> <li divider role="separator"></li> <mwc-list-item graphic="icon" .disabled="${this.disabled}"> ${!1===this.trigger.enabled?this.hass.localize("ui.panel.config.automation.editor.actions.enable"):this.hass.localize("ui.panel.config.automation.editor.actions.disable")} <ha-svg-icon slot="graphic" .path="${!1===this.trigger.enabled?I:E}"></ha-svg-icon> </mwc-list-item> <mwc-list-item class="warning" graphic="icon" .disabled="${this.disabled}"> ${this.hass.localize("ui.panel.config.automation.editor.actions.delete")} <ha-svg-icon class="warning" slot="graphic" .path="${Z}"></ha-svg-icon> </mwc-list-item> </ha-button-menu> `} <div class="${(0,c.$)({"card-content":!0,disabled:!1===this.trigger.enabled})}"> ${this._warnings?d.dy`<ha-alert alert-type="warning" .title="${this.hass.localize("ui.errors.config.editor_not_supported")}"> ${this._warnings.length&&void 0!==this._warnings[0]?d.dy` <ul> ${this._warnings.map((e=>d.dy`<li>${e}</li>`))} </ul>`:""} ${this.hass.localize("ui.errors.config.edit_in_yaml_supported")} </ha-alert>`:""} ${i?d.dy` ${t?"":d.dy` ${this.hass.localize("ui.panel.config.automation.editor.triggers.unsupported_platform",{platform:this.trigger.platform})} `} <ha-yaml-editor .hass="${this.hass}" .defaultValue="${this.trigger}" .readOnly="${this.disabled}" @value-changed="${this._onYamlChange}"></ha-yaml-editor> `:d.dy` ${a?d.dy` <ha-textfield .label="${this.hass.localize("ui.panel.config.automation.editor.triggers.id")}" .value="${this.trigger.id||""}" .disabled="${this.disabled}" @change="${this._idChanged}"> </ha-textfield> `:""} <div @ui-mode-not-available="${this._handleUiModeNotAvailable}" @value-changed="${this._onUiChanged}"> ${(0,h.h)(`ha-automation-trigger-${this.trigger.platform}`,{hass:this.hass,trigger:this.trigger,disabled:this.disabled,path:this.path})} </div> `} </div> </ha-expansion-panel> <div class="triggered ${(0,c.$)({active:void 0!==this._triggered,accent:this._triggerColor})}" @click="${this._showTriggeredInfo}"> ${this.hass.localize("ui.panel.config.automation.editor.triggers.triggered")} </div> </ha-card> `}},{kind:"method",key:"updated",value:function(e){(0,r.Z)((0,s.Z)(i.prototype),"updated",this).call(this,e),e.has("trigger")&&this._subscribeTrigger()}},{kind:"method",key:"connectedCallback",value:function(){(0,r.Z)((0,s.Z)(i.prototype),"connectedCallback",this).call(this),this.hasUpdated&&this.trigger&&this._subscribeTrigger()}},{kind:"method",key:"disconnectedCallback",value:function(){(0,r.Z)((0,s.Z)(i.prototype),"disconnectedCallback",this).call(this),this._triggerUnsub&&(this._triggerUnsub.then((e=>e())),this._triggerUnsub=void 0),this._doSubscribeTrigger.cancel()}},{kind:"method",key:"_subscribeTrigger",value:function(){this._triggerUnsub&&(this._triggerUnsub.then((e=>e())),this._triggerUnsub=void 0),this._doSubscribeTrigger()}},{kind:"field",key:"_doSubscribeTrigger",value(){return(0,v.D)((async()=>{let e;const t=this.trigger;this._triggerUnsub&&(this._triggerUnsub.then((e=>e())),this._triggerUnsub=void 0);if(!(await(0,_.w)(this.hass,{trigger:t})).trigger.valid||this.trigger!==t)return;const i=(0,f.Xm)(this.hass,(t=>{void 0!==e?(clearTimeout(e),this._triggerColor=!this._triggerColor):this._triggerColor=!1,this._triggered=t,e=window.setTimeout((()=>{this._triggered=void 0,e=void 0}),5e3)}),t);i.catch((()=>{this._triggerUnsub===i&&(this._triggerUnsub=void 0)})),this._triggerUnsub=i}),5e3)}},{kind:"method",key:"_handleUiModeNotAvailable",value:function(e){this._warnings=(0,m.p)(this.hass,e.detail).warnings,this._yamlMode||(this._yamlMode=!0)}},{kind:"method",key:"_handleAction",value:async function(e){var t;switch(e.detail.index){case 0:await this._renameTrigger();break;case 1:null===(t=this._reorderMode)||void 0===t||t.enter();break;case 2:this._requestShowId=!0,this.expand();break;case 3:(0,g.B)(this,"duplicate");break;case 4:this._setClipboard();break;case 5:this._setClipboard(),(0,g.B)(this,"value-changed",{value:null});break;case 6:this._switchUiMode(),this.expand();break;case 7:this._switchYamlMode(),this.expand();break;case 8:this._onDisable();break;case 9:this._onDelete()}}},{kind:"method",key:"_setClipboard",value:function(){this._clipboard={...this._clipboard,trigger:this.trigger}}},{kind:"method",key:"_onDelete",value:function(){(0,C.g7)(this,{title:this.hass.localize("ui.panel.config.automation.editor.triggers.delete_confirm_title"),text:this.hass.localize("ui.panel.config.automation.editor.triggers.delete_confirm_text"),dismissText:this.hass.localize("ui.common.cancel"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0,confirm:()=>{(0,g.B)(this,"value-changed",{value:null})}})}},{kind:"method",key:"_onDisable",value:function(){var e;const t=!(null===(e=this.trigger.enabled)||void 0===e||e),i={...this.trigger,enabled:t};var a;((0,g.B)(this,"value-changed",{value:i}),this._yamlMode)&&(null===(a=this._yamlEditor)||void 0===a||a.setValue(i))}},{kind:"method",key:"_idChanged",value:function(e){var t;const i=e.target.value;if(i===(null!==(t=this.trigger.id)&&void 0!==t?t:""))return;this._requestShowId=!0;const a={...this.trigger};i?a.id=i:delete a.id,(0,g.B)(this,"value-changed",{value:a})}},{kind:"method",key:"_onYamlChange",value:function(e){e.stopPropagation(),e.detail.isValid&&(this._warnings=void 0,(0,g.B)(this,"value-changed",{value:e.detail.value}))}},{kind:"method",key:"_onUiChanged",value:function(e){e.stopPropagation();const t={...this.trigger.alias?{alias:this.trigger.alias}:{},...e.detail.value};(0,g.B)(this,"value-changed",{value:t})}},{kind:"method",key:"_switchUiMode",value:function(){this._warnings=void 0,this._yamlMode=!1}},{kind:"method",key:"_switchYamlMode",value:function(){this._warnings=void 0,this._yamlMode=!0}},{kind:"method",key:"_showTriggeredInfo",value:function(){(0,C.Ys)(this,{text:d.dy` <ha-yaml-editor readOnly="readOnly" .hass="${this.hass}" .defaultValue="${this._triggered}"></ha-yaml-editor> `})}},{kind:"method",key:"_renameTrigger",value:async function(){const e=await(0,C.D9)(this,{title:this.hass.localize("ui.panel.config.automation.editor.triggers.change_alias"),inputLabel:this.hass.localize("ui.panel.config.automation.editor.triggers.alias"),inputType:"string",placeholder:(0,p.f)((0,y.R)(this.trigger,this.hass,this._entityReg,!0)),defaultValue:this.trigger.alias,confirmText:this.hass.localize("ui.common.submit")});if(null!==e){const i={...this.trigger};var t;if(""===e?delete i.alias:i.alias=e,(0,g.B)(this,"value-changed",{value:i}),this._yamlMode)null===(t=this._yamlEditor)||void 0===t||t.setValue(i)}}},{kind:"method",key:"expand",value:function(){this.updateComplete.then((()=>{this.shadowRoot.querySelector("ha-expansion-panel").expanded=!0}))}},{kind:"get",static:!0,key:"styles",value:function(){return[$.Qx,d.iv`ha-button-menu{--mdc-theme-text-primary-on-background:var(--primary-text-color)}.disabled{opacity:.5;pointer-events:none}ha-expansion-panel{--expansion-panel-summary-padding:0 0 0 8px;--expansion-panel-content-padding:0}h3{margin:0;font-size:inherit;font-weight:inherit}.trigger-icon{display:none}@media (min-width:870px){.trigger-icon{display:inline-block;color:var(--secondary-text-color);opacity:.9;margin-right:8px}}.card-content{padding:16px}.disabled-bar{background:var(--divider-color,#e0e0e0);text-align:center;border-top-right-radius:var(--ha-card-border-radius);border-top-left-radius:var(--ha-card-border-radius)}.triggered{cursor:pointer;position:absolute;top:0px;right:0px;left:0px;text-transform:uppercase;font-weight:700;font-size:14px;background-color:var(--primary-color);color:var(--text-primary-color);max-height:0px;overflow:hidden;transition:max-height .3s;text-align:center;border-top-right-radius:var(--ha-card-border-radius,12px);border-top-left-radius:var(--ha-card-border-radius,12px)}.triggered.active{max-height:100px}.triggered:hover{opacity:.8}.triggered.accent{background-color:var(--accent-color);color:var(--text-accent-color,var(--text-primary-color))}mwc-list-item[disabled]{--mdc-theme-text-primary-on-background:var(--disabled-text-color)}mwc-list-item.hidden{display:none}ha-textfield{display:block;margin-bottom:24px}.selected_menu_item{color:var(--primary-color)}li[role=separator]{border-bottom-color:var(--divider-color)}`]}}]}}),d.oi);a()}catch(e){a(e)}}))},41848:(e,t,i)=>{i.a(e,(async(e,t)=>{try{var a=i(309),o=i(34541),r=i(47838),s=i(22264),n=i(3239),d=i(5095),l=i(95260),c=i(99266),u=i(3747),h=i(18394),g=i(32723),p=(i(92295),i(85878),i(42308),i(37662),i(77251)),m=i(64082),v=i(276),f=e([v]);v=(f.then?(await f)():f)[0];const y="M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z",_="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z",k="M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z",b="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";(0,a.Z)([(0,l.Mo)("ha-automation-trigger")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.Cb)()],key:"triggers",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,l.Cb)()],key:"path",value:void 0},{kind:"field",decorators:[(0,l.SB)(),(0,s.F)({context:p.T,subscribe:!0})],key:"_reorderMode",value:void 0},{kind:"field",decorators:[(0,u.t)({key:"automationClipboard",state:!0,subscribe:!0,storage:"sessionStorage"})],key:"_clipboard",value:void 0},{kind:"field",key:"_focusLastTriggerOnChange",value:()=>!1},{kind:"field",key:"_triggerKeys",value:()=>new WeakMap},{kind:"get",key:"nested",value:function(){return void 0!==this.path}},{kind:"method",key:"render",value:function(){var e;return d.dy` <ha-sortable handle-selector=".handle" .disabled="${!(null!==(e=this._reorderMode)&&void 0!==e&&e.active)}" @item-moved="${this._triggerMoved}" group="triggers" .path="${this.path}"> <div class="triggers"> ${(0,c.r)(this.triggers,(e=>this._getKey(e)),((e,t)=>{var i,a,o;return d.dy` <ha-automation-trigger-row .path="${[...null!==(i=this.path)&&void 0!==i?i:[],t]}" .index="${t}" .trigger="${e}" .hideMenu="${Boolean(null===(a=this._reorderMode)||void 0===a?void 0:a.active)}" @duplicate="${this._duplicateTrigger}" @value-changed="${this._triggerChanged}" .hass="${this.hass}" .disabled="${this.disabled}"> ${null!==(o=this._reorderMode)&&void 0!==o&&o.active?d.dy` <ha-icon-button .index="${t}" slot="icons" .label="${this.hass.localize("ui.panel.config.automation.editor.move_up")}" .path="${_}" @click="${this._moveUp}" .disabled="${0===t}"></ha-icon-button> <ha-icon-button .index="${t}" slot="icons" .label="${this.hass.localize("ui.panel.config.automation.editor.move_down")}" .path="${y}" @click="${this._moveDown}" .disabled="${t===this.triggers.length-1}"></ha-icon-button> <div class="handle" slot="icons"> <ha-svg-icon .path="${k}"></ha-svg-icon> </div> `:""} </ha-automation-trigger-row> `}))} </div> </ha-sortable> <ha-button outlined .label="${this.hass.localize("ui.panel.config.automation.editor.triggers.add")}" .disabled="${this.disabled}" @click="${this._addTriggerDialog}"> <ha-svg-icon .path="${b}" slot="icon"></ha-svg-icon> </ha-button> `}},{kind:"method",key:"_addTriggerDialog",value:function(){var e;(0,m._)(this,{type:"trigger",add:this._addTrigger,clipboardItem:null===(e=this._clipboard)||void 0===e||null===(e=e.trigger)||void 0===e?void 0:e.platform})}},{kind:"field",key:"_addTrigger",value(){return e=>{let t;if(e===m.I)t=this.triggers.concat((0,n.Z)(this._clipboard.trigger));else{const i=e,a=customElements.get(`ha-automation-trigger-${i}`);t=this.triggers.concat({platform:i,...a.defaultConfig})}this._focusLastTriggerOnChange=!0,(0,h.B)(this,"value-changed",{value:t})}}},{kind:"method",key:"updated",value:function(e){if((0,o.Z)((0,r.Z)(i.prototype),"updated",this).call(this,e),e.has("triggers")&&this._focusLastTriggerOnChange){this._focusLastTriggerOnChange=!1;const e=this.shadowRoot.querySelector("ha-automation-trigger-row:last-of-type");e.updateComplete.then((()=>{e.expand(),e.scrollIntoView(),e.focus()}))}}},{kind:"method",key:"_getKey",value:function(e){return this._triggerKeys.has(e)||this._triggerKeys.set(e,Math.random().toString()),this._triggerKeys.get(e)}},{kind:"method",key:"_moveUp",value:function(e){const t=e.target.index,i=t-1;this._move(t,i)}},{kind:"method",key:"_moveDown",value:function(e){const t=e.target.index,i=t+1;this._move(t,i)}},{kind:"method",key:"_move",value:function(e,t,i,a){const o=(0,g.b)(this.triggers,e,t,i,a);(0,h.B)(this,"value-changed",{value:o})}},{kind:"method",key:"_triggerMoved",value:function(e){if(this.nested)return;e.stopPropagation();const{oldIndex:t,newIndex:i,oldPath:a,newPath:o}=e.detail;this._move(t,i,a,o)}},{kind:"method",key:"_triggerChanged",value:function(e){e.stopPropagation();const t=[...this.triggers],i=e.detail.value,a=e.target.index;if(null===i)t.splice(a,1);else{const e=this._getKey(t[a]);this._triggerKeys.set(i,e),t[a]=i}(0,h.B)(this,"value-changed",{value:t})}},{kind:"method",key:"_duplicateTrigger",value:function(e){e.stopPropagation();const t=e.target.index;(0,h.B)(this,"value-changed",{value:this.triggers.concat((0,n.Z)(this.triggers[t]))})}},{kind:"get",static:!0,key:"styles",value:function(){return d.iv`ha-automation-trigger-row{display:block;margin-bottom:16px;scroll-margin-top:48px}ha-svg-icon{height:20px}ha-alert{display:block;margin-bottom:16px;border-radius:var(--ha-card-border-radius,16px);overflow:hidden}.handle{padding:12px;cursor:move;cursor:grab}.handle ha-svg-icon{pointer-events:none;height:24px}`}}]}}),d.oi);t()}catch(e){t(e)}}))},98618:(e,t,i)=>{var a=i(309),o=i(5095),r=i(95260),s=i(14516),n=i(18394),d=(i(39663),i(27959));(0,a.Z)([(0,r.Mo)("ha-automation-trigger-calendar")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"trigger",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",key:"_schema",value:()=>(0,s.Z)((e=>[{name:"entity_id",required:!0,selector:{entity:{domain:"calendar"}}},{name:"event",type:"select",required:!0,options:[["start",e("ui.panel.config.automation.editor.triggers.type.calendar.start")],["end",e("ui.panel.config.automation.editor.triggers.type.calendar.end")]]},{name:"offset",selector:{duration:{}}},{name:"offset_type",type:"select",required:!0,options:[["before",e("ui.panel.config.automation.editor.triggers.type.calendar.before")],["after",e("ui.panel.config.automation.editor.triggers.type.calendar.after")]]}]))},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{event:"start",offset:0}}},{kind:"method",key:"render",value:function(){const e=this._schema(this.hass.localize),t=this.trigger.offset,i=(0,d.c)(t);let a="after";("object"==typeof t&&i.hours<0||"string"==typeof t&&t.startsWith("-"))&&(i.hours=Math.abs(i.hours),a="before");const r={...this.trigger,offset:i,offset_type:a};return o.dy` <ha-form .schema="${e}" .data="${r}" .hass="${this.hass}" .disabled="${this.disabled}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(e){var t,i,a;e.stopPropagation();const o=e.detail.value.offset,r="before"===e.detail.value.offset_type?"-":"",s={...e.detail.value,offset:`${r}${null!==(t=o.hours)&&void 0!==t?t:0}:${null!==(i=o.minutes)&&void 0!==i?i:0}:${null!==(a=o.seconds)&&void 0!==a?a:0}`};delete s.offset_type,(0,n.B)(this,"value-changed",{value:s})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>{switch(e.name){case"entity_id":return this.hass.localize("ui.components.entity.entity-picker.entity");case"event":return this.hass.localize("ui.panel.config.automation.editor.triggers.type.calendar.event")}return""}}}]}}),o.oi)},37025:(e,t,i)=>{var a=i(309),o=i(5095),r=i(95260),s=i(4771),n=i(18394),d=(i(51520),i(11285));const l="^[^.。,,?¿?؟!!;;::]+$";(0,a.Z)([(0,r.Mo)("ha-automation-trigger-conversation")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"trigger",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,r.IO)("#option_input",!0)],key:"_optionInput",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{command:""}}},{kind:"method",key:"render",value:function(){const{command:e}=this.trigger,t=e?(0,s.r)(e):[];return o.dy`${t.length?t.map(((e,t)=>o.dy` <ha-textfield class="option" iconTrailing .index="${t}" .value="${e}" .validationMessage="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.conversation.no_punctuation")}" autoValidate validateOnInitialRender pattern="${l}" @change="${this._updateOption}"> <ha-icon-button @click="${this._removeOption}" slot="trailingIcon" .path="${"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"}"></ha-icon-button> </ha-textfield> `)):o.Ld} <ha-textfield class="flex-auto" id="option_input" .label="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.conversation.add_sentence")}" .validationMessage="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.conversation.no_punctuation")}" autoValidate pattern="${l}" @keydown="${this._handleKeyAdd}" @change="${this._addOption}"></ha-textfield>`}},{kind:"method",key:"_handleKeyAdd",value:function(e){e.stopPropagation(),"Enter"===e.key&&this._addOption()}},{kind:"method",key:"_addOption",value:function(){const e=this._optionInput;null!=e&&e.value&&((0,n.B)(this,"value-changed",{value:{...this.trigger,command:this.trigger.command.length?[...Array.isArray(this.trigger.command)?this.trigger.command:[this.trigger.command],e.value]:e.value}}),e.value="")}},{kind:"method",key:"_updateOption",value:async function(e){const t=e.target.index,i=[...Array.isArray(this.trigger.command)?this.trigger.command:[this.trigger.command]];i.splice(t,1,e.target.value),(0,n.B)(this,"value-changed",{value:{...this.trigger,command:i}})}},{kind:"method",key:"_removeOption",value:async function(e){const t=e.target.parentElement.index;if(!await(0,d.g7)(this,{title:this.hass.localize("ui.panel.config.automation.editor.triggers.type.conversation.delete"),text:this.hass.localize("ui.panel.config.automation.editor.triggers.type.conversation.confirm_delete"),destructive:!0}))return;let i;Array.isArray(this.trigger.command)?(i=[...this.trigger.command],i.splice(t,1)):i="",(0,n.B)(this,"value-changed",{value:{...this.trigger,command:i}})}},{kind:"get",static:!0,key:"styles",value:function(){return o.iv`.layout{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:flex-start}.option{margin-top:4px}mwc-button{margin-left:8px}ha-textfield{display:block;margin-bottom:8px;--textfield-icon-trailing-padding:0}ha-textfield>ha-icon-button{position:relative;right:-8px;--mdc-icon-button-size:36px;--mdc-icon-size:20px;color:var(--secondary-text-color);inset-inline-start:initial;inset-inline-end:-8px;direction:var(--direction)}#option_input{margin-top:8px}.header{margin-top:8px;margin-bottom:8px}`}}]}}),o.oi)},84119:(e,t,i)=>{var a=i(309),o=i(22264),r=i(5095),s=i(95260),n=i(14516),d=i(18394),l=(i(27056),i(25917)),c=i(7748);(0,a.Z)([(0,s.Mo)("ha-device-trigger-picker")],(function(e,t){return{F:class extends t{constructor(){super(l.KL,l.r3,(e=>({device_id:e||"",platform:"device",domain:"",entity_id:""}))),e(this)}},d:[{kind:"get",key:"NO_AUTOMATION_TEXT",value:function(){return this.hass.localize("ui.panel.config.devices.automation.triggers.no_triggers")}},{kind:"get",key:"UNKNOWN_AUTOMATION_TEXT",value:function(){return this.hass.localize("ui.panel.config.devices.automation.triggers.unknown_trigger")}}]}}),c.g);i(39663);var u=i(38149);(0,a.Z)([(0,s.Mo)("ha-automation-trigger-device")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Object})],key:"trigger",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,s.SB)()],key:"_deviceId",value:void 0},{kind:"field",decorators:[(0,s.SB)()],key:"_capabilities",value:void 0},{kind:"field",decorators:[(0,s.SB)(),(0,o.F)({context:u.we,subscribe:!0})],key:"_entityReg",value:void 0},{kind:"field",key:"_origTrigger",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{device_id:"",domain:"",entity_id:""}}},{kind:"field",key:"_extraFieldsData",value:()=>(0,n.Z)(((e,t)=>{const i={};return t.extra_fields.forEach((t=>{void 0!==e[t.name]&&(i[t.name]=e[t.name])})),i}))},{kind:"method",key:"render",value:function(){var e;const t=this._deviceId||this.trigger.device_id;return r.dy` <ha-device-picker .value="${t}" @value-changed="${this._devicePicked}" .hass="${this.hass}" .disabled="${this.disabled}" .label="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.device.label")}"></ha-device-picker> <ha-device-trigger-picker .value="${this.trigger}" .deviceId="${t}" @value-changed="${this._deviceTriggerPicked}" .hass="${this.hass}" .disabled="${this.disabled}" .label="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.device.trigger")}"></ha-device-trigger-picker> ${null!==(e=this._capabilities)&&void 0!==e&&e.extra_fields?r.dy` <ha-form .hass="${this.hass}" .data="${this._extraFieldsData(this.trigger,this._capabilities)}" .schema="${this._capabilities.extra_fields}" .disabled="${this.disabled}" .computeLabel="${this._extraFieldsComputeLabelCallback(this.hass.localize)}" @value-changed="${this._extraFieldsChanged}"></ha-form> `:""} `}},{kind:"method",key:"firstUpdated",value:function(){this._capabilities||this._getCapabilities(),this.trigger&&(this._origTrigger=this.trigger)}},{kind:"method",key:"updated",value:function(e){if(!e.has("trigger"))return;const t=e.get("trigger");t&&!(0,l.hH)(this._entityReg,t,this.trigger)&&this._getCapabilities()}},{kind:"method",key:"_getCapabilities",value:async function(){const e=this.trigger;this._capabilities=e.domain?await(0,l.hA)(this.hass,e):void 0}},{kind:"method",key:"_devicePicked",value:function(e){e.stopPropagation(),this._deviceId=e.target.value,void 0===this._deviceId&&(0,d.B)(this,"value-changed",{value:{...i.defaultConfig,platform:"device"}})}},{kind:"method",key:"_deviceTriggerPicked",value:function(e){e.stopPropagation();let t=e.detail.value;this._origTrigger&&(0,l.hH)(this._entityReg,this._origTrigger,t)&&(t=this._origTrigger),this.trigger.id&&(t.id=this.trigger.id),(0,d.B)(this,"value-changed",{value:t})}},{kind:"method",key:"_extraFieldsChanged",value:function(e){e.stopPropagation(),(0,d.B)(this,"value-changed",{value:{...this.trigger,...e.detail.value}})}},{kind:"method",key:"_extraFieldsComputeLabelCallback",value:function(e){return t=>e(`ui.panel.config.automation.editor.triggers.type.device.extra_fields.${t.name}`)||t.name}},{kind:"field",static:!0,key:"styles",value:()=>r.iv`ha-device-picker{display:block;margin-bottom:24px}ha-form{display:block;margin-top:24px}`}]}}),r.oi)},10622:(e,t,i)=>{i.a(e,(async(e,t)=>{try{var a=i(309),o=i(5095),r=i(95260),s=i(18394),n=(i(51520),i(80392),i(14017),i(276)),d=e([n]);n=(d.then?(await d)():d)[0];(0,a.Z)([(0,r.Mo)("ha-automation-trigger-event")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"trigger",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{event_type:""}}},{kind:"method",key:"render",value:function(){const{event_type:e,event_data:t,context:i}=this.trigger;return o.dy` <ha-textfield .label="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.event.event_type")}" name="event_type" .value="${e}" .disabled="${this.disabled}" @change="${this._valueChanged}"></ha-textfield> <ha-yaml-editor .hass="${this.hass}" .label="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.event.event_data")}" .name="${"event_data"}" .readOnly="${this.disabled}" .defaultValue="${t}" @value-changed="${this._dataChanged}"></ha-yaml-editor> <br> ${this.hass.localize("ui.panel.config.automation.editor.triggers.type.event.context_users")} <ha-users-picker .pickedUserLabel="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.event.context_user_picked")}" .pickUserLabel="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.event.context_user_pick")}" .hass="${this.hass}" .disabled="${this.disabled}" .value="${this._wrapUsersInArray(null==i?void 0:i.user_id)}" @value-changed="${this._usersChanged}"></ha-users-picker> `}},{kind:"method",key:"_wrapUsersInArray",value:function(e){return e?"string"==typeof e?[e]:e:[]}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation(),(0,n.a)(this,e)}},{kind:"method",key:"_dataChanged",value:function(e){e.stopPropagation(),e.detail.isValid&&(0,n.a)(this,e)}},{kind:"method",key:"_usersChanged",value:function(e){e.stopPropagation();const t={...this.trigger};!e.detail.value.length&&t.context?delete t.context.user_id:(t.context||(t.context={}),t.context.user_id=e.detail.value),(0,s.B)(this,"value-changed",{value:t})}},{kind:"get",static:!0,key:"styles",value:function(){return o.iv`ha-textfield{display:block}`}}]}}),o.oi);t()}catch(e){t(e)}}))},50155:(e,t,i)=>{var a=i(309),o=(i(39663),i(5095)),r=i(95260),s=i(14516),n=i(18394);(0,a.Z)([(0,r.Mo)("ha-automation-trigger-geo_location")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"trigger",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",key:"_schema",value:()=>(0,s.Z)((e=>[{name:"source",selector:{text:{}}},{name:"zone",selector:{entity:{domain:"zone"}}},{name:"event",type:"select",required:!0,options:[["enter",e("ui.panel.config.automation.editor.triggers.type.geo_location.enter")],["leave",e("ui.panel.config.automation.editor.triggers.type.geo_location.leave")]]}]))},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{source:"",zone:"",event:"enter"}}},{kind:"method",key:"render",value:function(){return o.dy` <ha-form .schema="${this._schema(this.hass.localize)}" .data="${this.trigger}" .hass="${this.hass}" .disabled="${this.disabled}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();const t=e.detail.value;(0,n.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>this.hass.localize(`ui.panel.config.automation.editor.triggers.type.geo_location.${e.name}`)}}]}}),o.oi)},14810:(e,t,i)=>{var a=i(309),o=(i(39663),i(5095)),r=i(95260),s=i(14516),n=i(18394);(0,a.Z)([(0,r.Mo)("ha-automation-trigger-homeassistant")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"trigger",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",key:"_schema",value:()=>(0,s.Z)((e=>[{name:"event",type:"select",required:!0,options:[["start",e("ui.panel.config.automation.editor.triggers.type.homeassistant.start")],["shutdown",e("ui.panel.config.automation.editor.triggers.type.homeassistant.shutdown")]]}]))},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{event:"start"}}},{kind:"method",key:"render",value:function(){return o.dy` <ha-form .schema="${this._schema(this.hass.localize)}" .data="${this.trigger}" .hass="${this.hass}" .disabled="${this.disabled}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();const t=e.detail.value;(0,n.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>this.hass.localize(`ui.panel.config.automation.editor.triggers.type.homeassistant.${e.name}`)}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`label{display:flex;align-items:center}`}]}}),o.oi)},15527:(e,t,i)=>{var a=i(309),o=i(5095),r=i(95260),s=i(18394);i(39663);const n=[{name:"topic",required:!0,selector:{text:{}}},{name:"payload",selector:{text:{}}}];(0,a.Z)([(0,r.Mo)("ha-automation-trigger-mqtt")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"trigger",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{topic:""}}},{kind:"method",key:"render",value:function(){return o.dy` <ha-form .schema="${n}" .data="${this.trigger}" .hass="${this.hass}" .disabled="${this.disabled}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();const t=e.detail.value;(0,s.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>this.hass.localize(`ui.panel.config.automation.editor.triggers.type.mqtt.${e.name}`)}}]}}),o.oi)},21695:(e,t,i)=>{var a=i(309),o=i(5095),r=i(95260),s=i(14516),n=i(27959),d=i(18394),l=i(13426),c=(i(39663),i(4771));(0,a.Z)([(0,r.Mo)("ha-automation-trigger-numeric_state")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"trigger",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,r.SB)()],key:"_inputAboveIsEntity",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_inputBelowIsEntity",value:void 0},{kind:"field",key:"_schema",value:()=>(0,s.Z)(((e,t,i,a)=>[{name:"entity_id",required:!0,selector:{entity:{multiple:!0}}},{name:"attribute",selector:{attribute:{entity_id:t?t[0]:void 0,hide_attributes:["access_token","auto_update","available_modes","away_mode","changed_by","code_arm_required","code_format","color_mode","color_modes","current_activity","device_class","editable","effect_list","effect","entity_id","entity_picture","event_type","event_types","fan_mode","fan_modes","fan_speed_list","forecast","friendly_name","frontend_stream_type","has_date","has_time","hs_color","hvac_mode","hvac_modes","icon","id","latest_version","max_color_temp_kelvin","max_mireds","max_temp","media_album_name","media_artist","media_content_type","media_position_updated_at","media_title","min_color_temp_kelvin","min_mireds","min_temp","mode","next_dawn","next_dusk","next_midnight","next_noon","next_rising","next_setting","operation_list","operation_mode","options","percentage_step","precipitation_unit","preset_mode","preset_modes","pressure_unit","release_notes","release_summary","release_url","restored","rgb_color","rgbw_color","shuffle","skipped_version","sound_mode_list","sound_mode","source_list","source_type","source","state_class","step","supported_color_modes","supported_features","swing_mode","swing_modes","target_temp_step","temperature_unit","title","token","unit_of_measurement","user_id","uuid","visibility_unit","wind_speed_unit","xy_color"]}}},{name:"mode_above",type:"select",required:!0,options:[["value",e("ui.panel.config.automation.editor.triggers.type.numeric_state.type_value")],["input",e("ui.panel.config.automation.editor.triggers.type.numeric_state.type_input")]]},...i?[{name:"above",selector:{entity:{domain:["input_number","number","sensor"]}}}]:[{name:"above",selector:{number:{mode:"box",min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,step:.1}}}],{name:"mode_below",type:"select",required:!0,options:[["value",e("ui.panel.config.automation.editor.triggers.type.numeric_state.type_value")],["input",e("ui.panel.config.automation.editor.triggers.type.numeric_state.type_input")]]},...a?[{name:"below",selector:{entity:{domain:["input_number","number","sensor"]}}}]:[{name:"below",selector:{number:{mode:"box",min:Number.MIN_SAFE_INTEGER,max:Number.MAX_SAFE_INTEGER,step:.1}}}],{name:"value_template",selector:{template:{}}},{name:"for",selector:{duration:{}}}]))},{kind:"method",key:"willUpdate",value:function(e){e.has("trigger")&&this.trigger&&(0,l._)(this.trigger.for)&&(0,d.B)(this,"ui-mode-not-available",Error(this.hass.localize("ui.errors.config.no_template_editor_support")))}},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{entity_id:[]}}},{kind:"method",key:"render",value:function(){var e,t;const i=(0,n.c)(this.trigger.for),a=null!==(e=this._inputAboveIsEntity)&&void 0!==e?e:"string"==typeof this.trigger.above&&(this.trigger.above.startsWith("input_number.")||this.trigger.above.startsWith("number.")||this.trigger.above.startsWith("sensor.")),r=null!==(t=this._inputBelowIsEntity)&&void 0!==t?t:"string"==typeof this.trigger.below&&(this.trigger.below.startsWith("input_number.")||this.trigger.below.startsWith("number.")||this.trigger.below.startsWith("sensor.")),s=this._schema(this.hass.localize,this.trigger.entity_id,a,r),d={mode_above:a?"input":"value",mode_below:r?"input":"value",...this.trigger,entity_id:(0,c.r)(this.trigger.entity_id),for:i};return o.dy` <ha-form .hass="${this.hass}" .data="${d}" .schema="${s}" .disabled="${this.disabled}" @value-changed="${this._valueChanged}" .computeLabel="${this._computeLabelCallback}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();const t=e.detail.value;this._inputAboveIsEntity="input"===t.mode_above,this._inputBelowIsEntity="input"===t.mode_below,delete t.mode_above,delete t.mode_below,""===t.value_template&&delete t.value_template,(0,d.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>{switch(e.name){case"entity_id":return this.hass.localize("ui.components.entity.entity-picker.entity");case"attribute":return this.hass.localize("ui.components.entity.entity-attribute-picker.attribute");case"for":return this.hass.localize("ui.panel.config.automation.editor.triggers.type.state.for");default:return this.hass.localize(`ui.panel.config.automation.editor.triggers.type.numeric_state.${e.name}`)}}}}]}}),o.oi)},46891:(e,t,i)=>{var a=i(309),o=i(14516),r=i(5095),s=i(95260),n=i(18394);i(85878),i(96400),i(54371),i(51520);const d=["added","removed"];(0,a.Z)([(0,s.Mo)("ha-automation-trigger-persistent_notification")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"trigger",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",key:"_schema",value:()=>(0,o.Z)((e=>[{name:"notification_id",required:!1,selector:{text:{}}},{name:"update_type",type:"multi_select",required:!1,options:[["added",e("ui.panel.config.automation.editor.triggers.type.persistent_notification.update_types.added")],["removed",e("ui.panel.config.automation.editor.triggers.type.persistent_notification.update_types.removed")],["current",e("ui.panel.config.automation.editor.triggers.type.persistent_notification.update_types.current")],["updated",e("ui.panel.config.automation.editor.triggers.type.persistent_notification.update_types.updated")]]}]))},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{update_type:[...d],notification_id:""}}},{kind:"method",key:"render",value:function(){const e=this._schema(this.hass.localize);return r.dy` <ha-form .schema="${e}" .data="${this.trigger}" .hass="${this.hass}" .disabled="${this.disabled}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();const t=e.detail.value;(0,n.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>this.hass.localize(`ui.panel.config.automation.editor.triggers.type.persistent_notification.${e.name}`)}},{kind:"field",static:!0,key:"styles",value:()=>r.iv`ha-textfield{display:block}`}]}}),r.oi)},67626:(e,t,i)=>{var a=i(309),o=i(5095),r=i(95260),s=i(38768),n=i(14516),d=i(4771),l=i(18394),c=i(13426),u=i(21686),h=(i(39663),i(27959));const g=(0,s.f0)(u.G,(0,s.Ry)({alias:(0,s.jt)((0,s.Z_)()),platform:(0,s.i0)("state"),entity_id:(0,s.jt)((0,s.G0)([(0,s.Z_)(),(0,s.IX)((0,s.Z_)())])),attribute:(0,s.jt)((0,s.Z_)()),from:(0,s.jt)((0,s.AG)((0,s.Z_)())),to:(0,s.jt)((0,s.AG)((0,s.Z_)())),for:(0,s.jt)((0,s.G0)([(0,s.Rx)(),(0,s.Z_)(),u.H]))})),p="__ANY_STATE_IGNORE_ATTRIBUTES__";(0,a.Z)([(0,r.Mo)("ha-automation-trigger-state")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"trigger",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{entity_id:[]}}},{kind:"field",key:"_schema",value:()=>(0,n.Z)(((e,t,i)=>[{name:"entity_id",required:!0,selector:{entity:{multiple:!0}}},{name:"attribute",selector:{attribute:{entity_id:t?t[0]:void 0,hide_attributes:["access_token","available_modes","code_arm_required","code_format","color_modes","device_class","editable","effect_list","entity_id","entity_picture","event_types","fan_modes","fan_speed_list","friendly_name","frontend_stream_type","has_date","has_time","hvac_modes","icon","id","max_color_temp_kelvin","max_mireds","max_temp","max","min_color_temp_kelvin","min_mireds","min_temp","min","mode","operation_list","options","percentage_step","precipitation_unit","preset_modes","pressure_unit","sound_mode_list","source_list","state_class","step","supported_color_modes","supported_features","swing_modes","target_temp_step","temperature_unit","token","unit_of_measurement","visibility_unit","wind_speed_unit"]}}},{name:"from",selector:{state:{extra_options:i?[]:[{label:e("ui.panel.config.automation.editor.triggers.type.state.any_state_ignore_attributes"),value:p}],entity_id:t?t[0]:void 0,attribute:i}}},{name:"to",selector:{state:{extra_options:i?[]:[{label:e("ui.panel.config.automation.editor.triggers.type.state.any_state_ignore_attributes"),value:p}],entity_id:t?t[0]:void 0,attribute:i}}},{name:"for",selector:{duration:{}}}]))},{kind:"method",key:"shouldUpdate",value:function(e){if(!e.has("trigger"))return!0;if(this.trigger.for&&"object"==typeof this.trigger.for&&0===this.trigger.for.milliseconds&&delete this.trigger.for.milliseconds,this.trigger&&(0,c._)(this.trigger))return(0,l.B)(this,"ui-mode-not-available",Error(this.hass.localize("ui.errors.config.no_template_editor_support"))),!1;try{(0,s.hu)(this.trigger,g)}catch(e){return(0,l.B)(this,"ui-mode-not-available",e),!1}return!0}},{kind:"method",key:"render",value:function(){const e=(0,h.c)(this.trigger.for),t={...this.trigger,entity_id:(0,d.r)(this.trigger.entity_id),for:e};t.attribute||null!==t.to||(t.to=p),t.attribute||null!==t.from||(t.from=p);const i=this._schema(this.hass.localize,this.trigger.entity_id,this.trigger.attribute);return o.dy` <ha-form .hass="${this.hass}" .data="${t}" .schema="${i}" @value-changed="${this._valueChanged}" .computeLabel="${this._computeLabelCallback}" .disabled="${this.disabled}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();const t=e.detail.value;t.to===p&&(t.to=t.attribute?void 0:null),t.from===p&&(t.from=t.attribute?void 0:null),Object.keys(t).forEach((e=>void 0===t[e]||""===t[e]?delete t[e]:{})),(0,l.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>this.hass.localize("entity_id"===e.name?"ui.components.entity.entity-picker.entity":`ui.panel.config.automation.editor.triggers.type.state.${e.name}`)}}]}}),o.oi)},92430:(e,t,i)=>{var a=i(309),o=i(5095),r=i(95260),s=i(14516),n=i(18394);i(39663);(0,a.Z)([(0,r.Mo)("ha-automation-trigger-sun")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"trigger",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",key:"_schema",value:()=>(0,s.Z)((e=>[{name:"event",type:"select",required:!0,options:[["sunrise",e("ui.panel.config.automation.editor.triggers.type.sun.sunrise")],["sunset",e("ui.panel.config.automation.editor.triggers.type.sun.sunset")]]},{name:"offset",selector:{text:{}}}]))},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{event:"sunrise",offset:0}}},{kind:"method",key:"render",value:function(){const e=this._schema(this.hass.localize);return o.dy` <ha-form .schema="${e}" .data="${this.trigger}" .hass="${this.hass}" .disabled="${this.disabled}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();const t=e.detail.value;(0,n.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>this.hass.localize(`ui.panel.config.automation.editor.triggers.type.sun.${e.name}`)}}]}}),o.oi)},73240:(e,t,i)=>{var a=i(309),o=i(34541),r=i(47838),s=(i(44577),i(5095)),n=i(95260),d=i(18394),l=i(28858);i(71133);(0,a.Z)([(0,n.Mo)("ha-automation-trigger-tag")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"trigger",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.SB)()],key:"_tags",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{tag_id:""}}},{kind:"method",key:"firstUpdated",value:function(e){(0,o.Z)((0,r.Z)(i.prototype),"firstUpdated",this).call(this,e),this._fetchTags()}},{kind:"method",key:"render",value:function(){return this._tags?s.dy` <ha-select .label="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.tag.label")}" .disabled="${this.disabled||0===this._tags.length}" .value="${this.trigger.tag_id}" @selected="${this._tagChanged}"> ${this._tags.map((e=>s.dy` <mwc-list-item .value="${e.id}"> ${e.name||e.id} </mwc-list-item> `))} </ha-select> `:s.Ld}},{kind:"method",key:"_fetchTags",value:async function(){this._tags=(await(async e=>e.callWS({type:"tag/list"}))(this.hass)).sort(((e,t)=>(0,l.f)(e.name||e.id,t.name||t.id,this.hass.locale.language)))}},{kind:"method",key:"_tagChanged",value:function(e){e.target.value&&this._tags&&this.trigger.tag_id!==e.target.value&&(0,d.B)(this,"value-changed",{value:{...this.trigger,tag_id:e.target.value}})}},{kind:"get",static:!0,key:"styles",value:function(){return s.iv`ha-select{display:block}`}}]}}),s.oi)},75975:(e,t,i)=>{var a=i(309),o=(i(99539),i(5095)),r=i(95260),s=(i(39663),i(27959)),n=i(18394),d=i(13426);const l=[{name:"value_template",required:!0,selector:{template:{}}},{name:"for",selector:{duration:{}}}];(0,a.Z)([(0,r.Mo)("ha-automation-trigger-template")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"trigger",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{value_template:""}}},{kind:"method",key:"willUpdate",value:function(e){e.has("trigger")&&this.trigger&&(0,d._)(this.trigger.for)&&(0,n.B)(this,"ui-mode-not-available",Error(this.hass.localize("ui.errors.config.no_template_editor_support")))}},{kind:"method",key:"render",value:function(){const e=(0,s.c)(this.trigger.for),t={...this.trigger,for:e};return o.dy` <ha-form .hass="${this.hass}" .data="${t}" .schema="${l}" @value-changed="${this._valueChanged}" .computeLabel="${this._computeLabelCallback}" .disabled="${this.disabled}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();const t=e.detail.value;t.for&&Object.values(t.for).every((e=>0===e))&&delete t.for,(0,n.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>this.hass.localize(`ui.panel.config.automation.editor.triggers.type.template.${e.name}`)}}]}}),o.oi)},57068:(e,t,i)=>{var a=i(309),o=i(5095),r=i(95260),s=i(14516),n=i(18394);i(39663);(0,a.Z)([(0,r.Mo)("ha-automation-trigger-time")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"trigger",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,r.SB)()],key:"_inputMode",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{at:""}}},{kind:"field",key:"_schema",value:()=>(0,s.Z)(((e,t)=>{const i=t?{entity:{filter:[{domain:"input_datetime"},{domain:"sensor",device_class:"timestamp"}]}}:{time:{}};return[{name:"mode",type:"select",required:!0,options:[["value",e("ui.panel.config.automation.editor.triggers.type.time.type_value")],["input",e("ui.panel.config.automation.editor.triggers.type.time.type_input")]]},{name:"at",selector:i}]}))},{kind:"method",key:"willUpdate",value:function(e){e.has("trigger")&&this.trigger&&Array.isArray(this.trigger.at)&&(0,n.B)(this,"ui-mode-not-available",Error(this.hass.localize("ui.errors.config.editor_not_supported")))}},{kind:"method",key:"render",value:function(){var e;const t=this.trigger.at;if(Array.isArray(t))return o.Ld;const i=null!==(e=this._inputMode)&&void 0!==e?e:(null==t?void 0:t.startsWith("input_datetime."))||(null==t?void 0:t.startsWith("sensor.")),a=this._schema(this.hass.localize,i),r={mode:i?"input":"value",...this.trigger};return o.dy` <ha-form .hass="${this.hass}" .data="${r}" .schema="${a}" .disabled="${this.disabled}" @value-changed="${this._valueChanged}" .computeLabel="${this._computeLabelCallback}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();const t=e.detail.value;this._inputMode="input"===t.mode,delete t.mode,Object.keys(t).forEach((e=>void 0===t[e]||""===t[e]?delete t[e]:{})),(0,n.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>this.hass.localize(`ui.panel.config.automation.editor.triggers.type.time.${e.name}`)}}]}}),o.oi)},79664:(e,t,i)=>{var a=i(309),o=i(5095),r=i(95260),s=i(18394);i(39663);const n=[{name:"hours",selector:{text:{}}},{name:"minutes",selector:{text:{}}},{name:"seconds",selector:{text:{}}}];(0,a.Z)([(0,r.Mo)("ha-automation-trigger-time_pattern")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"trigger",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{}}},{kind:"method",key:"render",value:function(){return o.dy` <ha-form .hass="${this.hass}" .schema="${n}" .data="${this.trigger}" .disabled="${this.disabled}" .computeLabel="${this._computeLabelCallback}" @value-changed="${this._valueChanged}"></ha-form> `}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();const t=e.detail.value;(0,s.B)(this,"value-changed",{value:t})}},{kind:"field",key:"_computeLabelCallback",value(){return e=>this.hass.localize(`ui.panel.config.automation.editor.triggers.type.time_pattern.${e.name}`)}}]}}),o.oi)},82749:(e,t,i)=>{i.a(e,(async(e,t)=>{try{var a=i(309),o=i(34541),r=i(47838),s=i(5095),n=i(95260),d=i(18394),l=i(26654),c=i(26874),u=(i(85878),i(96400),i(54371),i(51520),i(33849)),h=i(276),g=e([h]);h=(g.then?(await g)():g)[0];const p="M12,15.5A3.5,3.5 0 0,1 8.5,12A3.5,3.5 0 0,1 12,8.5A3.5,3.5 0 0,1 15.5,12A3.5,3.5 0 0,1 12,15.5M19.43,12.97C19.47,12.65 19.5,12.33 19.5,12C19.5,11.67 19.47,11.34 19.43,11L21.54,9.37C21.73,9.22 21.78,8.95 21.66,8.73L19.66,5.27C19.54,5.05 19.27,4.96 19.05,5.05L16.56,6.05C16.04,5.66 15.5,5.32 14.87,5.07L14.5,2.42C14.46,2.18 14.25,2 14,2H10C9.75,2 9.54,2.18 9.5,2.42L9.13,5.07C8.5,5.32 7.96,5.66 7.44,6.05L4.95,5.05C4.73,4.96 4.46,5.05 4.34,5.27L2.34,8.73C2.21,8.95 2.27,9.22 2.46,9.37L4.57,11C4.53,11.34 4.5,11.67 4.5,12C4.5,12.33 4.53,12.65 4.57,12.97L2.46,14.63C2.27,14.78 2.21,15.05 2.34,15.27L4.34,18.73C4.46,18.95 4.73,19.03 4.95,18.95L7.44,17.94C7.96,18.34 8.5,18.68 9.13,18.93L9.5,21.58C9.54,21.82 9.75,22 10,22H14C14.25,22 14.46,21.82 14.5,21.58L14.87,18.93C15.5,18.67 16.04,18.34 16.56,17.94L19.05,18.95C19.27,19.03 19.54,18.95 19.66,18.73L21.66,15.27C21.78,15.05 21.73,14.78 21.54,14.63L19.43,12.97Z",m="M19,21H8V7H19M19,5H8A2,2 0 0,0 6,7V21A2,2 0 0,0 8,23H19A2,2 0 0,0 21,21V7A2,2 0 0,0 19,5M16,1H4A2,2 0 0,0 2,3V17H4V3H16V1Z",v=["GET","HEAD","POST","PUT"],f=["POST","PUT"],y="";(0,a.Z)([(0,n.Mo)("ha-automation-trigger-webhook")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,n.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,n.Cb)()],key:"trigger",value:void 0},{kind:"field",decorators:[(0,n.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,n.SB)()],key:"_config",value:void 0},{kind:"field",key:"_unsub",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{allowed_methods:[...f],local_only:!0,webhook_id:y}}},{kind:"method",key:"connectedCallback",value:function(){(0,o.Z)((0,r.Z)(i.prototype),"connectedCallback",this).call(this);const e={callback:e=>{this._config=e}};(0,d.B)(this,"subscribe-automation-config",e),this._unsub=e.unsub}},{kind:"method",key:"disconnectedCallback",value:function(){(0,o.Z)((0,r.Z)(i.prototype),"disconnectedCallback",this).call(this),this._unsub&&this._unsub()}},{kind:"method",key:"_generateWebhookId",value:function(){var e;const t=crypto.getRandomValues(new Uint8Array(18)),i=btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_");return`${(0,l.l)((null===(e=this._config)||void 0===e?void 0:e.alias)||"","-")}-${i}`}},{kind:"method",key:"willUpdate",value:function(e){(0,o.Z)((0,r.Z)(i.prototype),"willUpdate",this).call(this,e),e.has("trigger")&&(void 0===this.trigger.allowed_methods&&(this.trigger.allowed_methods=[...f]),void 0===this.trigger.local_only&&(this.trigger.local_only=!0),this.trigger.webhook_id===y&&(this.trigger.webhook_id=this._generateWebhookId()))}},{kind:"method",key:"render",value:function(){const{allowed_methods:e,local_only:t,webhook_id:i}=this.trigger;return s.dy` <div class="flex"> <ha-textfield name="webhook_id" .label="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.webhook.webhook_id")}" .helper="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.webhook.webhook_id_helper")}" .disabled="${this.disabled}" iconTrailing .value="${i||""}" @input="${this._valueChanged}"> <ha-icon-button @click="${this._copyUrl}" slot="trailingIcon" .label="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.webhook.copy_url")}" .path="${m}"></ha-icon-button> </ha-textfield> <ha-button-menu multi> <ha-icon-button slot="trigger" .label="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.webhook.webhook_settings")}" .path="${p}"></ha-icon-button> ${v.map((t=>s.dy` <ha-check-list-item left .value="${t}" @request-selected="${this._allowedMethodsChanged}" .selected="${e.includes(t)}"> ${t} </ha-check-list-item> `))} <li divider role="separator"></li> <ha-check-list-item left @request-selected="${this._localOnlyChanged}" .selected="${t}"> ${this.hass.localize("ui.panel.config.automation.editor.triggers.type.webhook.local_only")} </ha-check-list-item> </ha-button-menu> </div> `}},{kind:"method",key:"_valueChanged",value:function(e){(0,h.a)(this,e)}},{kind:"method",key:"_localOnlyChanged",value:function(e){if(e.stopPropagation(),this.trigger.local_only===e.detail.selected)return;const t={...this.trigger,local_only:e.detail.selected};(0,d.B)(this,"value-changed",{value:t})}},{kind:"method",key:"_allowedMethodsChanged",value:function(e){var t,i;e.stopPropagation();const a=e.target.value,o=e.detail.selected;if(o===(null===(t=this.trigger.allowed_methods)||void 0===t?void 0:t.includes(a)))return;const r=[...null!==(i=this.trigger.allowed_methods)&&void 0!==i?i:[]];o?r.push(a):r.splice(r.indexOf(a),1);const s={...this.trigger,allowed_methods:r};(0,d.B)(this,"value-changed",{value:s})}},{kind:"method",key:"_copyUrl",value:async function(e){const t=e.target.parentElement,i=this.hass.hassUrl(`/api/webhook/${t.value}`);await(0,c.v)(i),(0,u.C)(this,{message:this.hass.localize("ui.common.copied_clipboard")})}},{kind:"field",static:!0,key:"styles",value:()=>s.iv`.flex{display:flex}ha-textfield{flex:1}ha-textfield>ha-icon-button{--mdc-icon-button-size:24px;--mdc-icon-size:18px}ha-button-menu{padding-top:4px}`}]}}),s.oi);t()}catch(e){t(e)}}))},13503:(e,t,i)=>{var a=i(309),o=(i(91998),i(48950),i(5095)),r=i(95260),s=i(18394),n=i(3850),d=i(91131);function l(e){return(0,d.t)(e)&&"zone"!==(0,n.N)(e)}const c=["zone"];(0,a.Z)([(0,r.Mo)("ha-automation-trigger-zone")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)()],key:"trigger",value:void 0},{kind:"field",decorators:[(0,r.Cb)({type:Boolean})],key:"disabled",value:()=>!1},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{entity_id:"",zone:"",event:"enter"}}},{kind:"method",key:"render",value:function(){const{entity_id:e,zone:t,event:i}=this.trigger;return o.dy` <ha-entity-picker .label="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.zone.entity")}" .value="${e}" .disabled="${this.disabled}" @value-changed="${this._entityPicked}" .hass="${this.hass}" allow-custom-entity .entityFilter="${l}"></ha-entity-picker> <ha-entity-picker .label="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.zone.zone")}" .value="${t}" .disabled="${this.disabled}" @value-changed="${this._zonePicked}" .hass="${this.hass}" allow-custom-entity .includeDomains="${c}"></ha-entity-picker> <label> ${this.hass.localize("ui.panel.config.automation.editor.triggers.type.zone.event")} <ha-formfield .disabled="${this.disabled}" .label="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.zone.enter")}"> <ha-radio name="event" value="enter" .disabled="${this.disabled}" .checked="${"enter"===i}" @change="${this._radioGroupPicked}"></ha-radio> </ha-formfield> <ha-formfield .disabled="${this.disabled}" .label="${this.hass.localize("ui.panel.config.automation.editor.triggers.type.zone.leave")}"> <ha-radio name="event" value="leave" .disabled="${this.disabled}" .checked="${"leave"===i}" @change="${this._radioGroupPicked}"></ha-radio> </ha-formfield> </label> `}},{kind:"method",key:"_entityPicked",value:function(e){e.stopPropagation(),(0,s.B)(this,"value-changed",{value:{...this.trigger,entity_id:e.detail.value}})}},{kind:"method",key:"_zonePicked",value:function(e){e.stopPropagation(),(0,s.B)(this,"value-changed",{value:{...this.trigger,zone:e.detail.value}})}},{kind:"method",key:"_radioGroupPicked",value:function(e){e.stopPropagation(),(0,s.B)(this,"value-changed",{value:{...this.trigger,event:e.target.value}})}},{kind:"field",static:!0,key:"styles",value:()=>o.iv`label{display:flex;align-items:center}ha-entity-picker{display:block;margin-bottom:24px}`}]}}),o.oi)},8485:(e,t,i)=>{i.d(t,{a:()=>p});var a=i(43204),o=i(72774),r={ROOT:"mdc-form-field"},s={LABEL_SELECTOR:".mdc-form-field > label"};const n=function(e){function t(i){var o=e.call(this,(0,a.__assign)((0,a.__assign)({},t.defaultAdapter),i))||this;return o.click=function(){o.handleClick()},o}return(0,a.__extends)(t,e),Object.defineProperty(t,"cssClasses",{get:function(){return r},enumerable:!1,configurable:!0}),Object.defineProperty(t,"strings",{get:function(){return s},enumerable:!1,configurable:!0}),Object.defineProperty(t,"defaultAdapter",{get:function(){return{activateInputRipple:function(){},deactivateInputRipple:function(){},deregisterInteractionHandler:function(){},registerInteractionHandler:function(){}}},enumerable:!1,configurable:!0}),t.prototype.init=function(){this.adapter.registerInteractionHandler("click",this.click)},t.prototype.destroy=function(){this.adapter.deregisterInteractionHandler("click",this.click)},t.prototype.handleClick=function(){var e=this;this.adapter.activateInputRipple(),requestAnimationFrame((function(){e.adapter.deactivateInputRipple()}))},t}(o.K);var d=i(78220),l=i(18601),c=i(14114),u=i(5095),h=i(95260),g=i(53180);class p extends d.H{constructor(){super(...arguments),this.alignEnd=!1,this.spaceBetween=!1,this.nowrap=!1,this.label="",this.mdcFoundationClass=n}createAdapter(){return{registerInteractionHandler:(e,t)=>{this.labelEl.addEventListener(e,t)},deregisterInteractionHandler:(e,t)=>{this.labelEl.removeEventListener(e,t)},activateInputRipple:async()=>{const e=this.input;if(e instanceof l.Wg){const t=await e.ripple;t&&t.startPress()}},deactivateInputRipple:async()=>{const e=this.input;if(e instanceof l.Wg){const t=await e.ripple;t&&t.endPress()}}}}get input(){var e,t;return null!==(t=null===(e=this.slottedInputs)||void 0===e?void 0:e[0])&&void 0!==t?t:null}render(){const e={"mdc-form-field--align-end":this.alignEnd,"mdc-form-field--space-between":this.spaceBetween,"mdc-form-field--nowrap":this.nowrap};return u.dy` <div class="mdc-form-field ${(0,g.$)(e)}"> <slot></slot> <label class="mdc-label" @click="${this._labelClick}">${this.label}</label> </div>`}click(){this._labelClick()}_labelClick(){const e=this.input;e&&(e.focus(),e.click())}}(0,a.__decorate)([(0,h.Cb)({type:Boolean})],p.prototype,"alignEnd",void 0),(0,a.__decorate)([(0,h.Cb)({type:Boolean})],p.prototype,"spaceBetween",void 0),(0,a.__decorate)([(0,h.Cb)({type:Boolean})],p.prototype,"nowrap",void 0),(0,a.__decorate)([(0,h.Cb)({type:String}),(0,c.P)((async function(e){var t;null===(t=this.input)||void 0===t||t.setAttribute("aria-label",e)}))],p.prototype,"label",void 0),(0,a.__decorate)([(0,h.IO)(".mdc-form-field")],p.prototype,"mdcRoot",void 0),(0,a.__decorate)([(0,h.vZ)("",!0,"*")],p.prototype,"slottedInputs",void 0),(0,a.__decorate)([(0,h.IO)("label")],p.prototype,"labelEl",void 0)},92038:(e,t,i)=>{i.d(t,{W:()=>a});const a=i(5095).iv`.mdc-form-field{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));display:inline-flex;align-items:center;vertical-align:middle}.mdc-form-field>label{margin-left:0;margin-right:auto;padding-left:4px;padding-right:0;order:0}.mdc-form-field>label[dir=rtl],[dir=rtl] .mdc-form-field>label{margin-left:auto;margin-right:0}.mdc-form-field>label[dir=rtl],[dir=rtl] .mdc-form-field>label{padding-left:0;padding-right:4px}.mdc-form-field--nowrap>label{text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.mdc-form-field--align-end>label{margin-left:auto;margin-right:0;padding-left:0;padding-right:4px;order:-1}.mdc-form-field--align-end>label[dir=rtl],[dir=rtl] .mdc-form-field--align-end>label{margin-left:0;margin-right:auto}.mdc-form-field--align-end>label[dir=rtl],[dir=rtl] .mdc-form-field--align-end>label{padding-left:4px;padding-right:0}.mdc-form-field--space-between{justify-content:space-between}.mdc-form-field--space-between>label{margin:0}.mdc-form-field--space-between>label[dir=rtl],[dir=rtl] .mdc-form-field--space-between>label{margin:0}:host{display:inline-flex}.mdc-form-field{width:100%}::slotted(*){-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:Roboto,sans-serif;font-family:var(--mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif));font-size:.875rem;font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:1.25rem;line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:400;font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:.0178571429em;letter-spacing:var(--mdc-typography-body2-letter-spacing, .0178571429em);text-decoration:inherit;text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:inherit;text-transform:var(--mdc-typography-body2-text-transform,inherit);color:rgba(0,0,0,.87);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87))}::slotted(mwc-switch){margin-right:10px}::slotted(mwc-switch[dir=rtl]),[dir=rtl] ::slotted(mwc-switch){margin-left:10px}`}};
|
||
//# sourceMappingURL=1848.7Ao7gG4SlpU.js.map
|