"use strict";(self.webpackChunkhacs_frontend=self.webpackChunkhacs_frontend||[]).push([["8770"],{78946:function(e,t,i){var a=i(73577),n=i(50778),o=i(47208),s=i(82687);(0,a.Z)([(0,n.Mo)("ha-device-action-picker")],(function(e,t){return{F:class extends t{constructor(){super(o._2,o.AG,(e=>({device_id:e||"",domain:"",entity_id:""}))),e(this)}},d:[{kind:"get",key:"NO_AUTOMATION_TEXT",value:function(){return this.hass.localize("ui.panel.config.devices.automation.actions.no_actions")}},{kind:"get",key:"UNKNOWN_AUTOMATION_TEXT",value:function(){return this.hass.localize("ui.panel.config.devices.automation.actions.unknown_action")}}]}}),s.g)},45501:function(e,t,i){var a=i(73577),n=(i(71695),i(49278),i(11740),i(47021),i(87319),i(57243)),o=i(50778),s=i(20552),d=i(11297),l=i(81036);i(58130),i(59897),i(70596),i(20663);let c,r,h,u,p,v,m,f,g,b=e=>e;(0,a.Z)([(0,o.Mo)("ha-base-time-input")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:"auto-validate",type:Boolean})],key:"autoValidate",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"format",value(){return 12}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"days",value(){return 0}},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"hours",value(){return 0}},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"minutes",value(){return 0}},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"seconds",value(){return 0}},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"milliseconds",value(){return 0}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"dayLabel",value(){return""}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hourLabel",value(){return""}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"minLabel",value(){return""}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"secLabel",value(){return""}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"millisecLabel",value(){return""}},{kind:"field",decorators:[(0,o.Cb)({attribute:"enable-second",type:Boolean})],key:"enableSecond",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:"enable-millisecond",type:Boolean})],key:"enableMillisecond",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:"enable-day",type:Boolean})],key:"enableDay",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:"no-hours-limit",type:Boolean})],key:"noHoursLimit",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"amPm",value(){return"AM"}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"clearable",value:void 0},{kind:"method",key:"render",value:function(){return(0,n.dy)(c||(c=b` ${0}
${0} ${0} ${0} ${0}
${0}
${0} `),this.label?(0,n.dy)(r||(r=b``),this.label,this.required?" *":""):n.Ld,this.enableDay?(0,n.dy)(h||(h=b` `),this.days.toFixed(),this.dayLabel,this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled):n.Ld,this.hours.toFixed(),this.hourLabel,this._valueChanged,this._onFocus,this.required,this.autoValidate,(0,s.o)(this._hourMax),this.disabled,this._formatValue(this.minutes),this.minLabel,this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled,this.enableSecond?":":"",this.enableSecond?"has-suffix":"",this.enableSecond?(0,n.dy)(u||(u=b` `),this._formatValue(this.seconds),this.secLabel,this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled,this.enableMillisecond?":":"",this.enableMillisecond?"has-suffix":""):n.Ld,this.enableMillisecond?(0,n.dy)(p||(p=b` `),this._formatValue(this.milliseconds,3),this.millisecLabel,this._valueChanged,this._onFocus,this.required,this.autoValidate,this.disabled):n.Ld,!this.clearable||this.required||this.disabled?n.Ld:(0,n.dy)(v||(v=b``),this._clearValue,"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"),24===this.format?n.Ld:(0,n.dy)(m||(m=b` AM PM `),this.required,this.amPm,this.disabled,this._valueChanged,l.U),this.helper?(0,n.dy)(f||(f=b`${0}`),this.helper):n.Ld)}},{kind:"method",key:"_clearValue",value:function(){(0,d.B)(this,"value-changed")}},{kind:"method",key:"_valueChanged",value:function(e){const t=e.currentTarget;this[t.name]="amPm"===t.name?t.value:Number(t.value);const i={hours:this.hours,minutes:this.minutes,seconds:this.seconds,milliseconds:this.milliseconds};this.enableDay&&(i.days=this.days),12===this.format&&(i.amPm=this.amPm),(0,d.B)(this,"value-changed",{value:i})}},{kind:"method",key:"_onFocus",value:function(e){e.currentTarget.select()}},{kind:"method",key:"_formatValue",value:function(e,t=2){return e.toString().padStart(t,"0")}},{kind:"get",key:"_hourMax",value:function(){if(!this.noHoursLimit)return 12===this.format?12:23}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(g||(g=b`:host([clearable]){position:relative}:host{display:block}.time-input-wrap-wrap{display:flex}.time-input-wrap{display:flex;border-radius:var(--mdc-shape-small,4px) var(--mdc-shape-small,4px) 0 0;overflow:hidden;position:relative;direction:ltr;padding-right:3px}ha-textfield{width:55px;text-align:center;--mdc-shape-small:0;--text-field-appearance:none;--text-field-padding:0 4px;--text-field-suffix-padding-left:2px;--text-field-suffix-padding-right:0;--text-field-text-align:center}ha-textfield.hasSuffix{--text-field-padding:0 0 0 4px}ha-textfield:first-child{--text-field-border-top-left-radius:var(--mdc-shape-medium)}ha-textfield:last-child{--text-field-border-top-right-radius:var(--mdc-shape-medium)}ha-select{--mdc-shape-small:0;width:85px}:host([clearable]) .mdc-select__anchor{padding-inline-end:var(--select-selected-text-padding-end,12px)}ha-icon-button{position:relative;--mdc-icon-button-size:36px;--mdc-icon-size:20px;color:var(--secondary-text-color);direction:var(--direction);display:flex;align-items:center;background-color:var(--mdc-text-field-fill-color,#f5f5f5);border-bottom-style:solid;border-bottom-width:1px}label{-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var( --mdc-typography-body2-font-family, var(--mdc-typography-font-family, Roboto, sans-serif) );font-size:var(--mdc-typography-body2-font-size, .875rem);line-height:var(--mdc-typography-body2-line-height, 1.25rem);font-weight:var(--mdc-typography-body2-font-weight,400);letter-spacing:var( --mdc-typography-body2-letter-spacing, .0178571429em );text-decoration:var(--mdc-typography-body2-text-decoration,inherit);text-transform:var(--mdc-typography-body2-text-transform,inherit);color:var(--mdc-theme-text-primary-on-background,rgba(0,0,0,.87));padding-left:4px;padding-inline-start:4px;padding-inline-end:initial}ha-input-helper-text{padding-top:8px;line-height:normal}`))}}]}}),n.oi)},22371:function(e,t,i){var a=i(73577),n=(i(71695),i(19423),i(47021),i(57243)),o=i(50778),s=i(11297);i(45501);let d,l=e=>e;(0,a.Z)([(0,o.Mo)("ha-duration-input")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"data",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:"enable-millisecond",type:Boolean})],key:"enableMillisecond",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:"enable-day",type:Boolean})],key:"enableDay",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.IO)("paper-time-input",!0)],key:"_input",value:void 0},{kind:"method",key:"focus",value:function(){this._input&&this._input.focus()}},{kind:"method",key:"render",value:function(){return(0,n.dy)(d||(d=l` `),this.label,this.helper,this.required,!this.required&&void 0!==this.data,this.required,this.disabled,this.enableMillisecond,this.enableDay,this._days,this._hours,this._minutes,this._seconds,this._milliseconds,this._durationChanged)}},{kind:"get",key:"_days",value:function(){var e;return null!==(e=this.data)&&void 0!==e&&e.days?Number(this.data.days):this.required||this.data?0:NaN}},{kind:"get",key:"_hours",value:function(){var e;return null!==(e=this.data)&&void 0!==e&&e.hours?Number(this.data.hours):this.required||this.data?0:NaN}},{kind:"get",key:"_minutes",value:function(){var e;return null!==(e=this.data)&&void 0!==e&&e.minutes?Number(this.data.minutes):this.required||this.data?0:NaN}},{kind:"get",key:"_seconds",value:function(){var e;return null!==(e=this.data)&&void 0!==e&&e.seconds?Number(this.data.seconds):this.required||this.data?0:NaN}},{kind:"get",key:"_milliseconds",value:function(){var e;return null!==(e=this.data)&&void 0!==e&&e.milliseconds?Number(this.data.milliseconds):this.required||this.data?0:NaN}},{kind:"method",key:"_durationChanged",value:function(e){e.stopPropagation();const t=e.detail.value?Object.assign({},e.detail.value):void 0;var i;t&&(t.hours||(t.hours=0),t.minutes||(t.minutes=0),t.seconds||(t.seconds=0),"days"in t&&(t.days||(t.days=0)),"milliseconds"in t&&(t.milliseconds||(t.milliseconds=0)),this.enableMillisecond||t.milliseconds?t.milliseconds>999&&(t.seconds+=Math.floor(t.milliseconds/1e3),t.milliseconds%=1e3):delete t.milliseconds,t.seconds>59&&(t.minutes+=Math.floor(t.seconds/60),t.seconds%=60),t.minutes>59&&(t.hours+=Math.floor(t.minutes/60),t.minutes%=60),this.enableDay&&t.hours>24&&(t.days=(null!==(i=t.days)&&void 0!==i?i:0)+Math.floor(t.hours/24),t.hours%=24));(0,s.B)(this,"value-changed",{value:t})}}]}}),n.oi)},20663:function(e,t,i){var a=i(73577),n=(i(71695),i(47021),i(57243)),o=i(50778);let s,d,l=e=>e;(0,a.Z)([(0,o.Mo)("ha-input-helper-text")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"method",key:"render",value:function(){return(0,n.dy)(s||(s=l``))}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(d||(d=l`:host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:.75rem;padding-left:16px;padding-right:16px;padding-inline-start:16px;padding-inline-end:16px}`))}}]}}),n.oi)},2984:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t),i.d(t,{HaActionSelector:function(){return m}});var n=i(73577),o=(i(71695),i(47021),i(57243)),s=i(50778),d=i(27486),l=i(46982),c=i(31738),r=e([c]);c=(r.then?(await r)():r)[0];let h,u,p,v=e=>e,m=(0,n.Z)([(0,s.Mo)("ha-selector-action")],(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)({attribute:!1})],key:"selector",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:!1})],key:"value",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"disabled",value(){return!1}},{kind:"field",key:"_actions",value(){return(0,d.Z)((e=>e?(0,l.eR)(e):[]))}},{kind:"method",key:"render",value:function(){return(0,o.dy)(h||(h=v` ${0} `),this.label?(0,o.dy)(u||(u=v``),this.label):o.Ld,this.disabled,this._actions(this.value),this.hass)}},{kind:"get",static:!0,key:"styles",value:function(){return(0,o.iv)(p||(p=v`ha-automation-action{display:block;margin-bottom:16px}label{display:block;margin-bottom:4px;font-weight:500}`))}}]}}),o.oi);a()}catch(h){a(h)}}))},29939:function(e,t,i){var a=i(73577),n=i(72621),o=(i(71695),i(47021),i(62523)),s=i(83835),d=i(57243),l=i(50778),c=i(26610);let r,h=e=>e;(0,a.Z)([(0,l.Mo)("ha-switch")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"haptic",value(){return!1}},{kind:"method",key:"firstUpdated",value:function(){(0,n.Z)(i,"firstUpdated",this,3)([]),this.addEventListener("change",(()=>{this.haptic&&(0,c.j)("light")}))}},{kind:"field",static:!0,key:"styles",value(){return[s.W,(0,d.iv)(r||(r=h`:host{--mdc-theme-secondary:var(--switch-checked-color)}.mdc-switch.mdc-switch--checked .mdc-switch__thumb{background-color:var(--switch-checked-button-color);border-color:var(--switch-checked-button-color)}.mdc-switch.mdc-switch--checked .mdc-switch__track{background-color:var(--switch-checked-track-color);border-color:var(--switch-checked-track-color)}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__thumb{background-color:var(--switch-unchecked-button-color);border-color:var(--switch-unchecked-button-color)}.mdc-switch:not(.mdc-switch--checked) .mdc-switch__track{background-color:var(--switch-unchecked-track-color);border-color:var(--switch-unchecked-track-color)}`))]}}]}}),o.H)},26355:function(e,t,i){i.d(t,{Ko:function(){return s},cs:function(){return d},du:function(){return a},ko:function(){return l},lL:function(){return n},s3:function(){return o}});i(71695),i(92519),i(42179),i(89256),i(24931),i(88463),i(57449),i(19814),i(88044),i(47021);const a={condition:"M4 2A2 2 0 0 0 2 4V12H4V8H6V12H8V4A2 2 0 0 0 6 2H4M4 4H6V6H4M22 15.5V14A2 2 0 0 0 20 12H16V22H20A2 2 0 0 0 22 20V18.5A1.54 1.54 0 0 0 20.5 17A1.54 1.54 0 0 0 22 15.5M20 20H18V18H20V20M20 16H18V14H20M5.79 21.61L4.21 20.39L18.21 2.39L19.79 3.61Z",delay:"M12,20A7,7 0 0,1 5,13A7,7 0 0,1 12,6A7,7 0 0,1 19,13A7,7 0 0,1 12,20M19.03,7.39L20.45,5.97C20,5.46 19.55,5 19.04,4.56L17.62,6C16.07,4.74 14.12,4 12,4A9,9 0 0,0 3,13A9,9 0 0,0 12,22C17,22 21,17.97 21,13C21,10.88 20.26,8.93 19.03,7.39M11,14H13V8H11M15,1H9V3H15V1Z",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",play_media:"M8,5.14V19.14L19,12.14L8,5.14Z",service:"M12,5A2,2 0 0,1 14,7C14,7.24 13.96,7.47 13.88,7.69C17.95,8.5 21,11.91 21,16H3C3,11.91 6.05,8.5 10.12,7.69C10.04,7.47 10,7.24 10,7A2,2 0 0,1 12,5M22,19H2V17H22V19Z",wait_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",wait_for_trigger:"M12,9A2,2 0 0,1 10,7C10,5.89 10.9,5 12,5C13.11,5 14,5.89 14,7A2,2 0 0,1 12,9M12,14A2,2 0 0,1 10,12C10,10.89 10.9,10 12,10C13.11,10 14,10.89 14,12A2,2 0 0,1 12,14M12,19A2,2 0 0,1 10,17C10,15.89 10.9,15 12,15C13.11,15 14,15.89 14,17A2,2 0 0,1 12,19M20,10H17V8.86C18.72,8.41 20,6.86 20,5H17V4A1,1 0 0,0 16,3H8A1,1 0 0,0 7,4V5H4C4,6.86 5.28,8.41 7,8.86V10H4C4,11.86 5.28,13.41 7,13.86V15H4C4,16.86 5.28,18.41 7,18.86V20A1,1 0 0,0 8,21H16A1,1 0 0,0 17,20V18.86C18.72,18.41 20,16.86 20,15H17V13.86C18.72,13.41 20,11.86 20,10Z",repeat:"M17.65,6.35C16.2,4.9 14.21,4 12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20C15.73,20 18.84,17.45 19.73,14H17.65C16.83,16.33 14.61,18 12,18A6,6 0 0,1 6,12A6,6 0 0,1 12,6C13.66,6 15.14,6.69 16.22,7.78L13,11H20V4L17.65,6.35Z",choose:"M11,5H8L12,1L16,5H13V9.43C12.25,9.89 11.58,10.46 11,11.12V5M22,11L18,7V10C14.39,9.85 11.31,12.57 11,16.17C9.44,16.72 8.62,18.44 9.17,20C9.72,21.56 11.44,22.38 13,21.83C14.56,21.27 15.38,19.56 14.83,18C14.53,17.14 13.85,16.47 13,16.17C13.47,12.17 17.47,11.97 17.95,11.97V14.97L22,11M10.63,11.59C9.3,10.57 7.67,10 6,10V7L2,11L6,15V12C7.34,12.03 8.63,12.5 9.64,13.4C9.89,12.76 10.22,12.15 10.63,11.59Z",if:"M14,4L16.29,6.29L13.41,9.17L14.83,10.59L17.71,7.71L20,10V4M10,4H4V10L6.29,7.71L11,12.41V20H13V11.59L7.71,6.29",device_id:"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",stop:"M13 24C9.74 24 6.81 22 5.6 19L2.57 11.37C2.26 10.58 3 9.79 3.81 10.05L4.6 10.31C5.16 10.5 5.62 10.92 5.84 11.47L7.25 15H8V3.25C8 2.56 8.56 2 9.25 2S10.5 2.56 10.5 3.25V12H11.5V1.25C11.5 .56 12.06 0 12.75 0S14 .56 14 1.25V12H15V2.75C15 2.06 15.56 1.5 16.25 1.5C16.94 1.5 17.5 2.06 17.5 2.75V12H18.5V5.75C18.5 5.06 19.06 4.5 19.75 4.5S21 5.06 21 5.75V16C21 20.42 17.42 24 13 24Z",sequence:"M7,13V11H21V13H7M7,19V17H21V19H7M7,7V5H21V7H7M3,8V5H2V4H4V8H3M2,17V16H5V20H2V19H4V18.5H3V17.5H4V17H2M4.25,10A0.75,0.75 0 0,1 5,10.75C5,10.95 4.92,11.14 4.79,11.27L3.12,13H5V14H2V13.08L4,11H2V10H4.25Z",parallel:"M16,4.5V7H5V9H16V11.5L19.5,8M16,12.5V15H5V17H16V19.5L19.5,16",variables:"M21 2H3C1.9 2 1 2.9 1 4V20C1 21.1 1.9 22 3 22H21C22.1 22 23 21.1 23 20V4C23 2.9 22.1 2 21 2M21 20H3V6H21V20M16.6 8C18.1 9.3 19 11.1 19 13C19 14.9 18.1 16.7 16.6 18L15 17.4C16.3 16.4 17 14.7 17 13S16.3 9.6 15 8.6L16.6 8M7.4 8L9 8.6C7.7 9.6 7 11.3 7 13S7.7 16.4 9 17.4L7.4 18C5.9 16.7 5 14.9 5 13S5.9 9.3 7.4 8M12.1 12L13.5 10H15L12.8 13L14.1 16H12.8L12 14L10.6 16H9L11.3 12.9L10 10H11.3L12.1 12Z",set_conversation_response:"M12,8H4A2,2 0 0,0 2,10V14A2,2 0 0,0 4,16H5V20A1,1 0 0,0 6,21H8A1,1 0 0,0 9,20V16H12L17,20V4L12,8M21.5,12C21.5,13.71 20.54,15.26 19,16V8C20.53,8.75 21.5,10.3 21.5,12Z"},n=new Set(["variables"]),o={device_id:{},helpers:{icon:"M21.71 20.29L20.29 21.71A1 1 0 0 1 18.88 21.71L7 9.85A3.81 3.81 0 0 1 6 10A4 4 0 0 1 2.22 4.7L4.76 7.24L5.29 6.71L6.71 5.29L7.24 4.76L4.7 2.22A4 4 0 0 1 10 6A3.81 3.81 0 0 1 9.85 7L21.71 18.88A1 1 0 0 1 21.71 20.29M2.29 18.88A1 1 0 0 0 2.29 20.29L3.71 21.71A1 1 0 0 0 5.12 21.71L10.59 16.25L7.76 13.42M20 2L16 4V6L13.83 8.17L15.83 10.17L18 8H20L22 4Z",members:{}},building_blocks:{icon:"M18.5 18.5C19.04 18.5 19.5 18.96 19.5 19.5S19.04 20.5 18.5 20.5H6.5C5.96 20.5 5.5 20.04 5.5 19.5S5.96 18.5 6.5 18.5H18.5M18.5 17H6.5C5.13 17 4 18.13 4 19.5S5.13 22 6.5 22H18.5C19.88 22 21 20.88 21 19.5S19.88 17 18.5 17M21 11H18V7H13L10 11V16H22L21 11M11.54 11L13.5 8.5H16V11H11.54M9.76 3.41L4.76 2L2 11.83C1.66 13.11 2.41 14.44 3.7 14.8L4.86 15.12L8.15 12.29L4.27 11.21L6.15 4.46L8.94 5.24C9.5 5.53 10.71 6.34 11.47 7.37L12.5 6H12.94C11.68 4.41 9.85 3.46 9.76 3.41Z",members:{condition:{},delay:{},wait_template:{},wait_for_trigger:{},repeat:{},choose:{},if:{},stop:{},sequence:{},parallel:{},variables:{}}},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:{},service:{},set_conversation_response:{}}}},s="__SERVICE__",d=e=>null==e?void 0:e.startsWith(s),l=e=>e.substring(s.length)},26610:function(e,t,i){i.d(t,{j:function(){return n}});var a=i(11297);const n=e=>{(0,a.B)(window,"haptic",e)}},38774:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{Q:function(){return b}});i(52247),i(19083),i(71695),i(92745),i(77439),i(61006),i(39527),i(67670),i(13334),i(47021);var n=i(24785),o=i(21735),s=i(90916),d=i(73525),l=i(14519),c=i(80058),r=i(28273),h=i(47208),u=i(92374),p=i(60498),v=i(1275),m=i(46982),f=e([o,l,r]);[o,l,r]=f.then?(await f)():f;const g="ui.panel.config.automation.editor.actions.type",b=(e,t,i,a,n,o,s=!1)=>{try{const d=y(e,t,i,a,n,o,s);if("string"!=typeof d)throw new Error(String(d));return d}catch(d){console.error(d);let e="Error in describing action";return d.message&&(e+=": "+d.message),e}},y=(e,t,i,a,f,b,y=!1)=>{if(f.alias&&!y)return f.alias;if(b||(b=(0,m.Pw)(f)),"service"===b){const o=f,s=[],r=o.target||o.data;if(r)for(const[l,h]of Object.entries({area_id:"areas",device_id:"devices",entity_id:"entities",floor_id:"floors",label_id:"labels"})){if(!(l in r))continue;const o=(0,n.r)(r[l])||[];for(const n of o){if((0,c.J)(n)){s.push(e.localize(`${g}.service.description.target_template`,{name:h}));break}if("entity_id"===l)if(n.includes(".")){const t=e.states[n];t?s.push((0,d.C)(t)):s.push(n)}else{const i=(0,p.Mw)(t)[n];i?s.push((0,p.vA)(e,i)||n):"all"===n?s.push(e.localize(`${g}.service.description.target_every_entity`)):s.push(e.localize(`${g}.service.description.target_unknown_entity`))}else if("device_id"===l){const t=e.devices[n];t?s.push((0,u.jL)(t,e)):s.push(e.localize(`${g}.service.description.target_unknown_device`))}else if("area_id"===l){const t=e.areas[n];null!=t&&t.name?s.push(t.name):s.push(e.localize(`${g}.service.description.target_unknown_area`))}else if("floor_id"===l){var k;const t=null!==(k=a[n])&&void 0!==k?k:void 0;null!=t&&t.name?s.push(t.name):s.push(e.localize(`${g}.service.description.target_unknown_floor`))}else if("label_id"===l){const t=i.find((e=>e.label_id===n));null!=t&&t.name?s.push(t.name):s.push(e.localize(`${g}.service.description.target_unknown_label`))}else s.push(n)}}if(o.service_template||o.action&&(0,c.J)(o.action))return e.localize(s.length?`${g}.service.description.service_based_on_template`:`${g}.service.description.service_based_on_template_no_targets`,{targets:(0,l.z)(e.locale,s)});if(o.action){var _;const[t,i]=o.action.split(".",2),a=e.localize(`component.${t}.services.${i}.name`)||(null===(_=e.services[t][i])||void 0===_?void 0:_.name);return o.metadata?e.localize(s.length?`${g}.service.description.service_name`:`${g}.service.description.service_name_no_targets`,{domain:(0,v.Lh)(e.localize,t),name:a||o.action,targets:(0,l.z)(e.locale,s)}):e.localize(s.length?`${g}.service.description.service_based_on_name`:`${g}.service.description.service_based_on_name_no_targets`,{name:a?`${(0,v.Lh)(e.localize,t)}: ${a}`:o.action,targets:(0,l.z)(e.locale,s)})}return e.localize(`${g}.service.description.service`)}if("delay"===b){const t=f;let i;return i="number"==typeof t.delay?e.localize(`${g}.delay.description.duration_string`,{string:(0,s.Z)(t.delay)}):"string"==typeof t.delay?(0,c.J)(t.delay)?e.localize(`${g}.delay.description.duration_template`):e.localize(`${g}.delay.description.duration_string`,{string:t.delay||e.localize(`${g}.delay.description.duration_unknown`)}):t.delay?e.localize(`${g}.delay.description.duration_string`,{string:(0,o.$k)(e.locale,t.delay)}):e.localize(`${g}.delay.description.duration_string`,{string:e.localize(`${g}.delay.description.duration_unknown`)}),e.localize(`${g}.delay.description.full`,{duration:i})}if("play_media"===b){var $;const t=f,i=(null===($=t.target)||void 0===$?void 0:$.entity_id)||t.entity_id,a=i?e.states[i]:void 0;return e.localize(`${g}.play_media.description.full`,{hasMedia:t.metadata.title||t.data.media_content_id?"true":"false",media:t.metadata.title||t.data.media_content_id,hasMediaPlayer:a||void 0!==i?"true":"false",mediaPlayer:a?(0,d.C)(a):i})}if("wait_for_trigger"===b){const t=f,i=(0,n.r)(t.wait_for_trigger);return i&&0!==i.length?e.localize(`${g}.wait_for_trigger.description.wait_for_triggers`,{count:i.length}):e.localize(`${g}.wait_for_trigger.description.wait_for_a_trigger`)}if("variables"===b){const t=f;return e.localize(`${g}.variables.description.full`,{names:(0,l.z)(e.locale,Object.keys(t.variables))})}if("fire_event"===b){const t=f;return(0,c.J)(t.event)?e.localize(`${g}.event.description.full`,{name:e.localize(`${g}.event.description.template`)}):e.localize(`${g}.event.description.full`,{name:t.event})}if("wait_template"===b)return e.localize(`${g}.wait_template.description.full`);if("stop"===b){const t=f;return e.localize(`${g}.stop.description.full`,{hasReason:void 0!==t.stop?"true":"false",reason:t.stop})}if("if"===b){return void 0!==f.else?e.localize(`${g}.if.description.if_else`):e.localize(`${g}.if.description.if`)}if("choose"===b){const t=f;if(t.choose){const i=(0,n.r)(t.choose).length+(t.default?1:0);return e.localize(`${g}.choose.description.full`,{number:i})}return e.localize(`${g}.choose.description.no_action`)}if("repeat"===b){const t=f;let i="";if("count"in t.repeat){const a=t.repeat.count;i=e.localize(`${g}.repeat.description.count`,{count:a})}else if("while"in t.repeat){const a=(0,n.r)(t.repeat.while);i=e.localize(`${g}.repeat.description.while_count`,{count:a.length})}else if("until"in t.repeat){const a=(0,n.r)(t.repeat.until);i=e.localize(`${g}.repeat.description.until_count`,{count:a.length})}else if("for_each"in t.repeat){const a=(0,n.r)(t.repeat.for_each).map((e=>JSON.stringify(e)));i=e.localize(`${g}.repeat.description.for_each`,{items:(0,l.z)(e.locale,a)})}return e.localize(`${g}.repeat.description.full`,{chosenAction:i})}if("check_condition"===b)return e.localize(`${g}.check_condition.description.full`,{condition:(0,r.m)(f,e,t)});if("device_action"===b){const i=f;if(!i.device_id)return e.localize(`${g}.device_id.description.no_device`);const a=(0,h._2)(e,t,i);if(a)return a;const n=e.states[i.entity_id];return`${i.type||"Perform action with"} ${n?(0,d.C)(n):i.entity_id}`}if("sequence"===b){const t=f,i=(0,n.r)(t.sequence).length;return e.localize(`${g}.sequence.description.full`,{number:i})}if("parallel"===b){const t=f,i=(0,n.r)(t.parallel).length;return e.localize(`${g}.parallel.description.full`,{number:i})}if("set_conversation_response"===b){const t=f;return(0,c.J)(t.set_conversation_response)?e.localize(`${g}.set_conversation_response.description.template`):e.localize(`${g}.set_conversation_response.description.full`,{response:t.set_conversation_response})}return b};a()}catch(g){a(g)}}))},49373:function(e,t,i){i.d(t,{n:function(){return a}});i(19083);const a=(e,t)=>e.callWS({type:"execute_script",sequence:t})},44035:function(e,t,i){i.a(e,(async function(e,a){try{i.d(t,{a0:function(){return re},oL:function(){return ce}});var n=i(73577),o=(i(71695),i(19423),i(40251),i(39527),i(67670),i(13334),i(47021),i(60738)),s=i(12582),d=i(57243),l=i(50778),c=i(35359),r=i(90842),h=i(38653),u=i(11297),p=i(81036),v=i(81928),m=i(5280),f=(i(17949),i(43527),i(1192),i(2383),i(59897),i(15623)),g=i(26355),b=i(34290),y=i(61339),k=i(46982),_=i(38774),$=i(49373),C=i(4557),x=i(66193),V=i(46694),w=i(58728),H=i(3392),M=(i(68185),i(37319)),L=i(13667),A=i(61999),z=i(92440),B=(i(81686),i(52237)),O=i(56303),Z=i(23283),j=(i(21328),i(17758),i(58727)),q=(i(83449),e([f,w,H,M,L,A,z,B,O,Z,j,_]));[f,w,H,M,L,A,z,B,O,Z,j,_]=q.then?(await q)():q;let P,S,D,F,R,N,E,T,U,I,K,Q,W=e=>e;const J="M18.75 22.16L16 19.16L17.16 18L18.75 19.59L22.34 16L23.5 17.41L18.75 22.16M13 13V7H11V13H13M13 17V15H11V17H13M12 2C17.5 2 22 6.5 22 12L21.91 13.31C21.31 13.11 20.67 13 20 13C16.69 13 14 15.69 14 19C14 19.95 14.22 20.85 14.62 21.65C13.78 21.88 12.91 22 12 22C6.5 22 2 17.5 2 12C2 6.5 6.5 2 12 2Z",Y="M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z",X="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z",G="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",ee="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",te="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",ie="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",ae="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",ne="M8,5.14V19.14L19,12.14L8,5.14Z",oe="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",se="M3 6V8H14V6H3M3 10V12H14V10H3M20 10.1C19.9 10.1 19.7 10.2 19.6 10.3L18.6 11.3L20.7 13.4L21.7 12.4C21.9 12.2 21.9 11.8 21.7 11.6L20.4 10.3C20.3 10.2 20.2 10.1 20 10.1M18.1 11.9L12 17.9V20H14.1L20.2 13.9L18.1 11.9M3 14V16H10V14H3Z",de="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",le="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",ce=e=>{if(e)return"action"in e?(0,k.Pw)(e):["and","or","not"].some((t=>t in e))?"condition":Object.keys(g.du).find((t=>t in e))},re=(e,t)=>{var i,a;t.stopPropagation();const n=null===(i=t.target)||void 0===i?void 0:i.name;if(!n)return;const o=(null===(a=t.detail)||void 0===a?void 0:a.value)||t.target.value;if((e.action[n]||"")===o)return;let s;o?s=Object.assign(Object.assign({},e.action),{},{[n]:o}):(s=Object.assign({},e.action),delete s[n]),(0,u.B)(e,"value-changed",{value:s})},he=e=>e.preventDefault();(0,n.Z)([(0,l.Mo)("ha-automation-action-row")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,l.Cb)({attribute:!1})],key:"action",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"first",value:void 0},{kind:"field",decorators:[(0,l.Cb)({type:Boolean})],key:"last",value:void 0},{kind:"field",decorators:[(0,r.t)({key:"automationClipboard",state:!1,subscribe:!0,storage:"sessionStorage"})],key:"_clipboard",value:void 0},{kind:"field",decorators:[(0,l.SB)(),(0,o.F_)({context:y.we,subscribe:!0})],key:"_entityReg",value:void 0},{kind:"field",decorators:[(0,l.SB)(),(0,o.F_)({context:y.TD,subscribe:!0})],key:"_labelReg",value:void 0},{kind:"field",decorators:[(0,l.SB)(),(0,o.F_)({context:y.WC,subscribe:!0})],key:"_floorReg",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_warnings",value:void 0},{kind:"field",decorators:[(0,l.SB)()],key:"_uiModeAvailable",value(){return!0}},{kind:"field",decorators:[(0,l.SB)()],key:"_yamlMode",value(){return!1}},{kind:"field",decorators:[(0,l.IO)("ha-yaml-editor")],key:"_yamlEditor",value:void 0},{kind:"method",key:"willUpdate",value:function(e){if(!e.has("action"))return;const t=ce(this.action);this._uiModeAvailable=void 0!==t&&!g.lL.has(t),this._uiModeAvailable||this._yamlMode||(this._yamlMode=!0)}},{kind:"method",key:"updated",value:function(e){if(e.has("action")&&this._yamlMode){const e=this._yamlEditor;e&&e.value!==this.action&&e.setValue(this.action)}}},{kind:"method",key:"render",value:function(){if(!this.action)return d.Ld;const e=ce(this.action),t=this._yamlMode;return(0,d.dy)(P||(P=W` ${0}

${0} ${0}

${0} ${0} ${0}
  • ${0} ${0} ${0} ${0} ${0} ${0}
  • ${0} ${0}
    ${0} ${0}
    `),!1===this.action.enabled?(0,d.dy)(S||(S=W`
    ${0}
    `),this.hass.localize("ui.panel.config.automation.editor.actions.disabled")):d.Ld,"service"===e&&"action"in this.action&&this.action.action?(0,d.dy)(D||(D=W``),this.hass,this.action.action):(0,d.dy)(F||(F=W``),g.du[e]),(0,v.f)((0,_.Q)(this.hass,this._entityReg,this._labelReg,this._floorReg,this.action)),"condition"!==e&&!0===this.action.continue_on_error?(0,d.dy)(R||(R=W`
    ${0}
    `),J,this.hass.localize("ui.panel.config.automation.editor.actions.continue_on_error")):d.Ld,this._handleAction,he,p.U,this.hass.localize("ui.common.menu"),ae,this.hass.localize("ui.panel.config.automation.editor.actions.run"),ne,this.disabled,this.hass.localize("ui.panel.config.automation.editor.actions.rename"),de,this.disabled,this.hass.localize("ui.panel.config.automation.editor.actions.duplicate"),te,this.disabled,this.hass.localize("ui.panel.config.automation.editor.triggers.copy"),G,this.disabled,this.hass.localize("ui.panel.config.automation.editor.triggers.cut"),ee,this.disabled||this.first,this.hass.localize("ui.panel.config.automation.editor.move_up"),X,this.disabled||this.last,this.hass.localize("ui.panel.config.automation.editor.move_down"),Y,!this._uiModeAvailable,this.hass.localize("ui.panel.config.automation.editor.edit_"+(t?"ui":"yaml")),se,this.disabled,!1===this.action.enabled?this.hass.localize("ui.panel.config.automation.editor.actions.enable"):this.hass.localize("ui.panel.config.automation.editor.actions.disable"),!1===this.action.enabled?oe:le,this.disabled,this.hass.localize("ui.panel.config.automation.editor.actions.delete"),ie,(0,c.$)({"card-content":!0,disabled:!1===this.action.enabled}),this._warnings?(0,d.dy)(N||(N=W` ${0} ${0} `),this.hass.localize("ui.errors.config.editor_not_supported"),this._warnings.length>0&&void 0!==this._warnings[0]?(0,d.dy)(E||(E=W` `),this._warnings.map((e=>(0,d.dy)(T||(T=W`
  • ${0}
  • `),e)))):"",this.hass.localize("ui.errors.config.edit_in_yaml_supported")):"",t?(0,d.dy)(U||(U=W` ${0} `),void 0===e?(0,d.dy)(I||(I=W` ${0} `),this.hass.localize("ui.panel.config.automation.editor.actions.unsupported_action")):"",this.hass,this.action,this.disabled,this._onYamlChange):(0,d.dy)(K||(K=W`
    ${0}
    `),this._handleUiModeNotAvailable,this._onUiChanged,(0,h.h)(`ha-automation-action-${e}`,{hass:this.hass,action:this.action,narrow:this.narrow,disabled:this.disabled})))}},{kind:"method",key:"_handleUiModeNotAvailable",value:function(e){e.stopPropagation(),this._warnings=(0,m.p)(this.hass,e.detail).warnings,this._yamlMode||(this._yamlMode=!0)}},{kind:"method",key:"_handleAction",value:async function(e){switch(e.detail.index){case 0:this._runAction();break;case 1:await this._renameAction();break;case 2:(0,u.B)(this,"duplicate");break;case 3:this._setClipboard();break;case 4:this._setClipboard(),(0,u.B)(this,"value-changed",{value:null});break;case 5:(0,u.B)(this,"move-up");break;case 6:(0,u.B)(this,"move-down");break;case 7:this._yamlMode?this._switchUiMode():this._switchYamlMode(),this.expand();break;case 8:this._onDisable();break;case 9:this._onDelete()}}},{kind:"method",key:"_setClipboard",value:function(){this._clipboard=Object.assign(Object.assign({},this._clipboard),{},{action:(0,s.Z)(this.action)})}},{kind:"method",key:"_onDisable",value:function(){var e;const t=!(null===(e=this.action.enabled)||void 0===e||e),i=Object.assign(Object.assign({},this.action),{},{enabled:t});var a;((0,u.B)(this,"value-changed",{value:i}),this._yamlMode)&&(null===(a=this._yamlEditor)||void 0===a||a.setValue(i))}},{kind:"method",key:"_runAction",value:async function(){const e=await(0,b.w)(this.hass,{actions:this.action});if(e.actions.valid){try{await(0,$.n)(this.hass,this.action)}catch(t){return void(0,C.Ys)(this,{title:this.hass.localize("ui.panel.config.automation.editor.actions.run_action_error"),text:t.message||t})}(0,V.C)(this,{message:this.hass.localize("ui.panel.config.automation.editor.actions.run_action_success")})}else(0,C.Ys)(this,{title:this.hass.localize("ui.panel.config.automation.editor.actions.invalid_action"),text:e.actions.error})}},{kind:"method",key:"_onDelete",value:function(){(0,C.g7)(this,{title:this.hass.localize("ui.panel.config.automation.editor.actions.delete_confirm_title"),text:this.hass.localize("ui.panel.config.automation.editor.actions.delete_confirm_text"),dismissText:this.hass.localize("ui.common.cancel"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0,confirm:()=>{(0,u.B)(this,"value-changed",{value:null})}})}},{kind:"method",key:"_onYamlChange",value:function(e){e.stopPropagation(),e.detail.isValid&&(0,u.B)(this,"value-changed",{value:(0,k.eR)(e.detail.value)})}},{kind:"method",key:"_onUiChanged",value:function(e){e.stopPropagation();const t=Object.assign(Object.assign({},this.action.alias?{alias:this.action.alias}:{}),e.detail.value);(0,u.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:"_renameAction",value:async function(){const e=await(0,C.D9)(this,{title:this.hass.localize("ui.panel.config.automation.editor.actions.change_alias"),inputLabel:this.hass.localize("ui.panel.config.automation.editor.actions.alias"),inputType:"string",placeholder:(0,v.f)((0,_.Q)(this.hass,this._entityReg,this._labelReg,this._floorReg,this.action,void 0,!0)),defaultValue:this.action.alias,confirmText:this.hass.localize("ui.common.submit")});if(null!==e){const i=Object.assign({},this.action);var t;if(""===e?delete i.alias:i.alias=e,(0,u.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[x.Qx,(0,d.iv)(Q||(Q=W`ha-button-menu,ha-icon-button{--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}.action-icon{display:none}@media (min-width:870px){.action-icon{display:inline-block;color:var(--secondary-text-color);opacity:.9;margin-right:8px;margin-inline-end:8px;margin-inline-start:initial}}.card-content{padding:16px}.disabled-bar{background:var(--divider-color,#e0e0e0);text-align:center;border-top-right-radius:var(--ha-card-border-radius,12px);border-top-left-radius:var(--ha-card-border-radius,12px)}mwc-list-item[disabled]{--mdc-theme-text-primary-on-background:var(--disabled-text-color)}mwc-list-item.hidden{display:none}.warning ul{margin:4px 0}li[role=separator]{border-bottom-color:var(--divider-color)}`))]}}]}}),d.oi);a()}catch(P){a(P)}}))},31738:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(73577),n=i(72621),o=(i(71695),i(19423),i(40251),i(11740),i(46692),i(39527),i(99790),i(41360),i(47021),i(12582)),s=i(57243),d=i(50778),l=i(91583),c=i(90842),r=i(11297),h=i(85233),u=i(30137),p=(i(20095),i(14002),i(10508),i(26355)),v=i(6625),m=i(44035),f=e([m]);m=(f.then?(await f)():f)[0];let g,b,y,k,_=e=>e;const $="M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z",C="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";(0,a.Z)([(0,d.Mo)("ha-automation-action")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"actions",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_showReorder",value(){return!1}},{kind:"field",decorators:[(0,c.t)({key:"automationClipboard",state:!0,subscribe:!0,storage:"sessionStorage"})],key:"_clipboard",value:void 0},{kind:"field",key:"_focusLastActionOnChange",value(){return!1}},{kind:"field",key:"_actionKeys",value(){return new WeakMap}},{kind:"field",key:"_unsubMql",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this._unsubMql=(0,h.K)("(min-width: 600px)",(e=>{this._showReorder=e}))}},{kind:"method",key:"disconnectedCallback",value:function(){var e;(0,n.Z)(i,"disconnectedCallback",this,3)([]),null===(e=this._unsubMql)||void 0===e||e.call(this),this._unsubMql=void 0}},{kind:"method",key:"render",value:function(){return(0,s.dy)(g||(g=_`
    ${0}
    `),!this._showReorder||this.disabled,this._actionMoved,this._actionAdded,this._actionRemoved,(0,l.r)(this.actions,(e=>this._getKey(e)),((e,t)=>(0,s.dy)(b||(b=_` ${0} `),e,t,0===t,t===this.actions.length-1,e,this.narrow,this.disabled,this._duplicateAction,this._moveDown,this._moveUp,this._actionChanged,this.hass,this._showReorder&&!this.disabled?(0,s.dy)(y||(y=_`
    `),$):s.Ld))),this.disabled,this.hass.localize("ui.panel.config.automation.editor.actions.add"),this._addActionDialog,C,this.disabled,this.hass.localize("ui.panel.config.automation.editor.actions.add_building_block"),this._addActionBuildingBlockDialog,C)}},{kind:"method",key:"updated",value:function(e){if((0,n.Z)(i,"updated",this,3)([e]),e.has("actions")&&this._focusLastActionOnChange){this._focusLastActionOnChange=!1;const e=this.shadowRoot.querySelector("ha-automation-action-row:last-of-type");e.updateComplete.then((()=>{e.expand(),e.scrollIntoView(),e.focus()}))}}},{kind:"method",key:"expandAll",value:function(){this.shadowRoot.querySelectorAll("ha-automation-action-row").forEach((e=>{e.expand()}))}},{kind:"method",key:"_addActionDialog",value:function(){var e;(0,v._)(this,{type:"action",add:this._addAction,clipboardItem:(0,m.oL)(null===(e=this._clipboard)||void 0===e?void 0:e.action)})}},{kind:"method",key:"_addActionBuildingBlockDialog",value:function(){var e;(0,v._)(this,{type:"action",add:this._addAction,clipboardItem:(0,m.oL)(null===(e=this._clipboard)||void 0===e?void 0:e.action),group:"building_blocks"})}},{kind:"field",key:"_addAction",value(){return e=>{let t;if(e===v.I)t=this.actions.concat((0,o.Z)(this._clipboard.action));else if((0,p.cs)(e))t=this.actions.concat({action:(0,p.ko)(e),metadata:{}});else{const i=customElements.get(`ha-automation-action-${e}`);t=this.actions.concat(i?Object.assign({},i.defaultConfig):{[e]:{}})}this._focusLastActionOnChange=!0,(0,r.B)(this,"value-changed",{value:t})}}},{kind:"method",key:"_getKey",value:function(e){return this._actionKeys.has(e)||this._actionKeys.set(e,Math.random().toString()),this._actionKeys.get(e)}},{kind:"method",key:"_moveUp",value:function(e){e.stopPropagation();const t=e.target.index,i=t-1;this._move(t,i)}},{kind:"method",key:"_moveDown",value:function(e){e.stopPropagation();const t=e.target.index,i=t+1;this._move(t,i)}},{kind:"method",key:"_move",value:function(e,t){const i=this.actions.concat(),a=i.splice(e,1)[0];i.splice(t,0,a),this.actions=i,(0,r.B)(this,"value-changed",{value:i})}},{kind:"method",key:"_actionMoved",value:function(e){e.stopPropagation();const{oldIndex:t,newIndex:i}=e.detail;this._move(t,i)}},{kind:"method",key:"_actionAdded",value:async function(e){e.stopPropagation();const{index:t,data:i}=e.detail,a=[...this.actions.slice(0,t),i,...this.actions.slice(t)];this.actions=a,await(0,u.y)(),(0,r.B)(this,"value-changed",{value:this.actions})}},{kind:"method",key:"_actionRemoved",value:async function(e){e.stopPropagation();const{index:t}=e.detail,i=this.actions[t];this.actions=this.actions.filter((e=>e!==i)),await(0,u.y)();const a=this.actions.filter((e=>e!==i));(0,r.B)(this,"value-changed",{value:a})}},{kind:"method",key:"_actionChanged",value:function(e){e.stopPropagation();const t=[...this.actions],i=e.detail.value,a=e.target.index;if(null===i)t.splice(a,1);else{const e=this._getKey(t[a]);this._actionKeys.set(i,e),t[a]=i}(0,r.B)(this,"value-changed",{value:t})}},{kind:"method",key:"_duplicateAction",value:function(e){e.stopPropagation();const t=e.target.index;(0,r.B)(this,"value-changed",{value:this.actions.concat((0,o.Z)(this.actions[t]))})}},{kind:"get",static:!0,key:"styles",value:function(){return(0,s.iv)(k||(k=_`.actions{padding:16px;margin:-16px;display:flex;flex-direction:column;gap:16px}.sortable-ghost{background:0 0;border-radius:var(--ha-card-border-radius,12px)}.sortable-drag{background:0 0}ha-automation-action-row{display:block;scroll-margin-top:48px}ha-svg-icon{height:20px}.handle{padding:12px;cursor:move;cursor:grab}.handle ha-svg-icon{pointer-events:none;height:24px}.buttons{display:flex;flex-wrap:wrap;gap:8px;order:1}`))}}]}}),s.oi);t()}catch(g){t(g)}}))},58728:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(73577),n=(i(71695),i(19423),i(47021),i(57243)),o=i(50778),s=i(24785),d=i(11297),l=(i(20095),i(66193)),c=i(69723),r=i(31738),h=e([c,r]);[c,r]=h.then?(await h)():h;let u,p,v,m,f=e=>e;(0,a.Z)([(0,o.Mo)("ha-automation-action-choose")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"action",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_showDefault",value(){return!1}},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{choose:[{conditions:[],sequence:[]}]}}},{kind:"method",key:"render",value:function(){const e=this.action,t=e.choose?(0,s.r)(e.choose):[];return(0,n.dy)(u||(u=f` ${0} `),t,this.disabled,this._optionsChanged,this.hass,this._showDefault||e.default?(0,n.dy)(p||(p=f`

    ${0}:

    `),this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.default"),(0,s.r)(e.default)||[],this.disabled,this._defaultChanged,this.hass):(0,n.dy)(v||(v=f` `),this._addDefault,this.disabled,this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.add_default")))}},{kind:"method",key:"_addDefault",value:function(){this._showDefault=!0}},{kind:"method",key:"_optionsChanged",value:function(e){e.stopPropagation();const t=e.detail.value;(0,d.B)(this,"value-changed",{value:Object.assign(Object.assign({},this.action),{},{choose:t})})}},{kind:"method",key:"_defaultChanged",value:function(e){e.stopPropagation(),this._showDefault=!0;const t=e.detail.value,i=Object.assign(Object.assign({},this.action),{},{default:t});0===t.length&&delete i.default,(0,d.B)(this,"value-changed",{value:i})}},{kind:"get",static:!0,key:"styles",value:function(){return[l.Qx,(0,n.iv)(m||(m=f`.link-button-row{padding:14px 14px 0 14px}`))]}}]}}),n.oi);t()}catch(u){t(u)}}))},3392:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(73577),n=(i(71695),i(61893),i(19423),i(13334),i(47021),i(57243)),o=i(50778),s=i(27486),d=i(11297),l=i(32770),c=(i(58130),i(31594)),r=i(3417),h=e([r]);r=(h.then?(await h)():h)[0];let u,p,v,m=e=>e;(0,a.Z)([(0,o.Mo)("ha-automation-action-condition")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"action",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{condition:"state"}}},{kind:"method",key:"render",value:function(){return(0,n.dy)(u||(u=m` ${0} `),this.hass.localize("ui.panel.config.automation.editor.conditions.type_select"),this.disabled,this.action.condition,this._typeChanged,this._processedTypes(this.hass.localize).map((([e,t,i])=>(0,n.dy)(p||(p=m` ${0} `),e,t,i))),this.action,this.disabled,this.hass,this._conditionChanged)}},{kind:"field",key:"_processedTypes",value(){return(0,s.Z)((e=>Object.entries(c.L).map((([t,i])=>[t,e(`ui.panel.config.automation.editor.conditions.type.${t}.label`),i])).sort(((e,t)=>(0,l.$)(e[1],t[1],this.hass.locale.language)))))}},{kind:"method",key:"_conditionChanged",value:function(e){e.stopPropagation(),(0,d.B)(this,"value-changed",{value:e.detail.value})}},{kind:"method",key:"_typeChanged",value:function(e){const t=e.target.value;if(!t)return;const i=customElements.get(`ha-automation-condition-${t}`);t!==this.action.condition&&(0,d.B)(this,"value-changed",{value:Object.assign({},i.defaultConfig)})}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(v||(v=m`ha-select{margin-bottom:24px}`))}}]}}),n.oi);t()}catch(u){t(u)}}))},68185:function(e,t,i){var a=i(73577),n=(i(52247),i(71695),i(19423),i(47021),i(57243)),o=i(50778),s=i(11297),d=i(80058),l=(i(22371),i(28571));let c,r=e=>e;(0,a.Z)([(0,o.Mo)("ha-automation-action-delay")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"action",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_timeData",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{delay:""}}},{kind:"method",key:"willUpdate",value:function(e){e.has("action")&&(this.action&&(0,d._)(this.action)?(0,s.B)(this,"ui-mode-not-available",Error(this.hass.localize("ui.errors.config.no_template_editor_support"))):this._timeData=(0,l.c)(this.action.delay))}},{kind:"method",key:"render",value:function(){return(0,n.dy)(c||(c=r``),this.hass.localize("ui.panel.config.automation.editor.actions.type.delay.delay"),this.disabled,this._timeData,this._valueChanged)}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();const t=e.detail.value;t&&(0,s.B)(this,"value-changed",{value:Object.assign(Object.assign({},this.action),{},{delay:t})})}}]}}),n.oi)},37319:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(73577),n=(i(52247),i(71695),i(19423),i(40251),i(39527),i(41360),i(47021),i(60738)),o=i(57243),s=i(50778),d=i(27486),l=i(11297),c=(i(78946),i(66912)),r=(i(42877),i(61339)),h=i(47208),u=e([c]);c=(u.then?(await u)():u)[0];let p,v,m,f=e=>e;(0,a.Z)([(0,s.Mo)("ha-automation-action-device_id")],(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:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Object})],key:"action",value:void 0},{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,n.F_)({context:r.we,subscribe:!0})],key:"_entityReg",value:void 0},{kind:"field",key:"_origAction",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{device_id:"",domain:"",entity_id:""}}},{kind:"field",key:"_extraFieldsData",value(){return(0,d.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:"shouldUpdate",value:function(e){return!e.has("action")||(!this.action.device_id||this.action.device_id in this.hass.devices||((0,l.B)(this,"ui-mode-not-available",Error(this.hass.localize("ui.panel.config.automation.editor.edit_unknown_device"))),!1))}},{kind:"method",key:"render",value:function(){var e;const t=this._deviceId||this.action.device_id;return(0,o.dy)(p||(p=f` ${0} `),t,this.disabled,this._devicePicked,this.hass,this.hass.localize("ui.panel.config.automation.editor.actions.type.device_id.label"),this.action,t,this.disabled,this._deviceActionPicked,this.hass,this.hass.localize("ui.panel.config.automation.editor.actions.type.device_id.action"),null!==(e=this._capabilities)&&void 0!==e&&null!==(e=e.extra_fields)&&void 0!==e&&e.length?(0,o.dy)(v||(v=f` `),this.hass,this._extraFieldsData(this.action,this._capabilities),this._capabilities.extra_fields,this.disabled,(0,h.kJ)(this.hass,this.action),(0,h.Md)(this.hass,this.action),this._extraFieldsChanged):"")}},{kind:"method",key:"firstUpdated",value:function(){this._capabilities||this._getCapabilities(),this.action&&(this._origAction=this.action)}},{kind:"method",key:"updated",value:function(e){const t=e.get("action");t&&!(0,h.hH)(this._entityReg,t,this.action)&&(this._deviceId=void 0,this._getCapabilities())}},{kind:"method",key:"_getCapabilities",value:async function(){this._capabilities=this.action.domain?await(0,h._K)(this.hass,this.action):void 0}},{kind:"method",key:"_devicePicked",value:function(e){e.stopPropagation(),this._deviceId=e.target.value,void 0===this._deviceId&&(0,l.B)(this,"value-changed",{value:i.defaultConfig})}},{kind:"method",key:"_deviceActionPicked",value:function(e){e.stopPropagation();let t=e.detail.value;this._origAction&&(0,h.hH)(this._entityReg,this._origAction,t)&&(t=this._origAction),(0,l.B)(this,"value-changed",{value:t})}},{kind:"method",key:"_extraFieldsChanged",value:function(e){e.stopPropagation(),(0,l.B)(this,"value-changed",{value:Object.assign(Object.assign({},this.action),e.detail.value)})}},{kind:"field",static:!0,key:"styles",value(){return(0,o.iv)(m||(m=f`ha-device-picker{display:block;margin-bottom:24px}ha-device-action-picker{display:block}ha-form{display:block;margin-top:24px}`))}}]}}),o.oi);t()}catch(p){t(p)}}))},13667:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(73577),n=(i(71695),i(19423),i(47021),i(57243)),o=i(50778),s=i(11297),d=i(59498),l=i(43418),c=(i(70596),i(27196),i(44035)),r=e([d,l,c]);[d,l,c]=r.then?(await r)():r;let h,u,p=e=>e;(0,a.Z)([(0,o.Mo)("ha-automation-action-event")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"action",value:void 0},{kind:"field",decorators:[(0,o.IO)("ha-yaml-editor",!0)],key:"_yamlEditor",value:void 0},{kind:"field",key:"_actionData",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{event:"",event_data:{}}}},{kind:"method",key:"updated",value:function(e){e.has("action")&&(this._actionData&&this._actionData!==this.action.event_data&&this._yamlEditor&&this._yamlEditor.setValue(this.action.event_data),this._actionData=this.action.event_data)}},{kind:"method",key:"render",value:function(){const{event:e,event_data:t}=this.action;return(0,n.dy)(h||(h=p` `),this.hass.localize("ui.panel.config.automation.editor.actions.type.event.event"),e,this.disabled,this._eventChanged,this.hass,this.hass.localize("ui.panel.config.automation.editor.actions.type.event.event_data"),"event_data",this.disabled,t,this._dataChanged)}},{kind:"method",key:"_dataChanged",value:function(e){e.stopPropagation(),e.detail.isValid&&(this._actionData=e.detail.value,(0,c.a0)(this,e))}},{kind:"method",key:"_eventChanged",value:function(e){e.stopPropagation(),(0,s.B)(this,"value-changed",{value:Object.assign(Object.assign({},this.action),{},{event:e.target.value})})}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(u||(u=p`ha-textfield{display:block}`))}}]}}),n.oi);t()}catch(h){t(h)}}))},61999:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(73577),n=(i(71695),i(19423),i(47021),i(57243)),o=i(50778),s=i(11297),d=(i(70596),i(66193)),l=i(31738),c=e([l]);l=(c.then?(await c)():c)[0];let r,h,u,p,v=e=>e;(0,a.Z)([(0,o.Mo)("ha-automation-action-if")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"action",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_showElse",value(){return!1}},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{if:[],then:[]}}},{kind:"method",key:"render",value:function(){const e=this.action;return(0,n.dy)(r||(r=v`

    ${0}*:

    ${0}*:

    ${0} `),this.hass.localize("ui.panel.config.automation.editor.actions.type.if.if"),e.if,this.disabled,this._ifChanged,this.hass,this.hass.localize("ui.panel.config.automation.editor.actions.type.if.then"),e.then,this.disabled,this._thenChanged,this.hass,this._showElse||e.else?(0,n.dy)(h||(h=v`

    ${0}:

    `),this.hass.localize("ui.panel.config.automation.editor.actions.type.if.else"),e.else||[],this.disabled,this._elseChanged,this.hass):(0,n.dy)(u||(u=v` `),this._addElse,this.disabled,this.hass.localize("ui.panel.config.automation.editor.actions.type.if.add_else")))}},{kind:"method",key:"_addElse",value:function(){this._showElse=!0}},{kind:"method",key:"_ifChanged",value:function(e){e.stopPropagation();const t=e.detail.value;(0,s.B)(this,"value-changed",{value:Object.assign(Object.assign({},this.action),{},{if:t})})}},{kind:"method",key:"_thenChanged",value:function(e){e.stopPropagation();const t=e.detail.value;(0,s.B)(this,"value-changed",{value:Object.assign(Object.assign({},this.action),{},{then:t})})}},{kind:"method",key:"_elseChanged",value:function(e){e.stopPropagation(),this._showElse=!0;const t=e.detail.value,i=Object.assign(Object.assign({},this.action),{},{else:t});0===t.length&&delete i.else,(0,s.B)(this,"value-changed",{value:i})}},{kind:"get",static:!0,key:"styles",value:function(){return[d.Qx,(0,n.iv)(p||(p=v`.link-button-row{padding:14px}`))]}}]}}),n.oi);t()}catch(r){t(r)}}))},92440:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(73577),n=(i(71695),i(19423),i(47021),i(57243)),o=i(50778),s=i(11297),d=(i(70596),i(66193)),l=i(31738),c=e([l]);l=(c.then?(await c)():c)[0];let r,h=e=>e;(0,a.Z)([(0,o.Mo)("ha-automation-action-parallel")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"action",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{parallel:[]}}},{kind:"method",key:"render",value:function(){const e=this.action;return(0,n.dy)(r||(r=h` `),e.parallel,this.disabled,this._actionsChanged,this.hass)}},{kind:"method",key:"_actionsChanged",value:function(e){e.stopPropagation();const t=e.detail.value;(0,s.B)(this,"value-changed",{value:Object.assign(Object.assign({},this.action),{},{parallel:t})})}},{kind:"get",static:!0,key:"styles",value:function(){return d.Qx}}]}}),n.oi);t()}catch(r){t(r)}}))},81686:function(e,t,i){var a=i(73577),n=(i(71695),i(19423),i(47021),i(57243)),o=i(50778),s=i(27486),d=i(11297);i(61527);let l,c=e=>e;(0,a.Z)([(0,o.Mo)("ha-automation-action-play_media")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"action",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{action:"media_player.play_media",target:{entity_id:""},data:{media_content_id:"",media_content_type:""},metadata:{}}}},{kind:"field",key:"_getSelectorValue",value(){return(0,s.Z)((e=>{var t,i,a;return{entity_id:(null===(t=e.target)||void 0===t?void 0:t.entity_id)||e.entity_id,media_content_id:null===(i=e.data)||void 0===i?void 0:i.media_content_id,media_content_type:null===(a=e.data)||void 0===a?void 0:a.media_content_type,metadata:e.metadata}}))}},{kind:"method",key:"render",value:function(){return(0,n.dy)(l||(l=c` `),this.hass,this.disabled,this._getSelectorValue(this.action),this._valueChanged)}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation(),(0,d.B)(this,"value-changed",{value:Object.assign(Object.assign({},this.action),{},{action:"media_player.play_media",target:{entity_id:e.detail.value.entity_id},data:{media_content_id:e.detail.value.media_content_id,media_content_type:e.detail.value.media_content_type},metadata:e.detail.value.metadata||{}})})}}]}}),n.oi)},52237:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(73577),n=(i(71695),i(19423),i(47021),i(57243)),o=i(50778),s=i(27486),d=i(11297),l=(i(70596),i(66193)),c=i(31738),r=i(80058),h=(i(42877),e([c]));c=(h.then?(await h)():h)[0];let u,p,v=e=>e;const m=["count","while","until","for_each"],f=e=>m.find((t=>t in e));(0,a.Z)([(0,o.Mo)("ha-automation-action-repeat")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"action",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{repeat:{count:2,sequence:[]}}}},{kind:"field",key:"_schema",value(){return(0,s.Z)(((e,t,i)=>[{name:"type",selector:{select:{mode:"dropdown",options:m.map((t=>({value:t,label:e(`ui.panel.config.automation.editor.actions.type.repeat.type.${t}.label`)})))}}},..."count"===t?[{name:"count",required:!0,selector:i?{template:{}}:{number:{mode:"box",min:1}}}]:[],..."until"===t||"while"===t?[{name:t,selector:{condition:{}}}]:[],..."for_each"===t?[{name:"for_each",required:!0,selector:{object:{}}}]:[],{name:"sequence",selector:{action:{}}}]))}},{kind:"method",key:"render",value:function(){const e=this.action.repeat,t=f(e),i=this._schema(this.hass.localize,null!=t?t:"count","count"in e&&"string"==typeof e.count&&(0,r.J)(e.count)),a=Object.assign(Object.assign({},e),{},{type:t});return(0,n.dy)(u||(u=v``),this.hass,a,i,this.disabled,this._valueChanged,this._computeLabelCallback)}},{kind:"method",key:"_valueChanged",value:function(e){e.stopPropagation();const t=e.detail.value,i=t.type;delete t.type;if(i!==f(this.action.repeat)){var a,n;if("count"===i&&(t.count=2,delete t.while,delete t.until,delete t.for_each),"while"===i)t.while=null!==(a=t.until)&&void 0!==a?a:[],delete t.count,delete t.until,delete t.for_each;if("until"===i)t.until=null!==(n=t.while)&&void 0!==n?n:[],delete t.count,delete t.while,delete t.for_each;"for_each"===i&&(t.for_each={},delete t.count,delete t.while,delete t.until)}(0,d.B)(this,"value-changed",{value:Object.assign(Object.assign({},this.action),{},{repeat:Object.assign({},t)})})}},{kind:"get",static:!0,key:"styles",value:function(){return[l.Qx,(0,n.iv)(p||(p=v`ha-textfield{margin-top:16px}`))]}},{kind:"field",key:"_computeLabelCallback",value(){return e=>{switch(e.name){case"type":return this.hass.localize("ui.panel.config.automation.editor.actions.type.repeat.type_select");case"count":return this.hass.localize("ui.panel.config.automation.editor.actions.type.repeat.type.count.label");case"while":return this.hass.localize("ui.panel.config.automation.editor.actions.type.repeat.type.while.conditions")+":";case"until":return this.hass.localize("ui.panel.config.automation.editor.actions.type.repeat.type.until.conditions")+":";case"for_each":return this.hass.localize("ui.panel.config.automation.editor.actions.type.repeat.type.for_each.items")+":";case"sequence":return this.hass.localize("ui.panel.config.automation.editor.actions.type.repeat.sequence")+":"}return""}}}]}}),n.oi);t()}catch(u){t(u)}}))},56303:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(73577),n=(i(71695),i(19423),i(47021),i(57243)),o=i(50778),s=i(11297),d=(i(70596),i(66193)),l=i(31738),c=e([l]);l=(c.then?(await c)():c)[0];let r,h=e=>e;(0,a.Z)([(0,o.Mo)("ha-automation-action-sequence")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"action",value:void 0},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{sequence:[]}}},{kind:"method",key:"render",value:function(){const{action:e}=this;return(0,n.dy)(r||(r=h` `),e.sequence,this.disabled,this._actionsChanged,this.hass)}},{kind:"method",key:"_actionsChanged",value:function(e){e.stopPropagation();const t=e.detail.value;(0,s.B)(this,"value-changed",{value:Object.assign(Object.assign({},this.action),{},{sequence:t})})}},{kind:"get",static:!0,key:"styles",value:function(){return d.Qx}}]}}),n.oi);t()}catch(r){t(r)}}))},23283:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(73577),n=(i(52247),i(71695),i(19423),i(39527),i(36993),i(47021),i(57243)),o=i(50778),s=i(27486),d=i(62900),l=i(11297),c=i(79575),r=i(87729),h=i(80058),u=i(15606),p=i(46982),v=e([u]);u=(v.then?(await v)():v)[0];let m,f,g,b,y,k=e=>e;(0,a.Z)([(0,o.Mo)("ha-automation-action-service")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"action",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,o.SB)()],key:"_action",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_responseChecked",value(){return!1}},{kind:"field",key:"_fields",value(){return(0,s.Z)(((e,t)=>{if(!t)return{fields:{}};const i=(0,c.M)(t),a=(0,r.p)(t);return i in e&&a in e[i]?{fields:e[i][a].fields}:{fields:{}}}))}},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{action:"",data:{}}}},{kind:"method",key:"willUpdate",value:function(e){var t;if(!e.has("action"))return;try{(0,d.hu)(this.action,p.TL)}catch(a){return void(0,l.B)(this,"ui-mode-not-available",a)}const i=this._fields(this.hass.services,null===(t=this.action)||void 0===t?void 0:t.action).fields;this.action&&(Object.entries(this.action).some((([e,t])=>"data"!==e&&(0,h._)(t)))||this.action.data&&Object.entries(this.action.data).some((([e,t])=>{const a=i[e];return(null==a||!a.selector||!("template"in a.selector)&&!("object"in a.selector))&&(0,h._)(t)})))?(0,l.B)(this,"ui-mode-not-available",Error(this.hass.localize("ui.errors.config.no_template_editor_support"))):this.action.entity_id?(this._action=Object.assign(Object.assign({},this.action),{},{data:Object.assign(Object.assign({},this.action.data),{},{entity_id:this.action.entity_id})}),delete this._action.entity_id):this._action=this.action}},{kind:"method",key:"render",value:function(){var e,t;if(!this._action)return n.Ld;const[i,a]=this._action.action?this._action.action.split(".",2):[void 0,void 0];return(0,n.dy)(m||(m=k` ${0} `),this.narrow,this.hass,this._action,this.disabled,null===(e=this.hass.userData)||void 0===e?void 0:e.showAdvanced,!!this._action.metadata,this._actionChanged,i&&a&&null!==(t=this.hass.services[i])&&void 0!==t&&null!==(t=t[a])&&void 0!==t&&t.response?(0,n.dy)(f||(f=k` ${0} ${0} ${0} `),this.narrow,this.hass.services[i][a].response.optional?(0,n.dy)(g||(g=k``),this._action.response_variable||this._responseChecked,this.disabled,this._responseCheckboxChanged):(0,n.dy)(b||(b=k`
    `)),this.hass.localize("ui.panel.config.automation.editor.actions.type.service.response_variable"),this.hass.services[i][a].response.optional?this.hass.localize("ui.panel.config.automation.editor.actions.type.service.has_optional_response"):this.hass.localize("ui.panel.config.automation.editor.actions.type.service.has_response"),this._action.response_variable||"",!this.hass.services[i][a].response.optional,this.disabled||this.hass.services[i][a].response.optional&&!this._action.response_variable&&!this._responseChecked,this._responseVariableChanged):n.Ld)}},{kind:"method",key:"_actionChanged",value:function(e){e.detail.value===this._action&&e.stopPropagation();const t=Object.assign(Object.assign({},this.action),e.detail.value);if("response_variable"in this.action){var i;const[e,a]=this._action.action?this._action.action.split(".",2):[void 0,void 0];e&&a&&null!==(i=this.hass.services[e])&&void 0!==i&&i[a]&&!("response"in this.hass.services[e][a])&&(delete t.response_variable,this._responseChecked=!1)}(0,l.B)(this,"value-changed",{value:t})}},{kind:"method",key:"_responseVariableChanged",value:function(e){const t=Object.assign(Object.assign({},this.action),{},{response_variable:e.target.value});e.target.value||delete t.response_variable,(0,l.B)(this,"value-changed",{value:t})}},{kind:"method",key:"_responseCheckboxChanged",value:function(e){if(this._responseChecked=e.target.checked,!this._responseChecked){const e=Object.assign({},this.action);delete e.response_variable,(0,l.B)(this,"value-changed",{value:e})}}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(y||(y=k`ha-service-control{display:block;margin:0 -16px}ha-settings-row{margin:0 -16px;padding:var(--service-control-padding,0 16px)}ha-settings-row{--paper-time-input-justify-content:flex-end;--settings-row-content-width:100%;--settings-row-prefix-display:contents;border-top:var(--service-control-items-border-top,1px solid var(--divider-color))}ha-checkbox{margin-left:-16px;margin-inline-start:-16px;margin-inline-end:initial}.checkbox-spacer{width:32px}`))}}]}}),n.oi);t()}catch(m){t(m)}}))},21328:function(e,t,i){var a=i(73577),n=(i(71695),i(47021),i(57243)),o=i(50778);i(42877);let s,d=e=>e;const l=[{name:"set_conversation_response",selector:{template:{}}}];(0,a.Z)([(0,o.Mo)("ha-automation-action-set_conversation_response")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"action",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{set_conversation_response:""}}},{kind:"method",key:"render",value:function(){return(0,n.dy)(s||(s=d` `),this.hass,this.action,l,this.disabled,this._computeLabelCallback)}},{kind:"field",key:"_computeLabelCallback",value(){return()=>this.hass.localize("ui.panel.config.automation.editor.actions.type.set_conversation_response.label")}}]}}),n.oi)},17758:function(e,t,i){var a=i(73577),n=(i(71695),i(19423),i(47021),i(57243)),o=i(50778),s=i(11297);i(70596),i(52158),i(29939);let d,l,c=e=>e;(0,a.Z)([(0,o.Mo)("ha-automation-action-stop")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"action",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{stop:""}}},{kind:"method",key:"render",value:function(){const{error:e,stop:t,response_variable:i}=this.action;return(0,n.dy)(d||(d=c` `),this.hass.localize("ui.panel.config.automation.editor.actions.type.stop.stop"),t,this.disabled,this._stopChanged,this.hass.localize("ui.panel.config.automation.editor.actions.type.stop.response_variable"),i||"",this.disabled,this._responseChanged,this.disabled,this.hass.localize("ui.panel.config.automation.editor.actions.type.stop.error"),this.disabled,null!=e&&e,this._errorChanged)}},{kind:"method",key:"_stopChanged",value:function(e){e.stopPropagation(),(0,s.B)(this,"value-changed",{value:Object.assign(Object.assign({},this.action),{},{stop:e.target.value})})}},{kind:"method",key:"_responseChanged",value:function(e){e.stopPropagation(),(0,s.B)(this,"value-changed",{value:Object.assign(Object.assign({},this.action),{},{response_variable:e.target.value})})}},{kind:"method",key:"_errorChanged",value:function(e){e.stopPropagation(),(0,s.B)(this,"value-changed",{value:Object.assign(Object.assign({},this.action),{},{error:e.target.checked})})}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(l||(l=c`ha-textfield{display:block;margin-bottom:24px}`))}}]}}),n.oi)},58727:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(73577),n=(i(71695),i(19423),i(47021),i(57243)),o=i(50778),s=i(24785),d=i(28571),l=i(11297),c=(i(22371),i(52158),i(70596),i(41181)),r=i(44035),h=e([c,r]);[c,r]=h.then?(await h)():h;let u,p,v=e=>e;(0,a.Z)([(0,o.Mo)("ha-automation-action-wait_for_trigger")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"action",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{wait_for_trigger:[]}}},{kind:"method",key:"render",value:function(){var e;const t=(0,d.c)(this.action.timeout);return(0,n.dy)(u||(u=v` `),this.hass.localize("ui.panel.config.automation.editor.actions.type.wait_for_trigger.timeout"),t,this.disabled,this._timeoutChanged,this.disabled,this.hass.localize("ui.panel.config.automation.editor.actions.type.wait_for_trigger.continue_timeout"),null===(e=this.action.continue_on_timeout)||void 0===e||e,this.disabled,this._continueChanged,(0,s.r)(this.action.wait_for_trigger),this.hass,this.disabled,"wait_for_trigger",this._valueChanged)}},{kind:"method",key:"_timeoutChanged",value:function(e){e.stopPropagation();const t=e.detail.value;(0,l.B)(this,"value-changed",{value:Object.assign(Object.assign({},this.action),{},{timeout:t})})}},{kind:"method",key:"_continueChanged",value:function(e){(0,l.B)(this,"value-changed",{value:Object.assign(Object.assign({},this.action),{},{continue_on_timeout:e.target.checked})})}},{kind:"method",key:"_valueChanged",value:function(e){(0,r.a0)(this,e)}},{kind:"get",static:!0,key:"styles",value:function(){return(0,n.iv)(p||(p=v`ha-duration-input{display:block;margin-bottom:24px}ha-automation-trigger{display:block;margin-top:24px}`))}}]}}),n.oi);t()}catch(u){t(u)}}))},83449:function(e,t,i){var a=i(73577),n=(i(71695),i(47021),i(57243)),o=i(50778);i(42877);let s,d=e=>e;const l=[{name:"wait_template",selector:{template:{}}},{name:"timeout",required:!1,selector:{text:{}}},{name:"continue_on_timeout",selector:{boolean:{}}}];(0,a.Z)([(0,o.Mo)("ha-automation-action-wait_template")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"action",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"get",static:!0,key:"defaultConfig",value:function(){return{wait_template:"",continue_on_timeout:!0}}},{kind:"method",key:"render",value:function(){return(0,n.dy)(s||(s=d` `),this.hass,this.action,l,this.disabled,this._computeLabelCallback)}},{kind:"field",key:"_computeLabelCallback",value(){return e=>this.hass.localize(`ui.panel.config.automation.editor.actions.type.wait_template.${"continue_on_timeout"===e.name?"continue_timeout":e.name}`)}}]}}),n.oi)},62325:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(73577),n=(i(71695),i(19423),i(40251),i(47021),i(60738)),o=(i(87319),i(57243)),s=i(50778),d=i(24785),l=i(11297),c=i(14920),r=i(81036),h=i(81928),u=(i(43527),i(1192),i(2383),i(59897),i(80251)),p=i(31738),v=i(28273),m=i(61339),f=i(4557),g=i(66193),b=e([u,p,v]);[u,p,v]=b.then?(await b)():b;let y,k,_=e=>e;const $="M11,4H13V16L18.5,10.5L19.92,11.92L12,19.84L4.08,11.92L5.5,10.5L11,16V4Z",C="M13,20H11V8L5.5,13.5L4.08,12.08L12,4.16L19.92,12.08L18.5,13.5L13,8V20Z",x="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",V="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",w="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",H="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";(0,a.Z)([(0,s.Mo)("ha-automation-option-row")],(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)({attribute:!1})],key:"option",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Number})],key:"index",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"first",value(){return!1}},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"last",value(){return!1}},{kind:"field",decorators:[(0,s.SB)()],key:"_expanded",value(){return!1}},{kind:"field",decorators:[(0,s.SB)(),(0,n.F_)({context:m.we,subscribe:!0})],key:"_entityReg",value:void 0},{kind:"method",key:"_expandedChanged",value:function(e){"option"===e.currentTarget.id&&(this._expanded=e.detail.expanded)}},{kind:"method",key:"_getDescription",value:function(){const e=(0,d.r)(this.option.conditions);if(!e||0===e.length)return this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.no_conditions");let t="";return"string"==typeof e[0]?t+=e[0]:t+=(0,v.m)(e[0],this.hass,this._entityReg),e.length>1&&(t+=this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.option_description_additional",{numberOfAdditionalConditions:e.length-1})),t}},{kind:"method",key:"render",value:function(){return this.option?(0,o.dy)(y||(y=_`

    ${0}: ${0}

    ${0} ${0} ${0} ${0} ${0}

    ${0}:

    ${0}:

    `),this._expandedChanged,this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.option",{number:this.index+1}),this.option.alias||(this._expanded?"":this._getDescription()),this._handleAction,c.P,r.U,this.hass.localize("ui.common.menu"),w,this.disabled,this.hass.localize("ui.panel.config.automation.editor.actions.rename"),H,this.disabled,this.hass.localize("ui.panel.config.automation.editor.actions.duplicate"),x,this.disabled||this.first,this.hass.localize("ui.panel.config.automation.editor.move_up"),C,this.disabled||this.last,this.hass.localize("ui.panel.config.automation.editor.move_down"),$,this.disabled,this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.remove_option"),V,this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.conditions"),(0,d.r)(this.option.conditions),this.disabled,this.hass,this._conditionChanged,this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.sequence"),(0,d.r)(this.option.sequence)||[],this.disabled,this.hass,this._actionChanged):o.Ld}},{kind:"method",key:"_handleAction",value:async function(e){switch(e.detail.index){case 0:await this._renameOption();break;case 1:(0,l.B)(this,"duplicate");break;case 2:(0,l.B)(this,"move-up");break;case 3:(0,l.B)(this,"move-down");break;case 4:this._removeOption()}}},{kind:"method",key:"_removeOption",value:function(){(0,f.g7)(this,{title:this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.delete_confirm_title"),text:this.hass.localize("ui.panel.config.automation.editor.actions.delete_confirm_text"),dismissText:this.hass.localize("ui.common.cancel"),confirmText:this.hass.localize("ui.common.delete"),destructive:!0,confirm:()=>(0,l.B)(this,"value-changed",{value:null})})}},{kind:"method",key:"_renameOption",value:async function(){const e=await(0,f.D9)(this,{title:this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.change_alias"),inputLabel:this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.alias"),inputType:"string",placeholder:(0,h.f)(this._getDescription()),defaultValue:this.option.alias,confirmText:this.hass.localize("ui.common.submit")});if(null!==e){const t=Object.assign({},this.option);""===e?delete t.alias:t.alias=e,(0,l.B)(this,"value-changed",{value:t})}}},{kind:"method",key:"_conditionChanged",value:function(e){e.stopPropagation();const t=e.detail.value,i=Object.assign(Object.assign({},this.option),{},{conditions:t});(0,l.B)(this,"value-changed",{value:i})}},{kind:"method",key:"_actionChanged",value:function(e){e.stopPropagation();const t=e.detail.value,i=Object.assign(Object.assign({},this.option),{},{sequence:t});(0,l.B)(this,"value-changed",{value: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[g.Qx,(0,o.iv)(k||(k=_`ha-button-menu,ha-icon-button{--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}.card-content{padding:16px}mwc-list-item[disabled]{--mdc-theme-text-primary-on-background:var(--disabled-text-color)}mwc-list-item.hidden{display:none}.warning ul{margin:4px 0}li[role=separator]{border-bottom-color:var(--divider-color)}`))]}}]}}),o.oi);t()}catch(y){t(y)}}))},69723:function(e,t,i){i.a(e,(async function(e,t){try{var a=i(73577),n=i(72621),o=(i(71695),i(40251),i(11740),i(46692),i(39527),i(99790),i(41360),i(47021),i(12582)),s=i(57243),d=i(50778),l=i(91583),c=i(90842),r=i(11297),h=i(85233),u=i(30137),p=(i(20095),i(14002),i(10508),i(62325)),v=e([p]);p=(v.then?(await v)():v)[0];let m,f,g,b,y=e=>e;const k="M7,19V17H9V19H7M11,19V17H13V19H11M15,19V17H17V19H15M7,15V13H9V15H7M11,15V13H13V15H11M15,15V13H17V15H15M7,11V9H9V11H7M11,11V9H13V11H11M15,11V9H17V11H15M7,7V5H9V7H7M11,7V5H13V7H11M15,7V5H17V7H15Z",_="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";(0,a.Z)([(0,d.Mo)("ha-automation-option")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"narrow",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"options",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_showReorder",value(){return!1}},{kind:"field",decorators:[(0,c.t)({key:"automationClipboard",state:!0,subscribe:!0,storage:"sessionStorage"})],key:"_clipboard",value:void 0},{kind:"field",key:"_focusLastOptionOnChange",value(){return!1}},{kind:"field",key:"_optionsKeys",value(){return new WeakMap}},{kind:"field",key:"_unsubMql",value:void 0},{kind:"method",key:"connectedCallback",value:function(){(0,n.Z)(i,"connectedCallback",this,3)([]),this._unsubMql=(0,h.K)("(min-width: 600px)",(e=>{this._showReorder=e}))}},{kind:"method",key:"disconnectedCallback",value:function(){var e;(0,n.Z)(i,"disconnectedCallback",this,3)([]),null===(e=this._unsubMql)||void 0===e||e.call(this),this._unsubMql=void 0}},{kind:"method",key:"render",value:function(){return(0,s.dy)(m||(m=y`
    ${0}
    `),!this._showReorder||this.disabled,this._optionMoved,this._optionAdded,this._optionRemoved,(0,l.r)(this.options,(e=>this._getKey(e)),((e,t)=>(0,s.dy)(f||(f=y` ${0} `),e,t,0===t,t===this.options.length-1,e,this.narrow,this.disabled,this._duplicateOption,this._moveDown,this._moveUp,this._optionChanged,this.hass,this._showReorder&&!this.disabled?(0,s.dy)(g||(g=y`
    `),k):s.Ld))),this.disabled,this.hass.localize("ui.panel.config.automation.editor.actions.type.choose.add_option"),this._addOption,_)}},{kind:"method",key:"updated",value:function(e){if((0,n.Z)(i,"updated",this,3)([e]),e.has("options")&&this._focusLastOptionOnChange){this._focusLastOptionOnChange=!1;const e=this.shadowRoot.querySelector("ha-automation-option-row:last-of-type");e.updateComplete.then((()=>{e.expand(),e.scrollIntoView(),e.focus()}))}}},{kind:"method",key:"expandAll",value:function(){this.shadowRoot.querySelectorAll("ha-automation-option-row").forEach((e=>{e.expand()}))}},{kind:"field",key:"_addOption",value(){return()=>{const e=this.options.concat({conditions:[],sequence:[]});this._focusLastOptionOnChange=!0,(0,r.B)(this,"value-changed",{value:e})}}},{kind:"method",key:"_getKey",value:function(e){return this._optionsKeys.has(e)||this._optionsKeys.set(e,Math.random().toString()),this._optionsKeys.get(e)}},{kind:"method",key:"_moveUp",value:function(e){e.stopPropagation();const t=e.target.index,i=t-1;this._move(t,i)}},{kind:"method",key:"_moveDown",value:function(e){e.stopPropagation();const t=e.target.index,i=t+1;this._move(t,i)}},{kind:"method",key:"_move",value:function(e,t){const i=this.options.concat(),a=i.splice(e,1)[0];i.splice(t,0,a),this.options=i,(0,r.B)(this,"value-changed",{value:i})}},{kind:"method",key:"_optionMoved",value:function(e){e.stopPropagation();const{oldIndex:t,newIndex:i}=e.detail;this._move(t,i)}},{kind:"method",key:"_optionAdded",value:async function(e){e.stopPropagation();const{index:t,data:i}=e.detail,a=[...this.options.slice(0,t),i,...this.options.slice(t)];this.options=a,await(0,u.y)(),(0,r.B)(this,"value-changed",{value:this.options})}},{kind:"method",key:"_optionRemoved",value:async function(e){e.stopPropagation();const{index:t}=e.detail,i=this.options[t];this.options=this.options.filter((e=>e!==i)),await(0,u.y)();const a=this.options.filter((e=>e!==i));(0,r.B)(this,"value-changed",{value:a})}},{kind:"method",key:"_optionChanged",value:function(e){e.stopPropagation();const t=[...this.options],i=e.detail.value,a=e.target.index;if(null===i)t.splice(a,1);else{const e=this._getKey(t[a]);this._optionsKeys.set(i,e),t[a]=i}(0,r.B)(this,"value-changed",{value:t})}},{kind:"method",key:"_duplicateOption",value:function(e){e.stopPropagation();const t=e.target.index;(0,r.B)(this,"value-changed",{value:this.options.concat((0,o.Z)(this.options[t]))})}},{kind:"get",static:!0,key:"styles",value:function(){return(0,s.iv)(b||(b=y`.options{padding:16px;margin:-16px;display:flex;flex-direction:column;gap:16px}.sortable-ghost{background:0 0;border-radius:var(--ha-card-border-radius,12px)}.sortable-drag{background:0 0}ha-automation-option-row{display:block;scroll-margin-top:48px}ha-svg-icon{height:20px}.handle{padding:12px;cursor:move;cursor:grab}.handle ha-svg-icon{pointer-events:none;height:24px}.buttons{display:flex;flex-wrap:wrap;gap:8px;order:1}`))}}]}}),s.oi);t()}catch(m){t(m)}}))}}]); //# sourceMappingURL=8770.b226cf645367289b.js.map