UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

93 lines 86.4 kB
export const __rspack_esm_id=8012;export const __rspack_esm_ids=[8012];export const __webpack_modules__={72487(t,e,i){i.a(t,async function(t,a){try{i.d(e,{CA:()=>$,Mi:()=>Z,Pm:()=>k,Wq:()=>f,Yq:()=>h,bl:()=>I,c2:()=>_,fr:()=>b,gu:()=>z,kz:()=>c,m9:()=>T,sl:()=>v,ur:()=>q,zB:()=>u});i(18111),i(20116);var o=i(74487),r=i(22786),n=i(46927),s=i(8480),l=t([o,s]);[o,s]=l.then?(await l)():l;(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",month:"long",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)}));const h=(t,e,i)=>d(e,i.time_zone).format(t),d=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),c=(t,e,i)=>p(e,i.time_zone).format(t),p=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),u=(t,e,i)=>{const a=g(e,i.time_zone);if(e.date_format===n.ow.language||e.date_format===n.ow.system)return a.format(t);const o=a.formatToParts(t),r=o.find(t=>"literal"===t.type)?.value,s=o.find(t=>"day"===t.type)?.value,l=o.find(t=>"month"===t.type)?.value,h=o.find(t=>"year"===t.type)?.value,d=o[o.length-1];let c="literal"===d?.type?d?.value:"";"bg"===e.language&&e.date_format===n.ow.YMD&&(c="");return{[n.ow.DMY]:`${s}${r}${l}${r}${h}${c}`,[n.ow.MDY]:`${l}${r}${s}${r}${h}${c}`,[n.ow.YMD]:`${h}${r}${l}${r}${s}${c}`}[e.date_format]},g=(0,r.A)((t,e)=>{const i=t.date_format===n.ow.system?void 0:t.language;return t.date_format===n.ow.language||(t.date_format,n.ow.system),new Intl.DateTimeFormat(i,{year:"numeric",month:"numeric",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})}),v=(t,e,i)=>m(e,i.time_zone).format(t),m=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{day:"numeric",month:"short",timeZone:(0,s.wj)(t.time_zone,e)})),b=(t,e,i)=>y(e,i.time_zone).format(t),y=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",year:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),f=(t,e,i)=>w(e,i.time_zone).format(t),w=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"long",timeZone:(0,s.wj)(t.time_zone,e)})),_=(t,e,i)=>x(e,i.time_zone).format(t),x=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"short",timeZone:(0,s.wj)(t.time_zone,e)})),k=(t,e,i)=>C(e,i.time_zone).format(t),C=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),$=(t,e,i)=>M(e,i.time_zone).format(t),M=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",timeZone:(0,s.wj)(t.time_zone,e)})),z=(t,e,i)=>A(e,i.time_zone).format(t),A=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",timeZone:(0,s.wj)(t.time_zone,e)})),Z=(t,e,i)=>L(e,i.time_zone).format(t),L=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",month:"short",day:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),q=(t,e,i)=>H(e,i.time_zone).format(t),H=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"short",month:"short",day:"numeric",year:"numeric",timeZone:(0,s.wj)(t.time_zone,e)})),I=(t,e,i)=>{const a=(0,s.wj)(e.time_zone,i.time_zone);return new Intl.DateTimeFormat("en-CA",{year:"numeric",month:"2-digit",day:"2-digit",timeZone:a}).format(t)},T=(t,e,i,a)=>`${I(t,i,a)}/${I(e,i,a)}`;a()}catch(t){a(t)}})},95747(t,e,i){i.a(t,async function(t,a){try{i.d(e,{CL:()=>f,GH:()=>x,Rl:()=>u,ZS:()=>b,aQ:()=>v,r6:()=>c,yg:()=>w});var o=i(74487),r=i(22786),n=i(72487),s=i(30162),l=i(8480),h=i(69543),d=t([o,l,n,s]);[o,l,n,s]=d.then?(await d)():d;const c=(t,e,i)=>p(e,i.time_zone).format(t),p=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,h.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,h.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),u=t=>g().format(t),g=(0,r.A)(()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"})),v=(t,e,i)=>m(e,i.time_zone).format(t),m=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"short",day:"numeric",hour:(0,h.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,h.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),b=(t,e,i)=>y(e,i.time_zone).format(t),y=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{month:"short",day:"numeric",hour:(0,h.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,h.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),f=(t,e,i)=>(new Date).getFullYear()===t.getFullYear()?b(t,e,i):v(t,e,i),w=(t,e,i)=>_(e,i.time_zone).format(t),_=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{year:"numeric",month:"long",day:"numeric",hour:(0,h.J)(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,h.J)(t)?"h12":"h23",timeZone:(0,l.wj)(t.time_zone,e)})),x=(t,e,i)=>`${(0,n.zB)(t,e,i)}, ${(0,s.fU)(t,e,i)}`;a()}catch(t){a(t)}})},30162(t,e,i){i.a(t,async function(t,a){try{i.d(e,{LW:()=>v,Xs:()=>u,fU:()=>h,ie:()=>c});var o=i(74487),r=i(22786),n=i(8480),s=i(69543),l=t([o,n]);[o,n]=l.then?(await l)():l;const h=(t,e,i)=>d(e,i.time_zone).format(t),d=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{hour:"numeric",minute:"2-digit",hourCycle:(0,s.J)(t)?"h12":"h23",timeZone:(0,n.wj)(t.time_zone,e)})),c=(t,e,i)=>p(e,i.time_zone).format(t),p=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{hour:(0,s.J)(t)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,s.J)(t)?"h12":"h23",timeZone:(0,n.wj)(t.time_zone,e)})),u=(t,e,i)=>g(e,i.time_zone).format(t),g=(0,r.A)((t,e)=>new Intl.DateTimeFormat(t.language,{weekday:"long",hour:(0,s.J)(t)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,s.J)(t)?"h12":"h23",timeZone:(0,n.wj)(t.time_zone,e)})),v=(t,e,i)=>m(e,i.time_zone).format(t),m=(0,r.A)((t,e)=>new Intl.DateTimeFormat("en-GB",{hour:"numeric",minute:"2-digit",hour12:!1,timeZone:(0,n.wj)(t.time_zone,e)}));a()}catch(t){a(t)}})},8480(t,e,i){i.a(t,async function(t,a){try{i.d(e,{fL:()=>d,n2:()=>c,wj:()=>p});var o=i(74487),r=i(29079),n=i(46927),s=t([o]);o=(s.then?(await s)():s)[0];const l=Intl.DateTimeFormat?.().resolvedOptions?.().timeZone,h=l&&("UTC"===l||"Etc/UTC"===l||l in r)?l:void 0,d=14881==i.j?void 0!==h:null,c=h??"UTC",p=(t,e)=>t===n.Wj.local&&h?c:e;a()}catch(t){a(t)}})},69543(t,e,i){i.d(e,{J:()=>r});i(74423);var a=i(22786),o=i(46927);const r=(0,a.A)(t=>{if(t.time_format===o.Hg.language||t.time_format===o.Hg.system){const e=t.time_format===o.Hg.language?t.language:void 0;return new Date("January 1, 2023 22:00:00").toLocaleString(e).includes("10")}return t.time_format===o.Hg.am_pm})},93421(t,e,i){i.d(e,{IW:()=>d,dH:()=>h,fI:()=>l});i(44114);var a=i(35211),o=i(22792),r=i(32172);const n=(t,e)=>{let i=t;for(const t of e){if(null==i)return;i=i[t]}return i},s=(t,e,i)=>{const o=(0,r.p)({transformer:function(t){return i.call(this,t)},watch:e?[e]:[]}),n=(0,a.Fg)({context:t,subscribe:!0});return(t,e)=>{o(t,e),n(t,e)}},l=t=>s(o.iN,t.entityIdPath[0],function(e){const i=n(this,t.entityIdPath);return"string"==typeof i?e?.[i]:void 0}),h=t=>s(o.X1,t.entityIdPath[0],function(e){const i=n(this,t.entityIdPath);return"string"==typeof i?e?.[i]:void 0}),d=()=>s(o.D5,void 0,({localize:t})=>t)},26218(t,e,i){i.d(e,{a:()=>o});const a=(0,i(77796).n)(t=>{history.replaceState({scrollPosition:t},"")},300);function o(t){return(e,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const o=e.connectedCallback;e.connectedCallback=function(){o.call(this);const e=this[i];e&&this.updateComplete.then(()=>{const i=this.renderRoot.querySelector(t);i&&setTimeout(()=>{i.scrollTop=e},0)})};const r=Object.getOwnPropertyDescriptor(e,i);let n;if(void 0===r)n={get(){return this[`__${String(i)}`]||history.state?.scrollPosition},set(t){a(t),this[`__${String(i)}`]=t},configurable:!0,enumerable:!0};else{const t=r.set;n={...r,set(e){a(e),this[`__${String(i)}`]=e,t?.call(this,e)}}}Object.defineProperty(e,i,n)}}},32172(t,e,i){i.d(e,{p:()=>a});i(18111),i(7588),i(45367),i(92731),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);function a(t){return(e,i)=>{if("object"==typeof i)throw new Error("This decorator does not support this compilation type.");const a=String(i),o=e;if(o._transformers){if(!o.hasOwnProperty("_transformers")){const t=o._transformers;o._transformers=new Map,t.forEach((t,e)=>o._transformers.set(e,t))}}else{o._transformers=new Map,o._watching=new Map;const t=o.willUpdate;o.willUpdate=function(e){t.call(this,e);const i=new Set;e.forEach((t,e)=>{const a=this._watching.get(e);void 0!==a&&a.forEach(t=>i.add(t))}),i.forEach(t=>{this[t]=this[`__original_${String(t)}`]})}}o._transformers.set(i,t.transformer),t.watch&&t.watch.forEach(t=>{let e=o._watching.get(t);e||(e=new Set,o._watching.set(t,e)),e.add(i)});const r=Object.getOwnPropertyDescriptor(e,i);let n;if(void 0===r)n={get(){return this[`__transform_${a}`]},set(t){const e=this[`__transform_${a}`],i=this._transformers.get(a);this[`__transform_${a}`]=i?i.call(this,t):t,this[`__original_${a}`]=t,this.requestUpdate(a,e)},configurable:!0,enumerable:!0};else{const t=r.set;n={...r,set(e){const i=this[`__transform_${a}`],o=this._transformers.get(a);this[`__transform_${a}`]=o?o.call(this,e):e,this[`__original_${a}`]=e,this.requestUpdate(a,i),t?.call(this,e)}}}Object.defineProperty(e,i,n)}}},57237(t,e,i){i.d(e,{d:()=>a});const a=t=>t.stopPropagation()},86198(t,e,i){i.a(t,async function(t,a){try{i.d(e,{T:()=>s});var o=i(74487),r=i(22786),n=t([o]);o=(n.then?(await n)():n)[0];const s=(t,e)=>{try{return l(e)?.of(t)??t}catch{return t}},l=(0,r.A)(t=>new Intl.DisplayNames(t.language,{type:"language",fallback:"code"}));a()}catch(t){a(t)}})},77796(t,e,i){i.d(e,{n:()=>a});const a=(t,e,i=!0,a=!0)=>{let o,r=0;const n=(...n)=>{const s=()=>{r=!1===i?0:Date.now(),o=void 0,t(...n)},l=Date.now();r||!1!==i||(r=l);const h=e-(l-r);h<=0||h>e?(o&&(clearTimeout(o),o=void 0),r=l,t(...n)):o||!1===a||(o=window.setTimeout(s,h))};return n.cancel=()=>{clearTimeout(o),o=void 0,r=0},n}},38962(t,e,i){i.a(t,async function(t,a){try{i.r(e);var o=i(62826),r=i(5124),n=i(22441),s=i(6412),l=i(93421),h=i(1087),d=i(26300),c=(i(67094),t([d]));d=(c.then?(await c)():c)[0];const p="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",u={info:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M11,17H13V11H11V17Z",warning:"M12,2L1,21H23M12,6L19.53,19H4.47M11,10V14H13V10M11,16V18H13V16",error:"M11,15H13V17H11V15M11,7H13V13H11V7M12,2C6.47,2 2,6.5 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4A8,8 0 0,1 20,12A8,8 0 0,1 12,20Z",success:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2,4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"};class g extends r.WF{render(){return r.qy` <div class="issue-type ${(0,s.H)({[this.alertType]:!0})}" role="alert"> <div class="icon ${this.title?"":"no-title"}"> <slot name="icon"> <ha-svg-icon .path="${u[this.alertType]}"></ha-svg-icon> </slot> </div> <div class="${(0,s.H)({content:!0,narrow:this.narrow})}"> <div class="main-content"> ${this.title?r.qy`<div class="title">${this.title}</div>`:r.s6} <slot></slot> </div> <div class="action"> <slot name="action"> ${this.dismissable?r.qy`<ha-icon-button @click="${this._dismissClicked}" .label="${this._localize?.("ui.common.dismiss_alert")}" .path="${p}"></ha-icon-button>`:r.s6} </slot> </div> </div> </div> `}_dismissClicked(){(0,h.r)(this,"alert-dismissed-clicked")}constructor(...t){super(...t),this.title="",this.alertType="info",this.dismissable=!1,this.narrow=!1}}g.styles=r.AH`.issue-type{position:relative;padding:8px;display:flex}.icon{height:var(--ha-alert-icon-size,24px);width:var(--ha-alert-icon-size,24px)}.issue-type::after{position:absolute;top:0;right:0;bottom:0;left:0;opacity:.12;pointer-events:none;content:"";border-radius:var(--ha-border-radius-sm)}.icon.no-title{align-self:center}.content{display:flex;justify-content:space-between;align-items:center;width:100%;text-align:var(--float-start)}.content.narrow{flex-direction:column;align-items:flex-end}.action{z-index:1;width:min-content;--mdc-theme-primary:var(--primary-text-color)}.main-content{overflow-wrap:anywhere;word-break:break-word;line-height:normal;margin-left:8px;margin-right:0;margin-inline-start:8px;margin-inline-end:8px}.title{margin-top:2px;font-weight:var(--ha-font-weight-bold)}.action ha-icon-button{--mdc-theme-primary:var(--primary-text-color);--ha-icon-button-size:36px}.issue-type.info>.icon{color:var(--info-color)}.issue-type.info::after{background-color:var(--info-color)}.issue-type.warning>.icon{color:var(--warning-color)}.issue-type.warning::after{background-color:var(--warning-color)}.issue-type.error>.icon{color:var(--error-color)}.issue-type.error::after{background-color:var(--error-color)}.issue-type.success>.icon{color:var(--success-color)}.issue-type.success::after{background-color:var(--success-color)}:host ::slotted(ul){margin:0;padding-inline-start:20px}`,(0,o.Cg)([(0,n.MZ)()],g.prototype,"title",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"alert-type"})],g.prototype,"alertType",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],g.prototype,"dismissable",void 0),(0,o.Cg)([(0,n.wk)(),(0,l.IW)()],g.prototype,"_localize",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],g.prototype,"narrow",void 0),g=(0,o.Cg)([(0,n.EM)("ha-alert")],g),a()}catch(t){a(t)}})},44643(t,e,i){i.a(t,async function(t,e){try{i(44114),i(18111),i(20116),i(61701);var a=i(62826),o=i(5124),r=i(22441),n=i(1087),s=i(86198),l=i(69150),h=i(606),d=t([h,s]);[h,s]=d.then?(await d)():d;const c="preferred",p="last_used";class u extends o.WF{get _default(){return this.includeLastUsed?p:c}render(){if(!this._pipelines)return o.s6;const t=this.value??this._default,e=[{value:c,label:this.hass.localize("ui.components.pipeline-picker.preferred",{preferred:this._pipelines.find(t=>t.id===this._preferredPipeline)?.name})}];return this.includeLastUsed&&e.unshift({value:p,label:this.hass.localize("ui.components.pipeline-picker.last_used")}),e.push(...this._pipelines.map(t=>({value:t.id,label:`${t.name} (${(0,s.T)(t.language,this.hass.locale)})`}))),o.qy` <ha-select .label="${this.label||this.hass.localize("ui.components.pipeline-picker.pipeline")}" .value="${t}" .required="${this.required}" .disabled="${this.disabled}" @selected="${this._changed}" .options="${e}"> </ha-select> `}firstUpdated(t){super.firstUpdated(t),(0,l.nx)(this.hass).then(t=>{this._pipelines=t.pipelines,this._preferredPipeline=t.preferred_pipeline})}_changed(t){const e=t.detail.value;!this.hass||""===e||e===this.value||void 0===this.value&&e===this._default||(this.value=e===this._default?void 0:e,(0,n.r)(this,"value-changed",{value:this.value}))}constructor(...t){super(...t),this.disabled=!1,this.required=!1,this.includeLastUsed=!1,this._preferredPipeline=null}}u.styles=o.AH`ha-select{width:100%}`,(0,a.Cg)([(0,r.MZ)()],u.prototype,"value",void 0),(0,a.Cg)([(0,r.MZ)()],u.prototype,"label",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],u.prototype,"disabled",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],u.prototype,"required",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"includeLastUsed",void 0),(0,a.Cg)([(0,r.wk)()],u.prototype,"_pipelines",void 0),(0,a.Cg)([(0,r.wk)()],u.prototype,"_preferredPipeline",void 0),u=(0,a.Cg)([(0,r.EM)("ha-assist-pipeline-picker")],u),e()}catch(t){e(t)}})},76776(t,e,i){var a=i(62826),o=i(5124),r=i(22441);class n extends o.WF{render(){return o.qy` ${this.header?o.qy`<h1 class="card-header">${this.header}</h1>`:o.s6} <slot></slot> `}constructor(...t){super(...t),this.raised=!1}}n.styles=o.AH`:host{background:var(--ha-card-background,var(--card-background-color,#fff));-webkit-backdrop-filter:var(--ha-card-backdrop-filter,none);backdrop-filter:var(--ha-card-backdrop-filter,none);box-shadow:var(--ha-card-box-shadow,none);box-sizing:border-box;border-radius:var(--ha-card-border-radius,var(--ha-border-radius-lg));border-width:var(--ha-card-border-width,1px);border-style:solid;border-color:var(--ha-card-border-color,var(--divider-color,#e0e0e0));color:var(--primary-text-color);display:block;transition:all .3s ease-out;position:relative}:host([raised]){border:none;box-shadow:var(--ha-card-box-shadow,0px 2px 1px -1px rgba(0,0,0,.2),0px 1px 1px 0px rgba(0,0,0,.14),0px 1px 3px 0px rgba(0,0,0,.12))}.card-header,:host ::slotted(.card-header){color:var(--ha-card-header-color,var(--primary-text-color));font-family:var(--ha-card-header-font-family, inherit);font-size:var(--ha-card-header-font-size, var(--ha-font-size-2xl));letter-spacing:-.012em;line-height:var(--ha-line-height-expanded);padding:var(--ha-space-3) var(--ha-space-4) var(--ha-space-4);display:block;margin-block-start:0;margin-block-end:0;font-weight:var(--ha-font-weight-normal)}
    :host
      ::slotted(
        .card-content:not(:nth-child(1 of .card-content, .card-header))
      ),
    slot:not(:first-child)::slotted(.card-content) {
      padding-top: 0;
      margin-top: calc(var(--ha-space-2) * -1);
    }
    :host ::slotted(.card-content){padding:var(--ha-space-4)}:host ::slotted(.card-actions){border-top:1px solid var(--divider-color,#e8e8e8);padding:var(--ha-space-2)}`,(0,a.Cg)([(0,r.MZ)()],n.prototype,"header",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],n.prototype,"raised",void 0),n=(0,a.Cg)([(0,r.EM)("ha-card")],n)},9503(t,e,i){var a=i(62826),o=i(97577),r=i(5124),n=i(22441);class s extends o.A{get value(){return this._value??null}set value(t){this._value=t}static get styles(){return[o.A.styles,r.AH`:host{--wa-form-control-toggle-size:var(--ha-checkbox-size, 20px);--wa-form-control-border-color:var(
            --ha-checkbox-border-color,
            var(--ha-color-border-neutral-normal)
          );--wa-form-control-background-color:var(
            --ha-checkbox-background-color,
            var(--wa-form-control-background-color)
          );--checked-icon-color:var(
            --ha-checkbox-checked-icon-color,
            var(--wa-color-brand-on-loud)
          );--wa-form-control-activated-color:var(
            --ha-checkbox-checked-background-color,
            var(--ha-color-fill-primary-loud-resting)
          );-webkit-tap-highlight-color:transparent;--checked-icon-scale:var(--ha-checkbox-checked-icon-scale, 0.9);--wa-form-control-required-content:var(
            --ha-checkbox-required-marker,
            var(--ha-input-required-marker, "*")
          );--wa-form-control-required-content-offset:var(
            --ha-checkbox-required-marker-offset,
            0.1rem
          )}[part~=base]{align-items:center;gap:var(--ha-space-2)}[part~=control]{border-radius:var(--ha-checkbox-border-radius,var(--ha-border-radius-sm));border-width:var(--ha-checkbox-border-width,var(--ha-border-width-md));margin-inline-end:0}[part~=label]{line-height:1}#hint{font-size:var(--ha-font-size-xs);color:var(--ha-color-text-secondary)}label:has(input:not(:disabled)):hover{--wa-form-control-border-color:var(
            --ha-checkbox-border-color-hover,
            var(--ha-checkbox-border-color, var(--ha-color-border-neutral-loud))
          )}label:has(input:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-background-color-hover,var(--ha-color-form-background-hover))}label:has(input:checked:not(:disabled)):hover [part~=control],label:has(input:indeterminate:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover));border-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover))}`]}}s=(0,a.Cg)([(0,n.EM)("ha-checkbox")],s)},75064(t,e,i){var a=i(62826),o=i(5124),r=i(22441),n=i(2846);class s extends n.G{constructor(...t){super(...t),this.borderTop=!1}}s.styles=[...n.J,o.AH`:host{--md-list-item-one-line-container-height:48px;--md-list-item-two-line-container-height:64px}:host([border-top]) md-item{border-top:1px solid var(--divider-color)}[slot=start]{--state-icon-color:var(--secondary-text-color)}[slot=overline]{line-height:1.15rem;font-size:calc(var(--mdc-typography-subtitle1-font-size, 1rem) * .75);font-weight:var(--mdc-typography-subtitle1-font-weight,400);font-family:var(
          --mdc-typography-subtitle1-font-family,
          var(--mdc-typography-font-family)
        );color:var(--mdc-select-label-ink-color,rgba(0,0,0,.6))}[slot=headline]{line-height:var(--ha-line-height-normal);font-size:var(--ha-font-size-m);white-space:nowrap}[slot=supporting-text]{line-height:var(--ha-line-height-normal);font-size:var(--ha-font-size-s);white-space:nowrap}::slotted(img),::slotted(state-badge){width:32px;height:32px}::slotted(.code){font-family:var(--ha-font-family-code);font-size:var(--ha-font-size-xs)}::slotted(.domain){font-size:var(--ha-font-size-s);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal);align-self:flex-end;max-width:30%;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}`],(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0,attribute:"border-top"})],s.prototype,"borderTop",void 0),s=(0,a.Cg)([(0,r.EM)("ha-combo-box-item")],s)},70947(t,e,i){var a=i(62826),o=i(50759),r=(i(38625),i(5124)),n=i(22441);i(67094);class s extends o.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[o.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(...t){super(...t),this.selected=!1}}(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],s.prototype,"selected",void 0),s=(0,a.Cg)([(0,n.EM)("ha-dropdown-item")],s)},29823(t,e,i){i.a(t,async function(t,e){try{var a=i(62826),o=i(52254),r=i(5124),n=i(22441),s=t([o]);o=(s.then?(await s)():s)[0];class l extends o.A{get anchorElement(){return this.popup?.anchor}set anchorElement(t){this.popup&&(this.popup.anchor&&"ha-icon-button"===this.popup.anchor.localName&&(this.popup.anchor.selected=!1),this.popup.anchor=t)}getTrigger(){return this.anchorElement?this.anchorElement:super.getTrigger()}async showMenu(){await super.showMenu();const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!0)}async hideMenu(){const t=this.getTrigger();t&&"ha-icon-button"===t.localName&&(t.selected=!1),await super.hideMenu()}static get styles(){return[o.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(...t){super(...t),this.dropdownTag="ha-dropdown",this.dropdownItemTag="ha-dropdown-item"}}(0,a.Cg)([(0,n.MZ)({attribute:!1})],l.prototype,"dropdownTag",void 0),(0,a.Cg)([(0,n.MZ)({attribute:!1})],l.prototype,"dropdownItemTag",void 0),l=(0,a.Cg)([(0,n.EM)("ha-dropdown")],l),e()}catch(t){e(t)}})},90248(t,e,i){i.a(t,async function(t,a){try{i.r(e),i.d(e,{HaIconButtonArrowPrev:()=>p});var o=i(62826),r=i(5124),n=i(22441),s=i(63091),l=i(26300),h=t([l]);l=(h.then?(await h)():h)[0];const d="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z",c="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z";class p extends r.WF{render(){return r.qy` <ha-icon-button .disabled="${this.disabled}" .label="${this.label||this.hass?.localize("ui.common.back")||"Back"}" .path="${this._icon}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"></ha-icon-button> `}constructor(...t){super(...t),this.disabled=!1,this._icon="rtl"===s.G.document.dir?c:d}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],p.prototype,"disabled",void 0),(0,o.Cg)([(0,n.MZ)()],p.prototype,"label",void 0),(0,o.Cg)([(0,n.MZ)()],p.prototype,"href",void 0),(0,o.Cg)([(0,n.MZ)()],p.prototype,"target",void 0),(0,o.Cg)([(0,n.MZ)()],p.prototype,"rel",void 0),(0,o.Cg)([(0,n.MZ)()],p.prototype,"download",void 0),(0,o.Cg)([(0,n.wk)()],p.prototype,"_icon",void 0),p=(0,o.Cg)([(0,n.EM)("ha-icon-button-arrow-prev")],p),a()}catch(t){a(t)}})},26300(t,e,i){i.a(t,async function(t,a){try{i.r(e),i.d(e,{HaIconButton:()=>d});var o=i(62826),r=i(5124),n=i(22441),s=i(63672),l=i(18350),h=(i(67094),t([l]));l=(h.then?(await h)():h)[0];class d extends r.WF{render(){return r.qy` <ha-button appearance="plain" variant="neutral" aria-label="${(0,s.J)(this.label)}" title="${(0,s.J)(this.hideTitle?void 0:this.label)}" aria-haspopup="${(0,s.J)(this.ariaHasPopup)}" .disabled="${this.disabled}" .iconTag="${this.path?"ha-svg-icon":"span"}" .href="${this.href}" .target="${this.target}" .rel="${this.rel}" .download="${this.download}"> ${this.path?r.qy`<ha-svg-icon aria-hidden="true" .path="${this.path}"></ha-svg-icon>`:r.qy`<span><slot></slot></span>`} </ha-button> `}constructor(...t){super(...t),this.disabled=!1,this.hideTitle=!1,this.selected=!1}}d.shadowRootOptions={mode:"open",delegatesFocus:!0},d.styles=r.AH`:host{display:inline-block;outline:0;--ha-button-height:var(--ha-icon-button-size, 48px)}ha-button{position:relative;isolation:isolate;--wa-form-control-padding-inline:var(
        --ha-icon-button-padding-inline,
        --ha-space-2
      );--wa-color-on-normal:currentColor;--wa-color-fill-quiet:transparent;--ha-button-label-overflow:visible}ha-button::after{content:"";position:absolute;inset:0;z-index:-1;border-radius:50%;background-color:currentColor;opacity:0;pointer-events:none}ha-button::part(base){width:var(--wa-form-control-height);aspect-ratio:1;outline-offset:-4px}ha-button::part(label){display:flex}:host([selected]) ha-button::after{opacity:.1}@media (hover:hover){:host(:hover:not([disabled])) ha-button::after{opacity:.1}}`,(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],d.prototype,"disabled",void 0),(0,o.Cg)([(0,n.MZ)({type:String})],d.prototype,"path",void 0),(0,o.Cg)([(0,n.MZ)({type:String})],d.prototype,"label",void 0),(0,o.Cg)([(0,n.MZ)({type:String,attribute:"aria-haspopup"})],d.prototype,"ariaHasPopup",void 0),(0,o.Cg)([(0,n.MZ)({attribute:"hide-title",type:Boolean})],d.prototype,"hideTitle",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],d.prototype,"selected",void 0),(0,o.Cg)([(0,n.MZ)()],d.prototype,"href",void 0),(0,o.Cg)([(0,n.MZ)()],d.prototype,"target",void 0),(0,o.Cg)([(0,n.MZ)()],d.prototype,"rel",void 0),(0,o.Cg)([(0,n.MZ)()],d.prototype,"download",void 0),d=(0,o.Cg)([(0,n.EM)("ha-icon-button")],d),a()}catch(t){a(t)}})},3449(t,e,i){var a=i(62826),o=i(5124),r=i(22441);class n extends o.WF{render(){return o.qy`<slot></slot>`}constructor(...t){super(...t),this.disabled=!1}}n.styles=o.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,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],n.prototype,"disabled",void 0),n=(0,a.Cg)([(0,r.EM)("ha-input-helper-text")],n)},2846(t,e,i){i.d(e,{G:()=>h,J:()=>l});var a=i(62826),o=i(58168),r=i(82553),n=i(5124),s=i(22441);i(54276);const l=[r.R,n.AH`:host{--ha-icon-display:block;--md-sys-color-primary:var(--primary-text-color);--md-sys-color-secondary:var(--secondary-text-color);--md-sys-color-surface:var(--card-background-color);--md-sys-color-on-surface:var(--primary-text-color);--md-sys-color-on-surface-variant:var(--secondary-text-color)}md-item{overflow:var(--md-item-overflow,hidden);align-items:var(--md-item-align-items,center);gap:var(--ha-md-list-item-gap,16px)}`];class h extends o.n{renderRipple(){return"text"===this.type?n.s6:n.qy`<ha-ripple part="ripple" for="item" ?disabled="${this.disabled&&"link"!==this.type}"></ha-ripple>`}}h.styles=l,h=(0,a.Cg)([(0,s.EM)("ha-md-list-item")],h)},2054(t,e,i){i.a(t,async function(t,e){try{var a=i(62826),o=i(5124),r=i(22441),n=i(1087),s=i(44249),l=i(26300),h=t([l]);l=(h.then?(await h)():h)[0];const d="M3,6H21V8H3V6M3,11H21V13H3V11M3,16H21V18H3V16Z";class c extends o.WF{connectedCallback(){super.connectedCallback(),this._attachNotifOnConnect&&(this._attachNotifOnConnect=!1,this._subscribeNotifications())}disconnectedCallback(){super.disconnectedCallback(),this._unsubNotifications&&(this._attachNotifOnConnect=!0,this._unsubNotifications(),this._unsubNotifications=void 0)}render(){if(!this._show)return o.s6;const t=this._hasNotifications&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);return o.qy` <ha-icon-button .label="${this.hass.localize("ui.sidebar.sidebar_toggle")}" .path="${d}" @click="${this._toggleMenu}"></ha-icon-button> ${t?o.qy`<div class="dot"></div>`:""} `}willUpdate(t){if(super.willUpdate(t),!t.has("narrow")&&!t.has("hass"))return;const e=t.has("hass")?t.get("hass"):this.hass,i=t.has("narrow")?t.get("narrow"):this.narrow,a=!1===e?.kioskMode&&(i||"always_hidden"===e?.dockedSidebar),o=!1===this.hass.kioskMode&&(this.narrow||"always_hidden"===this.hass.dockedSidebar);this.hasUpdated&&a===o||(this._show=o||this._alwaysVisible,o?this._subscribeNotifications():this._unsubNotifications&&(this._unsubNotifications(),this._unsubNotifications=void 0))}_subscribeNotifications(){if(this._unsubNotifications)throw new Error("Already subscribed");this._unsubNotifications=(0,s.V)(this.hass.connection,t=>{this._hasNotifications=t.length>0})}_toggleMenu(){(0,n.r)(this,"hass-toggle-menu")}constructor(...t){super(...t),this.narrow=!1,this._hasNotifications=!1,this._show=!1,this._alwaysVisible=!1,this._attachNotifOnConnect=!1}}c.styles=o.AH`:host{position:relative}.dot{pointer-events:none;position:absolute;background-color:var(--accent-color);width:12px;height:12px;top:9px;right:7px;inset-inline-end:7px;inset-inline-start:initial;border-radius:var(--ha-border-radius-circle);border:2px solid var(--app-header-background-color)}`,(0,a.Cg)([(0,r.MZ)({type:Boolean})],c.prototype,"narrow",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],c.prototype,"hass",void 0),(0,a.Cg)([(0,r.wk)()],c.prototype,"_hasNotifications",void 0),(0,a.Cg)([(0,r.wk)()],c.prototype,"_show",void 0),c=(0,a.Cg)([(0,r.EM)("ha-menu-button")],c),e()}catch(t){e(t)}})},88285(t,e,i){i.a(t,async function(t,e){try{var a=i(62826),o=i(35211),r=i(5124),n=i(22441),s=i(63672),l=i(1087),h=i(22792),d=i(17894),c=(i(75064),i(47680),i(26300)),p=t([c]);c=(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 v extends((0,d.c)(r.WF)){async focus(){await this.updateComplete,await(this.item?.focus())}render(){const t=!!this.value,e=!(!this.value||this.required||this.disabled||this.hideClearIcon),i=this.placeholder??this.label,a=this.label&&t?r.qy`<span slot="overline">${this.label}${this.required?" *":""}</span>`:r.s6,o=t?this.valueRenderer?this.valueRenderer(this.value??""):r.qy`<span slot="headline">${this.value}</span>`:i?r.qy`<span slot="headline" class="placeholder"> ${i}${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>`} ${a}${o} ${this.unknown?r.qy`<div slot="supporting-text" class="unknown"> ${this.unknownItemText||this._i18n?.localize("ui.components.combo-box.unknown_item")} </div>`:r.s6} ${e?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(t){t.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(...t){super(...t),this.invalid=!1}}(0,a.Cg)([(0,n.MZ)({type:Boolean,reflect:!0})],v.prototype,"invalid",void 0),(0,a.Cg)([(0,n.P)("ha-combo-box-item",!0)],v.prototype,"item",void 0),(0,a.Cg)([(0,n.wk)(),(0,o.Fg)({context:h.D5,subscribe:!0})],v.prototype,"_i18n",void 0),v=(0,a.Cg)([(0,n.EM)("ha-picker-field")],v),e()}catch(t){e(t)}})},54276(t,e,i){var a=i(62826),o=i(76482),r=i(91382),n=i(96245),s=i(5124),l=i(22441);class h extends r.n{attach(t){super.attach(t),this.attachableTouchController.attach(t)}disconnectedCallback(){super.disconnectedCallback(),this.hovered=!1,this.pressed=!1}detach(){super.detach(),this.attachableTouchController.detach()}_onTouchControlChange(t,e){t?.removeEventListener("touchend",this._handleTouchEnd),e?.addEventListener("touchend",this._handleTouchEnd)}constructor(...t){super(...t),this.attachableTouchController=new o.i(this,this._onTouchControlChange.bind(this)),this._handleTouchEnd=()=>{this.disabled||super.endPressAnimation()}}}h.styles=[n.R,s.AH`:host{--md-ripple-hover-opacity:var(--ha-ripple-hover-opacity, 0.08);--md-ripple-pressed-opacity:var(--ha-ripple-pressed-opacity, 0.12);--md-ripple-hover-color:var(
          --ha-ripple-hover-color,
          var(--ha-ripple-color, var(--secondary-text-color))
        );--md-ripple-pressed-color:var(
          --ha-ripple-pressed-color,
          var(--ha-ripple-color, var(--secondary-text-color))
        )}`],h=(0,a.Cg)([(0,l.EM)("ha-ripple")],h)},606(t,e,i){i.a(t,async function(t,e){try{i(74423),i(18111),i(61701);var a=i(62826),o=i(5124),r=i(22441),n=i(63672),s=i(22786),l=i(1087),h=i(29823),d=(i(70947),i(3449),i(88285)),c=(i(67094),t([h,d]));[h,d]=c.then?(await c)():c;class p extends o.WF{render(){return this.disabled?o.qy`${this._renderField()}${this._renderHelper()}`:o.qy` <ha-dropdown placement="bottom" @wa-select="${this._handleSelect}" @wa-show="${this._handleShow}" @wa-hide="${this._handleHide}"> ${this._renderField()} ${this.options?this.options.map(t=>{const e=["string","number"].includes(typeof t);return o.qy` <ha-dropdown-item .value="${e?t:t.value}" .disabled="${!e&&(t.disabled??!1)}" .selected="${this.value===(e?t:t.value)}"> ${t.iconPath?o.qy`<ha-svg-icon slot="icon" .path="${t.iconPath}"></ha-svg-icon>`:o.s6} <div class="content"> ${e?t:t.label||t.value} ${t.secondary?o.qy`<div class="secondary">${t.secondary}</div>`:o.s6} </div> </ha-dropdown-item> `}):o.qy`<slot></slot>`} </ha-dropdown> ${this._renderHelper()} `}_renderField(){const t=this._getValueLabel(this.options,this.value);return o.qy` <ha-picker-field slot="trigger" type="button" class="${this._opened?"opened":""}" compact="compact" aria-label="${(0,n.J)(this.label)}" @clear="${this._clearValue}" .label="${this.label}" .value="${t}" .required="${this.required}" .disabled="${this.disabled}" .hideClearIcon="${!this.clearable||this.required||this.disabled||!String(this.value)}"> </ha-picker-field> `}_renderHelper(){return this.helper?o.qy`<ha-input-helper-text .disabled="${this.disabled}">${this.helper}</ha-input-helper-text>`:o.s6}_handleSelect(t){t.stopPropagation();const e=t.detail.item.value;e!==this.value&&(0,l.r)(this,"selected",{value:e})}_clearValue(){!this.disabled&&this.value&&(0,l.r)(this,"selected",{value:void 0})}_handleShow(){this.style.setProperty("--select-menu-width",`${this._triggerField.offsetWidth}px`),this._opened=!0}_handleHide(){this._opened=!1}constructor(...t){super(...t),this.clearable=!1,this.required=!1,this.disabled=!1,this._opened=!1,this._getValueLabel=(0,s.A)((t,e)=>{const i=void 0!==e?String(e):void 0;if(!t||!i)return i;for(const e of t){const t=["string","number"].includes(typeof e);if(t&&e===i||!t&&String(e.value)===i)return t?e:e.label||e.value}return i})}}p.styles=o.AH`:host{position:relative}ha-picker-field.opened{--mdc-text-field-idle-line-color:var(--primary-color)}ha-dropdown-item .content{display:flex;gap:var(--ha-space-1);flex-direction:column}ha-dropdown-item .secondary{font-size:var(--ha-font-size-s);color:var(--ha-color-text-secondary)}ha-dropdown::part(menu){min-width:var(--select-menu-width)}ha-input-helper-text{display:block;margin:var(--ha-space-2) 0 0}`,(0,a.Cg)([(0,r.MZ)({type:Boolean})],p.prototype,"clearable",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"options",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"label",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"helper",void 0),(0,a.Cg)([(0,r.MZ)()],p.prototype,"value",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],p.prototype,"required",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],p.prototype,"disabled",void 0),(0,a.Cg)([(0,r.wk)()],p.prototype,"_opened",void 0),(0,a.Cg)([(0,r.P)("ha-picker-field")],p.prototype,"_triggerField",void 0),p=(0,a.Cg)([(0,r.EM)("ha-select")],p),e()}catch(t){e(t)}})},65829(t,e,i){i.a(t,async function(t,a){try{i.r(e),i.d(e,{HaSpinner:()=>h});var o=i(62826),r=i(55262),n=i(5124),s=i(22441),l=t([r]);r=(l.then?(await l)():l)[0];class h extends r.A{updated(t){if(super.updated(t),t.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}static get styles(){return[r.A.styles,n.AH`:host{--indicator-color:var(
            --ha-spinner-indicator-color,
            var(--primary-color)
          );--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`]}}(0,o.Cg)([(0,s.MZ)()],h.prototype,"size",void 0),h=(0,o.Cg)([(0,s.EM)("ha-spinner")],h),a()}catch(t){a(t)}})},67094(t,e,i){i.r(e),i.d(e,{HaSvgIcon:()=>n});var a=i(62826),o=i(5124),r=i(22441);class n extends o.WF{render(){return o.JW` <svg viewBox="${this.viewBox||"0 0 24 24"}" preserveAspectRatio="xMidYMid meet" focusable="false" role="img" aria-hidden="true"> <g> ${this.path?o.JW`<path class="primary-path" d="${this.path}"></path>`:o.s6} ${this.secondaryPath?o.JW`<path class="secondary-path" d="${this.secondaryPath}"></path>`:o.s6} </g> </svg>`}}n.styles=o.AH`:host{display:var(--ha-icon-display,inline-flex);align-items:center;justify-content:center;position:relative;vertical-align:middle;fill:var(--icon-primary-color,currentcolor);width:var(--mdc-icon-size,24px);height:var(--mdc-icon-size,24px)}svg{width:100%;height:100%;pointer-events:none;display:block}path.primary-path{opacity:var(--icon-primary-opactity, 1)}path.secondary-path{fill:var(--icon-secondary-color,currentcolor);opacity:var(--icon-secondary-opactity, .5)}`,(0,a.Cg)([(0,r.MZ)()],n.prototype,"path",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],n.prototype,"secondaryPath",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],n.prototype,"viewBox",void 0),n=(0,a.Cg)([(0,r.EM)("ha-svg-icon")],n)},34127(t,e,i){i.a(t,async function(t,e){try{var a=i(62826),o=i(52630),r=i(5124),n=i(22441),s=t([o]);o=(s.then?(await s)():s)[0];class l extends o.A{static get styles(){return[o.A.styles,r.AH`:host{--wa-tooltip-background-color:var(
            --ha-tooltip-background-color,
            var(--ha-color-surface-default)
          );--wa-tooltip-content-color:var(
            --ha-tooltip-text-color,
            var(--primary-text-color)
          );--wa-tooltip-font-family:var(
            --ha-tooltip-font-family,
            var(--ha-font-family-body)
          );--wa-tooltip-font-size:var(
            --ha-tooltip-font-size,
            var(--ha-font-size-m)
          );--wa-tooltip-font-weight:var(
            --ha-tooltip-font-weight,
            var(--ha-font-weight-medium)
          );--wa-tooltip-line-height:var(
            --ha-tooltip-line-height,
            var(--ha-line-height-condensed)
          );--wa-tooltip-padding:var(--ha-tooltip-padding, var(--ha-space-2));--wa-tooltip-border-radius:var(
            --ha-tooltip-border-radius,
            var(--ha-border-radius-md)
          );--wa-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 0px);--wa-tooltip-border-width:0px;--wa-z-index-tooltip:1000}.tooltip::part(popup){animation-duration:var(--ha-tooltip-animation-duration, 0)}.body{box-shadow:var(--ha-tooltip-box-shadow,var(--ha-box-shadow-m))}`]}constructor(...t){super(...t),this.showDelay=350,this.hideDelay=150}}(0,a.Cg)([(0,n.MZ)({attribute:"show-delay",type:Number})],l.prototype,"showDelay",void 0),(0,a.Cg)([(0,n.MZ)({attribute:"hide-delay",type:Number})],l.prototype,"hideDelay",void 0),l=(0,a.Cg)([(0,n.EM)("ha-tooltip")],l),e()}catch(t){e(t)}})},91485(t,e,i){i.a(t,async function(t,a){try{i.d(e,{U:()=>_});var o=i(62826),r=(i(86137),i(30006)),n=i(92070),s=i(35211),l=i(5124),h=i(22441),d=i(6412),c=i(63672),p=i(57237),u=i(22792),g=i(26300),v=(i(67094),i(34127)),m=i(53305),b=t([r,g,v]);[r,g,v]=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",w="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 _ extends((0,m.w)(l.WF)){get _formControl(){return this._input}showPicker(){this._input?.showPicker()}stepUp(){this._input?.stepUp()}stepDown(){this._input?.stepDown()}async firstUpdated(t){super.firstUpdated(t),this.insetLabel||(await(this._input?.updateComplete),this._syncStartSlotWidth())}render(){const t=!this.label&&this._hasSlotController.test("label"),e=!this.hint&&this._hasSlotController.test("hint"),i=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,d.H)({input:!0,invalid:this.invalid||this._invalid,"label-raised":void 0!==this.value&&""!==this.value||this.label&&this.placeholder||i&&this.insetLabel,"no-label":!this.label,"hint-hidden":!(this.hint||e||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||t?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?w:f}"></ha-icon-button> </slot> <div slot="hint" class="${(0,d.H)({error:this.invalid||this._invalid})}" role="${(0,c.J)(this.invalid||this._invalid?"alert":void 0)}" aria-live="polite"> ${this._invalid||this.invalid?this.validationMessage||this._input?.validationMessage:this.hint||(e?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(...t){super(...t),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 t=this._input?.shadowRoot?.querySelector('[part~="start"]'),e=t?.offsetWidth??0;e>0&&!this.insetLabel?(this.style.setProperty("--start-slot-width",`calc(${e}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"))}}}_.styles=[m.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,o.Cg)([(0,h.MZ)({reflect:!0})],_.prototype,"appearance",void 0),(0,o.Cg)([(0,h.MZ)({reflect:!0})],_.prototype,"type",void 0),(0,o.Cg)([(0,h.MZ)({type:Boolean,attribute:"with-clear"})],_.prototype,"withClear",void 0),(0,o.Cg)([(0,h.MZ)({type:Boolean,attribute:"password-toggle"})],_.prototype,"passwordToggle",void 0),(0,o.Cg)([(0,h.MZ)({type:Boolean,attribute:"password-visible"})],_.prototype,"passwordVisible",void 0),(0,o.Cg)([(0,h.MZ)({type:Boolean,attribute:"without-spin-buttons"})],_.prototype,"withoutSpinButtons",void 0),(0,o.Cg)([(0,h.MZ)()],_.prototype,"pattern",void 0),(0,o.Cg)([(0,h.MZ)()],_.prototype,"min",void 0),(0,o.Cg)([(0,h.MZ)()],_.prototype,"max",void 0),(0,o.Cg)([(0,h.MZ)()],_.prototype,"step",void 0),(0,o.Cg)([(0,h.MZ)({type:Boolean})],_.prototype,"autocorrect",void 0),(0,o.Cg)([(0,h.MZ)({type:Boolean,attribute:"inset-label"})],_.prototype,"insetLabel",void 0),(0,o.Cg)([(0,h.P)("wa-input")],_.prototype,"_input",void 0),(0,o.Cg)([(0,h.wk)(),(0,s.Fg)({context:u.D5,subscribe:!0})],_.prototype,"i18n",void 0),_=(0,o.Cg)([(0,h.EM)("ha-input")],_),a()}catch(t){a(t)}})},53305(t,e,i){i.d(e,{w:()=>l,N:()=>h});var a=i(62826),o=i(5124),r=i(22441),n=i(22786);i(74423);const s=Boolean(globalThis.ElementInternals)&&globalThis.HTMLElement?.prototype.attachInternals?.toString().includes("[native code]"),l=t=>{class e extends t{get _formControl(){throw new Error("_formControl getter must be implemented by subclass")}select(){this._formControl?.select()}setSelectionRange(t,e,i){this._formControl?.setSelectionRange(t,e,i)}setRangeText(t,e,i,a){this._formControl?.setRangeText(t,e,i,a)}checkValidity(){return!s||(this._formControl?.checkValidity()??!0)}reportValidity(){const t=this.checkValidity();return this._invalid=!t,t}_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(...t){super(...t),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)((t,e)=>{if(!e)return t;let i=getComputedStyle(this).getPropertyValue(this._requiredMarkerCSSVar);return i||(i="*"),i.startsWith('"')&&i.endsWith('"')&&(i=i.slice(1,-1)),i?`${t}${i}`:t})}}return e.shadowRootOptions={mode:"open",delegatesFocus:!0},(0,a.Cg)([(0,r.MZ)()],e.prototype,"value",void 0),(0,a.Cg)([(0,r.MZ)()],e.prototype,"label",void 0),(0,a.Cg)([(0,r.MZ)()],e.prototype,"hint",void 0),(0,a.Cg)([(0,r.MZ)()],e.prototype,"placeholder",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"readonly",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],e.prototype,"required",void 0),(0,a.Cg)([(0,r.MZ)({type:Number})],e.prototype,"minlength",void 0),(0,a.Cg)([(0,r.MZ)({type:Number})],e.prototype,"maxlength",void 0),(0,a.Cg)([(0,r.MZ)()],e.prototype,"autocapitalize",void 0),(0,a.Cg)([(0,r.MZ)()],e.prototype,"autocomplete",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"autofocus",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"spellcheck",void 0),(0,a.Cg)([(0,r.MZ)()],e.prototype,"inputmode",void 0),(0,a.Cg)([(0,r.MZ)()],e.prototype,"enterkeyhint",void 0),(0,a.Cg)([(0,r.MZ)()],e.prototype,"name",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"disabled",void 0),(0,a.Cg)([(0,r.MZ)({attribute:"validation-message"})],e.prototype,"validationMessage",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"auto-validate"})],e.prototype,"autoValidate",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],e.prototype,"invalid",void 0),(0,a.Cg)([(0,r.wk)()],e.prototype,"_invalid",void 0),e},h=o.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)}`},69150(t,e,i){i.d(e,{$$:()=>v,AH:()=>o,NH:()=>p,QC:()=>a,Uc:()=>n,Zr:()=>u,ds:()=>g,hJ:()=>s,mp:()=>h,nx:()=>l,u6:()=>d,vU:()=>r,zn:()=>c});const a=(t,e,i)=>"run-start"===e.type?t={init_options:i,stage:"ready",run:e.data,events:[e],started:new Date(e.timestamp)}:t?((t="wake_word-start"===e.type?{...t,stage:"wake_word",wake_word:{...e.data,done:!1}}:"wake_word-end"===e.type?{...t,wake_word:{...t.wake_word,...e.data,done:!0}}:"stt-start"===e.type?{...t,stage:"stt",stt:{...e.data,done:!1}}:"stt-end"===e.type?{...t,stt:{...t.stt,...e.data,done:!0}}:"intent-start"===e.type?{...t,stage:"intent",intent:{...e.data,done:!1}}:"intent-end"===e.type?{...t,intent:{...t.intent,...e.data,done:!0}}:"tts-start"===e.type?{...t,stage:"tts",tts:{...e.data,done:!1}}:"tts-end"===e.type?{...t,tts:{...t.tts,...e.data,done:!0}}:"run-end"===e.type?{...t,finished:new Date(e.timestamp),stage:"done"}:"error"===e.type?{...t,finished:new Date(e.timestamp),stage:"error",error:e.data}:{...t}).events=[...t.events,e],t):void console.warn("Received unexpected event before receiving session",e),o=(t,e,i)=>{let o;const n=r(t,t=>{o=a(o,t,i),"run-end"!==t.type&&"error"!==t.type||n.then(t=>t()),o&&e(o)},i);return n},r=(t,e,i)=>t.connection.subscribeMessage(e,{...i,type:"assist_pipeline/run"}),n=(t,e)=>t.callWS({type:"assist_pipeline/pipeline_debug/list",pipeline_id:e}),s=(t,e,i)=>t.callWS({type:"assist_pipeline/pipeline_debug/get",pipeline_id:e,pipeline_run_id:i}),l=t=>t.callWS({type:"assist_pipeline/pipeline/list"}),h=(t,e)=>t.callWS({type:"assist_pipeline/pipeline/get",pipeline_id:e}),d=(t,e)=>t.callWS({type:"assist_pipeline/pipeline/create",...e}),c=(t,e,i)=>t.callWS({type:"assist_pipeline/pipeline/update",pipeline_id:e,...i}),p=(t,e)=>t.callWS({type:"assist_pipeline/pipeline/set_preferred",pipeline_id:e}),u=(t,e)=>t.callWS({type:"assist_pipeline/pipeline/delete",pipeline_id:e}),g=t=>t.callWS({type:"assist_pipeline/language/list"}),v=t=>t.callWS({type:"assist_pipeline/device/list"})},58129(t,e,i){i.d(e,{jJ:()=>r});i(18111),i(22489),i(61701);const a=t=>({...t,created:new Date(t.created)}),o=t=>({...t,created:new Date(t.created),content:t.content.map(a)}),r=(t,e,i)=>{let r=null;return t.connection.subscribeMessage(t=>{"initial_state"===t.event_type?(r=o(t.data),i(r)):"content_added"===t.event_type?r&&(r={...r,content:[...r.content,a(t.data.content)]},i(r)):"updated"===t.event_type?(r=o(t.data.chat_log),i(r)):"deleted"===t.event_type&&(r=null,i(null))},{type:"conversation/chat_log/subscribe",conversation_id:e})}},16869(t,e,i){i.d(e,{B:()=>o,g:()=>a});i(74423);const a=window.externalAppV2||window.externalApp||window.webkit?.messageHandlers?.getExternalAuth||location.search.includes("external_auth=1"),o=window.externalApp||window.externalAppV2},44249(t,e,i){i.d(e,{V:()=>a});const a=(t,e)=>{const i=new o,a=t.subscribeMessage(t=>e(i.processMessage(t)),{type:"persistent_notification/subscribe"});return()=>{a.then(t=>t?.())}};class o{processMessage(t){if("removed"===t.type)for(const e of Object.keys(t.notifications))delete this.notifications[e];else this.notifications={...this.notifications,...t.notifications};return Object.values(this.notifications)}constructor(){this.notifications={}}}},81310(t,e,i){i.a(t,async function(t,e){try{var a=i(62826),o=i(5124),r=i(22441),n=i(6412),s=i(26218),l=i(91926),h=i(90248),d=i(2054),c=i(14503),p=t([h,d]);[h,d]=p.then?(await p)():p;class u extends o.WF{render(){return o.qy` <div class="toolbar ${(0,n.H)({narrow:this.narrow})}"> <div class="toolbar-content"> ${this.mainPage||history.state?.root?o.qy` <ha-menu-button .hass="${this.hass}" .narrow="${this.narrow}"></ha-menu-button> `:this.backPath?o.qy` <ha-icon-button-arrow-prev href="${this.backPath}" .hass="${this.hass}"></ha-icon-button-arrow-prev> `:o.qy` <ha-icon-button-arrow-prev .hass="${this.hass}" @click="${this._backTapped}"></ha-icon-button-arrow-prev> `} <div class="main-title"> <slot name="header">${this.header}</slot> </div> <slot name="toolbar-icon"></slot> </div> </div> <div class="${(0,n.H)({content:!0,"ha-scrollbar":this.scrollable,"not-scrollable":!this.scrollable})}" @scroll="${this._saveScrollPos}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `}_saveScrollPos(t){this._savedScrollPos=t.target.scrollTop}_backTapped(){this.backCallback?this.backCallback():(0,l.OE)()}static get styles(){return[c.dp,o.AH`:host{display:block;height:100%;background-color:var(--primary-background-color);overflow:hidden;position:relative}:host([narrow]){width:100%;position:fixed}.toolbar{background-color:var(--app-header-background-color);padding-top:var(--safe-area-inset-top);padding-right:var(--safe-area-inset-right)}:host([narrow]) .toolbar{padding-left:var(--safe-area-inset-left)}.toolbar-content{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box;padding:8px 12px}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{display:flex;align-items:center;pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{margin-inline-start:var(--ha-space-6);line-height:var(--ha-line-height-normal);min-width:0;flex-grow:1;overflow-wrap:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.narrow .main-title{margin-inline-start:var(--ha-space-2)}.content{position:relative;width:calc(100% - var(--safe-area-inset-right,0px));height:calc(100% - 1px - var(--header-height,0px) - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));padding-bottom:var(--safe-area-inset-bottom,0px);margin-right:var(--safe-area-inset-right);overflow-y:auto;overflow:auto;-webkit-overflow-scrolling:touch}.content.not-scrollable{overflow:hidden;display:flex;flex-direction:column}:host([narrow]) .content{width:calc(100% - var(--safe-area-inset-left,0px) - var(--safe-area-inset-right,0px));margin-left:var(--safe-area-inset-left)}#fab{position:absolute;right:calc(16px + var(--safe-area-inset-right,0px));inset-inline-end:calc(16px + var(--safe-area-inset-right,0px));inset-inline-start:initial;bottom:calc(16px + var(--safe-area-inset-bottom,0px));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--ha-space-2);--ha-button-box-shadow:var(--ha-box-shadow-l)}:host([narrow]) #fab.tabs{bottom:calc(84px + var(--safe-area-inset-bottom,0px))}#fab[is-wide]{bottom:calc(24px + var(--safe-area-inset-bottom,0px));right:calc(24px + var(--safe-area-inset-right,0px));inset-inline-end:calc(24px + var(--safe-area-inset-right,0px));inset-inline-start:initial}`]}constructor(...t){super(...t),this.mainPage=!1,this.narrow=!1,this.scrollable=!0}}(0,a.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)()],u.prototype,"header",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,attribute:"main-page"})],u.prototype,"mainPage",void 0),(0,a.Cg)([(0,r.MZ)({type:String,attribute:"back-path"})],u.prototype,"backPath",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],u.prototype,"backCallback",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean,reflect:!0})],u.prototype,"narrow",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],u.prototype,"scrollable",void 0),(0,a.Cg)([(0,s.a)(".content")],u.prototype,"_savedScrollPos",void 0),(0,a.Cg)([(0,r.Ls)({passive:!0})],u.prototype,"_saveScrollPos",null),u=(0,a.Cg)([(0,r.EM)("hass-subpage")],u),e()}catch(t){e(t)}})},17894(t,e,i){i.d(e,{c:()=>r});var a=i(62826),o=i(22441);const r=t=>{class e extends t{constructor(...t){super(...t),this.disabled=!1,this.required=!1,this.unknown=!1,this.hideClearIcon=!1}}return(0,a.Cg)([(0,o.MZ)({type:Boolean})],e.prototype,"disabled",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean})],e.prototype,"required",void 0),(0,a.Cg)([(0,o.MZ)()],e.prototype,"icon",void 0),(0,a.Cg)([(0,o.MZ)()],e.prototype,"image",void 0),(0,a.Cg)([(0,o.MZ)()],e.prototype,"label",void 0),(0,a.Cg)([(0,o.MZ)()],e.prototype,"placeholder",void 0),(0,a.Cg)([(0,o.MZ)()],e.prototype,"helper",void 0),(0,a.Cg)([(0,o.MZ)()],e.prototype,"value",void 0),(0,a.Cg)([(0,o.MZ)({type:Boolean,reflect:!0})],e.prototype,"unknown",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"unknown-item-text"})],e.prototype,"unknownItemText",void 0),(0,a.Cg)([(0,o.MZ)({attribute:"hide-clear-icon",type:Boolean})],e.prototype,"hideClearIcon",void 0),(0,a.Cg)([(0,o.MZ)({attribute:!1})],e.prototype,"valueRenderer",void 0),e}},30034(t,e,i){i.a(t,async function(t,a){try{i.r(e),i.d(e,{AssistDebug:()=>d});var o=i(62826),r=i(5124),n=i(22441),s=i(54569),l=i(85161),h=t([s,l]);[s,l]=h.then?(await h)():h;class d extends r.WF{render(){const t=this.route.path.substring(1);return t?r.qy`<assist-pipeline-debug .hass="${this.hass}" .narrow="${this.narrow}" .pipelineId="${t}"></assist-pipeline-debug>`:r.qy`<assist-pipeline-run-debug .hass="${this.hass}" .narrow="${this.narrow}"></assist-pipeline-run-debug>`}constructor(...t){super(...t),this.narrow=!1}}(0,o.Cg)([(0,n.MZ)({attribute:!1})],d.prototype,"hass",void 0),(0,o.Cg)([(0,n.MZ)({type:Boolean})],d.prototype,"narrow",void 0),(0,o.Cg)([(0,n.MZ)({attribute:!1})],d.prototype,"route",void 0),d=(0,o.Cg)([(0,n.EM)("assist-debug")],d),a()}catch(t){a(t)}})},54569(t,e,i){i.a(t,async function(t,e){try{i(74423),i(18111),i(20116);var a=i(62826),o=i(5124),r=i(22441),n=i(75751),s=i(95747),l=i(69150),h=i(65063),d=i(81310),c=i(14503),p=i(90056),u=i(58129),g=t([d,p,s]);[d,p,s]=g.then?(await g)():g;const v="M8,7A2,2 0 0,1 10,9V14A2,2 0 0,1 8,16A2,2 0 0,1 6,14V9A2,2 0 0,1 8,7M14,14C14,16.97 11.84,19.44 9,19.92V22H7V19.92C4.16,19.44 2,16.97 2,14H4A4,4 0 0,0 8,18A4,4 0 0,0 12,14H14M21.41,9.41L17.17,13.66L18.18,10H14A2,2 0 0,1 12,8V4A2,2 0 0,1 14,2H20A2,2 0 0,1 22,4V8C22,8.55 21.78,9.05 21.41,9.41Z",m="M1,12L5,16V13H17.17C17.58,14.17 18.69,15 20,15A3,3 0 0,0 23,12A3,3 0 0,0 20,9C18.69,9 17.58,9.83 17.17,11H5V8L1,12Z",b="M23,12L19,16V13H6.83C6.42,14.17 5.31,15 4,15A3,3 0 0,1 1,12A3,3 0 0,1 4,9C5.31,9 6.42,9.83 6.83,11H19V8L23,12Z";class y extends o.WF{render(){return o.qy`<hass-subpage .narrow="${this.narrow}" .hass="${this.hass}" .header="${this.hass.localize("ui.panel.config.voice_assistants.debug.header")}"> <ha-icon-button .path="${v}" .label="${this.hass.localize("ui.panel.config.voice_assistants.debug.start_debug_run")}" href="/config/voice-assistants/debug?pipeline=${this.pipelineId}" slot="toolbar-icon"></ha-icon-button> <div class="toolbar"> ${this._runs?.length?o.qy` <ha-icon-button .disabled="${this._runs[this._runs.length-1].pipeline_run_id===this._runId}" .label="${this.hass.localize("ui.panel.config.voice_assistants.debug.older_run")}" @click="${this._pickOlderRun}" .path="${m}"></ha-icon-button> <select .value="${this._runId}" @change="${this._pickRun}"> ${(0,n.u)(this._runs,t=>t.pipeline_run_id,t=>o.qy`<option value="${t.pipeline_run_id}"> ${(0,s.yg)(new Date(t.timestamp),this.hass.locale,this.hass.config)} </option>`)} </select> <ha-icon-button .disabled="${this._runs[0].pipeline_run_id===this._runId}" .label="${this.hass.localize("ui.panel.config.voice_assistants.debug.newer_run")}" @click="${this._pickNewerRun}" .path="${b}"></ha-icon-button> `:""} </div> ${0===this._runs?.length?o.qy`<div class="container"> ${this.hass.localize("ui.panel.config.voice_assistants.debug.no_runs_found")} </div>`:""} <div class="content"> ${this._events?o.qy`<assist-render-pipeline-events .hass="${this.hass}" .events="${this._events}" .chatLog="${this._chatLog}"></assist-render-pipeline-events>`:""} </div> </hass-subpage>`}willUpdate(t){let e=!1;t.has("pipelineId")&&(this._fetchRuns(),e=!0),t.has("_runId")&&(this._unsubChatLogUpdates&&(this._unsubChatLogUpdates.then(t=>t()),this._unsubChatLogUpdates=void 0),this._fetchEvents(),e=!0),e&&this._unsubRefreshEventsID&&(clearTimeout(this._unsubRefreshEventsID),this._unsubRefreshEventsID=void 0)}disconnectedCallback(){super.disconnectedCallback(),this._unsubRefreshEventsID&&(clearTimeout(this._unsubRefreshEventsID),this._unsubRefreshEventsID=void 0),this._unsubChatLogUpdates&&(this._unsubChatLogUpdates.then(t=>t()),this._unsubChatLogUpdates=void 0)}async _fetchRuns(){if(this.pipelineId){try{this._runs=(await(0,l.Uc)(this.hass,this.pipelineId)).pipeline_runs.reverse()}catch(t){return void(0,h.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.voice_assistants.debug.error.fetch_runs"),text:t.message})}this._runs.length&&(this._runId&&this._runs.find(t=>t.pipeline_run_id===this._runId)||(this._runId=this._runs[0].pipeline_run_id,this._fetchEvents()))}else this._runs=void 0}async _fetchEvents(){if(this._runId){try{this._events=(await(0,l.hJ)(this.hass,this.pipelineId,this._runId)).events}catch(t){return void(0,h.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.voice_assistants.debug.error.fetch_events"),text:t.message})}this._events.length&&(this._unsubChatLogUpdates||"run-start"!==this._events[0].type||(this._unsubChatLogUpdates=(0,u.jJ)(this.hass,this._events[0].data.conversation_id,t=>{t?this._chatLog=t:(this._unsubChatLogUpdates?.then(t=>t()),this._unsubChatLogUpdates=void 0)}),this._unsubChatLogUpdates.catch(()=>{this._unsubChatLogUpdates=void 0})),["run-end","error"].includes(this._events[this._events.length-1].type)||(this._unsubRefreshEventsID=window.setTimeout(()=>{this._fetchEvents()},2e3)))}else this._events=void 0}_pickOlderRun(){const t=this._runs.findIndex(t=>t.pipeline_run_id===this._runId);this._runId=this._runs[t+1].pipeline_run_id}_pickNewerRun(){const t=this._runs.findIndex(t=>t.pipeline_run_id===this._runId);this._runId=this._runs[t-1].pipeline_run_id}_pickRun(t){this._runId=t.target.value}constructor(...t){super(...t),this.narrow=!1}}y.styles=[c.RF,o.AH`.toolbar{display:flex;align-items:center;justify-content:center;height:var(--header-height);background-color:var(--primary-background-color);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box}.content{padding:24px 0 32px;max-width:600px;margin:0 auto;direction:ltr}.container{padding:16px}assist-render-pipeline-run{padding-top:16px}`],(0,a.Cg)([(0,r.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],y.prototype,"narrow",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],y.prototype,"route",void 0),(0,a.Cg)([(0,r.MZ)({attribute:!1})],y.prototype,"pipelineId",void 0),(0,a.Cg)([(0,r.wk)()],y.prototype,"_runId",void 0),(0,a.Cg)([(0,r.wk)()],y.prototype,"_runs",void 0),(0,a.Cg)([(0,r.wk)()],y.prototype,"_events",void 0),(0,a.Cg)([(0,r.wk)()],y.prototype,"_chatLog",void 0),y=(0,a.Cg)([(0,r.EM)("assist-pipeline-debug")],y),e()}catch(t){e(t)}})},85161(t,e,i){i.a(t,async function(t,e){try{i(74423),i(44114),i(16573),i(78100),i(77936),i(18111),i(61701),i(33110),i(37467),i(44732),i(79577),i(16632),i(34226),i(9486),i(20456);var a=i(62826),o=i(5124),r=i(22441),n=i(6030),s=i(44643),l=i(18350),h=(i(9503),i(91485)),d=i(69150),c=i(65063),p=i(81310),u=i(14503),g=i(74209),v=i(30039),m=i(7724),b=i(58129),y=t([s,l,h,p,m]);[s,l,h,p,m]=y.then?(await y)():y;class f extends o.WF{render(){return o.qy` <hass-subpage .narrow="${this.narrow}" .hass="${this.hass}" .header="${this.hass.localize("ui.panel.config.voice_assistants.debug.pipeline.header")}"> ${this._pipelineRuns.length>0?o.qy` <ha-button slot="toolbar-icon" @click="${this._clearConversation}" .disabled="${!this._finished}" appearance="plain"> ${this.hass.localize("ui.common.clear")} </ha-button> <ha-button appearance="plain" slot="toolbar-icon" @click="${this._downloadConversation}"> ${this.hass.localize("ui.common.download")} </ha-button> `:""} <div class="content"> <div class="start-row"> ${0===this._pipelineRuns.length?o.qy` <ha-assist-pipeline-picker .hass="${this.hass}" .value="${this._pipelineId}" @value-changed="${this._pipelinePicked}"></ha-assist-pipeline-picker> <div class="start-buttons"> <ha-button appearance="filled" @click="${this._runTextPipeline}"> ${this.hass.localize("ui.panel.config.voice_assistants.debug.pipeline.run_text_pipeline")} </ha-button> <ha-button appearance="filled" @click="${this._runAudioPipeline}" .disabled="${!window.isSecureContext||!(window.AudioContext||window.webkitAudioContext)}"> ${this.hass.localize("ui.panel.config.voice_assistants.debug.pipeline.run_audio_pipeline")} </ha-button> <ha-button appearance="filled" @click="${this._runAudioWakeWordPipeline}" .disabled="${!window.isSecureContext||!(window.AudioContext||window.webkitAudioContext)}"> ${this.hass.localize("ui.panel.config.voice_assistants.debug.pipeline.run_audio_with_wake")} </ha-button> </div> `:"intent"===this._pipelineRuns[0].init_options.start_stage?o.qy` <ha-input id="continue-conversation-text" .label="${this.hass.localize("ui.panel.config.voice_assistants.debug.pipeline.response")}" .disabled="${!this._finished}" @keydown="${this._handleContinueKeyDown}"></ha-input> <ha-button @click="${this._runTextPipeline}" .disabled="${!this._finished}"> ${this.hass.localize("ui.panel.config.voice_assistants.debug.pipeline.send")} </ha-button> `:this._finished?"wake_word"===this._pipelineRuns[0].init_options.start_stage?o.qy` <ha-button appearance="filled" @click="${this._runAudioWakeWordPipeline}"> ${this.hass.localize("ui.panel.config.voice_assistants.debug.pipeline.continue_listening")} </ha-button> `:o.qy`<ha-button appearance="filled" @click="${this._runAudioPipeline}"> ${this.hass.localize("ui.panel.config.voice_assistants.debug.pipeline.continue_talking")} </ha-button>`:o.qy` <ha-checkbox id="continue-conversation" checked="checked"> ${this.hass.localize("ui.panel.config.voice_assistants.debug.pipeline.continue_conversation")} </ha-checkbox> `} </div> ${this._pipelineRuns.map(t=>null===t?"":o.qy` <assist-render-pipeline-run .hass="${this.hass}" .pipelineRun="${t}" .chatLog="${this._chatLog}"></assist-render-pipeline-run> `)} </div> </hass-subpage> `}disconnectedCallback(){super.disconnectedCallback(),this._chatLogSubscription&&(this._chatLogSubscription.unsub.then(t=>t()),this._chatLogSubscription=null)}get conversationId(){return 0===this._pipelineRuns.length?null:this._pipelineRuns[0].intent?.intent_output?.conversation_id||null}async _runTextPipeline(){const t=this._continueConversationTextField;let e;e=t?t.value??null:await(0,c.an)(this,{title:this.hass.localize("ui.panel.config.voice_assistants.debug.pipeline.input_text"),confirmText:this.hass.localize("ui.panel.config.voice_assistants.debug.pipeline.run")}),e&&await this._doRunPipeline(e=>{["done","error"].includes(e.stage)&&(this._finished=!0,t&&(t.value=""))},{start_stage:"intent",end_stage:"intent",input:{text:e}})}async _runAudioWakeWordPipeline(){const t=new g.N(t=>{this._audioBuffer?this._audioBuffer.push(t):this._sendAudioChunk(t)});let e;this._audioBuffer=[],await t.start();let i=()=>{if(i=void 0,t.close(),"stt"===e?.stage&&!1===e.stt.done){if(this._audioBuffer)for(const t of this._audioBuffer)this._sendAudioChunk(t);this._sendAudioChunk(new Int16Array)}this._audioBuffer=void 0};await this._doRunPipeline(t=>{if(e=t,"wake_word"===t.stage&&this._audioBuffer){for(const t of this._audioBuffer)this._sendAudioChunk(t);this._audioBuffer=void 0}if(!["ready","wake_word","stt"].includes(t.stage)&&i&&i(),"done"!==t.stage||t.error)("done"===t.stage&&t.error||"error"===t.stage)&&(this._finished=!0);else{const e=t.tts.tts_output.url,i=new Audio(e);i.addEventListener("ended",()=>{this.isConnected&&this._continueConversationCheckbox.checked?this._runAudioWakeWordPipeline():this._finished=!0}),i.play()}},{start_stage:"wake_word",end_stage:"tts",input:{sample_rate:t.sampleRate}})}async _runAudioPipeline(){const t=new g.N(t=>{this._audioBuffer?this._audioBuffer.push(t):this._sendAudioChunk(t)});let e;this._audioBuffer=[],await t.start();let i=()=>{if(i=void 0,t.close(),"stt"===e?.stage&&!1===e.stt.done){if(this._audioBuffer)for(const t of this._audioBuffer)this._sendAudioChunk(t);this._sendAudioChunk(new Int16Array)}this._audioBuffer=void 0};await this._doRunPipeline(t=>{if(e=t,"stt"===t.stage&&this._audioBuffer){for(const t of this._audioBuffer)this._sendAudioChunk(t);this._audioBuffer=void 0}if(!["ready","stt"].includes(t.stage)&&i&&i(),"done"===t.stage){const e=t.tts.tts_output.url,i=new Audio(e);i.addEventListener("ended",()=>{this.isConnected&&this._continueConversationCheckbox.checked?this._runAudioPipeline():this._finished=!0}),i.play()}else"error"===t.stage&&(this._finished=!0)},{start_stage:"stt",end_stage:"tts",input:{sample_rate:t.sampleRate}})}async _doRunPipeline(t,e){this._finished=!1;let i=!1;try{await(0,d.AH)(this.hass,e=>{i?this._pipelineRuns=[e,...this._pipelineRuns.slice(1)]:(this._pipelineRuns=[e,...this._pipelineRuns],i=!0),t(e);const a=this.conversationId;this._chatLog||!a||this._chatLogSubscription&&this._chatLogSubscription.conversationId===a||(this._chatLogSubscription&&this._chatLogSubscription.unsub.then(t=>t()),this._chatLogSubscription={conversationId:a,unsub:(0,b.jJ)(this.hass,a,t=>{t?this._chatLog=t:(this._chatLogSubscription?.unsub.then(t=>t()),this._chatLogSubscription=null)})},this._chatLogSubscription.unsub.catch(()=>{this._chatLogSubscription=null}))},{...e,pipeline:this._pipelineId,conversation_id:this.conversationId})}catch(t){await(0,c.showAlertDialog)(this,{title:this.hass.localize("ui.panel.config.voice_assistants.debug.pipeline.error_starting"),text:t.message||t})}}_sendAudioChunk(t){this.hass.connection.socket.binaryType="arraybuffer";const e=new Uint8Array(1+2*t.length);e[0]=this._pipelineRuns[0].run.runner_data.stt_binary_handler_id,e.set(new Uint8Array(t.buffer),1),this.hass.connection.socket.send(e)}_handleContinueKeyDown(t){"Enter"===t.key&&this._runTextPipeline()}_clearConversation(){this._pipelineRuns=[]}_downloadConversation(){(0,v.R)(`data:text/plain;charset=utf-8,${encodeURIComponent(JSON.stringify(this._pipelineRuns,null,2))}`,"conversation.json")}_pipelinePicked(t){this._pipelineId=t.detail.value}constructor(...t){super(...t),this.narrow=!1,this._pipelineRuns=[],this._finished=!1,this._pipelineId=(0,n.p9)("pipeline")||void 0,this._chatLogSubscription=null}}f.styles=[u.RF,o.AH`.content{padding:24px 0 32px;max-width:600px;margin:0 auto;direction:ltr}.start-buttons{display:flex;flex-wrap:wrap;gap:var(--ha-space-2);align-items:center;justify-content:center}.start-row{display:flex;justify-content:space-around;align-items:center;flex-wrap:wrap;margin:0 16px 16px;direction:var(--direction)}ha-assist-pipeline-picker{display:block;width:100%;margin-bottom:16px}.start-row ha-input{flex:1}assist-render-pipeline-run{padding-top:16px}assist-render-pipeline-run+assist-render-pipeline-run{border-top:1px solid var(--divider-color)}`],(0,a.Cg)([(0,r.MZ)({attribute:!1})],f.prototype,"hass",void 0),(0,a.Cg)([(0,r.MZ)({type:Boolean})],f.prototype,"narrow",void 0),(0,a.Cg)([(0,r.wk)()],f.prototype,"_pipelineRuns",void 0),(0,a.Cg)([(0,r.P)("#continue-conversation")],f.prototype,"_continueConversationCheckbox",void 0),(0,a.Cg)([(0,r.P)("#continue-conversation-text")],f.prototype,"_continueConversationTextField",void 0),(0,a.Cg)([(0,r.wk)()],f.prototype,"_finished",void 0),(0,a.Cg)([(0,r.wk)()],f.prototype,"_pipelineId",void 0),(0,a.Cg)([(0,r.wk)()],f.prototype,"_chatLog",void 0),f=(0,a.Cg)([(0,r.EM)("assist-pipeline-run-debug")],f),e()}catch(t){e(t)}})},14503(t,e,i){i.d(e,{RF:()=>r,dp:()=>l,kO:()=>s,nA:()=>n,og:()=>o});var a=i(5124);const o=a.AH`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`,r=a.AH`:host{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}.header{transition:box-shadow .2s linear,width var(--ha-animation-duration-normal) ease,padding-left var(--ha-animation-duration-normal) ease,padding-right var(--ha-animation-duration-normal) ease}@media (prefers-reduced-motion:reduce){.header{transition:box-shadow .2s linear}}h1{font-family:var(--ha-font-family-heading);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed)}h2{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-normal)}h3{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-l);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}${o} .card-actions a{text-decoration:none}.card-actions .warning{--mdc-theme-primary:var(--error-color)}.layout.horizontal,.layout.vertical{display:flex}.layout.inline{display:inline-flex}.layout.horizontal{flex-direction:row}.layout.vertical{flex-direction:column}.layout.wrap{flex-wrap:wrap}.layout.no-wrap{flex-wrap:nowrap}.layout.center,.layout.center-center{align-items:center}.layout.bottom{align-items:flex-end}.layout.center-center,.layout.center-justified{justify-content:center}.flex{flex:1;flex-basis:0.000000001px}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.layout.justified{justify-content:space-between}`,n=a.AH`ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:400px;--mdc-dialog-max-width:600px;--mdc-dialog-max-width:min(600px, 95vw);--justify-action-buttons:space-between;--dialog-container-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--dialog-surface-padding:0px}ha-adaptive-dialog .form,ha-dialog .form{color:var(--primary-text-color)}a{color:var(--primary-color)}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:100vw;--mdc-dialog-max-width:100vw;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--dialog-container-padding:0px;--dialog-surface-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--vertical-align-dialog:flex-end}ha-dialog{--ha-dialog-border-radius:var(--ha-border-radius-square)}}.error{color:var(--error-color)}`,s=a.AH`ha-adaptive-dialog,ha-dialog{--vertical-align-dialog:flex-start;--dialog-surface-margin-top:var(--ha-space-10);--mdc-dialog-max-height:calc(
      100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--mdc-dialog-max-height:calc(
      100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--ha-dialog-max-height:calc(
      100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    );--ha-dialog-max-height:calc(
      100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var(
          --safe-area-inset-y,
          0px
        )
    )}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--dialog-surface-margin-top:0px;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--ha-dialog-max-height:100vh;--ha-dialog-max-height:100svh}}`,l=a.AH`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{border-radius:var(--ha-border-radius-sm);background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`;a.AH`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`},74209(t,e,i){i.d(e,{N:()=>a});i(14603),i(47566),i(98721);class a{get active(){return this._active}get sampleRate(){return this._context?.sampleRate}static get isSupported(){return window.isSecureContext&&(window.AudioContext||window.webkitAudioContext)}async start(){if(this._context&&this._stream&&this._source&&this._recorder)this._stream.getTracks()[0].enabled=!0,await this._context.resume(),this._active=!0;else try{await this._createContext()}catch(t){console.error(t),this._active=!1}}async stop(){this._active=!1,this._stream&&(this._stream.getTracks()[0].enabled=!1),await(this._context?.suspend())}close(){this._active=!1,this._stream?.getTracks()[0].stop(),this._recorder&&(this._recorder.port.onmessage=null),this._source?.disconnect(),this._context?.close(),this._stream=void 0,this._source=void 0,this._recorder=void 0,this._context=void 0}async _createContext(){const t=new(AudioContext||webkitAudioContext);this._stream=await navigator.mediaDevices.getUserMedia({audio:!0}),await t.audioWorklet.addModule(new URL(i.p+i.u(33921),i.b)),this._context=t,this._source=this._context.createMediaStreamSource(this._stream),this._recorder=new AudioWorkletNode(this._context,"recorder-worklet"),this._recorder.port.onmessage=t=>{this._active&&this._callback(t.data)},this._active=!0,this._source.connect(this._recorder)}constructor(t){this._active=!1,this._callback=t}}},36918(t,e,i){i.d(e,{o:()=>a});const a=(t,e)=>`https://www.iobroker.net/#${t.language&&t.language.split("-")[0]||"en"}/adapters/adapterref/iobroker.lovelace/README.md#`},30039(t,e,i){i.d(e,{R:()=>o});i(14603),i(47566),i(98721);var a=i(16869);const o=(t,e="")=>{const i=document.createElement("a");i.target="_blank",i.href=t,i.download=e,i.style.display="none",document.body.appendChild(i),i.dispatchEvent(new MouseEvent("click")),document.body.removeChild(i),t.startsWith("blob:")&&(a.B?setTimeout(()=>URL.revokeObjectURL(t),1e4):URL.revokeObjectURL(t))}},89429(t){t.exports=function(){}}};