iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
10 lines • 75.3 kB
JavaScript
export const __rspack_esm_id=60597;export const __rspack_esm_ids=[60597];export const __webpack_modules__={36312(e,t,o){o.d(t,{x:()=>i});o(74423);const i=(e,t)=>e&&e.components.includes(t)},62384(e,t,o){o.d(t,{v:()=>i});o(74423);const i=(e,t,o,i)=>{const[a,r,n]=e.split(".",3);return Number(a)>t||Number(a)===t&&(void 0===i?Number(r)>=o:Number(r)>o)||void 0!==i&&Number(a)===t&&Number(r)===o&&Number(n)>=i}},46190(e,t,o){o.d(t,{FD:()=>l,Is:()=>i,JF:()=>a,gt:()=>r,jj:()=>s,oL:()=>d,yd:()=>n});o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);const i=["alert","button","climate","cover","configurator","event","input_button","input_select","input_number","input_text","humidifier","lawn_mower","lock","media_player","number","scene","script","select","timer","text","update","vacuum","water_heater"],a=["sensor","binary_sensor","calendar","camera","device_tracker","image","weather"],r=["assist_satellite","conversation","stt","tts"],n=["automation","button","cover","date","datetime","fan","group","humidifier","input_boolean","input_button","input_datetime","input_number","input_select","input_text","light","lock","media_player","number","scene","script","select","switch","text","time","vacuum","valve"],s=["closed","locked","off"],l=new Set(["fan","input_boolean","light","switch","group","automation","humidifier","valve"]),d=new Set(["camera","image","media_player"])},380(e,t,o){o.d(t,{D:()=>s,P:()=>n});o(74423);var i=o(67932),a=o(46927),r=o(96029);const n=e=>e.first_weekday===a.zt.language?"weekInfo"in Intl.Locale.prototype?new Intl.Locale(e.language).weekInfo.firstDay%7:(0,i.S)(e.language)%7:r.Z.includes(e.first_weekday)?r.Z.indexOf(e.first_weekday):1,s=e=>{const t=n(e);return r.Z[t]}},95747(e,t,o){o.a(e,async function(e,i){try{o.d(t,{CL:()=>f,GH:()=>C,Rl:()=>u,ZS:()=>b,aQ:()=>m,r6:()=>h,yg:()=>_});var a=o(74487),r=o(22786),n=o(72487),s=o(30162),l=o(8480),d=o(69543),c=e([a,l,n,s]);[a,l,n,s]=c.then?(await c)():c;const h=(e,t,o)=>p(t,o.time_zone).format(e),p=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,d.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,d.J)(e)?"h12":"h23",timeZone:(0,l.wj)(e.time_zone,t)})),u=e=>g().format(e),g=(0,r.A)(()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})),m=(e,t,o)=>v(t,o.time_zone).format(e),v=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",hour:(0,d.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,d.J)(e)?"h12":"h23",timeZone:(0,l.wj)(e.time_zone,t)})),b=(e,t,o)=>y(t,o.time_zone).format(e),y=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{month:"short",day:"numeric",hour:(0,d.J)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,d.J)(e)?"h12":"h23",timeZone:(0,l.wj)(e.time_zone,t)})),f=(e,t,o)=>(new Date).getFullYear()===e.getFullYear()?b(e,t,o):m(e,t,o),_=(e,t,o)=>w(t,o.time_zone).format(e),w=(0,r.A)((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,d.J)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,d.J)(e)?"h12":"h23",timeZone:(0,l.wj)(e.time_zone,t)})),C=(e,t,o)=>`${(0,n.zB)(e,t,o)}, ${(0,s.fU)(e,t,o)}`;i()}catch(e){i(e)}})},8480(e,t,o){o.a(e,async function(e,i){try{o.d(t,{fL:()=>c,n2:()=>h,wj:()=>p});var a=o(74487),r=o(29079),n=o(46927),s=e([a]);a=(s.then?(await s)():s)[0];const l=Intl.DateTimeFormat?.().resolvedOptions?.().timeZone,d=l&&("UTC"===l||"Etc/UTC"===l||l in r)?l:void 0,c=14881==o.j?void 0!==d:null,h=d??"UTC",p=(e,t)=>e===n.Wj.local&&d?h:t;i()}catch(e){i(e)}})},96029(e,t,o){o.d(t,{Tq:()=>n,Z:()=>a,ZV:()=>i,sj:()=>r});const i=["sun","mon","tue","wed","thu","fri","sat"],a=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"],r={0:"sun",1:"mon",2:"tue",3:"wed",4:"thu",5:"fri",6:"sat"},n={sun:"sunday",mon:"monday",tue:"tuesday",wed:"wednesday",thu:"thursday",fri:"friday",sat:"saturday"}},93905(e,t,o){o.d(t,{I:()=>r});o(44114),o(18111),o(7588),o(69112),o(33110);class i{addFromStorage(e){if(!this._storage[e]){const t=this.storage.getItem(e);t&&(this._storage[e]=JSON.parse(t))}}subscribeChanges(e,t){return this._listeners[e]?this._listeners[e].push(t):this._listeners[e]=[t],()=>{this.unsubscribeChanges(e,t)}}unsubscribeChanges(e,t){if(!(e in this._listeners))return;const o=this._listeners[e].indexOf(t);-1!==o&&this._listeners[e].splice(o,1)}hasKey(e){return e in this._storage}getValue(e){return this._storage[e]}setValue(e,t){const o=this._storage[e];this._storage[e]=t;try{void 0===t?this.storage.removeItem(e):this.storage.setItem(e,JSON.stringify(t))}catch(e){}finally{this._listeners[e]&&this._listeners[e].forEach(e=>e(o,t))}}constructor(e=window.localStorage){this._storage={},this._listeners={},this.storage=e,this.storage===window.localStorage&&window.addEventListener("storage",e=>{e.key&&this.hasKey(e.key)&&(this._storage[e.key]=e.newValue?JSON.parse(e.newValue):e.newValue,this._listeners[e.key]&&this._listeners[e.key].forEach(t=>t(e.oldValue?JSON.parse(e.oldValue):e.oldValue,this._storage[e.key])))})}}const a={};function r(e){return(t,o)=>{if("object"==typeof o)throw new Error("This decorator does not support this compilation type.");const r=e.storage||"localStorage";let n;r&&r in a?n=a[r]:(n=new i(window[r]),a[r]=n);const s=e.key||String(o);n.addFromStorage(s);const l=!1!==e.subscribe?e=>n.subscribeChanges(s,(t,i)=>{e.requestUpdate(o,t)}):void 0,d=()=>n.hasKey(s)?e.deserializer?e.deserializer(n.getValue(s)):n.getValue(s):void 0,c=(t,i)=>{let a;e.state&&(a=d()),n.setValue(s,e.serializer?e.serializer(i):i),e.state&&t.requestUpdate(o,a)},h=t.performUpdate;if(t.performUpdate=function(){this.__initialized=!0,h.call(this)},e.subscribe){const e=t.connectedCallback,o=t.disconnectedCallback;t.connectedCallback=function(){e.call(this);const t=this;t.__unbsubLocalStorage||(t.__unbsubLocalStorage=l?.(this))},t.disconnectedCallback=function(){o.call(this);this.__unbsubLocalStorage?.(),this.__unbsubLocalStorage=void 0}}const p=Object.getOwnPropertyDescriptor(t,o);let u;if(void 0===p)u={get:()=>d(),set(e){(this.__initialized||void 0===d())&&c(this,e)},configurable:!0,enumerable:!0};else{const e=p.set;u={...p,get:()=>d(),set(t){(this.__initialized||void 0===d())&&c(this,t),e?.call(this,t)}}}Object.defineProperty(t,o,u)}}},57237(e,t,o){o.d(t,{d:()=>i});const i=e=>e.stopPropagation()},65522(e,t,o){o.d(t,{A:()=>i});const i=e=>e.name?.trim()},81816(e,t,o){o.d(t,{aH:()=>n,cx:()=>s,es:()=>l});var i=o(37981),a=o(28978),r=o(79461);const n=(e,t,o)=>{const i=t[e.entity_id];return i?s(i,o):(0,a.u)(e)},s=(e,t,o)=>{const n=e.name||("original_name"in e&&null!=e.original_name?String(e.original_name):void 0),s=e.device_id?t[e.device_id]:void 0;if(!s)return n||(o?(0,a.u)(o):void 0);const l=(0,i.xn)(s);return l!==n?l&&n&&(0,r.p)(n,l)||n:void 0},l=(e,t,o)=>!n(e,t,o)},74705(e,t,o){o.d(t,{Bj:()=>u,Cf:()=>p,uU:()=>h});o(18111),o(81148),o(22489),o(61701),o(13579);if(66649!=o.j)var i=o(44537);var a=o(15638),r=o(65522),n=o(37981),s=o(81816),l=o(55931);if(66649!=o.j)var d=o(28978);var c=o(28455);const h=(e,t,o,a,r,n,l)=>{if("string"==typeof t)return t;if(!t)return(0,d.u)(e);let c=(0,i.e)(t);const h=l?.separator??" ";if(c.every(e=>"text"===e.type))return c.map(e=>e.text).join(h);if((0,s.es)(e,o,a)){c.some(e=>"device"===e.type)||(c=c.map(e=>"entity"===e.type?{type:"device"}:e))}const u=p(e,c,o,a,r,n);return 1===u.length?u[0]||"":u.filter(e=>e).join(h)},p=(e,t,o,i,a,d)=>{const{device:h,area:p,floor:u}=(0,c.ln)(e,o,i,a,d);return t.map(t=>{switch(t.type){case"entity":return(0,s.aH)(e,o,i);case"device":return h?(0,n.xn)(h):void 0;case"area":return p?(0,r.A)(p):void 0;case"floor":return u?(0,l.X)(u):void 0;case"text":return t.text;default:return""}})},u=(e,t)=>{const[o,i,r]=p(t,[{type:"entity"},{type:"device"},{type:"area"}],e.entities,e.devices,e.areas,e.floors),n=(0,a.qC)(e.language,e.translationMetadata.translations);return{primary:o||i||t.entity_id,secondary:[r,o?i:void 0].filter(Boolean).join(n?" ◂ ":" ▸ ")||void 0}}},55931(e,t,o){o.d(t,{X:()=>i});const i=e=>e.name?.trim()},68246(e,t,o){o.d(t,{Y:()=>i});const i=e=>e.slice(e.indexOf(".")+1)},28978(e,t,o){o.d(t,{_:()=>a,u:()=>r});var i=o(68246);const a=(e,t)=>void 0===t.friendly_name?(0,i.Y)(e).replace(/_/g," "):(t.friendly_name??"").toString(),r=e=>a(e.entity_id,e.attributes)},28455(e,t,o){o.d(t,{EX:()=>a,jI:()=>r,ln:()=>i});const i=(e,t,o,i,a)=>{const n=t[e.entity_id];return n?r(n,t,o,i,a):{entity:null,device:null,area:null,floor:null}},a=(e,t,o)=>{const i=t[e];if(!i)return;const a=i.device_id,r=a?o[a]:void 0;return i.area_id||r?.area_id||void 0},r=(e,t,o,i,a)=>{const r=t[e.entity_id],n=e?.device_id,s=n?o[n]:void 0,l=e?.area_id||s?.area_id,d=l?i[l]:void 0,c=d?.floor_id;return{entity:r,device:s||null,area:d||null,floor:(c?a[c]:void 0)||null}}},79461(e,t,o){o.d(t,{p:()=>a});const i=[" ",": "," - "],a=(e,t)=>{const o=e.toLowerCase(),a=t.toLowerCase();for(const t of i){const i=`${a}${t}`;if(o.startsWith(i)){const t=e.substring(i.length);if(t.length)return r(t.substr(0,t.indexOf(" ")))?t:t[0].toUpperCase()+t.slice(1)}}},r=e=>e.toLowerCase()!==e},24790(e,t,o){o.d(t,{F:()=>a,r:()=>r});o(18111),o(13579);const i=/{%|{{/,a=e=>i.test(e),r=e=>{if(!e)return!1;if("string"==typeof e)return a(e);if("object"==typeof e){return(Array.isArray(e)?e:Object.values(e)).some(e=>e&&r(e))}return!1}},22682(e,t,o){o.d(t,{$:()=>n});const i="^\\d{4}-(0[1-9]|1[0-2])-([12]\\d|0[1-9]|3[01])",a=new RegExp(i+"$"),r=new RegExp(i),n=(e,t=!1)=>t?r.test(e):a.test(e)},19459(e,t,o){o.d(t,{b:()=>i});o(45367),o(92731),o(69479),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);const i=(e,t,o)=>{if(e===t)return!0;if(e&&t&&"object"==typeof e&&"object"==typeof t){if(e.constructor!==t.constructor)return!1;let a,r;if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(a=r;0!==a--;)if(!i(e[a],t[a],o))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(a of e.entries())if(!t.has(a[0]))return!1;for(a of e.entries())if(!i(a[1],t.get(a[0]),o))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(a of e.entries())if(!t.has(a[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!==t.length)return!1;for(a=r;0!==a--;)if(e[a]!==t[a])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===t.toString();const n=Object.keys(e);if(r=n.length,r!==Object.keys(t).length)return!1;for(a=r;0!==a--;)if(!Object.prototype.hasOwnProperty.call(t,n[a]))return!1;for(a=r;0!==a--;){const r=n[a];if(!i(e[r],t[r],o))return!1}if(o?.compareSymbols){const a=Object.getOwnPropertySymbols(e),r=Object.getOwnPropertySymbols(t);if(a.length!==r.length)return!1;for(const r of a){if(!Object.prototype.hasOwnProperty.call(t,r))return!1;if(!i(e[r],t[r],o))return!1}}return!0}return e!=e&&t!=t}},7553(e,t,o){o.d(t,{h:()=>a});class i extends Error{constructor(e,...t){super(...t),Error.captureStackTrace&&Error.captureStackTrace(this,i),this.name="TimeoutError",this.timeout=e,this.message=`Timed out in ${e} ms.`}}const a=(e,t)=>{const o=new Promise((t,o)=>{setTimeout(()=>{o(new i(e))},e)});return Promise.race([t,o])}},99611(e,t,o){o.a(e,async function(e,t){try{o(18111),o(13579),o(17642),o(58004),o(33853),o(45876),o(32475),o(15024),o(31698);var i=o(62826),a=o(1126),r=o(35211),n=o(5124),s=o(22441),l=o(1087),d=o(60353),c=o(22792),h=o(59992),p=o(14503),u=o(22348),g=e([a]);a=(g.then?(await g)():g)[0];const m=300,v=new Set(["ha-control-slider","ha-slider","ha-control-switch","ha-control-circular-slider","ha-hs-color-picker","ha-map","ha-more-info-control-select-container","ha-filter-chip"]),b=new Set(["volume-slider-container","forecast"]);class y extends((0,h.V)(n.WF)){get scrollableElement(){return this._bodyElement}connectedCallback(){super.connectedCallback(),this.addEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.addEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0})}updated(e){super.updated(e),e.has("open")&&(this._drawerOpen=this.open)}render(){return n.qy` <wa-drawer id="drawer" placement="bottom" .open="${this._drawerOpen}" .lightDismiss="${!this.preventScrimClose}" .ariaLabelledby="${this.ariaLabelledBy}" .ariaDescribedby="${this.ariaDescribedBy}" @keydown="${this._handleKeyDown}" @wa-show="${this._handleShow}" @wa-after-show="${this._handleAfterShow}" @wa-hide="${this._handleHide}" @wa-after-hide="${this._handleAfterHide}" @click="${this._handleCloseAction}" without-header @touchstart="${this._handleTouchStart}"> <div class="handle-wrapper" aria-hidden="true"> <div class="handle"></div> </div> <slot name="header"></slot> <div class="content-wrapper"> <div id="body" class="body ha-scrollbar"> <slot></slot> </div> ${this.renderScrollableFades()} </div> <slot name="footer"></slot> </wa-drawer> `}_startResizing(e){document.addEventListener("touchmove",this._handleTouchMove,{passive:!1}),document.addEventListener("touchend",this._handleTouchEnd),document.addEventListener("touchcancel",this._handleTouchEnd),this._gestureRecognizer.start(e)}_animateSnapBack(){this.style.setProperty("--dialog-transition",`transform ${m}ms ease-out`),this.style.removeProperty("--dialog-transform"),setTimeout(()=>{this.style.removeProperty("--dialog-transition")},m)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("slider-interaction-start",this._handleSliderInteractionStart,{capture:!0}),this.removeEventListener("slider-interaction-stop",this._handleSliderInteractionStop,{capture:!0}),this._unregisterResizeHandlers(),this._isDragging=!1}static get styles(){return[...super.styles,p.dp,n.AH`wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:${m}ms;--hide-duration:${m}ms}wa-drawer::part(dialog){max-height:min(var(--ha-bottom-sheet-max-height,90vh),calc(100vh - max(var(--safe-area-inset-top),48px)));max-height:min(var(--ha-bottom-sheet-max-height,90dvh),calc(100dvh - max(var(--safe-area-inset-top),48px)));align-items:center;transform:var(--dialog-transform);transition:var(--dialog-transition)}@media (prefers-reduced-motion:reduce){wa-drawer{--wa-color-surface-raised:transparent;--spacing:0;--size:var(--ha-bottom-sheet-height, auto);--show-duration:1ms;--hide-duration:1ms}wa-drawer::part(dialog){transition:1ms}}wa-drawer::part(dialog)::backdrop{-webkit-backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));backdrop-filter:var(--ha-bottom-sheet-scrim-backdrop-filter,var(--ha-dialog-scrim-backdrop-filter,var(--dialog-backdrop-filter,none)));background-color:var(--ha-bottom-sheet-scrim-color,var(--mdc-dialog-scrim-color,none))}wa-drawer::part(body){max-width:var(--ha-bottom-sheet-max-width);width:100%;position:relative;border-top-left-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));border-top-right-radius:var(--ha-bottom-sheet-border-radius,var(--ha-dialog-border-radius,var(--ha-border-radius-2xl)));background-color:var(--ha-bottom-sheet-surface-background,var(--ha-dialog-surface-background,var(--card-background-color,var(--ha-color-surface-default))));-webkit-backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));backdrop-filter:var(--ha-bottom-sheet-surface-backdrop-filter,var(--ha-dialog-surface-backdrop-filter,none));padding:var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left))}:host([flexcontent]) wa-drawer::part(body){display:flex;flex-direction:column}:host([prevent-scrim-close]) .handle-wrapper{display:none}.handle-wrapper{position:absolute;top:0;inset-inline-start:0;width:100%;padding-bottom:2px;display:flex;justify-content:center;align-items:center;pointer-events:none;z-index:1}.handle-wrapper .handle{height:16px;width:200px;display:flex;justify-content:center;align-items:center}.handle-wrapper .handle::after{content:"";border-radius:var(--ha-border-radius-md);height:4px;background:var(--ha-bottom-sheet-handle-color,var(--divider-color));width:40px}.content-wrapper{position:relative;flex:1;display:flex;flex-direction:column;min-height:0}.body{padding:var(--ha-bottom-sheet-content-padding,0);box-sizing:border-box}:host([flexcontent]) .body{flex:1;max-width:100%;display:flex;flex-direction:column;padding:var(--ha-bottom-sheet-content-padding,var(--ha-bottom-sheet-padding,0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left)));box-sizing:border-box}slot[name=footer]{display:block;padding:0}::slotted([slot=footer]){display:flex;padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4) var(--ha-space-4);gap:var(--ha-space-3);justify-content:flex-end;align-items:center;width:100%;box-sizing:border-box}:host([flexcontent]) slot[name=footer]{flex-shrink:0}`]}constructor(...e){super(...e),this.open=!1,this.flexContent=!1,this.preventScrimClose=!1,this._drawerOpen=!1,this._sliderInteractionActive=!1,this._gestureRecognizer=new d.u,this._isDragging=!1,this._escapePressed=!1,this._handleShow=async()=>{this._drawerOpen=!0,this.open=!0,(0,l.r)(this,"opened"),await this.updateComplete,requestAnimationFrame(()=>{const e=this._autofocusElement;this._hassConfig?.auth.external&&(0,u.V)(this._hassConfig.auth.external)?e&&(e.id||(e.id="ha-bottom-sheet-autofocus"),this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:e.id}})):e?.focus()})},this._handleAfterShow=()=>{(0,l.r)(this,"after-show")},this._handleSliderInteractionStart=()=>{this._sliderInteractionActive=!0},this._handleSliderInteractionStop=()=>{this._sliderInteractionActive=!1},this._handleAfterHide=e=>{if(this._sliderInteractionActive)return this._drawerOpen=!0,void(this.open=!0);e.eventPhase===Event.AT_TARGET&&(this.open=!1,this._drawerOpen=!1,(0,l.r)(this,"closed"))},this._handleHide=e=>{if(e.eventPhase!==Event.AT_TARGET)return;const t=e.detail.source===e.target.drawer;if(this._sliderInteractionActive)return e.preventDefault(),this._drawerOpen=!0,this.open=!0,void(this._escapePressed=!1);this.preventScrimClose&&this._escapePressed&&t&&e.preventDefault(),this._escapePressed=!1},this._handleKeyDown=e=>{"Escape"===e.key&&(this._escapePressed=!0,this.preventScrimClose&&e.preventDefault(),e.stopPropagation(),e.currentTarget.open=!1)},this._handleCloseAction=e=>{e.composedPath().some(e=>e instanceof HTMLElement&&("close"===e.getAttribute("data-dialog")||"close"===e.getAttribute("data-drawer")))&&(this._drawerOpen=!1)},this._handleTouchStart=e=>{if(this.preventScrimClose)return;const t=e.composedPath();for(const e of t){if(e===this._drawer)break;if(e instanceof HTMLElement&&(e.scrollTop>0||v.has(e.localName)||Array.from(e.classList).some(e=>b.has(e))))return}e.stopPropagation(),this._startResizing(e.touches[0].clientY)},this._handleTouchMove=e=>{const t=e.touches[0].clientY,o=this._gestureRecognizer.move(t);o<0&&(e.preventDefault(),this._isDragging=!0,requestAnimationFrame(()=>{this._isDragging&&this.style.setProperty("--dialog-transform",`translateY(${-1*o}px)`)}))},this._handleTouchEnd=()=>{this._unregisterResizeHandlers(),this._isDragging=!1;const e=this._gestureRecognizer.end();if(e.isSwipe)return void(e.isDownwardSwipe?this._drawerOpen=!1:this._animateSnapBack());const t=this._drawer.shadowRoot?.querySelector('[part="body"]'),o=t?.offsetHeight||0;o>0&&e.delta<0&&Math.abs(e.delta)>.5*o?this._drawerOpen=!1:this._animateSnapBack()},this._unregisterResizeHandlers=()=>{document.removeEventListener("touchmove",this._handleTouchMove),document.removeEventListener("touchend",this._handleTouchEnd),document.removeEventListener("touchcancel",this._handleTouchEnd)}}}(0,i.Cg)([(0,s.MZ)({attribute:"aria-labelledby"})],y.prototype,"ariaLabelledBy",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"aria-describedby"})],y.prototype,"ariaDescribedBy",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean})],y.prototype,"open",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"flexcontent"})],y.prototype,"flexContent",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0,attribute:"prevent-scrim-close"})],y.prototype,"preventScrimClose",void 0),(0,i.Cg)([(0,s.wk)()],y.prototype,"_drawerOpen",void 0),(0,i.Cg)([(0,s.wk)()],y.prototype,"_sliderInteractionActive",void 0),(0,i.Cg)([(0,s.wk)(),(0,r.Fg)({context:c.WF,subscribe:!0})],y.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,s.P)("#drawer")],y.prototype,"_drawer",void 0),(0,i.Cg)([(0,s.P)("#body")],y.prototype,"_bodyElement",void 0),(0,i.Cg)([(0,s.P)("[autofocus]")],y.prototype,"_autofocusElement",void 0),y=(0,i.Cg)([(0,s.EM)("ha-bottom-sheet")],y),t()}catch(e){t(e)}})},70947(e,t,o){var i=o(62826),a=o(50759),r=(o(38625),o(5124)),n=o(22441);o(67094);class s extends a.A{renderCheckboxIcon(){return r.qy` <ha-svg-icon id="check" part="checkmark" .path="${this.checked?"M10,17L5,12L6.41,10.58L10,14.17L17.59,6.58L19,8M19,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":"M19,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,3M19,5V19H5V5H19Z"}"></ha-svg-icon> `}static get styles(){return[a.A.styles,r.AH`:host{min-height:var(--ha-space-10)}#check{visibility:visible;flex-shrink:0}#icon ::slotted(*){color:var(--ha-color-on-neutral-normal)}:host([variant=danger]) #icon ::slotted(*){color:var(--ha-color-on-danger-quiet)}:host([selected]){font-weight:var(--ha-font-weight-medium);color:var(--primary-color);background-color:var(--ha-color-fill-primary-quiet-resting);--icon-primary-color:var(--primary-color)}:host([selected]:hover){background-color:var(--ha-color-fill-primary-quiet-hover)}`]}constructor(...e){super(...e),this.selected=!1}}(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],s.prototype,"selected",void 0),s=(0,i.Cg)([(0,n.EM)("ha-dropdown-item")],s)},29823(e,t,o){o.a(e,async function(e,t){try{var i=o(62826),a=o(52254),r=o(5124),n=o(22441),s=e([a]);a=(s.then?(await s)():s)[0];class l extends a.A{get anchorElement(){return this.popup?.anchor}set anchorElement(e){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=e)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const e=this.getTrigger();e&&"ha-icon-button"===e.localName&&(e.selected=!0)}async hideMenu(){const e=this.getTrigger();e&&"ha-icon-button"===e.localName&&(e.selected=!1),await super.hideMenu()}static get styles(){return[a.A.styles,r.AH`:host{font-size:var(--ha-dropdown-font-size, var(--ha-font-size-m));--wa-color-surface-raised:var(
--card-background-color,
var(--ha-dialog-surface-background, var(--mdc-theme-surface, #fff)),
)}#menu{padding:var(--ha-space-1)}wa-popup::part(popup){z-index:200}`]}constructor(...e){super(...e),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,i.Cg)([(0,n.MZ)({attribute:!1})],l.prototype,"dropdownTag",void 0),(0,i.Cg)([(0,n.MZ)({attribute:!1})],l.prototype,"dropdownItemTag",void 0),l=(0,i.Cg)([(0,n.EM)("ha-dropdown")],l),t()}catch(e){t(e)}})},18198(e,t,o){o.d(t,{Dc:()=>s,Si:()=>n});var i=o(62826),a=o(5124),r=o(22441);o(47680),o(67094);const n=e=>{switch(e.level){case 0:return"M11,10H13V16H11V10M22,12H19V20H5V12H2L12,3L22,12M15,10A2,2 0 0,0 13,8H11A2,2 0 0,0 9,10V16A2,2 0 0,0 11,18H13A2,2 0 0,0 15,16V10Z";case 1:return"M12,3L2,12H5V20H19V12H22L12,3M10,8H14V18H12V10H10V8Z";case 2:return"M12,3L2,12H5V20H19V12H22L12,3M9,8H13A2,2 0 0,1 15,10V12A2,2 0 0,1 13,14H11V16H15V18H9V14A2,2 0 0,1 11,12H13V10H9V8Z";case 3:return"M12,3L22,12H19V20H5V12H2L12,3M15,11.5V10C15,8.89 14.1,8 13,8H9V10H13V12H11V14H13V16H9V18H13A2,2 0 0,0 15,16V14.5A1.5,1.5 0 0,0 13.5,13A1.5,1.5 0 0,0 15,11.5Z";case-1:return"M12,3L2,12H5V20H19V12H22L12,3M11,15H7V13H11V15M15,18H13V10H11V8H15V18Z"}return"M10,20V14H14V20H19V12H22L12,3L2,12H5V20H10Z"},s=e=>{switch(e.level){case 0:return"mdi:home-floor-0";case 1:return"mdi:home-floor-1";case 2:return"mdi:home-floor-2";case 3:return"mdi:home-floor-3";case-1:return"mdi:home-floor-negative-1"}return"mdi:home"};class l extends a.WF{render(){if(!this.floor)return a.s6;if(this.floor.icon)return a.qy`<ha-icon .icon="${this.floor.icon}"></ha-icon>`;const e=n(this.floor);return a.qy`<ha-svg-icon .path="${e}"></ha-svg-icon>`}}(0,i.Cg)([(0,r.MZ)({attribute:!1})],l.prototype,"floor",void 0),(0,i.Cg)([(0,r.MZ)()],l.prototype,"icon",void 0),l=(0,i.Cg)([(0,r.EM)("ha-floor-icon")],l)},52763(e,t,o){o.a(e,async function(e,i){try{o.d(t,{U:()=>m});o(74423),o(18111),o(7588),o(61701);var a=o(62826),r=o(5124),n=o(22441),s=o(69558),l=o(1087),d=o(38962),c=(o(11399),e([d]));d=(c.then?(await c)():c)[0];const h={boolean:()=>o.e(81347).then(o.bind(o,46990)),constant:()=>o.e(65733).then(o.bind(o,90820)),float:()=>Promise.all([o.e(4801),o.e(39763),o.e(32450),o.e(51868),o.e(27585)]).then(o.bind(o,20676)),grid:()=>o.e(60761).then(o.bind(o,70208)),expandable:()=>o.e(45001).then(o.bind(o,40003)),integer:()=>Promise.all([o.e(4801),o.e(39763),o.e(32450),o.e(21543),o.e(86712),o.e(49985)]).then(o.bind(o,20036)),multi_select:()=>Promise.all([o.e(4801),o.e(39763),o.e(46095),o.e(34995),o.e(80131),o.e(58303),o.e(71739),o.e(24407)]).then(o.bind(o,36182)),positive_time_period_dict:()=>Promise.all([o.e(4801),o.e(39763),o.e(32450),o.e(46095),o.e(34995),o.e(67943),o.e(16508),o.e(85462)]).then(o.bind(o,89422)),select:()=>Promise.all([o.e(4801),o.e(39763),o.e(32450),o.e(46095),o.e(7305),o.e(92769),o.e(34995),o.e(3283),o.e(81034),o.e(99463),o.e(26092),o.e(4809)]).then(o.bind(o,63804)),string:()=>Promise.all([o.e(4801),o.e(39763),o.e(32450),o.e(84725),o.e(95926)]).then(o.bind(o,54753)),optional_actions:()=>Promise.all([o.e(4801),o.e(39763),o.e(34995),o.e(85351)]).then(o.bind(o,8456))},p=(e,t)=>e?!t.name||t.flatten?e:e[t.name]:void 0,u=(e,t)=>e&&t.name?e[t.name]:null,g=(e,t)=>e&&t.name?e[t.name]:null;class m extends r.WF{getFormProperties(){return{}}reportValidity(){const e=this._root;if(!e)return!0;const t=[...e.children].filter(e=>"ha-alert"!==e.localName);let o,i=!0;return this.schema.forEach((e,a)=>{const r=t[a];if(!r)return;let n=!0;if("reportValidity"in r&&"function"==typeof r.reportValidity)n=r.reportValidity();else if(e.required&&(!("type"in e)||!["boolean","constant"].includes(e.type??""))&&(!("selector"in e)||!("boolean"in e.selector)&&!("constant"in e.selector))){const t=p(this.data,e);n=null!=t&&""!==t}n||(i=!1,o||(o=r))}),o&&o.focus?.(),i}willUpdate(e){e.has("schema")&&this.schema&&this.schema.forEach(e=>{"selector"in e||h[e.type]?.()})}render(){return r.qy` <div class="root" part="root"> ${this.error&&this.error.base?r.qy` <ha-alert alert-type="error"> ${this._computeError(this.error.base,this.schema)} </ha-alert> `:""} ${this.schema.map(e=>{const t=u(this.error,e),o=g(this.warning,e);return r.qy` ${t?r.qy` <ha-alert own-margin alert-type="error"> ${this._computeError(t,e)} </ha-alert> `:o?r.qy` <ha-alert own-margin alert-type="warning"> ${this._computeWarning(o,e)} </ha-alert> `:""} ${"selector"in e?r.qy`<ha-selector .schema="${e}" .hass="${this.hass}" .narrow="${this.narrow}" .name="${e.name}" .selector="${e.selector}" .value="${p(this.data,e)}" .label="${this._computeLabel(e,this.data)}" .disabled="${e.disabled||this.disabled||!1}" .placeholder="${e.required?void 0:e.default}" .helper="${this._computeHelper(e)}" .localizeValue="${this.localizeValue}" .required="${e.required||!1}" .context="${this._generateContext(e)}"></ha-selector>`:(0,s._)(this.fieldElementName(e.type),{schema:e,data:p(this.data,e),label:this._computeLabel(e,this.data),helper:this._computeHelper(e),disabled:this.disabled||e.disabled||!1,hass:this.hass,localize:this.hass?.localize,computeLabel:this.computeLabel,computeHelper:this.computeHelper,localizeValue:this.localizeValue,context:this._generateContext(e),...this.getFormProperties()})} `})} </div> `}fieldElementName(e){return`ha-form-${e}`}_generateContext(e){if(!e.context&&!this.context)return;const t={...this.context};if(e.context)for(const[o,i]of Object.entries(e.context))t[o]=this.data[i];return t}createRenderRoot(){const e=super.createRenderRoot();return this.addValueChangedListener(e),e}addValueChangedListener(e){e.addEventListener("value-changed",e=>{e.stopPropagation();const t=e.target.schema;if(e.target===this)return;const o=!t.name||"flatten"in t&&t.flatten?e.detail.value:{[t.name]:e.detail.value};this.data={...this.data,...o},(0,l.r)(this,"value-changed",{value:this.data})})}_computeLabel(e,t){return this.computeLabel?this.computeLabel(e,t):e?e.name:""}_computeHelper(e){return this.computeHelper?this.computeHelper(e):""}_computeError(e,t){return Array.isArray(e)?r.qy`<ul> ${e.map(e=>r.qy`<li> ${this.computeError?this.computeError(e,t):e} </li>`)} </ul>`:this.computeError?this.computeError(e,t):e}_computeWarning(e,t){return this.computeWarning?this.computeWarning(e,t):e}constructor(...e){super(...e),this.narrow=!1,this.disabled=!1}}m.shadowRootOptions={mode:"open",delegatesFocus:!0},m.styles=r.AH`.root>*{display:block}.root>:not([own-margin]):not(:last-child){margin-bottom:24px}ha-alert[own-margin]{margin-bottom:4px}`,(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],m.prototype,"narrow",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"data",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"schema",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"error",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"warning",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],m.prototype,"disabled",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"computeError",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"computeWarning",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"computeLabel",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"computeHelper",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"localizeValue",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],m.prototype,"context",void 0),(0,a.Cg)([(0,n.P)(".root")],m.prototype,"_root",void 0),m=(0,a.Cg)([(0,n.EM)("ha-form")],m),i()}catch(e){i(e)}})},38508(e,t,o){o.a(e,async function(e,t){try{o(18111),o(13579);var i=o(62826),a=o(61366),r=o(35211),n=o(5124),s=o(22441),l=o(63672),d=o(91335),c=o(1087),h=o(22792),p=o(17894),u=o(22348),g=o(99611),m=o(18350),v=(o(75064),o(3449),o(49639)),b=o(88285),y=(o(67094),e([a,g,m,v,b]));[a,g,m,v,b]=y.then?(await y)():y;const f="M3 16H10V14H3M18 14V10H16V14H12V16H16V20H18V16H22V14M14 6H3V8H14M14 10H3V12H14V10Z";class _ extends((0,p.c)(n.WF)){willUpdate(e){e.has("value")&&this._setUnknownValue()}setFieldValue(e){this._comboBox?this._comboBox.setFieldValue(e):this._initialFieldValue=e}render(){const e=this.useTopLabel&&this.value?void 0:this.label;return n.qy`<div class="container"> ${this.useTopLabel&&this.label?n.qy`<label ?disabled="${this.disabled}">${this.label}</label>`:n.s6} <div id="picker"> <slot name="field"> ${this.addButtonLabel&&!this.value?n.qy`<ha-button size="small" appearance="filled" @click="${this.open}" .disabled="${this.disabled}"> <ha-svg-icon .path="${f}" slot="start"></ha-svg-icon> ${this.addButtonLabel} </ha-button>`:n.qy`<ha-picker-field type="button" class="${this._opened?"opened":""}" compact="compact" .unknown="${this._unknownValue}" .unknownItemText="${this.unknownItemText}" aria-label="${(0,l.J)(this.label)}" @click="${this.open}" @clear="${this._clear}" .icon="${this.icon}" .image="${this.image}" .label="${e}" .placeholder="${this.placeholder}" .value="${this.value}" .valueRenderer="${this.valueRenderer}" .required="${this.required}" .disabled="${this.disabled}" .invalid="${this.invalid}" .hideClearIcon="${this.hideClearIcon}"> <slot name="start"></slot> </ha-picker-field>`} </slot> </div> ${this._pickerWrapperOpen||this._opened?this._openedNarrow?n.qy` <ha-bottom-sheet flexcontent .open="${this._pickerWrapperOpen}" @wa-after-show="${this._dialogOpened}" @closed="${this._hidePicker}" role="dialog" aria-modal="true" aria-label="${this.label||"Select option"}"> ${this._renderComboBox(!0)} </ha-bottom-sheet> `:n.qy` <wa-popover .open="${this._pickerWrapperOpen}" style="--body-width:${this._popoverWidth}px" without-arrow distance="-4" .placement="${this.popoverPlacement}" .for="${this.popoverAnchor?null:"picker"}" .anchor="${this.popoverAnchor??null}" auto-size="vertical" auto-size-padding="16" @wa-after-show="${this._dialogOpened}" @wa-after-hide="${this._hidePicker}" trap-focus role="dialog" aria-modal="true" aria-label="${this.label||"Select option"}"> ${this._renderComboBox()} </wa-popover> `:n.s6} </div> ${this._renderHelper()}`}_renderComboBox(e=!1){return this._opened?n.qy` <ha-picker-combo-box id="combo-box" .allowCustomValue="${this.allowCustomValue}" .label="${this.searchLabel}" .value="${this._selectedValue??this.value}" @value-changed="${this._valueChanged}" .rowRenderer="${this.rowRenderer}" .notFoundLabel="${this.notFoundLabel}" .emptyLabel="${this.emptyLabel}" .getItems="${this.getItems}" .getAdditionalItems="${this.getAdditionalItems}" .searchFn="${this.searchFn}" .mode="${e?"dialog":"popover"}" .sections="${this.sections}" .sectionTitleFunction="${this.sectionTitleFunction}" .selectedSection="${this.selectedSection}" .searchKeys="${this.searchKeys}" .customValueLabel="${this.customValueLabel}" .noSort="${this.noSort}"></ha-picker-combo-box> `:n.s6}_renderHelper(){const e=this.invalid&&this.errorMessage,t=!e&&this.helper;return e||t?n.qy`<ha-input-helper-text .disabled="${this.disabled}"> ${e?this.errorMessage:this.helper} </ha-input-helper-text>`:n.s6}refreshItems(){this._comboBox?.refreshItems()}_hidePicker(e){e.stopPropagation(),this._newValue&&((0,c.r)(this,"value-changed",{value:this._newValue}),this._newValue=void 0),this._opened=!1,this._pickerWrapperOpen=!1,this._selectedValue=void 0,this._unsubscribeTinyKeys?.(),(0,c.r)(this,"picker-closed")}_valueChanged(e){e.stopPropagation();const t=e.detail.value;t&&(this._pickerWrapperOpen=!1,this._newValue=t)}_clear(e){e.stopPropagation(),this._setValue(void 0)}_setValue(e){this.value=e,(0,c.r)(this,"value-changed",{value:e})}async open(e,t){e?.stopPropagation(),this.disabled||(this._selectedValue=t?.selectedValue,this._openedNarrow=this._narrow,this._popoverWidth=this._containerElement?.offsetWidth||250,this._pickerWrapperOpen=!0,this._unsubscribeTinyKeys=(0,d.Tc)(this,{Escape:this._handleEscClose}))}connectedCallback(){super.connectedCallback(),this._handleResize(),window.addEventListener("resize",this._handleResize)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("resize",this._handleResize),this._unsubscribeTinyKeys?.()}static get styles(){return[n.AH`.container{position:relative;display:block;max-width:100%}label[disabled]{color:var(--mdc-text-field-disabled-ink-color,rgba(0,0,0,.6))}label{display:block;margin:0 0 8px}ha-input-helper-text{display:block;margin:var(--ha-space-2) 0 0}:host([invalid]) ha-input-helper-text{color:var(--mdc-theme-error,var(--error-color,#b00020))}wa-popover{--wa-space-l:0}wa-popover::part(dialog)::backdrop{background:0 0}wa-popover::part(body){width:var(--ha-generic-picker-width,max(var(--body-width),250px));max-width:var(--ha-generic-picker-max-width,var(--ha-generic-picker-width,max(var(--body-width),250px)));max-height:500px;height:70vh;overflow:hidden}@media (max-height:1000px){wa-popover::part(body){max-height:400px}}ha-bottom-sheet{--ha-bottom-sheet-height:90vh;--ha-bottom-sheet-height:calc(100dvh - var(--ha-space-12));--ha-bottom-sheet-max-height:var(--ha-bottom-sheet-height);--ha-bottom-sheet-max-width:600px;--ha-bottom-sheet-padding:0;--ha-bottom-sheet-surface-background:var(--card-background-color);--ha-bottom-sheet-border-radius:var(--ha-border-radius-2xl);--ha-bottom-sheet-content-padding:0 var(--safe-area-inset-right) var(--safe-area-inset-bottom) var(--safe-area-inset-left)}ha-picker-field.opened{--mdc-text-field-idle-line-color:var(--primary-color)}`]}constructor(...e){super(...e),this.popoverPlacement="bottom",this.useTopLabel=!1,this.noSort=!1,this._opened=!1,this._pickerWrapperOpen=!1,this._popoverWidth=0,this._openedNarrow=!1,this._unknownValue=!1,this._narrow=!1,this.invalid=!1,this._setUnknownValue=()=>{const e=this.getItems();!this.allowCustomValue&&void 0!==this.value&&null!==this.value&&""!==this.value&&e?this._unknownValue=!e.some(e=>"string"!=typeof e&&e.id===this.value):this._unknownValue=!1},this._dialogOpened=()=>{this._opened=!0,(0,c.r)(this,"picker-opened"),requestAnimationFrame(()=>{this._initialFieldValue&&(this._comboBox?.setFieldValue(this._initialFieldValue),this._initialFieldValue=void 0),this._hassConfig?.auth.external&&(0,u.V)(this._hassConfig.auth.external)?this._hassConfig.auth.external.fireMessage({type:"focus_element",payload:{element_id:"combo-box"}}):this._comboBox?.focus()})},this._handleResize=()=>{this._narrow=window.matchMedia("(max-width: 870px)").matches||window.matchMedia("(max-height: 500px)").matches,!this._openedNarrow&&this._pickerWrapperOpen&&(this._popoverWidth=this._containerElement?.offsetWidth||250)},this._handleEscClose=e=>{e.stopPropagation()}}}_.shadowRootOptions={...n.WF.shadowRootOptions,delegatesFocus:!0},(0,i.Cg)([(0,s.MZ)({type:Boolean,attribute:"allow-custom-value"})],_.prototype,"allowCustomValue",void 0),(0,i.Cg)([(0,s.MZ)({type:String,attribute:"search-label"})],_.prototype,"searchLabel",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"getItems",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"getAdditionalItems",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"rowRenderer",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"searchFn",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"searchKeys",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"notFoundLabel",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"empty-label"})],_.prototype,"emptyLabel",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"popover-placement"})],_.prototype,"popoverPlacement",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"add-button-label"})],_.prototype,"addButtonLabel",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"sections",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"sectionTitleFunction",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"selected-section"})],_.prototype,"selectedSection",void 0),(0,i.Cg)([(0,s.MZ)({attribute:!1})],_.prototype,"popoverAnchor",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,attribute:"use-top-label"})],_.prototype,"useTopLabel",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"custom-value-label"})],_.prototype,"customValueLabel",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,attribute:"no-sort"})],_.prototype,"noSort",void 0),(0,i.Cg)([(0,s.P)(".container")],_.prototype,"_containerElement",void 0),(0,i.Cg)([(0,s.P)("ha-picker-combo-box")],_.prototype,"_comboBox",void 0),(0,i.Cg)([(0,s.wk)(),(0,r.Fg)({context:h.WF,subscribe:!0})],_.prototype,"_hassConfig",void 0),(0,i.Cg)([(0,s.wk)()],_.prototype,"_opened",void 0),(0,i.Cg)([(0,s.wk)()],_.prototype,"_pickerWrapperOpen",void 0),(0,i.Cg)([(0,s.wk)()],_.prototype,"_popoverWidth",void 0),(0,i.Cg)([(0,s.wk)()],_.prototype,"_openedNarrow",void 0),(0,i.Cg)([(0,s.wk)()],_.prototype,"_unknownValue",void 0),(0,i.Cg)([(0,s.wk)()],_.prototype,"_selectedValue",void 0),(0,i.Cg)([(0,s.MZ)({attribute:"error-message"})],_.prototype,"errorMessage",void 0),(0,i.Cg)([(0,s.MZ)({type:Boolean,reflect:!0})],_.prototype,"invalid",void 0),_=(0,i.Cg)([(0,s.EM)("ha-generic-picker")],_),t()}catch(e){t(e)}})},3449(e,t,o){var i=o(62826),a=o(5124),r=o(22441);class n extends a.WF{render(){return a.qy`<slot></slot>`}constructor(...e){super(...e),this.disabled=!1}}n.styles=a.AH`:host{display:block;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-size:var(--ha-font-size-s);padding-left:16px;padding-right:16px;padding-inline-start:16px;padding-inline-end:16px;letter-spacing:var(
--mdc-typography-caption-letter-spacing,
.0333333333em
);line-height:normal}:host([disabled]){color:var(--mdc-text-field-disabled-ink-color,rgba(0,0,0,.6))}`,(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0),n=(0,i.Cg)([(0,r.EM)("ha-input-helper-text")],n)},88285(e,t,o){o.a(e,async function(e,t){try{var i=o(62826),a=o(35211),r=o(5124),n=o(22441),s=o(63672),l=o(1087),d=o(22792),c=o(17894),h=(o(75064),o(47680),o(26300)),p=e([h]);h=(p.then?(await p)():p)[0];const u="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",g="M7,10L12,15L17,10H7Z";class m extends((0,c.c)(r.WF)){async focus(){await this.updateComplete,await(this.item?.focus())}render(){const e=!!this.value,t=!(!this.value||this.required||this.disabled||this.hideClearIcon),o=this.placeholder??this.label,i=this.label&&e?r.qy`<span slot="overline">${this.label}${this.required?" *":""}</span>`:r.s6,a=e?this.valueRenderer?this.valueRenderer(this.value??""):r.qy`<span slot="headline">${this.value}</span>`:o?r.qy`<span slot="headline" class="placeholder"> ${o}${this.required?" *":""} </span>`:r.s6;return r.qy` <ha-combo-box-item aria-label="${(0,s.J)(this.label||this.placeholder)}" .disabled="${this.disabled}" type="button" compact="compact"> ${this.image?r.qy`<img alt="${this.label??""}" slot="start" .src="${this.image}" crossorigin="anonymous" referrerpolicy="no-referrer">`:this.icon?r.qy`<ha-icon slot="start" .icon="${this.icon}"></ha-icon>`:r.qy`<slot name="start"></slot>`} ${i}${a} ${this.unknown?r.qy`<div slot="supporting-text" class="unknown"> ${this.unknownItemText||this._i18n?.localize("ui.components.combo-box.unknown_item")} </div>`:r.s6} ${t?r.qy` <ha-icon-button class="clear" slot="end" @click="${this._clear}" .path="${u}"></ha-icon-button> `:r.s6} <ha-svg-icon class="arrow" slot="end" .path="${g}"></ha-svg-icon> </ha-combo-box-item> `}_clear(e){e.stopPropagation(),(0,l.r)(this,"clear")}static get styles(){return[r.AH`ha-combo-box-item[disabled]{background-color:var(--ha-color-form-background-disabled);--md-list-item-disabled-opacity:0.5;opacity:.5;cursor:not-allowed}ha-combo-box-item{position:relative;background-color:var(--ha-color-form-background);border-radius:var(--ha-border-radius-sm);border-end-end-radius:0;border-end-start-radius:0;--md-list-item-one-line-container-height:56px;--md-list-item-two-line-container-height:56px;--md-list-item-top-space:0px;--md-list-item-bottom-space:0px;--md-list-item-leading-space:var(--ha-space-4);--md-list-item-trailing-space:var(--ha-space-2);--ha-md-list-item-gap:var(--ha-space-2);--md-focus-ring-width:0px;--md-focus-ring-duration:0s}ha-combo-box-item:after{display:block;content:"";position:absolute;pointer-events:none;bottom:0;left:0;right:0;height:1px;width:100%;background-color:var(--ha-color-border-neutral-loud);transform:height 180ms ease-in-out,background-color 180ms ease-in-out}ha-combo-box-item:focus:after{height:2px;background-color:var(--mdc-theme-primary)}:host([unknown]) ha-combo-box-item{background-color:var(--ha-color-fill-warning-quiet-resting)}:host([invalid]) ha-combo-box-item:after{height:2px;background-color:var(--mdc-theme-error,var(--error-color,#b00020))}.clear{margin:0 -8px;--ha-icon-button-size:32px;--ha-icon-button-padding-inline:var(--ha-space-1)}.arrow{--mdc-icon-size:20px;width:32px}.placeholder{color:var(--secondary-text-color)}:host([invalid]) .placeholder{color:var(--mdc-theme-error,var(--error-color,#b00020))}.unknown{color:var(--ha-color-on-warning-normal)}`]}constructor(...e){super(...e),this.invalid=!1}}(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],m.prototype,"invalid",void 0),(0,i.Cg)([(0,n.P)("ha-combo-box-item",!0)],m.prototype,"item",void 0),(0,i.Cg)([(0,n.wk)(),(0,a.Fg)({context:d.D5,subscribe:!0})],m.prototype,"_i18n",void 0),m=(0,i.Cg)([(0,n.EM)("ha-picker-field")],m),t()}catch(e){t(e)}})},45078(e,t,o){o.a(e,async function(e,i){try{o.r(t),o.d(t,{HaTriggerSelector:()=>h});var a=o(62826),r=o(5124),n=o(22441),s=o(22786),l=o(88249),d=o(53723),c=e([d]);d=(c.then?(await c)():c)[0];class h extends r.WF{render(){return r.qy` ${this.label?r.qy`<label>${this.label}</label>`:r.s6} <ha-automation-trigger .disabled="${this.disabled}" .triggers="${this._triggers(this.value)}" .hass="${this.hass}" .narrow="${this.narrow}"></ha-automation-trigger> `}constructor(...e){super(...e),this.narrow=!1,this.disabled=!1,this._triggers=(0,s.A)(e=>e?(0,l.vO)(e):[])}}h.styles=r.AH`ha-automation-trigger{display:block;margin-bottom:16px}label{display:block;margin-bottom:4px;font-weight:var(--ha-font-weight-medium)}`,(0,a.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean})],h.prototype,"narrow",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"selector",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],h.prototype,"value",void 0),(0,a.Cg)([(0,n.MZ)()],h.prototype,"label",void 0),(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],h.prototype,"disabled",void 0),h=(0,a.Cg)([(0,n.EM)("ha-selector-trigger")],h),i()}catch(e){i(e)}})},8034(e,t,o){var i=o(62826),a=o(92070),r=o(5124),n=o(22441);class s extends r.WF{render(){const e=this._hasSlotController.test("description");return r.qy` <div class="prefix-wrap"> <slot name="prefix"></slot> <div class="body" part="heading" ?two-line="${!this.threeLine&&e}" ?three-line="${this.threeLine}"> <slot name="heading"></slot> ${e?r.qy`<span class="secondary"><slot name="description"></slot></span>`:r.s6} </div> </div> <div class="content"> <slot></slot> </div> `}constructor(...e){super(...e),this.narrow=!1,this.slim=!1,this.threeLine=!1,this.wrapHeading=!1,this.empty=!1,this._hasSlotController=new a.X(this,"description")}}s.styles=r.AH`:host{display:flex;padding:0 var(--ha-space-4);align-content:normal;align-self:auto;align-items:center}.body{padding-top:var(--settings-row-body-padding-top,var(--ha-space-2));padding-bottom:var(--settings-row-body-padding-bottom,var(--ha-space-2));padding-left:0;padding-inline-start:0;padding-right:var(--ha-space-4);padding-inline-end:var(--ha-space-4);overflow:hidden;display:var(--layout-vertical_-_display,flex);flex-direction:var(--layout-vertical_-_flex-direction,column);justify-content:var(--layout-center-justified_-_justify-content,center);flex:var(--layout-flex_-_flex,1);flex-basis:var(--layout-flex_-_flex-basis,0.000000001px)}.body[three-line]{min-height:88px}:host(:not([wrap-heading])) body>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.body>.secondary{display:block;padding-top:var(--ha-space-1);font-family:var(
--mdc-typography-body2-font-family,
var(--mdc-typography-font-family, var(--ha-font-family-body))
);font-size:var(--mdc-typography-body2-font-size, var(--ha-font-size-s));-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-weight:var(--mdc-typography-body2-font-weight,var(--ha-font-weight-normal));line-height:normal;color:var(--secondary-text-color)}.body[two-line]{min-height:calc(72px - 16px);flex:1}.content{display:contents}:host(:not([narrow])) .content{display:var(--settings-row-content-display,flex);justify-content:flex-end;flex:1;min-width:0;padding:var(--settings-row-content-padding-block,var(--ha-space-4)) 0}:host([empty]) .content{display:none}.content ::slotted(*){width:var(--settings-row-content-width)}:host([narrow]){align-items:normal;flex-direction:column;border-top:1px solid var(--divider-color);padding-bottom:var(--ha-space-2)}::slotted(ha-switch){padding:var(--settings-row-switch-padding-block,var(--ha-space-4)) 0}.secondary{white-space:normal}.prefix-wrap{flex:var(--settings-row-prefix-flex,1);display:var(--settings-row-prefix-display)}:host([narrow]) .prefix-wrap{display:flex;align-items:center}:host([slim]),:host([slim]) .content,:host([slim]) ::slotted(ha-switch){padding:0}:host([slim]) .body{min-height:0}`,(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],s.prototype,"narrow",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],s.prototype,"slim",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"three-line"})],s.prototype,"threeLine",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,attribute:"wrap-heading",reflect:!0})],s.prototype,"wrapHeading",void 0),(0,i.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],s.prototype,"empty",void 0),s=(0,i.Cg)([(0,n.EM)("ha-settings-row")],s)},91485(e,t,o){o.a(e,async function(e,i){try{o.d(t,{U:()=>w});var a=o(62826),r=(o(86137),o(30006)),n=o(92070),s=o(35211),l=o(5124),d=o(22441),c=o(6412),h=o(63672),p=o(57237),u=o(22792),g=o(26300),m=(o(67094),o(34127)),v=o(53305),b=e([r,g,m]);[r,g,m]=b.then?(await b)():b;const y="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z",f="M12,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,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z",_="M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z";class w extends((0,v.w)(l.WF)){get _formControl(){return this._input}showPicker(){this._input?.showPicker()}stepUp(){this._input?.stepUp()}stepDown(){this._input?.stepDown()}async firstUpdated(e){super.firstUpdated(e),this.insetLabel||(await(this._input?.updateComplete),this._syncStartSlotWidth())}render(){const e=!this.label&&this._hasSlotController.test("label"),t=!this.hint&&this._hasSlotController.test("hint"),o=this._hasSlotController.test("start");return l.qy` <wa-input .type="${this.type}" .value="${this.value??null}" .withClear="${this.withClear}" .placeholder="${this.placeholder}" .readonly="${this.readonly}" .passwordToggle="${this.passwordToggle}" .passwordVisible="${this.passwordVisible}" .withoutSpinButtons="${this.withoutSpinButtons}" .required="${this.required}" .pattern="${this.pattern}" .minlength="${this.minlength}" .maxlength="${this.maxlength}" .min="${this.min}" .max="${this.max}" .step="${this.step}" .autocapitalize="${this.autocapitalize||void 0}" .autocorrect="${this.autocorrect?"on":"off"}" .autocomplete="${this.autocomplete}" .autofocus="${this.autofocus}" .enterkeyhint="${this.enterkeyhint||void 0}" .spellcheck="${this.spellcheck}" .inputmode="${this.inputmode||void 0}" .name="${this.name}" .disabled="${this.disabled}" class="${(0,c.H)({input:!0,invalid:this.invalid||this._invalid,"label-raised":void 0!==this.value&&""!==this.value||this.label&&this.placeholder||o&&this.insetLabel,"no-label":!this.label,"hint-hidden":!(this.hint||t||this.required||this._invalid||this.invalid)})}" @input="${this._handleInput}" @change="${this._handleChange}" @blur="${this._handleBlur}" @wa-invalid="${this._handleInvalid}" exportparts="base:wa-base, hint:wa-hint, input:wa-input"> ${this.label||e?l.qy`<slot name="label" slot="label">${this.label?this._renderLabel(this.label,this.required):l.s6}</slot>`:l.s6} <slot name="start" slot="start" @slotchange="${this._syncStartSlotWidth}"> ${this.renderStartDefault()} </slot> <slot name="end" slot="end"> ${this.renderEndDefault()} </slot> <slot name="clear-button" slot="clear-button"> <ha-icon-button @click="${this._handleClearClick}" .label="${this.i18n?.localize?.("ui.components.input.clear")||"Clear"}" .path="${y}"></ha-icon-button> </slot> <slot name="password-toggle-button" slot="password-toggle-button"> <ha-icon-button @keydown="${p.d}" @click="${this._handlePasswordToggle}" .label="${this.i18n?.localize?.("ui.components.input."+(this.passwordVisible?"hide_password":"show_password"))||(this.passwordVisible?"Hide password":"Show password")}" .path="${this.passwordVisible?_:f}"></ha-icon-button> </slot> <div slot="hint" class="${(0,c.H)({error:this.invalid||this._invalid})}" role="${(0,h.J)(this.invalid||this._invalid?"alert":void 0)}" aria-live="polite"> ${this._invalid||this.invalid?this.validationMessage||this._input?.validationMessage:this.hint||(t?l.qy`<slot name="hint"></slot>`:l.s6)} </div> </wa-input> `}renderStartDefault(){return l.s6}renderEndDefault(){return l.s6}_handleClearClick(){this._input?.clear()}_handlePasswordToggle(){this.passwordVisible=!this.passwordVisible}constructor(...e){super(...e),this.appearance="material",this.type="text",this.withClear=!1,this.passwordToggle=!1,this.passwordVisible=!1,this.withoutSpinButtons=!1,this.autocorrect=!1,this.insetLabel=!1,this._hasSlotController=new n.X(this,"label","hint","input","start"),this._syncStartSlotWidth=()=>{const e=this._input?.shadowRoot?.querySelector('[part~="start"]'),t=e?.offsetWidth??0;t>0&&!this.insetLabel?(this.style.setProperty("--start-slot-width",`calc(${t}px + var(--ha-space-1))`),this.style.setProperty("--input-padding-inline-start","var(--ha-space-1)")):(this.style.removeProperty("--start-slot-width"),this.style.removeProperty("--input-padding-inline-start"))}}}w.styles=[v.N,l.AH`:host{display:flex;align-items:flex-start;padding-top:var(--ha-input-padding-top);padding-bottom:var(--ha-input-padding-bottom,var(--ha-space-2));text-align:var(--ha-input-text-align,start)}:host([appearance=outlined]){padding-bottom:var(--ha-input-padding-bottom)}wa-input::part(label){padding-inline-start:calc(var(--start-slot-width,0px) + var(--ha-space-4));padding-inline-end:var(--ha-space-4);padding-top:var(--ha-space-5)}:host([appearance=material]:focus-within) wa-input::part(label){color:var(--primary-color)}:host(:focus-within) wa-input::part(label),:host([type=date]) wa-input::part(label),wa-input.label-raised::part(label){padding-top:var(--ha-space-3);font-size:var(--ha-font-size-xs)}wa-input::part(base){height:56px;padding:0 var(--ha-space-4)}:host([appearance=outlined]) wa-input.no-label::part(base){height:32px;padding:0 var(--ha-space-2)}:host([appearance=outlined]) wa-input::part(base){border:1px solid var(--ha-color-border-neutral-quiet);background-color:var(--card-background-color);border-radius:var(--ha-border-radius-md);transition:border-color var(--wa-transition-normal) ease-in-out}:host([appearance=material]) ::part(base)::after{content:"";position:absolute;bottom:0;left:0;right:0;height:1px;background-color:var(--ha-color-border-neutral-loud);transition:height var(--wa-transition-normal) ease-in-out,background-color var(--wa-transition-normal) ease-in-out}:host([appearance=material]:focus-within) wa-input::part(base)::after{height:2px;background-color:var(--primary-color)}:host([appearance=material]) wa-input.invalid:not([disabled])::part(base)::after,:host([appearance=material]:focus-within) wa-input.invalid::part(base)::after{background-color:var(--ha-color-border-danger-normal)}wa-input::part(input){padding-top:var(--ha-space-3);padding-inline-start:var(--input-padding-inline-start,0)}wa-input.no-label::part(input){padding-top:0}:host([type=color]) wa-input::part(input){padding-top:var(--ha-space-6);padding-bottom:2px;cursor:pointer}:host([type=color]) wa-input.no-label::part(input){padding:var(--ha-space-2)}:host([type=color]) wa-input.no-label::part(base){padding:0}wa-input::part(input)::placeholder{color:var(--ha-color-neutral-60)}wa-input::part(base):hover{background-color:var(--ha-color-form-background-hover)}:host([appearance=outlined]) wa-input::part(base):hover{border-color:var(--ha-color-border-neutral-normal)}:host([appearance=outlined]:focus-within) wa-input::part(base){border-color:var(--primary-color)}wa-input:disabled::part(base){background-color:var(--ha-color-form-background-disabled)}wa-input:disabled::part(label){opacity:.5}wa-input::part(end){color:var(--ha-color-text-secondary)}ha-icon-button{display:flex;align-items:center;color:var(--ha-color-text-secondary)}:host([appearance=outlined]) wa-input.no-label{--ha-icon-button-size:24px;--mdc-icon-size:18px}`],(0,a.Cg)([(0,d.MZ)({reflect:!0})],w.prototype,"appearance",void 0),(0,a.Cg)([(0,d.MZ)({reflect:!0})],w.prototype,"type",void 0),(0,a.Cg)([(0,d.MZ)({type:Boolean,attribute:"with-clear"})],w.prototype,"withClear",void 0),(0,a.Cg)([(0,d.MZ)({type:Boolean,attribute:"password-toggle"})],w.prototype,"passwordToggle",void 0),(0,a.Cg)([(0,d.MZ)({type:Boolean,attribute:"password-visible"})],w.prototype,"passwordVisible",void 0),(0,a.Cg)([(0,d.MZ)({type:Boolean,attribute:"without-spin-buttons"})],w.prototype,"withoutSpinButtons",void 0),(0,a.Cg)([(0,d.MZ)()],w.prototype,"pattern",void 0),(0,a.Cg)([(0,d.MZ)()],w.prototype,"min",void 0),(0,a.Cg)([(0,d.MZ)()],w.prototype,"max",void 0),(0,a.Cg)([(0,d.MZ)()],w.prototype,"step",void 0),(0,a.Cg)([(0,d.MZ)({type:Boolean})],w.prototype,"autocorrect",void 0),(0,a.Cg)([(0,d.MZ)({type:Boolean,attribute:"inset-label"})],w.prototype,"insetLabel",void 0),(0,a.Cg)([(0,d.P)("wa-input")],w.prototype,"_input",void 0),(0,a.Cg)([(0,d.wk)(),(0,s.Fg)({context:u.D5,subscribe:!0})],w.prototype,"i18n",void 0),w=(0,a.Cg)([(0,d.EM)("ha-input")],w),i()}catch(e){i(e)}})},53305(e,t,o){o.d(t,{w:()=>l,N:()=>d});var i=o(62826),a=o(5124),r=o(22441),n=o(22786);o(74423);const s=Boolean(globalThis.ElementInternals)&&globalThis.HTMLElement?.prototype.attachInternals?.toString().includes("[native code]"),l=e=>{class t extends e{get _formControl(){throw new Error("_formControl getter must be implemented by subclass")}select(){this._formControl?.select()}setSelectionRange(e,t,o){this._formControl?.setSelectionRange(e,t,o)}setRangeText(e,t,o,i){this._formControl?.setRangeText(e,t,o,i)}checkValidity(){return!s||(this._formControl?.checkValidity()??!0)}reportValidity(){const e=this.checkValidity();return this._invalid=!e,e}_handleInput(){this.value=this._formControl?.value??void 0,this._invalid&&this._formControl?.checkValidity()&&(this._invalid=!1)}_handleChange(){this.value=this._formControl?.value??void 0}_handleBlur(){this.autoValidate&&(this._invalid=!this._formControl?.checkValidity())}_handleInvalid(){this._invalid=!0}constructor(...e){super(...e),this.label="",this.hint="",this.placeholder="",this.readonly=!1,this.required=!1,this.autocapitalize="",this.autofocus=!1,this.spellcheck=!0,this.inputmode="",this.enterkeyhint="",this.disabled=!1,this.validationMessage="",this.autoValidate=!1,this.invalid=!1,this._invalid=!1,this._requiredMarkerCSSVar="--ha-input-required-marker",this._renderLabel=(0,n.A)((e,t)=>{if(!t)return e;let o=getComputedStyle(this).getPropertyValue(this._requiredMarkerCSSVar);return o||(o="*"),o.startsWith('"')&&o.endsWith('"')&&(o=o.slice(1,-1)),o?`${e}${o}`:e})}}return t.shadowRootOptions={mode:"open",delegatesFocus:!0},(0,i.Cg)([(0,r.MZ)()],t.prototype,"value",void 0),(0,i.Cg)([(0,r.MZ)()],t.prototype,"label",void 0),(0,i.Cg)([(0,r.MZ)()],t.prototype,"hint",void 0),(0,i.Cg)([(0,r.MZ)()],t.prototype,"placeholder",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],t.prototype,"readonly",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],t.prototype,"required",void 0),(0,i.Cg)([(0,r.MZ)({type:Number})],t.prototype,"minlength",void 0),(0,i.Cg)([(0,r.MZ)({type:Number})],t.prototype,"maxlength",void 0),(0,i.Cg)([(0,r.MZ)()],t.prototype,"autocapitalize",void 0),(0,i.Cg)([(0,r.MZ)()],t.prototype,"autocomplete",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],t.prototype,"autofocus",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],t.prototype,"spellcheck",void 0),(0,i.Cg)([(0,r.MZ)()],t.prototype,"inputmode",void 0),(0,i.Cg)([(0,r.MZ)()],t.prototype,"enterkeyhint",void 0),(0,i.Cg)([(0,r.MZ)()],t.prototype,"name",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],t.prototype,"disabled",void 0),(0,i.Cg)([(0,r.MZ)({attribute:"validation-message"})],t.prototype,"validationMessage",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean,attribute:"auto-validate"})],t.prototype,"autoValidate",void 0),(0,i.Cg)([(0,r.MZ)({type:Boolean})],t.prototype,"invalid",void 0),(0,i.Cg)([(0,r.wk)()],t.prototype,"_invalid",void 0),t},d=a.AH`.input{flex:1;min-width:0;--wa-transition-fast:var(--wa-transition-normal);position:relative}.input::part(label){position:absolute;top:0;font-weight:var(--ha-font-weight-normal);font-family:var(--ha-font-family-body);transition:all var(--wa-transition-normal) ease-in-out;color:var(--secondary-text-color);line-height:var(--ha-line-height-condensed);z-index:1;pointer-events:none;font-size:var(--ha-font-size-m)}.input.invalid:not([disabled])::part(label),:host(:focus-within) .input.invalid::part(label){color:var(--ha-color-fill-danger-loud-resting)}.input::part(base){background-color:var(--ha-color-form-background);border-top-left-radius:var(--ha-border-radius-sm);border-top-right-radius:var(--ha-border-radius-sm);border-bottom-left-radius:var(--ha-border-radius-square);border-bottom-right-radius:var(--ha-border-radius-square);border:none;position:relative;transition:background-color var(--wa-transition-normal) ease-in-out}:host(:focus-within) .input::part(base){outline:0}.input::part(hint){min-height:var(--ha-space-5);margin-block-start:0;margin-inline-start:var(--ha-space-3);font-size:var(--ha-font-size-s);display:flex;align-items:center;color:var(--ha-color-text-secondary)}.input.hint-hidden::part(hint){height:0;min-height:0}.error{color:var(--ha-color-on-danger-quiet)}`},82e3(e,t,o){o.d(t,{D5:()=>i,Fy:()=>h,Gk:()=>g,Hg:()=>a,TJ:()=>n,UQ:()=>c,Y_:()=>m,ds:()=>u,e0:()=>r,ec:()=>p,go:()=>l,n2:()=>d,sq:()=>s});o(74423),o(18111),o(61701),o(33110);const i=14881==o.j?`${location.protocol}//${location.host}`:null,a=e=>e.map(e=>{if("string"!==e.type)return e;switch(e.name){case"username":return{...e,autocomplete:"username",autofocus:!0};case"password":return{...e,autocomplete:"current-password"};case"code":return{...e,autocomplete:"one-time-code",autofocus:!0};default:return e}}),r=(e,t)=>e.callWS({type:"auth/sign_path",path:t}),n=()=>fetch("/auth/providers",{credentials:"same-origin"}),s=(e,t,o)=>fetch("/auth/login_flow",{method:"POST",credentials:"same-origin",body:JSON.stringify({client_id:e,handler:o,redirect_uri:t})}),l=(e,t)=>fetch(`/auth/login_flow/${e}`,{method:"POST",credentials:"same-origin",body:JSON.stringify(t)}),d=e=>fetch(`/auth/login_flow/${e}`,{method:"DELETE",credentials:"same-origin"}),c=(e,t,o,i)=>{e.includes("?")?e.endsWith("&")||(e+="&"):e+="?",e+=`code=${encodeURIComponent(t)}`,o&&(e+=`&state=${encodeURIComponent(o)}`),i&&(e+="&storeToken=true"),document.location.assign(e)},h=async(e,t,o,i)=>e.callWS({type:"config/auth_provider/homeassistant/create",user_id:t,username:o,password:i}),p=(e,t,o)=>e.callWS({type:"config/auth_provider/homeassistant/change_password",current_password:t,new_password:o}),u=(e,t,o)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_password",user_id:t,password:o}),g=(e,t,o)=>e.callWS({type:"config/auth_provider/homeassistant/admin_change_username",user_id:t,username:o}),m=(e,t,o)=>e.callWS({type:"auth/delete_all_refresh_tokens",token_type:t,delete_current_token:o})},88249(e,t,o){o.d(t,{$W:()=>v,Dp:()=>L,Dt:()=>c,G3:()=>M,HB:()=>y,KH:()=>V,Q:()=>d,S9:()=>S,VH:()=>l,XF:()=>h,aI:()=>w,b1:()=>b,fo:()=>$,lB:()=>p,lg:()=>u,mX:()=>C,oj:()=>m,rY:()=>k,sF:()=>Z,vH:()=>x,vO:()=>_});o(44114),o(18111),o(7588),o(61701);var i=o(44537),a=o(91926),r=o(6030),n=o(87225),s=o(84025);const l="__DYNAMIC__",d=e=>e?.startsWith(l),c=e=>e.substring(l.length),h=e=>{if("condition"in e&&Array.isArray(e.condition))return{condition:"and",conditions:e.condition};for(const t of n.I8)if(t in e)return{condition:t,conditions:e[t]};return e},p=(e,t)=>{e.callService("automation","trigger",{entity_id:t,skip_condition:!0})},u=(e,t)=>e.callApi("DELETE",`config/automation/config/${t}`);let g;const m=(e,t)=>e.callApi("GET",`config/automation/config/${t}`),v=(e,t)=>e.callWS({type:"automation/config",entity_id:t}),b=(e,t,o)=>e.callApi("POST",`config/automation/config/${t}`,o),y=e=>{e=f(e);for(const t of["triggers","conditions","actions"]){const o=e[t];o&&!Array.isArray(o)&&(e[t]=[o])}return e},f=e=>("trigger"in e&&("triggers"in e||(e.triggers=e.trigger),delete e.trigger),"condition"in e&&("conditions"in e||(e.conditions=e.condition),delete e.condition),"action"in e&&("actions"in e||(e.actions=e.action),delete e.action),e.triggers&&(e.triggers=_(e.triggers)),e.actions&&(e.actions=(0,s.Rn)(e.actions)),e),_=e=>e?Array.isArray(e)?e.map(_):("triggers"in e&&e.triggers&&(e.triggers=_(e.triggers)),"platform"in e&&("trigger"in e||(e.trigger=e.platform),delete e.platform),"options"in e&&e.options&&"behavior"in e.options&&("any"===e.options.behavior?e.options.behavior="each":"last"===e.options.behavior&&(e.options.behavior="all")),e):e,w=e=>{if(!e)return[];const t=[];return(0,i.e)(e).forEach(e=>{"triggers"in e?e.triggers&&t.push(...w(e.triggers)):t.push(e)}),t},C=(e,t)=>{g=e;const o=t?`?${(0,r.KH)({expanded:"1"})}`:"";(0,a.oo)(`/config/automation/edit/new${o}`)},x=e=>{C({...e,id:void 0,alias:void 0})},k=()=>{const e=g;return g=void 0,e},$=e=>{if(!e||"object"!=typeof e)return!1;const t=e;return"trigger"in t&&"string"==typeof t.trigger||"platform"in t&&"string"==typeof t.platform},M=e=>{if(!e||"object"!=typeof e)return!1;return"condition"in e&&"string"==typeof e.condition},V=e=>{if(!e||"object"!=typeof e)return!1;return"field"in e&&"object"==typeof e.field},L=(e,t,o,i)=>e.connection.subscribeMessage(t,{type:"subscribe_trigger",trigger:o,variables:i}),S=(e,t,o)=>e.callWS({type:"test_condition",condition:t,variables:o}),Z=(e,t,o)=>e.subscribeMessage(t,{type:"subscribe_condition",condition:o})},87225(e,t,o){o.d(t,{GS:()=>r,I8:()=>s,YQ:()=>h,bn:()=>d,fg:()=>l,oW:()=>n,ob:()=>c});o(74423);var i=o(71727),a=o(68246);const r=[{groups:{dynamicGroups:{},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:{sun:{},time:{},zone:{}}},helpers:{},template:{},trigger:{},other:{}}},{titleKey:"ui.panel.config.automation.editor.conditions.groups.generic.label",generic:!0,groups:{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:{}}}}},{titleKey:"ui.panel.config.automation.editor.conditions.groups.custom_integrations.label",groups:{customDynamicGroups:{}}}],n={and:{},or:{},not:{}},s=["and","or","not"],l=["ha-automation-condition-and","ha-automation-condition-not","ha-automation-condition-or"],d=(e,t)=>e.connection.subscribeMessage(t,{type:"condition_platforms/subscribe"}),c=e=>e.includes(".")?(0,i.m)(e):e,h=e=>e.includes(".")?(0,a.Y)(e):"_"},48250(e,t,o){o.d(t,{Bp:()=>a,aI:()=>i,gg:()=>l,oT:()=>r,wE:()=>n,x0:()=>s});const i=async(e,t)=>(await e.sendMessagePromise({type:"frontend/get_user_data",key:t})).value,a=async(e,t,o)=>e.sendMessagePromise({type:"frontend/set_user_data",key:t,value:o}),r=(e,t,o)=>e.subscribeMessage(o,{type:"frontend/subscribe_user_data",key:t}),n=async(e,t)=>(await e.sendMessagePromise({type:"frontend/get_system_data",key:t})).value,s=async(e,t,o)=>e.sendMessagePromise({type:"frontend/set_system_data",key:t,value:o}),l=(e,t,o)=>e.subscribeMessage(o,{type:"frontend/subscribe_system_data",key:t})},95350(e,t,o){if(o.d(t,{$h:()=>p,FP:()=>v,Og:()=>r,QC:()=>h,QQ:()=>s,S1:()=>n,Ud:()=>b,fK:()=>d,l7:()=>c,nQ:()=>g,p$:()=>l}),66649!=o.j)var i=o(35518);if(66649!=o.j)var a=o(9899);const r=66649!=o.j?{bluetooth:"config/bluetooth",dhcp:"config/dhcp",matter:"config/matter",mqtt:"config/mqtt",ssdp:"config/ssdp",thread:"config/thread",zeroconf:"config/zeroconf",zha:"config/zha/dashboard",zwave_js:"config/zwave_js/dashboard"}:null;var n=66649!=o.j?function(e){return e[e.CRITICAL=50]="CRITICAL",e[e.ERROR=40]="ERROR",e[e.WARNING=30]="WARNING",e[e.INFO=20]="INFO",e[e.DEBUG=10]="DEBUG",e[e.NOTSET=0]="NOTSET",e}({}):null;const s=(e,t)=>t.issue_tracker||`https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+${e}%22`,l=(e,t,o)=>e(`component.${t}.title`)||o?.name||t,d=(e,t)=>{const o={type:"manifest/list"};return t&&(o.integrations=t),e.callWS(o)},c=async(e,t)=>{const o=await e.sendMessagePromise({type:"manifest/list"}),i={};for(const e of o)i[e.domain]=e;return t(i),()=>{}},h=(e,t)=>e.callWS({type:"manifest/get",integration:t}),p=e=>e.callWS({type:"integration/setup_info"}),u=e=>e.sendMessagePromise({type:"logger/log_info"}),g=(e,t,o,i)=>e.callWS({type:"logger/integration_log_level",integration:t,level:o,persistence:i}),m=(e,t)=>e.subscribeEvents((0,a.s)(()=>u(e).then(e=>t.setState(e,!0)),200,!0),"logging_changed"),v=(e,t)=>(0,i.N)("_integration_log_info",u,m,e,t),b=(e,t)=>e.callWS({type:"integration/wait",domain:t})},84025(e,t,o){o.d(t,{AM:()=>w,BD:()=>g,FN:()=>c,GA:()=>M,Ht:()=>b,Iq:()=>h,Kq:()=>f,NX:()=>C,Q2:()=>v,R$:()=>_,Rn:()=>L,TP:()=>$,dW:()=>u,kR:()=>m,nB:()=>S,pq:()=>x,sW:()=>V,ve:()=>k});o(18111),o(81148),o(61701),o(13579);var i=o(63533),a=o(23832),r=o(68246),n=o(91926),s=o(24790),l=o(6030),d=o(88249);const c=66649!=o.j?["single","restart","queued","parallel"]:null,h=(0,a.g)(["queued","parallel"]),p=(0,i.Ik)({alias:(0,i.lq)((0,i.Yj)()),note:(0,i.lq)((0,i.Yj)()),continue_on_error:(0,i.lq)((0,i.zM)()),enabled:(0,i.lq)((0,i.zM)())}),u=(0,i.Ik)({entity_id:(0,i.lq)((0,i.KC)([(0,i.Yj)(),(0,i.YO)((0,i.Yj)())])),device_id:(0,i.lq)((0,i.KC)([(0,i.Yj)(),(0,i.YO)((0,i.Yj)())])),area_id:(0,i.lq)((0,i.KC)([(0,i.Yj)(),(0,i.YO)((0,i.Yj)())])),floor_id:(0,i.lq)((0,i.KC)([(0,i.Yj)(),(0,i.YO)((0,i.Yj)())])),label_id:(0,i.lq)((0,i.KC)([(0,i.Yj)(),(0,i.YO)((0,i.Yj)())]))}),g=(0,i.kp)(p,(0,i.Ik)({action:(0,i.lq)((0,i.Yj)()),service_template:(0,i.lq)((0,i.Yj)()),entity_id:(0,i.lq)((0,i.Yj)()),target:(0,i.lq)((0,i.KC)([u,(0,i.YP)((0,i.Yj)(),"has_template",e=>(0,s.r)(e))])),data:(0,i.lq)((0,i.Ik)()),response_variable:(0,i.lq)((0,i.Yj)()),metadata:(0,i.lq)((0,i.Ik)())})),m=(e,t,o)=>e.callService("script",t,o),v=e=>"off"===e.state||!!("on"===e.state&&h(e.attributes.mode)&&e.attributes.current<e.attributes.max),b=(e,t)=>e.callApi("DELETE",`config/script/config/${t}`);let y;const f=(e,t)=>e.callApi("GET",`config/script/config/${t}`),_=(e,t)=>e.callWS({type:"script/config",entity_id:t}),w=(e,t)=>{y=e;const o=t?`?${(0,l.KH)({expanded:"1"})}`:"";(0,n.oo)(`/config/script/edit/new${o}`)},C=()=>{const e=y;return y=void 0,e},x=e=>"string"==typeof e&&(0,s.r)(e)?"check_condition":"delay"in e?"delay":"wait_template"in e?"wait_template":["condition","and","or","not"].some(t=>t in e)?"check_condition":"event"in e?"fire_event":!("device_id"in e)||"trigger"in e||"condition"in e?"repeat"in e?"repeat":"choose"in e?"choose":"if"in e?"if":"wait_for_trigger"in e?"wait_for_trigger":"variables"in e?"variables":"stop"in e?"stop":"sequence"in e?"sequence":"parallel"in e?"parallel":"set_conversation_response"in e?"set_conversation_response":"action"in e||"service"in e?"service":"unknown":"device_action",k=e=>"unknown"!==x(e),$=(e,t)=>{const o=e.services.script[(0,r.Y)(t)]?.fields;return void 0!==o&&Object.keys(o).length>0},M=(e,t)=>{const o=e.services.script[(0,r.Y)(t)]?.fields;return void 0!==o&&Object.values(o).some(e=>e.required)},V=(e,t,o)=>{const i=e.services.script[(0,r.Y)(t)]?.fields;return void 0===i||0===Object.keys(i).length||void 0!==o&&Object.entries(i).every(([e,t])=>!t.required||void 0!==o[e])},L=e=>{if(!e)return e;if(Array.isArray(e))return e.map(L);if("object"==typeof e&&null!==e&&"service"in e&&("action"in e||(e.action=e.service),delete e.service),"object"==typeof e&&null!==e&&"scene"in e&&(e.action="scene.turn_on",e.target={entity_id:e.scene},delete e.scene),"object"==typeof e&&null!==e&&"action"in e&&"media_player.play_media"===e.action&&"data"in e&&(e.data?.media_content_id||e.data?.media_content_type)){const t={...e.data},o={media_content_id:t.media_content_id,media_content_type:t.media_content_type,metadata:{...e.metadata||{}}};delete e.metadata,delete t.media_content_id,delete t.media_content_type,e.data={...t,media:o}}if("object"==typeof e&&null!==e&&"sequence"in e){delete e.metadata;for(const t of e.sequence)L(t)}const t=x(e);if("parallel"===t){L(e.parallel)}if("choose"===t){const t=e;if(Array.isArray(t.choose))for(const e of t.choose)L(e.sequence);else t.choose&&L(t.choose.sequence);t.default&&L(t.default)}if("repeat"===t){L(e.repeat.sequence)}if("if"===t){const t=e;L(t.then),t.else&&L(t.else)}if("wait_for_trigger"===t){const t=e;(0,d.vO)(t.wait_for_trigger)}return e},S=e=>{const t=e.sequence;return t&&!Array.isArray(t)&&(e.sequence=[t]),e.sequence&&(e.sequence=L(e.sequence)),e}},46927(e,t,o){if(o.d(t,{$W:()=>c,Hg:()=>r,Wj:()=>n,Yk:()=>h,jG:()=>a,mo:()=>d,ow:()=>s,zt:()=>l}),66649!=o.j)var i=o(48250);var a=function(e){return e.language="language",e.system="system",e.comma_decimal="comma_decimal",e.decimal_comma="decimal_comma",e.quote_decimal="quote_decimal",e.space_comma="space_comma",e.none="none",e}({}),r=function(e){return e.language="language",e.system="system",e.am_pm="12",e.twenty_four="24",e}({}),n=function(e){return e.local="local",e.server="server",e}({}),s=function(e){return e.language="language",e.system="system",e.DMY="DMY",e.MDY="MDY",e.YMD="YMD",e}({}),l=function(e){return e.language="language",e.monday="monday",e.tuesday="tuesday",e.wednesday="wednesday",e.thursday="thursday",e.friday="friday",e.saturday="saturday",e.sunday="sunday",e}({});const d=(e,t)=>(0,i.oT)(e.connection,"language",t),c=(e,t)=>(0,i.Bp)(e.connection,"language",t),h=async(e,t,o,i,a)=>(await e.callWS({type:"frontend/get_translations",language:t,category:o,integration:i,config_flow:a})).resources},17894(e,t,o){o.d(t,{c:()=>r});var i=o(62826),a=o(22441);const r=e=>{class t extends e{constructor(...e){super(...e),this.disabled=!1,this.required=!1,this.unknown=!1,this.hideClearIcon=!1}}return(0,i.Cg)([(0,a.MZ)({type:Boolean})],t.prototype,"disabled",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean})],t.prototype,"required",void 0),(0,i.Cg)([(0,a.MZ)()],t.prototype,"icon",void 0),(0,i.Cg)([(0,a.MZ)()],t.prototype,"image",void 0),(0,i.Cg)([(0,a.MZ)()],t.prototype,"label",void 0),(0,i.Cg)([(0,a.MZ)()],t.prototype,"placeholder",void 0),(0,i.Cg)([(0,a.MZ)()],t.prototype,"helper",void 0),(0,i.Cg)([(0,a.MZ)()],t.prototype,"value",void 0),(0,i.Cg)([(0,a.MZ)({type:Boolean,reflect:!0})],t.prototype,"unknown",void 0),(0,i.Cg)([(0,a.MZ)({attribute:"unknown-item-text"})],t.prototype,"unknownItemText",void 0),(0,i.Cg)([(0,a.MZ)({attribute:"hide-clear-icon",type:Boolean})],t.prototype,"hideClearIcon",void 0),(0,i.Cg)([(0,a.MZ)({attribute:!1})],t.prototype,"valueRenderer",void 0),t}},37619(e,t,o){o.d(t,{X:()=>r,s:()=>a});o(69112),o(33110);let i=!1;const a=e=>{i=e},r=(e,t)=>{const o=e.sendMessagePromise(t);return i&&console.log(`⬆️ Sent #${t.id}`,t),i&&o.then(e=>console.log(`⬇️ Received #${t.id}`,e&&"object"==typeof e?JSON.parse(JSON.stringify(e)):e),e=>console.error(`❌ Error #${t.id}`,e)),o}}};