329 files

This commit is contained in:
Home Assistant Version Control committed 2026-08-06 13:56:25 +00:00
1 parent 0df89406fa
commit 7afe7add1d
330 files changed
+13098 -5942

No files matched your search

@@ -1,9 +1,9 @@
/*! maintenance_supporter frontend 2.46.0 */
var _t=Object.defineProperty;var Ci=Object.getOwnPropertyDescriptor;var w=(a,s,e)=>()=>{if(e)throw e[0];try{return a&&(s=a(a=0)),s}catch(t){throw e=[t],t}};var Li=(a,s)=>{for(var e in s)_t(a,e,{get:s[e],enumerable:!0})};var l=(a,s,e,t)=>{for(var i=t>1?void 0:t?Ci(s,e):s,n=a.length-1,c;n>=0;n--)(c=a[n])&&(i=(t?c(s,e,i):c(i))||i);return t&&i&&_t(s,e,i),i};var Ee,Se,Fe,gt,pe,mt,E,ft,Ue,Ve=w(()=>{Ee=globalThis,Se=Ee.ShadowRoot&&(Ee.ShadyCSS===void 0||Ee.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fe=Symbol(),gt=new WeakMap,pe=class{constructor(s,e,t){if(this._$cssResult$=!0,t!==Fe)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=s,this.t=e}get styleSheet(){let s=this.o,e=this.t;if(Se&&s===void 0){let t=e!==void 0&&e.length===1;t&&(s=gt.get(e)),s===void 0&&((this.o=s=new CSSStyleSheet).replaceSync(this.cssText),t&&gt.set(e,s))}return s}toString(){return this.cssText}},mt=a=>new pe(typeof a=="string"?a:a+"",void 0,Fe),E=(a,...s)=>{let e=a.length===1?a[0]:s.reduce((t,i,n)=>t+(c=>{if(c._$cssResult$===!0)return c.cssText;if(typeof c=="number")return c;throw Error("Value passed to 'css' function must be a 'css' function result: "+c+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+a[n+1],a[0]);return new pe(e,a,Fe)},ft=(a,s)=>{if(Se)a.adoptedStyleSheets=s.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of s){let t=document.createElement("style"),i=Ee.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,a.appendChild(t)}},Ue=Se?a=>a:a=>a instanceof CSSStyleSheet?(s=>{let e="";for(let t of s.cssRules)e+=t.cssText;return mt(e)})(a):a});var Ii,Pi,Ri,ji,Hi,Ni,Ae,vt,qi,zi,he,ue,Te,bt,V,_e=w(()=>{Ve();Ve();({is:Ii,defineProperty:Pi,getOwnPropertyDescriptor:Ri,getOwnPropertyNames:ji,getOwnPropertySymbols:Hi,getPrototypeOf:Ni}=Object),Ae=globalThis,vt=Ae.trustedTypes,qi=vt?vt.emptyScript:"",zi=Ae.reactiveElementPolyfillSupport,he=(a,s)=>a,ue={toAttribute(a,s){switch(s){case Boolean:a=a?qi:null;break;case Object:case Array:a=a==null?a:JSON.stringify(a)}return a},fromAttribute(a,s){let e=a;switch(s){case Boolean:e=a!==null;break;case Number:e=a===null?null:Number(a);break;case Object:case Array:try{e=JSON.parse(a)}catch{e=null}}return e}},Te=(a,s)=>!Ii(a,s),bt={attribute:!0,type:String,converter:ue,reflect:!1,useDefault:!1,hasChanged:Te};Symbol.metadata??=Symbol("metadata"),Ae.litPropertyMetadata??=new WeakMap;V=class extends HTMLElement{static addInitializer(s){this._$Ei(),(this.l??=[]).push(s)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(s,e=bt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(s)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(s,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(s,t,e);i!==void 0&&Pi(this.prototype,s,i)}}static getPropertyDescriptor(s,e,t){let{get:i,set:n}=Ri(this.prototype,s)??{get(){return this[e]},set(c){this[e]=c}};return{get:i,set(c){let d=i?.call(this);n?.call(this,c),this.requestUpdate(s,d,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(s){return this.elementProperties.get(s)??bt}static _$Ei(){if(this.hasOwnProperty(he("elementProperties")))return;let s=Ni(this);s.finalize(),s.l!==void 0&&(this.l=[...s.l]),this.elementProperties=new Map(s.elementProperties)}static finalize(){if(this.hasOwnProperty(he("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(he("properties"))){let e=this.properties,t=[...ji(e),...Hi(e)];for(let i of t)this.createProperty(i,e[i])}let s=this[Symbol.metadata];if(s!==null){let e=litPropertyMetadata.get(s);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){let e=[];if(Array.isArray(s)){let t=new Set(s.flat(1/0).reverse());for(let i of t)e.unshift(Ue(i))}else s!==void 0&&e.push(Ue(s));return e}static _$Eu(s,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof s=="string"?s.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(s=>this.enableUpdating=s),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(s=>s(this))}addController(s){(this._$EO??=new Set).add(s),this.renderRoot!==void 0&&this.isConnected&&s.hostConnected?.()}removeController(s){this._$EO?.delete(s)}_$E_(){let s=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(s.set(t,this[t]),delete this[t]);s.size>0&&(this._$Ep=s)}createRenderRoot(){let s=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ft(s,this.constructor.elementStyles),s}connectedCallback(){this.renderRoot??=thiLine truncated
/*! maintenance_supporter frontend 2.52.0 */
var _t=Object.defineProperty;var Li=Object.getOwnPropertyDescriptor;var w=(a,s,e)=>()=>{if(e)throw e[0];try{return a&&(s=a(a=0)),s}catch(t){throw e=[t],t}};var Ii=(a,s)=>{for(var e in s)_t(a,e,{get:s[e],enumerable:!0})};var l=(a,s,e,t)=>{for(var i=t>1?void 0:t?Li(s,e):s,n=a.length-1,c;n>=0;n--)(c=a[n])&&(i=(t?c(s,e,i):c(i))||i);return t&&i&&_t(s,e,i),i};var Ee,Se,Fe,gt,pe,mt,E,ft,Ue,Ve=w(()=>{Ee=globalThis,Se=Ee.ShadowRoot&&(Ee.ShadyCSS===void 0||Ee.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Fe=Symbol(),gt=new WeakMap,pe=class{constructor(s,e,t){if(this._$cssResult$=!0,t!==Fe)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=s,this.t=e}get styleSheet(){let s=this.o,e=this.t;if(Se&&s===void 0){let t=e!==void 0&&e.length===1;t&&(s=gt.get(e)),s===void 0&&((this.o=s=new CSSStyleSheet).replaceSync(this.cssText),t&&gt.set(e,s))}return s}toString(){return this.cssText}},mt=a=>new pe(typeof a=="string"?a:a+"",void 0,Fe),E=(a,...s)=>{let e=a.length===1?a[0]:s.reduce((t,i,n)=>t+(c=>{if(c._$cssResult$===!0)return c.cssText;if(typeof c=="number")return c;throw Error("Value passed to 'css' function must be a 'css' function result: "+c+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+a[n+1],a[0]);return new pe(e,a,Fe)},ft=(a,s)=>{if(Se)a.adoptedStyleSheets=s.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(let e of s){let t=document.createElement("style"),i=Ee.litNonce;i!==void 0&&t.setAttribute("nonce",i),t.textContent=e.cssText,a.appendChild(t)}},Ue=Se?a=>a:a=>a instanceof CSSStyleSheet?(s=>{let e="";for(let t of s.cssRules)e+=t.cssText;return mt(e)})(a):a});var Pi,Ri,ji,Hi,Ni,qi,Ae,vt,Mi,zi,he,ue,Te,bt,V,_e=w(()=>{Ve();Ve();({is:Pi,defineProperty:Ri,getOwnPropertyDescriptor:ji,getOwnPropertyNames:Hi,getOwnPropertySymbols:Ni,getPrototypeOf:qi}=Object),Ae=globalThis,vt=Ae.trustedTypes,Mi=vt?vt.emptyScript:"",zi=Ae.reactiveElementPolyfillSupport,he=(a,s)=>a,ue={toAttribute(a,s){switch(s){case Boolean:a=a?Mi:null;break;case Object:case Array:a=a==null?a:JSON.stringify(a)}return a},fromAttribute(a,s){let e=a;switch(s){case Boolean:e=a!==null;break;case Number:e=a===null?null:Number(a);break;case Object:case Array:try{e=JSON.parse(a)}catch{e=null}}return e}},Te=(a,s)=>!Pi(a,s),bt={attribute:!0,type:String,converter:ue,reflect:!1,useDefault:!1,hasChanged:Te};Symbol.metadata??=Symbol("metadata"),Ae.litPropertyMetadata??=new WeakMap;V=class extends HTMLElement{static addInitializer(s){this._$Ei(),(this.l??=[]).push(s)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(s,e=bt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(s)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(s,e),!e.noAccessor){let t=Symbol(),i=this.getPropertyDescriptor(s,t,e);i!==void 0&&Ri(this.prototype,s,i)}}static getPropertyDescriptor(s,e,t){let{get:i,set:n}=ji(this.prototype,s)??{get(){return this[e]},set(c){this[e]=c}};return{get:i,set(c){let d=i?.call(this);n?.call(this,c),this.requestUpdate(s,d,t)},configurable:!0,enumerable:!0}}static getPropertyOptions(s){return this.elementProperties.get(s)??bt}static _$Ei(){if(this.hasOwnProperty(he("elementProperties")))return;let s=qi(this);s.finalize(),s.l!==void 0&&(this.l=[...s.l]),this.elementProperties=new Map(s.elementProperties)}static finalize(){if(this.hasOwnProperty(he("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(he("properties"))){let e=this.properties,t=[...Hi(e),...Ni(e)];for(let i of t)this.createProperty(i,e[i])}let s=this[Symbol.metadata];if(s!==null){let e=litPropertyMetadata.get(s);if(e!==void 0)for(let[t,i]of e)this.elementProperties.set(t,i)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let i=this._$Eu(e,t);i!==void 0&&this._$Eh.set(i,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(s){let e=[];if(Array.isArray(s)){let t=new Set(s.flat(1/0).reverse());for(let i of t)e.unshift(Ue(i))}else s!==void 0&&e.push(Ue(s));return e}static _$Eu(s,e){let t=e.attribute;return t===!1?void 0:typeof t=="string"?t:typeof s=="string"?s.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise(s=>this.enableUpdating=s),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach(s=>s(this))}addController(s){(this._$EO??=new Set).add(s),this.renderRoot!==void 0&&this.isConnected&&s.hostConnected?.()}removeController(s){this._$EO?.delete(s)}_$E_(){let s=new Map,e=this.constructor.elementProperties;for(let t of e.keys())this.hasOwnProperty(t)&&(s.set(t,this[t]),delete this[t]);s.size>0&&(this._$Ep=s)}createRenderRoot(){let s=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ft(s,this.constructor.elementStyles),s}connectedCallback(){this.renderRoot??=thiLine truncated
\f\r]`,ge=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,wt=/-->/g,$t=/>/g,Z=RegExp(`>|${Be}(?:([^\\s"'>=/]+)(${Be}*=${Be}*(?:[^
\f\r"'\`<>=]|("|')|))|$)`,"g"),kt=/'/g,Et=/"/g,Ct=/^(?:script|style|textarea|title)$/i,Xe=a=>(s,...e)=>({_$litType$:a,strings:s,values:e}),o=Xe(1),oe=Xe(2),js=Xe(3),te=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),St=new WeakMap,X=ee.createTreeWalker(ee,129);Di=(a,s)=>{let e=a.length-1,t=[],i,n=s===2?"<svg>":s===3?"<math>":"",c=ge;for(let d=0;d<e;d++){let u=a[d],_,v,f=-1,b=0;for(;b<u.length&&(c.lastIndex=b,v=c.exec(u),v!==null);)b=c.lastIndex,c===ge?v[1]==="!--"?c=wt:v[1]!==void 0?c=$t:v[2]!==void 0?(Ct.test(v[2])&&(i=RegExp("</"+v[2],"g")),c=Z):v[3]!==void 0&&(c=Z):c===Z?v[0]===">"?(c=i??ge,f=-1):v[1]===void 0?f=-2:(f=c.lastIndex-v[2].length,_=v[1],c=v[3]===void 0?Z:v[3]==='"'?Et:kt):c===Et||c===kt?c=Z:c===wt||c===$t?c=ge:(c=Z,i=void 0);let g=c===Z&&a[d+1].startsWith("/>")?" ":"";n+=c===ge?u+Mi:f>=0?(t.push(_),u.slice(0,f)+At+u.slice(f)+J+g):u+J+(f===-2?d:g)}return[Lt(a,n+(a[e]||"<?>")+(s===2?"</svg>":s===3?"</math>":"")),t]},ve=class a{constructor({strings:s,_$litType$:e},t){let i;this.parts=[];let n=0,c=0,d=s.length-1,u=this.parts,[_,v]=Di(s,e);if(this.el=a.createElement(_,t),X.currentNode=this.el.content,e===2||e===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=X.nextNode())!==null&&u.length<d;){if(i.nodeType===1){if(i.hasAttributes())for(let f of i.getAttributeNames())if(f.endsWith(At)){let b=v[c++],g=i.getAttribute(f).split(J),x=/([.?@])?(.*)/.exec(b);u.push({type:1,index:n,name:x[2],strings:g,ctor:x[1]==="."?Ge:x[1]==="?"?Ke:x[1]==="@"?Ye:ne}),i.removeAttribute(f)}else f.startsWith(J)&&(u.push({type:6,index:n}),i.removeAttribute(f));if(Ct.test(i.tagName)){let f=i.textContent.split(J),b=f.length-1;if(b>0){i.textContent=Ce?Ce.emptyScript:"";for(let g=0;g<b;g++)i.append(f[g],me()),X.nextNode(),u.push({type:2,index:++n});i.append(f[b],me())}}}else if(i.nodeType===8)if(i.data===Tt)u.push({type:2,index:n});else{let f=-1;for(;(f=i.data.indexOf(J,f+1))!==-1;)u.push({type:7,index:n}),f+=J.length-1}n++}}static createElement(s,e){let t=ee.createElement("template");return t.innerHTML=s,t}};We=class{constructor(s,e){this._$AV=[],this._$AN=void 0,this._$AD=s,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(s){let{el:{content:e},parts:t}=this._$AD,i=(s?.creationScope??ee).importNode(e,!0);X.currentNode=i;let n=X.nextNode(),c=0,d=0,u=t[0];for(;u!==void 0;){if(c===u.index){let _;u.type===2?_=new be(n,n.nextSibling,this,s):u.type===1?_=new u.ctor(n,u.name,u.strings,this,s):u.type===6&&(_=new Je(n,this,s)),this._$AV.push(_),u=t[++d]}c!==u?.index&&(n=X.nextNode(),c++)}return X.currentNode=ee,i}p(s){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(s,t,e),e+=t.strings.length-2):t._$AI(s[e])),e++}},be=class a{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(s,e,t,i){this.type=2,this._$AH=h,this._$AN=void 0,this._$AA=s,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let s=this._$AA.parentNode,e=this._$AM;return e!==void 0&&s?.nodeType===11&&(s=e.parentNode),s}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(s,e=this){s=ae(this,s,e),fe(s)?s===h||s==null||s===""?(this._$AH!==h&&this._$AR(),this._$AH=h):s!==this._$AH&&s!==te&&this._(s):s._$litType$!==void 0?this.$(s):s.nodeType!==void 0?this.T(s):Oi(s)?this.k(s):this._(s)}O(s){return this._$AA.parentNode.insertBefore(s,this._$AB)}T(s){this._$AH!==s&&(this._$AR(),this._$AH=this.O(s))}_(s){this._$AH!==h&&fe(this._$AH)?this._$AA.nextSibling.data=s:this.T(ee.createTextNode(s)),this._$AH=s}$(s){let{values:e,_$litType$:t}=s,i=typeof t=="number"?this._$AC(s):(t.el===void 0&&(t.el=ve.createElement(Lt(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let n=new We(i,this),c=n.u(this.options);n.p(e),this.T(c),this._$AH=n}}_$AC(s){let e=St.get(s.strings);return e===void 0&&St.set(s.strings,e=new ve(s)),e}k(s){Ze(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let n of s)i===e.length?e.push(t=new a(this.O(me()),this.O(me()),this,this.options)):t=e[i],t._$AI(n),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(s=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);s!==this._$AB;){let t=yt(s).nextSibling;yt(s).remove(),s=t}}setConnected(s){this._$AM===void 0&&(this._$Cv=s,this._$AP?.(s))}},ne=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(s,e,t,i,n){this.type=1,this._$AH=h,this._$AN=void 0,this.element=s,this.name=e,this._$AM=i,this.options=n,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=h}_$AI(s,e=this,t,i){let n=this.strings,c=!1;if(n===void 0)s=ae(this,s,e,0),c=!fe(s)||s!==this._$AH&&s!==te,c&&(this._$AH=s);else{let d=s,u,_;for(s=n[0],u=0;u<n.length-1;u++)_=ae(this,d[t+u],e,u),_===te&&(_=this._$AH[u]),c||=!fe(_)||_!==this._$AH[u],_===h?s=h:s!==h&&(s+=(_??"")+n[u+1]),this._$AH[u]=_}c&&!i&&this.j(s)}j(s){s===h?this.element.removeAttribute(this.name):this.element.setAtLine truncated
\f\r"'\`<>=]|("|')|))|$)`,"g"),kt=/'/g,Et=/"/g,Ct=/^(?:script|style|textarea|title)$/i,Xe=a=>(s,...e)=>({_$litType$:a,strings:s,values:e}),o=Xe(1),oe=Xe(2),Hs=Xe(3),te=Symbol.for("lit-noChange"),h=Symbol.for("lit-nothing"),St=new WeakMap,X=ee.createTreeWalker(ee,129);Fi=(a,s)=>{let e=a.length-1,t=[],i,n=s===2?"<svg>":s===3?"<math>":"",c=ge;for(let d=0;d<e;d++){let u=a[d],_,v,f=-1,y=0;for(;y<u.length&&(c.lastIndex=y,v=c.exec(u),v!==null);)y=c.lastIndex,c===ge?v[1]==="!--"?c=wt:v[1]!==void 0?c=$t:v[2]!==void 0?(Ct.test(v[2])&&(i=RegExp("</"+v[2],"g")),c=Z):v[3]!==void 0&&(c=Z):c===Z?v[0]===">"?(c=i??ge,f=-1):v[1]===void 0?f=-2:(f=c.lastIndex-v[2].length,_=v[1],c=v[3]===void 0?Z:v[3]==='"'?Et:kt):c===Et||c===kt?c=Z:c===wt||c===$t?c=ge:(c=Z,i=void 0);let g=c===Z&&a[d+1].startsWith("/>")?" ":"";n+=c===ge?u+Oi:f>=0?(t.push(_),u.slice(0,f)+At+u.slice(f)+J+g):u+J+(f===-2?d:g)}return[Lt(a,n+(a[e]||"<?>")+(s===2?"</svg>":s===3?"</math>":"")),t]},ve=class a{constructor({strings:s,_$litType$:e},t){let i;this.parts=[];let n=0,c=0,d=s.length-1,u=this.parts,[_,v]=Fi(s,e);if(this.el=a.createElement(_,t),X.currentNode=this.el.content,e===2||e===3){let f=this.el.content.firstChild;f.replaceWith(...f.childNodes)}for(;(i=X.nextNode())!==null&&u.length<d;){if(i.nodeType===1){if(i.hasAttributes())for(let f of i.getAttributeNames())if(f.endsWith(At)){let y=v[c++],g=i.getAttribute(f).split(J),x=/([.?@])?(.*)/.exec(y);u.push({type:1,index:n,name:x[2],strings:g,ctor:x[1]==="."?Ge:x[1]==="?"?Ke:x[1]==="@"?Ye:ne}),i.removeAttribute(f)}else f.startsWith(J)&&(u.push({type:6,index:n}),i.removeAttribute(f));if(Ct.test(i.tagName)){let f=i.textContent.split(J),y=f.length-1;if(y>0){i.textContent=Ce?Ce.emptyScript:"";for(let g=0;g<y;g++)i.append(f[g],me()),X.nextNode(),u.push({type:2,index:++n});i.append(f[y],me())}}}else if(i.nodeType===8)if(i.data===Tt)u.push({type:2,index:n});else{let f=-1;for(;(f=i.data.indexOf(J,f+1))!==-1;)u.push({type:7,index:n}),f+=J.length-1}n++}}static createElement(s,e){let t=ee.createElement("template");return t.innerHTML=s,t}};We=class{constructor(s,e){this._$AV=[],this._$AN=void 0,this._$AD=s,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(s){let{el:{content:e},parts:t}=this._$AD,i=(s?.creationScope??ee).importNode(e,!0);X.currentNode=i;let n=X.nextNode(),c=0,d=0,u=t[0];for(;u!==void 0;){if(c===u.index){let _;u.type===2?_=new be(n,n.nextSibling,this,s):u.type===1?_=new u.ctor(n,u.name,u.strings,this,s):u.type===6&&(_=new Je(n,this,s)),this._$AV.push(_),u=t[++d]}c!==u?.index&&(n=X.nextNode(),c++)}return X.currentNode=ee,i}p(s){let e=0;for(let t of this._$AV)t!==void 0&&(t.strings!==void 0?(t._$AI(s,t,e),e+=t.strings.length-2):t._$AI(s[e])),e++}},be=class a{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(s,e,t,i){this.type=2,this._$AH=h,this._$AN=void 0,this._$AA=s,this._$AB=e,this._$AM=t,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let s=this._$AA.parentNode,e=this._$AM;return e!==void 0&&s?.nodeType===11&&(s=e.parentNode),s}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(s,e=this){s=ae(this,s,e),fe(s)?s===h||s==null||s===""?(this._$AH!==h&&this._$AR(),this._$AH=h):s!==this._$AH&&s!==te&&this._(s):s._$litType$!==void 0?this.$(s):s.nodeType!==void 0?this.T(s):Di(s)?this.k(s):this._(s)}O(s){return this._$AA.parentNode.insertBefore(s,this._$AB)}T(s){this._$AH!==s&&(this._$AR(),this._$AH=this.O(s))}_(s){this._$AH!==h&&fe(this._$AH)?this._$AA.nextSibling.data=s:this.T(ee.createTextNode(s)),this._$AH=s}$(s){let{values:e,_$litType$:t}=s,i=typeof t=="number"?this._$AC(s):(t.el===void 0&&(t.el=ve.createElement(Lt(t.h,t.h[0]),this.options)),t);if(this._$AH?._$AD===i)this._$AH.p(e);else{let n=new We(i,this),c=n.u(this.options);n.p(e),this.T(c),this._$AH=n}}_$AC(s){let e=St.get(s.strings);return e===void 0&&St.set(s.strings,e=new ve(s)),e}k(s){Ze(this._$AH)||(this._$AH=[],this._$AR());let e=this._$AH,t,i=0;for(let n of s)i===e.length?e.push(t=new a(this.O(me()),this.O(me()),this,this.options)):t=e[i],t._$AI(n),i++;i<e.length&&(this._$AR(t&&t._$AB.nextSibling,i),e.length=i)}_$AR(s=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);s!==this._$AB;){let t=yt(s).nextSibling;yt(s).remove(),s=t}}setConnected(s){this._$AM===void 0&&(this._$Cv=s,this._$AP?.(s))}},ne=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(s,e,t,i,n){this.type=1,this._$AH=h,this._$AN=void 0,this.element=s,this.name=e,this._$AM=i,this.options=n,t.length>2||t[0]!==""||t[1]!==""?(this._$AH=Array(t.length-1).fill(new String),this.strings=t):this._$AH=h}_$AI(s,e=this,t,i){let n=this.strings,c=!1;if(n===void 0)s=ae(this,s,e,0),c=!fe(s)||s!==this._$AH&&s!==te,c&&(this._$AH=s);else{let d=s,u,_;for(s=n[0],u=0;u<n.length-1;u++)_=ae(this,d[t+u],e,u),_===te&&(_=this._$AH[u]),c||=!fe(_)||_!==this._$AH[u],_===h?s=h:s!==h&&(s+=(_??"")+n[u+1]),this._$AH[u]=_}c&&!i&&this.j(s)}j(s){s===h?this.element.removeAttribute(this.name):this.element.setAtLine truncated
Replace seal
Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"{field}: too long (max {n} characters)",err_too_short:"{field}: too short (min {n} characters)",err_value_too_high:"{field}: too large (max {n})",err_value_too_low:"{field}: too small (min {n})",err_required:"{field}: required",err_wrong_type:"{field}: wrong type (expected: {type})",err_invalid_choice:"{field}: not an allowed value",err_invalid_value:"{field}: invalid value",feat_schedule_time:"Time-of-day scheduling",feat_schedule_time_desc:"Tasks become overdue at a specific time of day instead of midnight.",schedule_time_optional:"Due at time (optional, HH:MM)",schedule_time_help:"Empty = midnight (default). HA timezone.",at_time:"at",notes_optional:"Notes (optional)",cost_optional:"Cost (optional)",duration_minutes:"Duration in minutes (optional)",days:"days",day:"day",today:"Today",d_overdue:"d overdue",no_tasks:"No maintenance tasks yet. Create an object to get started.",no_tasks_short:"No tasks",no_history:"No history entries yet.",show_all:"Show all",cost_duration_chart:"Cost & Duration",installed:"Installed",confirm_delete_object:"Delete this object and all its tasks?",confirm_delete_task:"Delete this task?",min:"Min",max:"Max",save:"Save",saving:"Saving\u2026",edit_task:"Edit Task",new_task:"New Maintenance Task",task_name:"Task name",maintenance_type:"Maintenance type",priority:"Priority",labels:"Labels",labels_placeholder:"e.g. safety, seasonal, tenant-visible",labels_help:"Comma-separated tags for filtering and reporting.",priority_low:"Low",priority_normal:"Normal",priority_high:"High",schedule_type:"Schedule type",interval_days:"Interval (days)",warning_days:"Warning days",earliest_completion_days:"Earliest completion (days before due)",earliest_completion_days_help:"Leave empty to allow completing any time. 0 = only on/after the due date.",last_performed_optional:"Last performed (optional)",interval_anchor:"Interval anchor",anchor_completion:"From completion date",anchor_planned:"From planned date (no drift)",edit_object:"Edit Object",name:"Name",manufacturer_optional:"Manufacturer (optional)",model_optional:"Model (optional)",serial_number_optional:"Serial number (optional)",serial_number_label:"S/N",documentation_url_label:"Manual",object_notes_label:"Notes",sort_due_date:"Due date",sort_object:"Object name",sort_type:"Type",sort_task_name:"Task name",all_objects:"All objects",tasks_lower:"tasks",no_tasks_yet:"No tasks yet",add_first_task:"Add first task",trigger_configuration:"Trigger Configuration",entity_id:"Entity ID",comma_separated:"comma-separated",entity_logic:"Entity logic",entity_logic_any:"Any entity triggers",entity_logic_all:"All entities must trigger",entities:"entities",attribute_optional:"Attribute (optional, blank = state)",use_entity_state:"Use entity state (no attribute)",trigger_above:"Trigger above",trigger_below:"Trigger below",for_at_least_minutes:"For at least (minutes)",safety_interval_days:"Safety interval (days, optional)",safety_interval:"Safety interval (optional)",delta_mode:"Delta mode",from_state_optional:"From state (optional)",to_state_optional:"To state (optional)",documentation_url_optional:"Documentation URL (optional)",object_notes_optional:"Notes (optional)",nfc_tag_id_optional:"NFC Tag ID (optional)",nfc_tags_empty_help:"No NFC tags registered in Home Assistant yet.",nfc_tags_open_settings:"Open Tags settings",nfc_tags_refresh:"Refresh",environmental_entity_optional:"Environmental sensor (optional)",environmental_entity_helper:"e.g. sensor.outdoor_temperature \u2014 adjusts the interval based on environmental conditions",environmental_attribute_optional:"Environmental attribute (optional)",nfc_tag_id:"NFC Tag ID",nfc_linked:"NFC tag linked",nfc_link_hint:"Click to link NFC tag",responsible_user:"Responsible User",shared_with:"Shared with (rotation)",shared_with_help:"Pick multiple people to share this task; the responsible person rotates on each completion.",rotation_strategy:"Rotation",rotation_none:"No rotation",rotation_round_robin:"Round-robin",rotation_least_completed:"Least completed",rotation_random:"Random",no_user_assigned:"(No user assigned)",all_users:"All Users",my_tasks:"My Tasks",tab_calendar:"Calendar",cal_no_events:"No maintenance",cal_window_7:"7 days",cal_window_14:"14 days",cal_window_30:"30 days",cal_window_365:"1 year",cal_every_n_days:"every {n} days",cal_source_time:"Time-based",cal_source_time_adaptive:"Time-based (adaptive)",cal_source_sensor:"Sensor-based",cal_predicted:"predicted",cal_confidence_high:"high confidence",cal_confidence_medium:"medium confidence",cal_confidence_low:"low confidence",budget_monthly:"Monthly budget",budget_yearly:"Yearly budget",groups:"Groups",new_group:"New group",edit_group:"Edit group",no_groups:"No groups yet",delete_group:"Delete group",delete_group_confirm:"Delete group '{name}'?",group_select_tasks:"Select tasks",group_name_required:"Name is required",description_optional:"Description (optional)",selected:"Sel Line truncated
Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"{field}: too long (max {n} characters)",err_too_short:"{field}: too short (min {n} characters)",err_value_too_high:"{field}: too large (max {n})",err_value_too_low:"{field}: too small (min {n})",err_required:"{field}: required",err_wrong_type:"{field}: wrong type (expected: {type})",err_invalid_choice:"{field}: not an allowed value",err_invalid_value:"{field}: invalid value",feat_schedule_time:"Time-of-day scheduling",feat_schedule_time_desc:"Tasks become overdue at a specific time of day instead of midnight.",schedule_time_optional:"Due at time (optional, HH:MM)",schedule_time_help:"Empty = midnight (default). HA timezone.",at_time:"at",notes_optional:"Notes (optional)",cost_optional:"Cost (optional)",duration_minutes:"Duration in minutes (optional)",days:"days",day:"day",today:"Today",d_overdue:"d overdue",no_tasks:"No maintenance tasks yet. Create an object to get started.",no_tasks_short:"No tasks",no_history:"No history entries yet.",show_all:"Show all",cost_duration_chart:"Cost & Duration",installed:"Installed",confirm_delete_object:"Delete this object and all its tasks?",confirm_delete_task:"Delete this task?",min:"Min",max:"Max",save:"Save",saving:"Saving\u2026",edit_task:"Edit Task",new_task:"New Maintenance Task",task_name:"Task name",maintenance_type:"Maintenance type",priority:"Priority",labels:"Labels",labels_placeholder:"e.g. safety, seasonal, tenant-visible",labels_help:"Comma-separated tags for filtering and reporting.",priority_low:"Low",priority_normal:"Normal",priority_high:"High",schedule_type:"Schedule type",interval_days:"Interval (days)",warning_days:"Warning days",earliest_completion_days:"Earliest completion (days before due)",earliest_completion_days_help:"Leave empty to allow completing any time. 0 = only on/after the due date.",last_performed_optional:"Last performed (optional)",interval_anchor:"Interval anchor",anchor_completion:"From completion date",anchor_planned:"From planned date (no drift)",edit_object:"Edit Object",name:"Name",manufacturer_optional:"Manufacturer (optional)",model_optional:"Model (optional)",serial_number_optional:"Serial number (optional)",serial_number_label:"S/N",documentation_url_label:"Manual",object_notes_label:"Notes",sort_due_date:"Due date",sort_object:"Object name",sort_type:"Type",sort_task_name:"Task name",all_objects:"All objects",tasks_lower:"tasks",no_tasks_yet:"No tasks yet",add_first_task:"Add first task",trigger_configuration:"Trigger Configuration",entity_id:"Entity ID",comma_separated:"comma-separated",entity_logic:"Entity logic",entity_logic_any:"Any entity triggers",entity_logic_all:"All entities must trigger",entities:"entities",attribute_optional:"Attribute (optional, blank = state)",use_entity_state:"Use entity state (no attribute)",trigger_above:"Trigger above",trigger_below:"Trigger below",for_at_least_minutes:"For at least (minutes)",safety_interval_days:"Safety interval (days, optional)",safety_interval:"Safety interval (optional)",delta_mode:"Delta mode",from_state_optional:"From state (optional)",to_state_optional:"To state (optional)",documentation_url_optional:"Documentation URL (optional)",object_notes_optional:"Notes (optional)",nfc_tag_id_optional:"NFC Tag ID (optional)",nfc_tags_empty_help:"No NFC tags registered in Home Assistant yet.",nfc_tags_open_settings:"Open Tags settings",nfc_tags_refresh:"Refresh",environmental_entity_optional:"Environmental sensor (optional)",environmental_entity_helper:"e.g. sensor.outdoor_temperature \u2014 adjusts the interval based on environmental conditions",environmental_attribute_optional:"Environmental attribute (optional)",nfc_tag_id:"NFC Tag ID",nfc_linked:"NFC tag linked",nfc_link_hint:"Click to link NFC tag",responsible_user:"Responsible User",shared_with:"Shared with (rotation)",shared_with_help:"Pick multiple people to share this task; the responsible person rotates on each completion.",rotation_strategy:"Rotation",rotation_none:"No rotation",rotation_round_robin:"Round-robin",rotation_least_completed:"Least completed",rotation_random:"Random",no_user_assigned:"(No user assigned)",all_users:"All Users",my_tasks:"My Tasks",tab_calendar:"Calendar",cal_no_events:"No maintenance",cal_window_7:"7 days",cal_window_14:"14 days",cal_window_30:"30 days",cal_window_365:"1 year",cal_every_n_days:"every {n} days",cal_source_time:"Time-based",cal_source_time_adaptive:"Time-based (adaptive)",cal_source_sensor:"Sensor-based",cal_predicted:"predicted",cal_confidence_high:"high confidence",cal_confidence_medium:"medium confidence",cal_confidence_low:"low confidence",budget_monthly:"Monthly budget",budget_yearly:"Yearly budget",groups:"Groups",new_group:"New group",edit_group:"Edit group",no_groups:"No groups yet",delete_group:"Delete group",delete_group_confirm:"Delete group '{name}'?",group_select_tasks:"Select tasks",group_name_required:"Name is required",description_optional:"Description (optional)",selected:"Sel Line truncated
.field { display: flex; flex-direction: column; gap: 4px; }
.field-label { font-size: 12px; color: var(--secondary-text-color); }
.field-input {
@@ -1179,7 +1179,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
.stat-item .stat-label { font-size: 11px; white-space: normal; text-align: center; line-height: 1.2; }
.stat-value { font-size: 20px; }
}
`});var ce,rt=w(()=>{"use strict";ce=class{constructor(s){this.usersCache=null;this.cacheTimestamp=0;this.CACHE_TTL_MS=6e4;this.hass=s}updateHass(s){this.hass=s}async getUsers(s=!1){let e=Date.now();if(!s&&this.usersCache&&e-this.cacheTimestamp<this.CACHE_TTL_MS)return this.usersCache;try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/users/list"});return this.usersCache=t.users,this.cacheTimestamp=e,this.usersCache}catch(t){return console.error("Failed to fetch users:",t),this.usersCache||[]}}async assignUser(s,e,t){await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/assign_user",entry_id:s,task_id:e,user_id:t})}async getTasksByUser(s){return(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/tasks/by_user",user_id:s})).tasks}getUserName(s){return!s||!this.usersCache?null:this.usersCache.find(t=>t.id===s)?.name||null}getUser(s){return!s||!this.usersCache?null:this.usersCache.find(e=>e.id===s)||null}getCurrentUserId(){return this.hass.user?.id||null}isCurrentUser(s){return s?s===this.getCurrentUserId():!1}clearCache(){this.usersCache=null,this.cacheTimestamp=0}}});function Q(a){return`${a.entry_id??""}\0${a.part_id}`}function Qi(a,s,e,t){let i=!!a.entry_id&&a.entry_id!==s,n=i?a.entry_id:s,c=e.find(v=>v.entry_id===n),d=(c?.parts||[]).find(v=>v.id===a.part_id)||null,u=i&&c?.object?.name||"",_=d?.name||r("shared_part_unknown",t);return{part:d,foreign:i,ownerName:u,label:u?`${_} (${u})`:_}}function Zt(a,s,e,t){let n=(e.find(d=>d.entry_id===s)?.parts||[]).map(d=>({...d})),c=new Set(n.map(d=>Q({part_id:d.id})));for(let d of a?.consumes_parts||[]){if(!d.entry_id||d.entry_id===s)continue;let u=Q(d);if(c.has(u))continue;c.add(u);let{part:_,ownerName:v}=Qi(d,s,e,t);n.push({id:d.part_id,name:_?.name||r("shared_part_unknown",t),unit:_?.unit,stock:_?.stock??null,storage_location:_?.storage_location,entry_id:d.entry_id,owner_name:v})}return n}var ze=w(()=>{"use strict";L()});function es(a,s){let e=Xi[a];if(!e)return a;let t=r(e,s);return t&&t!==e?t:a}function ts(a){let e=a.match(/data\['([^']+)'\]/)?.[1],t;return(t=a.match(/length of value must be at most (\d+)/))?{field:e,rule:"too_long",param:t[1]}:(t=a.match(/length of value must be at least (\d+)/))?{field:e,rule:"too_short",param:t[1]}:(t=a.match(/value must be at most (\S+)/))?{field:e,rule:"value_too_high",param:t[1]}:(t=a.match(/value must be at least (\S+)/))?{field:e,rule:"value_too_low",param:t[1]}:/required key not provided/.test(a)?{field:e,rule:"required"}:(t=a.match(/expected (\w+)/))?{field:e,rule:"wrong_type",param:t[1]}:/value must be one of/.test(a)?{field:e,rule:"invalid_choice"}:/not a valid value/.test(a)?{field:e,rule:"invalid_value"}:{field:e,rule:"unknown"}}function P(a,s,e){if(e=e??r("action_error",s),typeof a=="string")return a;if(typeof a!="object"||a===null)return e;let t=a,i=t.message||t.error?.message||"";if(!i)return e;let n=ts(i),c=n.field?es(n.field,s):"",d=u=>r(u,s).replace("{field}",c).replace("{n}",n.param??"");switch(n.rule){case"too_long":return d("err_too_long");case"too_short":return d("err_too_short");case"value_too_high":return d("err_value_too_high");case"value_too_low":return d("err_value_too_low");case"required":return d("err_required");case"wrong_type":return d("err_wrong_type").replace("{type}",n.param??"");case"invalid_choice":return d("err_invalid_choice");case"invalid_value":return d("err_invalid_value");default:return i||e}}var Xi,re=w(()=>{"use strict";L();Xi={name:"name",task_type:"maintenance_type",schedule_type:"schedule_type",interval_days:"interval_days",interval_anchor:"interval_anchor",warning_days:"warning_days",last_performed:"last_performed_optional",notes:"notes_optional",documentation_url:"documentation_url_optional",custom_icon:"custom_icon_optional",nfc_tag_id:"nfc_tag_id_optional",responsible_user_id:"responsible_user",entity_slug:"entity_slug",entity_id:"entity_id",area_id:"area_id_optional",manufacturer:"manufacturer_optional",model:"model_optional",serial_number:"serial_number_optional",installation_date:"installation_date_optional",warranty_expiry:"warranty_expiry_optional",checklist:"checklist_steps_optional",reason:"reason",feedback:"feedback",cost:"cost",duration:"duration",description:"description_optional",group_name:"name",group_description:"description_optional",environmental_entity:"environmental_entity_optional",environmental_attribute:"environmental_attribute_optional",trigger_above:"trigger_above",trigger_below:"trigger_below",trigger_for_minutes:"trigger_for_minutes"}});var Xt,Me,at=w(()=>{"use strict";Xt=["notes","cost","duration","photo","user"],Me={notes:"notes_label",cost:"cost",duration:"duration",photo:"photo_label",user:"user_label"}});var $,nt=w(()=>{"use strict";I();M();L();re();ze();at();$=class extends k{constructor(){super(...arguments);this.entryId="";this.taskId="";this.taskName="";this.lang="en";this.checklist=[];this.adaptiveEnabled=!1;this.taskType="";this.readingUnit="";this.restockDef Line truncated
`});var ce,rt=w(()=>{"use strict";ce=class{constructor(s){this.usersCache=null;this.cacheTimestamp=0;this.CACHE_TTL_MS=6e4;this.hass=s}updateHass(s){this.hass=s}async getUsers(s=!1){let e=Date.now();if(!s&&this.usersCache&&e-this.cacheTimestamp<this.CACHE_TTL_MS)return this.usersCache;try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/users/list"});return this.usersCache=t.users,this.cacheTimestamp=e,this.usersCache}catch(t){return console.error("Failed to fetch users:",t),this.usersCache||[]}}async assignUser(s,e,t){await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/assign_user",entry_id:s,task_id:e,user_id:t})}async getTasksByUser(s){return(await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/tasks/by_user",user_id:s})).tasks}getUserName(s){return!s||!this.usersCache?null:this.usersCache.find(t=>t.id===s)?.name||null}getUser(s){return!s||!this.usersCache?null:this.usersCache.find(e=>e.id===s)||null}getCurrentUserId(){return this.hass.user?.id||null}isCurrentUser(s){return s?s===this.getCurrentUserId():!1}clearCache(){this.usersCache=null,this.cacheTimestamp=0}}});function Q(a){return`${a.entry_id??""}\0${a.part_id}`}function Zi(a,s,e,t){let i=!!a.entry_id&&a.entry_id!==s,n=i?a.entry_id:s,c=e.find(v=>v.entry_id===n),d=(c?.parts||[]).find(v=>v.id===a.part_id)||null,u=i&&c?.object?.name||"",_=d?.name||r("shared_part_unknown",t);return{part:d,foreign:i,ownerName:u,label:u?`${_} (${u})`:_}}function Xt(a,s,e,t){let n=(e.find(d=>d.entry_id===s)?.parts||[]).map(d=>({...d})),c=new Set(n.map(d=>Q({part_id:d.id})));for(let d of a?.consumes_parts||[]){if(!d.entry_id||d.entry_id===s)continue;let u=Q(d);if(c.has(u))continue;c.add(u);let{part:_,ownerName:v}=Zi(d,s,e,t);n.push({id:d.part_id,name:_?.name||r("shared_part_unknown",t),unit:_?.unit,stock:_?.stock??null,storage_location:_?.storage_location,entry_id:d.entry_id,owner_name:v})}return n}var Me=w(()=>{"use strict";L()});function ts(a,s){let e=es[a];if(!e)return a;let t=r(e,s);return t&&t!==e?t:a}function is(a){let e=a.match(/data\['([^']+)'\]/)?.[1],t;return(t=a.match(/length of value must be at most (\d+)/))?{field:e,rule:"too_long",param:t[1]}:(t=a.match(/length of value must be at least (\d+)/))?{field:e,rule:"too_short",param:t[1]}:(t=a.match(/value must be at most (\S+)/))?{field:e,rule:"value_too_high",param:t[1]}:(t=a.match(/value must be at least (\S+)/))?{field:e,rule:"value_too_low",param:t[1]}:/required key not provided/.test(a)?{field:e,rule:"required"}:(t=a.match(/expected (\w+)/))?{field:e,rule:"wrong_type",param:t[1]}:/value must be one of/.test(a)?{field:e,rule:"invalid_choice"}:/not a valid value/.test(a)?{field:e,rule:"invalid_value"}:{field:e,rule:"unknown"}}function P(a,s,e){if(e=e??r("action_error",s),typeof a=="string")return a;if(typeof a!="object"||a===null)return e;let t=a,i=t.message||t.error?.message||"";if(!i)return e;let n=is(i),c=n.field?ts(n.field,s):"",d=u=>r(u,s).replace("{field}",c).replace("{n}",n.param??"");switch(n.rule){case"too_long":return d("err_too_long");case"too_short":return d("err_too_short");case"value_too_high":return d("err_value_too_high");case"value_too_low":return d("err_value_too_low");case"required":return d("err_required");case"wrong_type":return d("err_wrong_type").replace("{type}",n.param??"");case"invalid_choice":return d("err_invalid_choice");case"invalid_value":return d("err_invalid_value");default:return i||e}}var es,re=w(()=>{"use strict";L();es={name:"name",task_type:"maintenance_type",schedule_type:"schedule_type",interval_days:"interval_days",interval_anchor:"interval_anchor",warning_days:"warning_days",last_performed:"last_performed_optional",notes:"notes_optional",documentation_url:"documentation_url_optional",custom_icon:"custom_icon_optional",nfc_tag_id:"nfc_tag_id_optional",responsible_user_id:"responsible_user",entity_slug:"entity_slug",entity_id:"entity_id",area_id:"area_id_optional",manufacturer:"manufacturer_optional",model:"model_optional",serial_number:"serial_number_optional",installation_date:"installation_date_optional",warranty_expiry:"warranty_expiry_optional",checklist:"checklist_steps_optional",reason:"reason",feedback:"feedback",cost:"cost",duration:"duration",description:"description_optional",group_name:"name",group_description:"description_optional",environmental_entity:"environmental_entity_optional",environmental_attribute:"environmental_attribute_optional",trigger_above:"trigger_above",trigger_below:"trigger_below",trigger_for_minutes:"trigger_for_minutes"}});var ei,ze,at=w(()=>{"use strict";ei=["notes","cost","duration","photo","user"],ze={notes:"notes_label",cost:"cost",duration:"duration",photo:"photo_label",user:"user_label"}});var $,nt=w(()=>{"use strict";I();z();L();re();Me();at();$=class extends k{constructor(){super(...arguments);this.entryId="";this.taskId="";this.taskName="";this.lang="en";this.checklist=[];this.adaptiveEnabled=!1;this.taskType="";this.readingUnit="";this.restockDef Line truncated
<ha-dialog open @closed=${this._close}>
<div class="dialog-title">${r("complete_title",e)}${this.taskName}</div>
<div class="content">
@@ -1293,13 +1293,13 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
<ha-button
@click=${this._complete}
.disabled=${this._loading||this._missingRequired.length>0}
title=${this._missingRequired.length?this._missingRequired.map(t=>r("err_required",e).replace("{field}",r(Me[t]??t,e))).join(" \xB7 "):""}
title=${this._missingRequired.length?this._missingRequired.map(t=>r("err_required",e).replace("{field}",r(ze[t]??t,e))).join(" \xB7 "):""}
>
${this._loading?r("completing",e):r("complete",e)}
</ha-button>
</div>
</ha-dialog>
`}};$.styles=[Qt,E`
`}};$.styles=[Zt,E`
.req-mark {
color: var(--error-color, #f44336);
margin-left: 2px;
@@ -1451,7 +1451,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
color: var(--text-primary-color, #fff);
border-color: var(--primary-color);
}
`],l([y({attribute:!1})],$.prototype,"hass",2),l([y()],$.prototype,"entryId",2),l([y()],$.prototype,"taskId",2),l([y()],$.prototype,"taskName",2),l([y()],$.prototype,"lang",2),l([y({type:Array})],$.prototype,"checklist",2),l([y({type:Boolean})],$.prototype,"adaptiveEnabled",2),l([y()],$.prototype,"taskType",2),l([y()],$.prototype,"readingUnit",2),l([y({attribute:!1})],$.prototype,"restockDefault",2),l([y({attribute:!1})],$.prototype,"parts",2),l([y({attribute:!1})],$.prototype,"consumesParts",2),l([y({type:Array})],$.prototype,"consumesInfo",2),l([y({type:Array})],$.prototype,"requiredFields",2),l([p()],$.prototype,"_open",2),l([p()],$.prototype,"_notes",2),l([p()],$.prototype,"_cost",2),l([p()],$.prototype,"_duration",2),l([p()],$.prototype,"_loading",2),l([p()],$.prototype,"_error",2),l([p()],$.prototype,"_checklistState",2),l([p()],$.prototype,"_feedback",2),l([p()],$.prototype,"_photoDocId",2),l([p()],$.prototype,"_photoPreview",2),l([p()],$.prototype,"_photoUploading",2),l([p()],$.prototype,"_readingValue",2),l([p()],$.prototype,"_restockQty",2),l([p()],$.prototype,"_usedParts",2);customElements.get("maintenance-complete-dialog")||customElements.define("maintenance-complete-dialog",$)});var R,ot=w(()=>{"use strict";I();M();R=class extends k{constructor(){super(...arguments);this.label="";this.value="";this.placeholder="";this.type="text";this.required=!1;this.disabled=!1}_onInput(e){let t=e.target.value;this.value=t,this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:t}}))}render(){return o`
`],l([b({attribute:!1})],$.prototype,"hass",2),l([b()],$.prototype,"entryId",2),l([b()],$.prototype,"taskId",2),l([b()],$.prototype,"taskName",2),l([b()],$.prototype,"lang",2),l([b({type:Array})],$.prototype,"checklist",2),l([b({type:Boolean})],$.prototype,"adaptiveEnabled",2),l([b()],$.prototype,"taskType",2),l([b()],$.prototype,"readingUnit",2),l([b({attribute:!1})],$.prototype,"restockDefault",2),l([b({attribute:!1})],$.prototype,"parts",2),l([b({attribute:!1})],$.prototype,"consumesParts",2),l([b({type:Array})],$.prototype,"consumesInfo",2),l([b({type:Array})],$.prototype,"requiredFields",2),l([p()],$.prototype,"_open",2),l([p()],$.prototype,"_notes",2),l([p()],$.prototype,"_cost",2),l([p()],$.prototype,"_duration",2),l([p()],$.prototype,"_loading",2),l([p()],$.prototype,"_error",2),l([p()],$.prototype,"_checklistState",2),l([p()],$.prototype,"_feedback",2),l([p()],$.prototype,"_photoDocId",2),l([p()],$.prototype,"_photoPreview",2),l([p()],$.prototype,"_photoUploading",2),l([p()],$.prototype,"_readingValue",2),l([p()],$.prototype,"_restockQty",2),l([p()],$.prototype,"_usedParts",2),l([b({attribute:!1})],$.prototype,"checklistPrefill",2);customElements.get("maintenance-complete-dialog")||customElements.define("maintenance-complete-dialog",$)});var R,ot=w(()=>{"use strict";I();z();R=class extends k{constructor(){super(...arguments);this.label="";this.value="";this.placeholder="";this.type="text";this.required=!1;this.disabled=!1}_onInput(e){let t=e.target.value;this.value=t,this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:t}}))}render(){return o`
<label class="field">
${this.label?o`<span class="label">${this.label}${this.required?o`<span class="req">*</span>`:h}</span>`:h}
<input
@@ -1503,7 +1503,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
color: var(--secondary-text-color);
font-style: italic;
}
`,l([y()],R.prototype,"label",2),l([y()],R.prototype,"value",2),l([y()],R.prototype,"placeholder",2),l([y()],R.prototype,"type",2),l([y({type:Boolean})],R.prototype,"required",2),l([y({type:Boolean})],R.prototype,"disabled",2),l([y()],R.prototype,"step",2),l([y()],R.prototype,"min",2),l([y()],R.prototype,"max",2),l([y()],R.prototype,"pattern",2),l([y()],R.prototype,"helper",2);customElements.get("ms-textfield")||customElements.define("ms-textfield",R)});var A,ei=w(()=>{"use strict";I();M();L();re();ot();A=class extends k{constructor(){super(...arguments);this.objects=[];this._open=!1;this._loading=!1;this._error="";this._name="";this._manufacturer="";this._model="";this._serialNumber="";this._areaId="";this._installationDate="";this._warrantyExpiry="";this._documentationUrl="";this._notes="";this._haDeviceId="";this._parentEntryId="";this._entryId=null}get _lang(){return this.hass?.language??navigator.language.split("-")[0]??"en"}openCreate(){this._entryId=null,this._name="",this._manufacturer="",this._model="",this._serialNumber="",this._areaId="",this._installationDate="",this._warrantyExpiry="",this._documentationUrl="",this._notes="",this._haDeviceId="",this._parentEntryId="",this._error="",this._open=!0}openEdit(e,t){this._entryId=e,this._name=t.name||"",this._manufacturer=t.manufacturer||"",this._model=t.model||"",this._serialNumber=t.serial_number||"",this._areaId=t.area_id||"",this._installationDate=t.installation_date||"",this._warrantyExpiry=t.warranty_expiry||"",this._documentationUrl=t.documentation_url||"",this._notes=t.notes||"",this._haDeviceId=t.ha_device_id||"",this._parentEntryId=t.parent_entry_id||"",this._error="",this._open=!0}async _save(){if(!this._loading&&this._name.trim()){this._loading=!0,this._error="";try{this._entryId?await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/update",entry_id:this._entryId,name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}):await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/create",name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}),this._open=!1,this.dispatchEvent(new CustomEvent("object-saved"))}catch(e){this._error=P(e,this._lang,r("save_error",this._lang))}finally{this._loading=!1}}}_parentChoices(){return(this.objects||[]).filter(e=>e.entry_id!==this._entryId)}_close(){this._open=!1}render(){if(!this._open)return o``;let e=this._lang,t=this._entryId?r("edit_object",e):r("new_object",e);return o`
`,l([b()],R.prototype,"label",2),l([b()],R.prototype,"value",2),l([b()],R.prototype,"placeholder",2),l([b()],R.prototype,"type",2),l([b({type:Boolean})],R.prototype,"required",2),l([b({type:Boolean})],R.prototype,"disabled",2),l([b()],R.prototype,"step",2),l([b()],R.prototype,"min",2),l([b()],R.prototype,"max",2),l([b()],R.prototype,"pattern",2),l([b()],R.prototype,"helper",2);customElements.get("ms-textfield")||customElements.define("ms-textfield",R)});var A,ti=w(()=>{"use strict";I();z();L();re();ot();A=class extends k{constructor(){super(...arguments);this.objects=[];this._open=!1;this._loading=!1;this._error="";this._name="";this._manufacturer="";this._model="";this._serialNumber="";this._areaId="";this._installationDate="";this._warrantyExpiry="";this._documentationUrl="";this._notes="";this._haDeviceId="";this._parentEntryId="";this._entryId=null}get _lang(){return this.hass?.language??navigator.language.split("-")[0]??"en"}openCreate(){this._entryId=null,this._name="",this._manufacturer="",this._model="",this._serialNumber="",this._areaId="",this._installationDate="",this._warrantyExpiry="",this._documentationUrl="",this._notes="",this._haDeviceId="",this._parentEntryId="",this._error="",this._open=!0}openEdit(e,t){this._entryId=e,this._name=t.name||"",this._manufacturer=t.manufacturer||"",this._model=t.model||"",this._serialNumber=t.serial_number||"",this._areaId=t.area_id||"",this._installationDate=t.installation_date||"",this._warrantyExpiry=t.warranty_expiry||"",this._documentationUrl=t.documentation_url||"",this._notes=t.notes||"",this._haDeviceId=t.ha_device_id||"",this._parentEntryId=t.parent_entry_id||"",this._error="",this._open=!0}async _save(){if(!this._loading&&this._name.trim()){this._loading=!0,this._error="";try{this._entryId?await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/update",entry_id:this._entryId,name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}):await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/create",name:this._name,manufacturer:this._manufacturer||null,model:this._model||null,serial_number:this._serialNumber||null,area_id:this._areaId||null,installation_date:this._installationDate||null,warranty_expiry:this._warrantyExpiry||null,documentation_url:this._documentationUrl.trim()||null,notes:this._notes.trim()||null,ha_device_id:this._haDeviceId||null,parent_entry_id:this._parentEntryId||null}),this._open=!1,this.dispatchEvent(new CustomEvent("object-saved"))}catch(e){this._error=P(e,this._lang,r("save_error",this._lang))}finally{this._loading=!1}}}_parentChoices(){return(this.objects||[]).filter(e=>e.entry_id!==this._entryId)}_close(){this._open=!1}render(){if(!this._open)return o``;let e=this._lang,t=this._entryId?r("edit_object",e):r("new_object",e);return o`
<ha-dialog open @closed=${this._close}>
<div class="dialog-title">${t}</div>
<div class="content">
@@ -1644,8 +1644,8 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
color: var(--error-color, #f44336);
font-size: 13px;
}
`,l([y({attribute:!1})],A.prototype,"hass",2),l([y({attribute:!1})],A.prototype,"objects",2),l([p()],A.prototype,"_open",2),l([p()],A.prototype,"_loading",2),l([p()],A.prototype,"_error",2),l([p()],A.prototype,"_name",2),l([p()],A.prototype,"_manufacturer",2),l([p()],A.prototype,"_model",2),l([p()],A.prototype,"_serialNumber",2),l([p()],A.prototype,"_areaId",2),l([p()],A.prototype,"_installationDate",2),l([p()],A.prototype,"_warrantyExpiry",2),l([p()],A.prototype,"_documentationUrl",2),l([p()],A.prototype,"_notes",2),l([p()],A.prototype,"_haDeviceId",2),l([p()],A.prototype,"_parentEntryId",2),l([p()],A.prototype,"_entryId",2);customElements.get("maintenance-object-dialog")||customElements.define("maintenance-object-dialog",A)});function ns(){return{entityIds:"",type:"threshold",above:"",below:"",forMinutes:"0",targetValue:"",deltaMode:!1,fromState:"",toState:"",targetChanges:"",runtimeHours:"",onStates:"",carry:{}}}function ls(a){return{entityIds:(a.entity_ids||(a.entity_id?[a.entity_id]:[])).join(", "),type:a.type||"threshold",above:a.trigger_above?.toString()??"",below:a.trigger_below?.toString()??"",forMinutes:a.trigger_for_minutes?.toString()??"0",targetValue:a.trigger_target_value?.toString()??"",deltaMode:a.trigger_delta_mode||!1,fromState:a.trigger_from_state||"",toState:a.trigger_to_state||"",targetChanges:a.trigger_target_changes?.toString()??"",runtimeHours:a.trigger_runtime_hours?.toString()??"",onStates:(a.trigger_on_states||[]).join(", "),carry:Object.fromEntries(Object.entries(a).filter(([e])=>!os.has(e)&&!e.startsWith("_")))}}function cs(a){let s=a.entityIds.split(",").map(t=>t.trim()).filter(Boolean);if(s.length===0)return null;let e={...a.carry||{},entity_id:s[0],entity_ids:s,type:a.type};if(a.type==="threshold"){let t=parseFloat(a.above);isNaN(t)||(e.trigger_above=t);let i=parseFloat(a.below);isNaN(i)||(e.trigger_below=i);let n=parseInt(a.forMinutes,10);isNaN(n)||(e.trigger_for_minutes=n)}else if(a.type==="counter"){let t=parseFloat(a.targetValue);isNaN(t)||(e.trigger_target_value=t),e.trigger_delta_mode=a.deltaMode}else if(a.type==="state_change"){a.fromState&&(e.trigger_from_state=a.fromState),a.toState&&(e.trigger_to_state=a.toState);let t=parseInt(a.targetChanges,10);isNaN(t)||(e.trigger_target_changes=t)}else if(a.type==="runtime"){let t=parseFloat(a.runtimeHours);isNaN(t)||(e.trigger_runtime_hours=t);let i=(a.onStates||"").split(",").map(n=>n.trim()).filter(Boolean);i.length>0&&(e.trigger_on_states=i)}return e}function ds(a){return Array.from({length:7},(s,e)=>we(e,a,"short"))}function ps(a){let s=new Intl.DateTimeFormat(a||"en",{month:"short"});return Array.from({length:12},(e,t)=>s.format(new Date(2021,t,1)))}var is,ss,rs,lt,ti,as,os,m,ct,ii=w(()=>{"use strict";I();M();L();rt();ze();re();at();ot();is=["cleaning","inspection","replacement","calibration","service","reading","custom"],ss=["low","normal","high"],rs=["time_based","weekdays","nth_weekday","day_of_month","sensor_based","one_time","manual"],lt=["weekdays","nth_weekday","day_of_month"],ti=["threshold","counter","state_change","runtime"],as=[...ti,"compound"];os=new Set(["entity_id","entity_ids","type","trigger_above","trigger_below","trigger_for_minutes","trigger_target_value","trigger_delta_mode","trigger_from_state","trigger_to_state","trigger_target_changes","trigger_runtime_hours","trigger_on_states"]);m=class m extends k{constructor(){super(...arguments);this.checklistsEnabled=!1;this.scheduleTimeEnabled=!1;this.completionActionsEnabled=!1;this.defaultWarningDays=7;this.parts=[];this._foreignOwners=[];this._open=!1;this._loading=!1;this._error="";this._entryId="";this._taskId=null;this._objectChoices=[];this._name="";this._type="custom";this._scheduleType="time_based";this._intervalDays="30";this._intervalUnit="days";this._dueDate="";this._warningDays="7";this._earliestCompletionDays="";this._intervalAnchor="completion";this._weekdays=[];this._nth="1";this._nthWeekday="5";this._domDay="1";this._domLastDay=!1;this._domBusiness=!1;this._calOffset="0";this._seasonMonths=[];this._endsMode="never";this._endsCount="";this._endsUntil="";this._schedulePreview=[];this._schedulePreviewEnded=!1;this._previewSeq=0;this._notes="";this._documentationUrl="";this._customIcon="";this._priority="normal";this._labels="";this._enabled=!0;this._triggerEntityId="";this._triggerEntityIds=[];this._triggerEntityLogic="any";this._triggerAttribute="";this._triggerType="threshold";this._triggerAbove="";this._triggerBelow="";this._triggerForMinutes="0";this._triggerTargetValue="";this._triggerDeltaMode=!1;this._triggerBaselineValue="";this._liveBaselineValue=null;this._autoCompleteOnRecovery=!1;this._triggerFromState="";this._triggerToState="";this._triggerTargetChanges="";this._triggerRuntimeHours="";this._triggerOnStates="";this._compoundLogic="AND";this._compoundConditions=[];this._suggestedAttributes=[];this._availableAttributes=[];this._entityDomain="";this._lastPerformed="";this._nfcTagId="";this._readingUnit="";this._consumesParts={};thi Line truncated
`),this._requiredCompletion=[...t.required_completion_fields||[]],this._scheduleTime=t.schedule_time||"";let c=t.on_complete_action;if(c&&c.service){this._actionService=c.service;let _=c.target?.entity_id;this._actionTargetEntity=Array.isArray(_)?_[0]||"":_||"",this._actionData=c.data&&typeof c.data=="object"?{...c.data}:{},this._actionDataJsonFallback=""}else this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="";let d=t.quick_complete_defaults;this._qcNotes=d?.notes||"",this._qcCost=d?.cost!=null?String(d.cost):"",this._qcDuration=d?.duration!=null?String(d.duration):"",this._qcFeedback=d?.feedback||"";let u=t.adaptive_config||{};if(this._environmentalEntity=u.environmental_entity||"",this._environmentalAttribute=u.environmental_attribute||"",this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute,t.trigger_config){let _=t.trigger_config;this._triggerEntityId=_.entity_id||_.entity_ids&&_.entity_ids[0]||"",this._triggerEntityIds=_.entity_ids||(_.entity_id?[_.entity_id]:[]),this._triggerEntityLogic=_.entity_logic||"any",this._triggerAttribute=_.attribute||"",this._triggerType=_.type||"threshold",this._triggerAbove=_.trigger_above?.toString()||"",this._triggerBelow=_.trigger_below?.toString()||"",this._triggerForMinutes=_.trigger_for_minutes?.toString()||"0",this._triggerTargetValue=_.trigger_target_value?.toString()||"",this._triggerDeltaMode=_.trigger_delta_mode||!1,this._triggerBaselineValue=_.trigger_baseline_value?.toString()||"",this._liveBaselineValue=t.trigger_baseline_value??null,this._autoCompleteOnRecovery=_.auto_complete_on_recovery||!1,this._triggerFromState=_.trigger_from_state||"",this._triggerToState=_.trigger_to_state||"",this._triggerTargetChanges=_.trigger_target_changes?.toString()||"",this._triggerRuntimeHours=_.trigger_runtime_hours?.toString()||"",this._triggerOnStates=(_.trigger_on_states||[]).join(", "),_.type==="compound"?(this._compoundLogic=_.compound_logic==="OR"?"OR":"AND",this._compoundConditions=(_.conditions||[]).map(ls)):(this._compoundLogic="AND",this._compoundConditions=[])}else this._resetTriggerFields();this._triggerEntityId&&this._fetchEntityAttributes(this._triggerEntityId),await Promise.all([this._loadUsers(),this._loadTags(),this._loadParts(),this._loadForeignPools()]),this._open=!0}_resetFields(){this._name="",this._type="custom",this._scheduleType="time_based",this._intervalDays="30",this._intervalUnit="days",this._dueDate="",this._warningDays=String(this.defaultWarningDays),this._earliestCompletionDays="",this._intervalAnchor="completion",this._weekdays=[],this._nth="1",this._nthWeekday="5",this._domDay="1",this._domLastDay=!1,this._domBusiness=!1,this._calOffset="0",this._seasonMonths=[],this._endsMode="never",this._endsCount="",this._endsUntil="",this._notes="",this._documentationUrl="",this._customIcon="",this._priority="normal",this._labels="",this._enabled=!0,this._lastPerformed="",this._nfcTagId="",this._readingUnit="",this._consumesParts={},this._responsibleUserId=null,this._assigneePool=[],this._rotationStrategy="",this._checklistText="",this._requiredCompletion=[],this._scheduleTime="",this._environmentalEntity="",this._environmentalAttribute="",this._environmentalInitial="",this._environmentalAttributeInitial="",this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="",this._actionTesting=!1,this._actionTestResult="",this._qcNotes="",this._qcCost="",this._qcDuration="",this._qcFeedback="",this._resetTriggerFields()}_resetTriggerFields(){this._triggerEntityId="",this._triggerEntityIds=[],this._triggerEntityLogic="any",this._triggerAttribute="",this._suggestedAttributes=[],this._availableAttributes=[],this._entityDomain="",this._triggerType="threshold",this._triggerAbove="",this._triggerBelow="",this._triggerForMinutes="0",this._triggerTargetValue="",this._triggerDeltaMode=!1,this._triggerBaselineValue="",this._liveBaselineValue=null,this._autoCompleteOnRecovery=!1,this._triggerFromState="",this._triggerToState="",this._triggerTargetChanges="",this._triggerRuntimeHours="",this._triggerOnStates="",this._compoundLogic="AND",this._compoundConditions=[]}async _loadUsers(){this._userService||(this._userService=new ce(this.hass));try{this._availableUsers=await this._userService.getUsers()}catch(e){console.error("Failed to load users:",e),this._availableUsers=[]}}_toggleAssignee(e){this._assigneePool=this._assigneePool.includes(e)?this._assigneePool.filter(t=>t!==e):[...this._assigneePool,e]}async _testAction(){let e=this._actionService.trim();if(!e||!/^[a-z][a-z0-9_]*\.[a-z0-9_]+$/.test(e)){this._actionTestResult="error",this._actionTestError="Invalid service format (expected 'domain.service')",setTimeout(()=>{this._actionTestResult="",this._actionTestError=""},5e3);return}let[t,i]=e.split(".");if(!this.hass?.services?.[t]?.[i]){this._actionTestResult="error",this._actionTestError=`Service "${e}" is not regisLine truncated
`,l([b({attribute:!1})],A.prototype,"hass",2),l([b({attribute:!1})],A.prototype,"objects",2),l([p()],A.prototype,"_open",2),l([p()],A.prototype,"_loading",2),l([p()],A.prototype,"_error",2),l([p()],A.prototype,"_name",2),l([p()],A.prototype,"_manufacturer",2),l([p()],A.prototype,"_model",2),l([p()],A.prototype,"_serialNumber",2),l([p()],A.prototype,"_areaId",2),l([p()],A.prototype,"_installationDate",2),l([p()],A.prototype,"_warrantyExpiry",2),l([p()],A.prototype,"_documentationUrl",2),l([p()],A.prototype,"_notes",2),l([p()],A.prototype,"_haDeviceId",2),l([p()],A.prototype,"_parentEntryId",2),l([p()],A.prototype,"_entryId",2);customElements.get("maintenance-object-dialog")||customElements.define("maintenance-object-dialog",A)});function os(){return{entityIds:"",type:"threshold",above:"",below:"",forMinutes:"0",targetValue:"",deltaMode:!1,fromState:"",toState:"",targetChanges:"",runtimeHours:"",onStates:"",carry:{}}}function cs(a){return{entityIds:(a.entity_ids||(a.entity_id?[a.entity_id]:[])).join(", "),type:a.type||"threshold",above:a.trigger_above?.toString()??"",below:a.trigger_below?.toString()??"",forMinutes:a.trigger_for_minutes?.toString()??"0",targetValue:a.trigger_target_value?.toString()??"",deltaMode:a.trigger_delta_mode||!1,fromState:a.trigger_from_state||"",toState:a.trigger_to_state||"",targetChanges:a.trigger_target_changes?.toString()??"",runtimeHours:a.trigger_runtime_hours?.toString()??"",onStates:(a.trigger_on_states||[]).join(", "),carry:Object.fromEntries(Object.entries(a).filter(([e])=>!ls.has(e)&&!e.startsWith("_")))}}function ds(a){let s=a.entityIds.split(",").map(t=>t.trim()).filter(Boolean);if(s.length===0)return null;let e={...a.carry||{},entity_id:s[0],entity_ids:s,type:a.type};if(a.type==="threshold"){let t=parseFloat(a.above);isNaN(t)||(e.trigger_above=t);let i=parseFloat(a.below);isNaN(i)||(e.trigger_below=i);let n=parseInt(a.forMinutes,10);isNaN(n)||(e.trigger_for_minutes=n)}else if(a.type==="counter"){let t=parseFloat(a.targetValue);isNaN(t)||(e.trigger_target_value=t),e.trigger_delta_mode=a.deltaMode}else if(a.type==="state_change"){a.fromState&&(e.trigger_from_state=a.fromState),a.toState&&(e.trigger_to_state=a.toState);let t=parseInt(a.targetChanges,10);isNaN(t)||(e.trigger_target_changes=t)}else if(a.type==="runtime"){let t=parseFloat(a.runtimeHours);isNaN(t)||(e.trigger_runtime_hours=t);let i=(a.onStates||"").split(",").map(n=>n.trim()).filter(Boolean);i.length>0&&(e.trigger_on_states=i)}return e}function ps(a){return Array.from({length:7},(s,e)=>we(e,a,"short"))}function hs(a){let s=new Intl.DateTimeFormat(a||"en",{month:"short"});return Array.from({length:12},(e,t)=>s.format(new Date(2021,t,1)))}var ss,rs,as,lt,ii,ns,ls,m,ct,si=w(()=>{"use strict";I();z();L();rt();Me();re();at();ot();ss=["cleaning","inspection","replacement","calibration","service","reading","custom"],rs=["low","normal","high"],as=["time_based","weekdays","nth_weekday","day_of_month","sensor_based","one_time","manual"],lt=["weekdays","nth_weekday","day_of_month"],ii=["threshold","counter","state_change","runtime"],ns=[...ii,"compound"];ls=new Set(["entity_id","entity_ids","type","trigger_above","trigger_below","trigger_for_minutes","trigger_target_value","trigger_delta_mode","trigger_from_state","trigger_to_state","trigger_target_changes","trigger_runtime_hours","trigger_on_states"]);m=class m extends k{constructor(){super(...arguments);this.checklistsEnabled=!1;this.scheduleTimeEnabled=!1;this.completionActionsEnabled=!1;this.defaultWarningDays=7;this.parts=[];this._foreignOwners=[];this._open=!1;this._loading=!1;this._error="";this._entryId="";this._taskId=null;this._objectChoices=[];this._name="";this._type="custom";this._scheduleType="time_based";this._intervalDays="30";this._intervalUnit="days";this._dueDate="";this._warningDays="7";this._earliestCompletionDays="";this._intervalAnchor="completion";this._weekdays=[];this._nth="1";this._nthWeekday="5";this._domDay="1";this._domLastDay=!1;this._domBusiness=!1;this._calOffset="0";this._seasonMonths=[];this._endsMode="never";this._endsCount="";this._endsUntil="";this._schedulePreview=[];this._schedulePreviewEnded=!1;this._previewSeq=0;this._notes="";this._documentationUrl="";this._customIcon="";this._priority="normal";this._labels="";this._enabled=!0;this._triggerEntityId="";this._triggerEntityIds=[];this._triggerEntityLogic="any";this._triggerAttribute="";this._triggerType="threshold";this._triggerAbove="";this._triggerBelow="";this._triggerForMinutes="0";this._triggerTargetValue="";this._triggerDeltaMode=!1;this._triggerBaselineValue="";this._liveBaselineValue=null;this._autoCompleteOnRecovery=!1;this._triggerFromState="";this._triggerToState="";this._triggerTargetChanges="";this._triggerRuntimeHours="";this._triggerOnStates="";this._compoundLogic="AND";this._compoundConditions=[];this._suggestedAttributes=[];this._availableAttributes=[];this._entityDomain="";this._lastPerformed="";this._nfcTagId="";this._readingUnit="";this._consumesParts={};thi Line truncated
`),this._requiredCompletion=[...t.required_completion_fields||[]],this._scheduleTime=t.schedule_time||"";let c=t.on_complete_action;if(c&&c.service){this._actionService=c.service;let _=c.target?.entity_id;this._actionTargetEntity=Array.isArray(_)?_[0]||"":_||"",this._actionData=c.data&&typeof c.data=="object"?{...c.data}:{},this._actionDataJsonFallback=""}else this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="";let d=t.quick_complete_defaults;this._qcNotes=d?.notes||"",this._qcCost=d?.cost!=null?String(d.cost):"",this._qcDuration=d?.duration!=null?String(d.duration):"",this._qcFeedback=d?.feedback||"";let u=t.adaptive_config||{};if(this._environmentalEntity=u.environmental_entity||"",this._environmentalAttribute=u.environmental_attribute||"",this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute,t.trigger_config){let _=t.trigger_config;this._triggerEntityId=_.entity_id||_.entity_ids&&_.entity_ids[0]||"",this._triggerEntityIds=_.entity_ids||(_.entity_id?[_.entity_id]:[]),this._triggerEntityLogic=_.entity_logic||"any",this._triggerAttribute=_.attribute||"",this._triggerType=_.type||"threshold",this._triggerAbove=_.trigger_above?.toString()||"",this._triggerBelow=_.trigger_below?.toString()||"",this._triggerForMinutes=_.trigger_for_minutes?.toString()||"0",this._triggerTargetValue=_.trigger_target_value?.toString()||"",this._triggerDeltaMode=_.trigger_delta_mode||!1,this._triggerBaselineValue=_.trigger_baseline_value?.toString()||"",this._liveBaselineValue=t.trigger_baseline_value??null,this._autoCompleteOnRecovery=_.auto_complete_on_recovery||!1,this._triggerFromState=_.trigger_from_state||"",this._triggerToState=_.trigger_to_state||"",this._triggerTargetChanges=_.trigger_target_changes?.toString()||"",this._triggerRuntimeHours=_.trigger_runtime_hours?.toString()||"",this._triggerOnStates=(_.trigger_on_states||[]).join(", "),_.type==="compound"?(this._compoundLogic=_.compound_logic==="OR"?"OR":"AND",this._compoundConditions=(_.conditions||[]).map(cs)):(this._compoundLogic="AND",this._compoundConditions=[])}else this._resetTriggerFields();this._triggerEntityId&&this._fetchEntityAttributes(this._triggerEntityId),await Promise.all([this._loadUsers(),this._loadTags(),this._loadParts(),this._loadForeignPools()]),this._open=!0}_resetFields(){this._name="",this._type="custom",this._scheduleType="time_based",this._intervalDays="30",this._intervalUnit="days",this._dueDate="",this._warningDays=String(this.defaultWarningDays),this._earliestCompletionDays="",this._intervalAnchor="completion",this._weekdays=[],this._nth="1",this._nthWeekday="5",this._domDay="1",this._domLastDay=!1,this._domBusiness=!1,this._calOffset="0",this._seasonMonths=[],this._endsMode="never",this._endsCount="",this._endsUntil="",this._notes="",this._documentationUrl="",this._customIcon="",this._priority="normal",this._labels="",this._enabled=!0,this._lastPerformed="",this._nfcTagId="",this._readingUnit="",this._consumesParts={},this._responsibleUserId=null,this._assigneePool=[],this._rotationStrategy="",this._checklistText="",this._requiredCompletion=[],this._scheduleTime="",this._environmentalEntity="",this._environmentalAttribute="",this._environmentalInitial="",this._environmentalAttributeInitial="",this._actionService="",this._actionTargetEntity="",this._actionData={},this._actionDataJsonFallback="",this._actionTesting=!1,this._actionTestResult="",this._qcNotes="",this._qcCost="",this._qcDuration="",this._qcFeedback="",this._resetTriggerFields()}_resetTriggerFields(){this._triggerEntityId="",this._triggerEntityIds=[],this._triggerEntityLogic="any",this._triggerAttribute="",this._suggestedAttributes=[],this._availableAttributes=[],this._entityDomain="",this._triggerType="threshold",this._triggerAbove="",this._triggerBelow="",this._triggerForMinutes="0",this._triggerTargetValue="",this._triggerDeltaMode=!1,this._triggerBaselineValue="",this._liveBaselineValue=null,this._autoCompleteOnRecovery=!1,this._triggerFromState="",this._triggerToState="",this._triggerTargetChanges="",this._triggerRuntimeHours="",this._triggerOnStates="",this._compoundLogic="AND",this._compoundConditions=[]}async _loadUsers(){this._userService||(this._userService=new ce(this.hass));try{this._availableUsers=await this._userService.getUsers()}catch(e){console.error("Failed to load users:",e),this._availableUsers=[]}}_toggleAssignee(e){this._assigneePool=this._assigneePool.includes(e)?this._assigneePool.filter(t=>t!==e):[...this._assigneePool,e]}async _testAction(){let e=this._actionService.trim();if(!e||!/^[a-z][a-z0-9_]*\.[a-z0-9_]+$/.test(e)){this._actionTestResult="error",this._actionTestError="Invalid service format (expected 'domain.service')",setTimeout(()=>{this._actionTestResult="",this._actionTestError=""},5e3);return}let[t,i]=e.split(".");if(!this.hass?.services?.[t]?.[i]){this._actionTestResult="error",this._actionTestError=`Service "${e}" is not regisLine truncated
<details class="ca-section">
<summary>${r("on_complete_action_title",e)}</summary>
<p class="field-help">${r("on_complete_action_desc",e)}</p>
@@ -1741,8 +1741,8 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
@input=${d=>{let u=parseFloat(d.target.value);this._consumesParts={...this._consumesParts,[i]:{...c,quantity:Number.isFinite(u)&&u>=.01?u:1}}}}
/>`:h}
</div>
`}_toggleRequired(e,t){let i=new Set(this._requiredCompletion);t?i.add(e):i.delete(e),this._requiredCompletion=[...i]}async _save(){if(!this._loading&&this._name.trim()){this._loading=!0,this._error="";try{let e={type:this._taskId?"maintenance_supporter/task/update":"maintenance_supporter/task/create",entry_id:this._entryId,name:this._name,task_type:this._type,schedule_type:this._scheduleType,warning_days:Number.isNaN(parseInt(this._warningDays,10))?this.defaultWarningDays:Math.max(0,parseInt(this._warningDays,10))},t=this._earliestCompletionDays.trim();if(e.earliest_completion_days=t===""?null:Math.max(0,parseInt(t,10)||0),this._taskId&&(e.task_id=this._taskId),this._scheduleType==="one_time"?(e.due_date=this._dueDate||null,e.interval_days=null):lt.includes(this._scheduleType)?(e.schedule={...this._buildSchedule(),...this._recurrenceExtras()},e.interval_days=null,this._taskId&&(e.due_date=null)):(this._taskId&&(e.due_date=null),this._scheduleType!=="manual"&&this._intervalDays?(e.interval_days=parseInt(this._intervalDays,10),e.interval_unit=this._intervalUnit,e.interval_anchor=this._intervalAnchor,this._scheduleType==="time_based"&&(e.schedule={kind:"interval",...this._recurrenceExtras()})):this._taskId&&(e.interval_days=null,e.interval_anchor="completion")),e.notes=this._notes||null,e.documentation_url=this._documentationUrl||null,e.custom_icon=this._customIcon||null,e.priority=this._priority,e.labels=this._labels.split(",").map(d=>d.trim()).filter(Boolean),e.enabled=this._enabled,e.last_performed=this._lastPerformed||null,e.nfc_tag_id=this._nfcTagId||null,e.reading_unit=this._readingUnit.trim()||null,(this.parts.length||this._foreignOwners.length)&&(e.consumes_parts=Object.values(this._consumesParts).map(d=>d.entry_id?{part_id:d.part_id,quantity:d.quantity,entry_id:d.entry_id}:{part_id:d.part_id,quantity:d.quantity})),e.responsible_user_id=this._responsibleUserId,e.assignee_pool=this._assigneePool,e.required_completion_fields=this._requiredCompletion,e.rotation_strategy=this._assigneePool.length>=2&&this._rotationStrategy?this._rotationStrategy:null,this._scheduleType==="sensor_based"&&this._triggerType==="compound"){let d=this._compoundConditions.map(cs).filter(u=>u!==null);if(d.length>0){let u={type:"compound",compound_logic:this._compoundLogic,conditions:d};this._autoCompleteOnRecovery&&(u.auto_complete_on_recovery=!0),e.trigger_config=u}else this._taskId&&(e.trigger_config=null)}else if(this._scheduleType==="sensor_based"&&this._triggerEntityId){let d=this._triggerEntityIds.length>0?this._triggerEntityIds:[this._triggerEntityId],u={entity_id:d[0],entity_ids:d,type:this._triggerType};if(this._triggerAttribute&&(u.attribute=this._triggerAttribute),this._autoCompleteOnRecovery&&(u.auto_complete_on_recovery=!0),d.length>1&&(u.entity_logic=this._triggerEntityLogic),this._triggerType==="threshold"){if(this._triggerAbove){let _=parseFloat(this._triggerAbove);isNaN(_)||(u.trigger_above=_)}if(this._triggerBelow){let _=parseFloat(this._triggerBelow);isNaN(_)||(u.trigger_below=_)}if(this._triggerForMinutes){let _=parseInt(this._triggerForMinutes,10);isNaN(_)||(u.trigger_for_minutes=_)}}else if(this._triggerType==="counter"){if(this._triggerTargetValue){let _=parseFloat(this._triggerTargetValue);isNaN(_)||(u.trigger_target_value=_)}if(u.trigger_delta_mode=this._triggerDeltaMode,this._triggerDeltaMode&&this._triggerBaselineValue){let _=parseFloat(this._triggerBaselineValue);!isNaN(_)&&_>=0&&(u.trigger_baseline_value=_)}}else if(this._triggerType==="state_change"){if(this._triggerFromState&&(u.trigger_from_state=this._triggerFromState),this._triggerToState&&(u.trigger_to_state=this._triggerToState),this._triggerTargetChanges){let _=parseInt(this._triggerTargetChanges,10);isNaN(_)||(u.trigger_target_changes=_)}}else if(this._triggerType==="runtime"){if(this._triggerRuntimeHours){let v=parseFloat(this._triggerRuntimeHours);isNaN(v)||(u.trigger_runtime_hours=v)}let _=this._triggerOnStates.split(",").map(v=>v.trim()).filter(Boolean);_.length>0&&(u.trigger_on_states=_)}e.trigger_config=u}else this._taskId&&(e.trigger_config=null);if(this.scheduleTimeEnabled&&this._scheduleType==="time_based"){let d=this._scheduleTime.trim();e.schedule_time=/^([01]\d|2[0-3]):[0-5]\d$/.test(d)?d:null}if(this.checklistsEnabled){let d=this._checklistText.split(`
`).map(u=>u.trim()).filter(Boolean).slice(0,100);e.checklist=d.length?d:null}if(this.completionActionsEnabled){let d=this._actionService.trim();if(d&&/^[a-z][a-z0-9_]*\.[a-z0-9_]+$/.test(d)){let f={service:d},b=this._actionTargetEntity.trim();b&&(f.target={entity_id:b});let g=this._buildActionData();Object.keys(g).length>0&&(f.data=g),e.on_complete_action=f}else e.on_complete_action=null;let u={};this._qcNotes.trim()&&(u.notes=this._qcNotes.trim());let _=parseFloat(this._qcCost);!isNaN(_)&&_>=0&&(u.cost=_);let v=parseInt(this._qcDuration,10);!isNaN(v)&&v>=0&&(u.duration=v),this._qcFeedback&&(u.feedback=this._qcFeedback),e.quick_complete_defaults=Object.keys(u).length?u:null}let i=await this.hass.connection.sendMessagePromise(e),n=this._taskId||i?.task_id,c=this._environmentalEntity!==this._environmentalInitial||this._environmentalAttribute!==this._environmentalAttributeInitial;if(n&&this._scheduleType==="sensor_based"&&c)try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/set_environmental_entity",entry_id:this._entryId,task_id:n,environmental_entity:this._environmentalEntity||null,environmental_attribute:this._environmentalAttribute||null}),this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute}catch{}this._open=!1,this.dispatchEvent(new CustomEvent("task-saved"))}catch(e){this._error=P(e,this._lang,r("save_error",this._lang))}finally{this._loading=!1}}}_close(){this._open=!1}_renderTriggerFields(){if(this._scheduleType!=="sensor_based")return h;let e=this._lang,t=this._triggerType==="compound";return o`
`}_toggleRequired(e,t){let i=new Set(this._requiredCompletion);t?i.add(e):i.delete(e),this._requiredCompletion=[...i]}async _save(){if(!this._loading&&this._name.trim()){this._loading=!0,this._error="";try{let e={type:this._taskId?"maintenance_supporter/task/update":"maintenance_supporter/task/create",entry_id:this._entryId,name:this._name,task_type:this._type,schedule_type:this._scheduleType,warning_days:Number.isNaN(parseInt(this._warningDays,10))?this.defaultWarningDays:Math.max(0,parseInt(this._warningDays,10))},t=this._earliestCompletionDays.trim();if(e.earliest_completion_days=t===""?null:Math.max(0,parseInt(t,10)||0),this._taskId&&(e.task_id=this._taskId),this._scheduleType==="one_time"?(e.due_date=this._dueDate||null,e.interval_days=null):lt.includes(this._scheduleType)?(e.schedule={...this._buildSchedule(),...this._recurrenceExtras()},e.interval_days=null,this._taskId&&(e.due_date=null)):(this._taskId&&(e.due_date=null),this._scheduleType!=="manual"&&this._intervalDays?(e.interval_days=parseInt(this._intervalDays,10),e.interval_unit=this._intervalUnit,e.interval_anchor=this._intervalAnchor,this._scheduleType==="time_based"&&(e.schedule={kind:"interval",...this._recurrenceExtras()})):this._taskId&&(e.interval_days=null,e.interval_anchor="completion")),e.notes=this._notes||null,e.documentation_url=this._documentationUrl||null,e.custom_icon=this._customIcon||null,e.priority=this._priority,e.labels=this._labels.split(",").map(d=>d.trim()).filter(Boolean),e.enabled=this._enabled,e.last_performed=this._lastPerformed||null,e.nfc_tag_id=this._nfcTagId||null,e.reading_unit=this._readingUnit.trim()||null,(this.parts.length||this._foreignOwners.length)&&(e.consumes_parts=Object.values(this._consumesParts).map(d=>d.entry_id?{part_id:d.part_id,quantity:d.quantity,entry_id:d.entry_id}:{part_id:d.part_id,quantity:d.quantity})),e.responsible_user_id=this._responsibleUserId,e.assignee_pool=this._assigneePool,e.required_completion_fields=this._requiredCompletion,e.rotation_strategy=this._assigneePool.length>=2&&this._rotationStrategy?this._rotationStrategy:null,this._scheduleType==="sensor_based"&&this._triggerType==="compound"){let d=this._compoundConditions.map(ds).filter(u=>u!==null);if(d.length>0){let u={type:"compound",compound_logic:this._compoundLogic,conditions:d};this._autoCompleteOnRecovery&&(u.auto_complete_on_recovery=!0),e.trigger_config=u}else this._taskId&&(e.trigger_config=null)}else if(this._scheduleType==="sensor_based"&&this._triggerEntityId){let d=this._triggerEntityIds.length>0?this._triggerEntityIds:[this._triggerEntityId],u={entity_id:d[0],entity_ids:d,type:this._triggerType};if(this._triggerAttribute&&(u.attribute=this._triggerAttribute),this._autoCompleteOnRecovery&&(u.auto_complete_on_recovery=!0),d.length>1&&(u.entity_logic=this._triggerEntityLogic),this._triggerType==="threshold"){if(this._triggerAbove){let _=parseFloat(this._triggerAbove);isNaN(_)||(u.trigger_above=_)}if(this._triggerBelow){let _=parseFloat(this._triggerBelow);isNaN(_)||(u.trigger_below=_)}if(this._triggerForMinutes){let _=parseInt(this._triggerForMinutes,10);isNaN(_)||(u.trigger_for_minutes=_)}}else if(this._triggerType==="counter"){if(this._triggerTargetValue){let _=parseFloat(this._triggerTargetValue);isNaN(_)||(u.trigger_target_value=_)}if(u.trigger_delta_mode=this._triggerDeltaMode,this._triggerDeltaMode&&this._triggerBaselineValue){let _=parseFloat(this._triggerBaselineValue);!isNaN(_)&&_>=0&&(u.trigger_baseline_value=_)}}else if(this._triggerType==="state_change"){if(this._triggerFromState&&(u.trigger_from_state=this._triggerFromState),this._triggerToState&&(u.trigger_to_state=this._triggerToState),this._triggerTargetChanges){let _=parseInt(this._triggerTargetChanges,10);isNaN(_)||(u.trigger_target_changes=_)}}else if(this._triggerType==="runtime"){if(this._triggerRuntimeHours){let v=parseFloat(this._triggerRuntimeHours);isNaN(v)||(u.trigger_runtime_hours=v)}let _=this._triggerOnStates.split(",").map(v=>v.trim()).filter(Boolean);_.length>0&&(u.trigger_on_states=_)}e.trigger_config=u}else this._taskId&&(e.trigger_config=null);if(this.scheduleTimeEnabled&&this._scheduleType==="time_based"){let d=this._scheduleTime.trim();e.schedule_time=/^([01]\d|2[0-3]):[0-5]\d$/.test(d)?d:null}if(this.checklistsEnabled){let d=this._checklistText.split(`
`).map(u=>u.trim()).filter(Boolean).slice(0,100);e.checklist=d.length?d:null}if(this.completionActionsEnabled){let d=this._actionService.trim();if(d&&/^[a-z][a-z0-9_]*\.[a-z0-9_]+$/.test(d)){let f={service:d},y=this._actionTargetEntity.trim();y&&(f.target={entity_id:y});let g=this._buildActionData();Object.keys(g).length>0&&(f.data=g),e.on_complete_action=f}else e.on_complete_action=null;let u={};this._qcNotes.trim()&&(u.notes=this._qcNotes.trim());let _=parseFloat(this._qcCost);!isNaN(_)&&_>=0&&(u.cost=_);let v=parseInt(this._qcDuration,10);!isNaN(v)&&v>=0&&(u.duration=v),this._qcFeedback&&(u.feedback=this._qcFeedback),e.quick_complete_defaults=Object.keys(u).length?u:null}let i=await this.hass.connection.sendMessagePromise(e),n=this._taskId||i?.task_id,c=this._environmentalEntity!==this._environmentalInitial||this._environmentalAttribute!==this._environmentalAttributeInitial;if(n&&this._scheduleType==="sensor_based"&&c)try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/set_environmental_entity",entry_id:this._entryId,task_id:n,environmental_entity:this._environmentalEntity||null,environmental_attribute:this._environmentalAttribute||null}),this._environmentalInitial=this._environmentalEntity,this._environmentalAttributeInitial=this._environmentalAttribute}catch{}this._open=!1,this.dispatchEvent(new CustomEvent("task-saved"))}catch(e){this._error=P(e,this._lang,r("save_error",this._lang))}finally{this._loading=!1}}}_close(){this._open=!1}_renderTriggerFields(){if(this._scheduleType!=="sensor_based")return h;let e=this._lang,t=this._triggerType==="compound";return o`
<h3>${r("trigger_configuration",e)}</h3>
<div class="select-row">
<label>${r("trigger_type",e)}</label>
@@ -1750,7 +1750,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
.value=${this._triggerType}
@change=${i=>this._triggerType=i.target.value}
>
${as.map(i=>o`<option value=${i} ?selected=${i===this._triggerType}>${r(i,e)}</option>`)}
${ns.map(i=>o`<option value=${i} ?selected=${i===this._triggerType}>${r(i,e)}</option>`)}
</select>
</div>
${t?this._renderCompoundEditor():o`
@@ -1809,7 +1809,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
@input=${i=>this._intervalDays=i.target.value}
></ms-textfield>
${this._intervalDays?this._renderUnitSelect():h}
`}_patchCondition(e,t){this._compoundConditions=this._compoundConditions.map((i,n)=>n===e?{...i,...t}:i)}_addCondition(){this._compoundConditions=[...this._compoundConditions,ns()]}_removeCondition(e){this._compoundConditions=this._compoundConditions.filter((t,i)=>i!==e)}_renderCompoundEditor(){let e=this._lang;return o`
`}_patchCondition(e,t){this._compoundConditions=this._compoundConditions.map((i,n)=>n===e?{...i,...t}:i)}_addCondition(){this._compoundConditions=[...this._compoundConditions,os()]}_removeCondition(e){this._compoundConditions=this._compoundConditions.filter((t,i)=>i!==e)}_renderCompoundEditor(){let e=this._lang;return o`
<div class="select-row">
<label>${r("compound_logic",e)}</label>
<select
@@ -1847,7 +1847,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
.value=${e.type}
@change=${c=>this._patchCondition(t,{type:c.target.value})}
>
${ti.map(c=>o`<option value=${c} ?selected=${c===e.type}>${r(c,i)}</option>`)}
${ii.map(c=>o`<option value=${c} ?selected=${c===e.type}>${r(c,i)}</option>`)}
</select>
</div>
${this._renderConditionTypeFields(e,t)}
@@ -1893,7 +1893,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
${r("schedule_preview_title",e)}: ${i}${this._schedulePreviewEnded?o` <span class="field-help">${r("schedule_preview_ends",e)}</span>`:h}
${n}
</div>
`}_buildSchedule(){let e=i=>{let n=parseInt(this._calOffset,10)||0;return n&&(i.offset=Math.max(-15,Math.min(n,15))),i};if(this._scheduleType==="weekdays")return e({kind:"weekdays",weekdays:[...this._weekdays].sort((i,n)=>i-n)});if(this._scheduleType==="nth_weekday")return e({kind:"nth_weekday",nth:parseInt(this._nth,10),weekday:parseInt(this._nthWeekday,10)});let t={kind:"day_of_month",day:this._domLastDay?-1:parseInt(this._domDay,10)||1};return this._domBusiness&&(t.business=!0),e(t)}_recurrenceExtras(){let e={};if(this._seasonMonths.length&&(e.season_months=[...this._seasonMonths].sort((t,i)=>t-i)),this._endsMode==="count"){let t=parseInt(this._endsCount,10);t>=1&&(e.ends={count:t})}else this._endsMode==="until"&&this._endsUntil&&(e.ends={until:this._endsUntil});return e}_toggleSeasonMonth(e){this._seasonMonths=this._seasonMonths.includes(e)?this._seasonMonths.filter(t=>t!==e):[...this._seasonMonths,e]}_renderRecurrenceExtras(){let e=this._lang;if(!(this._scheduleType==="time_based"||lt.includes(this._scheduleType)))return h;let i=ps(e);return o`
`}_buildSchedule(){let e=i=>{let n=parseInt(this._calOffset,10)||0;return n&&(i.offset=Math.max(-15,Math.min(n,15))),i};if(this._scheduleType==="weekdays")return e({kind:"weekdays",weekdays:[...this._weekdays].sort((i,n)=>i-n)});if(this._scheduleType==="nth_weekday")return e({kind:"nth_weekday",nth:parseInt(this._nth,10),weekday:parseInt(this._nthWeekday,10)});let t={kind:"day_of_month",day:this._domLastDay?-1:parseInt(this._domDay,10)||1};return this._domBusiness&&(t.business=!0),e(t)}_recurrenceExtras(){let e={};if(this._seasonMonths.length&&(e.season_months=[...this._seasonMonths].sort((t,i)=>t-i)),this._endsMode==="count"){let t=parseInt(this._endsCount,10);t>=1&&(e.ends={count:t})}else this._endsMode==="until"&&this._endsUntil&&(e.ends={until:this._endsUntil});return e}_toggleSeasonMonth(e){this._seasonMonths=this._seasonMonths.includes(e)?this._seasonMonths.filter(t=>t!==e):[...this._seasonMonths,e]}_renderRecurrenceExtras(){let e=this._lang;if(!(this._scheduleType==="time_based"||lt.includes(this._scheduleType)))return h;let i=hs(e);return o`
<label class="field-label">${r("season_window_label",e)}</label>
<div class="field-help">${r("season_window_hint",e)}</div>
<div class="weekday-chips season-chips">
@@ -1928,7 +1928,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
.value=${this._endsUntil}
@input=${n=>this._endsUntil=n.target.value}
></ms-textfield>`:h}
`}_renderCalendarFields(){let e=this._lang,t=ds(e);if(this._scheduleType==="weekdays")return o`
`}_renderCalendarFields(){let e=this._lang,t=ps(e);if(this._scheduleType==="weekdays")return o`
<label class="field-label">${r("recurrence_on_days",e)}</label>
<div class="weekday-chips">
${t.map((i,n)=>o`
@@ -1980,7 +1980,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
max="15"
.value=${this._calOffset}
@input=${t=>this._calOffset=t.target.value}
></ms-textfield>`}_renderTriggerLiveHint(){if(this._triggerType==="compound")return h;let e=this._triggerEntityId||this._triggerEntityIds[0];if(!e||!this.hass?.states)return h;let t=this.hass.states[e];if(!t)return h;let i=this._lang,n=t.attributes?.unit_of_measurement,c=typeof n=="string"&&n?` ${n}`:"",d=this._triggerAttribute?t.attributes?.[this._triggerAttribute]:t.state,u=typeof d=="number"?d:parseFloat(String(d)),_=d!=="unknown"&&d!=="unavailable"&&d!=null&&!isNaN(u),v=b=>Number.isInteger(b)?String(b):String(Math.round(b*10)/10),f=[];if(this._triggerType==="threshold"){let b=parseFloat(this._triggerAbove),g=parseFloat(this._triggerBelow);if(isNaN(b)&&isNaN(g))return h;_&&f.push(r("trigger_hint_now",i).replace("{value}",v(u)+c)),isNaN(b)||f.push(r("trigger_hint_above",i).replace("{target}",v(b)+c)),isNaN(g)||f.push(r("trigger_hint_below",i).replace("{target}",v(g)+c))}else if(this._triggerType==="counter"){let b=parseFloat(this._triggerTargetValue);if(isNaN(b))return h;this._triggerDeltaMode?this._taskId?f.push(r("trigger_hint_counter_delta_edit",i).replace("{target}",v(b)+c)):_?f.push(r("trigger_hint_counter_delta",i).replace("{value}",v(u)+c).replace("{due}",v(u+b)+c).replace("{target}",v(b)+c)):f.push(r("trigger_hint_counter_delta_edit",i).replace("{target}",v(b)+c)):(_&&f.push(r("trigger_hint_now",i).replace("{value}",v(u)+c)),f.push(r("trigger_hint_counter_abs",i).replace("{target}",v(b)+c)))}else if(this._triggerType==="runtime"){let b=parseFloat(this._triggerRuntimeHours);if(isNaN(b))return h;f.push(r("trigger_hint_runtime",i).replace("{hours}",v(b))),f.push(r("trigger_hint_state_now",i).replace("{value}",String(t.state)))}else if(this._triggerType==="state_change"){let b=parseInt(this._triggerTargetChanges,10)||1,g=this._triggerToState.trim();f.push((g?r("trigger_hint_state_change_to",i).replace("{state}",g):r("trigger_hint_state_change",i)).replace("{count}",String(b))),f.push(r("trigger_hint_state_now",i).replace("{value}",String(t.state)))}return f.length?o`<div class="trigger-live-hint">${f.join(" ")}</div>`:h}_renderTriggerTypeFields(){let e=this._lang;return this._triggerType==="threshold"?o`
></ms-textfield>`}_renderTriggerLiveHint(){if(this._triggerType==="compound")return h;let e=this._triggerEntityId||this._triggerEntityIds[0];if(!e||!this.hass?.states)return h;let t=this.hass.states[e];if(!t)return h;let i=this._lang,n=t.attributes?.unit_of_measurement,c=typeof n=="string"&&n?` ${n}`:"",d=this._triggerAttribute?t.attributes?.[this._triggerAttribute]:t.state,u=typeof d=="number"?d:parseFloat(String(d)),_=d!=="unknown"&&d!=="unavailable"&&d!=null&&!isNaN(u),v=y=>Number.isInteger(y)?String(y):String(Math.round(y*10)/10),f=[];if(this._triggerType==="threshold"){let y=parseFloat(this._triggerAbove),g=parseFloat(this._triggerBelow);if(isNaN(y)&&isNaN(g))return h;_&&f.push(r("trigger_hint_now",i).replace("{value}",v(u)+c)),isNaN(y)||f.push(r("trigger_hint_above",i).replace("{target}",v(y)+c)),isNaN(g)||f.push(r("trigger_hint_below",i).replace("{target}",v(g)+c))}else if(this._triggerType==="counter"){let y=parseFloat(this._triggerTargetValue);if(isNaN(y))return h;this._triggerDeltaMode?this._taskId?f.push(r("trigger_hint_counter_delta_edit",i).replace("{target}",v(y)+c)):_?f.push(r("trigger_hint_counter_delta",i).replace("{value}",v(u)+c).replace("{due}",v(u+y)+c).replace("{target}",v(y)+c)):f.push(r("trigger_hint_counter_delta_edit",i).replace("{target}",v(y)+c)):(_&&f.push(r("trigger_hint_now",i).replace("{value}",v(u)+c)),f.push(r("trigger_hint_counter_abs",i).replace("{target}",v(y)+c)))}else if(this._triggerType==="runtime"){let y=parseFloat(this._triggerRuntimeHours);if(isNaN(y))return h;f.push(r("trigger_hint_runtime",i).replace("{hours}",v(y))),f.push(r("trigger_hint_state_now",i).replace("{value}",String(t.state)))}else if(this._triggerType==="state_change"){let y=parseInt(this._triggerTargetChanges,10)||1,g=this._triggerToState.trim();f.push((g?r("trigger_hint_state_change_to",i).replace("{state}",g):r("trigger_hint_state_change",i)).replace("{count}",String(y))),f.push(r("trigger_hint_state_now",i).replace("{value}",String(t.state)))}return f.length?o`<div class="trigger-live-hint">${f.join(" ")}</div>`:h}_renderTriggerTypeFields(){let e=this._lang;return this._triggerType==="threshold"?o`
<ms-textfield
label="${r("trigger_above",e)}"
type="number"
@@ -2095,7 +2095,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
.value=${this._type}
@change=${i=>this._type=i.target.value}
>
${is.map(i=>o`<option value=${i} ?selected=${i===this._type}>${r(i,e)}</option>`)}
${ss.map(i=>o`<option value=${i} ?selected=${i===this._type}>${r(i,e)}</option>`)}
</select>
</div>
${this._type==="reading"?o`
@@ -2129,7 +2129,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
.value=${this._priority}
@change=${i=>this._priority=i.target.value}
>
${ss.map(i=>o`<option value=${i} ?selected=${i===this._priority}>${r("priority_"+i,e)}</option>`)}
${rs.map(i=>o`<option value=${i} ?selected=${i===this._priority}>${r("priority_"+i,e)}</option>`)}
</select>
</div>
<div class="field">
@@ -2148,7 +2148,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
.value=${this._scheduleType}
@change=${i=>this._scheduleType=i.target.value}
>
${rs.map(i=>o`<option value=${i} ?selected=${i===this._scheduleType}>${r(i,e)}</option>`)}
${as.map(i=>o`<option value=${i} ?selected=${i===this._scheduleType}>${r(i,e)}</option>`)}
</select>
</div>
${this._scheduleType==="time_based"?o`
@@ -2219,14 +2219,14 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
`:h}
<h3>${r("require_on_completion",e)}</h3>
<div class="required-completion">
${Xt.map(i=>o`
${ei.map(i=>o`
<label class="req-option">
<input
type="checkbox"
.checked=${this._requiredCompletion.includes(i)}
@change=${n=>this._toggleRequired(i,n.target.checked)}
/>
<span>${r(Me[i],e)}</span>
<span>${r(ze[i],e)}</span>
</label>
`)}
</div>
@@ -2625,7 +2625,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
font-size: 14px;
cursor: pointer;
}
`,l([y({attribute:!1})],m.prototype,"hass",2),l([y({type:Boolean,attribute:"checklists-enabled"})],m.prototype,"checklistsEnabled",2),l([y({type:Boolean,attribute:"schedule-time-enabled"})],m.prototype,"scheduleTimeEnabled",2),l([y({type:Boolean,attribute:"completion-actions-enabled"})],m.prototype,"completionActionsEnabled",2),l([y({type:Number,attribute:"default-warning-days"})],m.prototype,"defaultWarningDays",2),l([p()],m.prototype,"parts",2),l([p()],m.prototype,"_foreignOwners",2),l([p()],m.prototype,"_open",2),l([p()],m.prototype,"_loading",2),l([p()],m.prototype,"_error",2),l([p()],m.prototype,"_entryId",2),l([p()],m.prototype,"_taskId",2),l([p()],m.prototype,"_objectChoices",2),l([p()],m.prototype,"_name",2),l([p()],m.prototype,"_type",2),l([p()],m.prototype,"_scheduleType",2),l([p()],m.prototype,"_intervalDays",2),l([p()],m.prototype,"_intervalUnit",2),l([p()],m.prototype,"_dueDate",2),l([p()],m.prototype,"_warningDays",2),l([p()],m.prototype,"_earliestCompletionDays",2),l([p()],m.prototype,"_intervalAnchor",2),l([p()],m.prototype,"_weekdays",2),l([p()],m.prototype,"_nth",2),l([p()],m.prototype,"_nthWeekday",2),l([p()],m.prototype,"_domDay",2),l([p()],m.prototype,"_domLastDay",2),l([p()],m.prototype,"_domBusiness",2),l([p()],m.prototype,"_calOffset",2),l([p()],m.prototype,"_seasonMonths",2),l([p()],m.prototype,"_endsMode",2),l([p()],m.prototype,"_endsCount",2),l([p()],m.prototype,"_endsUntil",2),l([p()],m.prototype,"_schedulePreview",2),l([p()],m.prototype,"_schedulePreviewEnded",2),l([p()],m.prototype,"_notes",2),l([p()],m.prototype,"_documentationUrl",2),l([p()],m.prototype,"_customIcon",2),l([p()],m.prototype,"_priority",2),l([p()],m.prototype,"_labels",2),l([p()],m.prototype,"_enabled",2),l([p()],m.prototype,"_triggerEntityId",2),l([p()],m.prototype,"_triggerEntityIds",2),l([p()],m.prototype,"_triggerEntityLogic",2),l([p()],m.prototype,"_triggerAttribute",2),l([p()],m.prototype,"_triggerType",2),l([p()],m.prototype,"_triggerAbove",2),l([p()],m.prototype,"_triggerBelow",2),l([p()],m.prototype,"_triggerForMinutes",2),l([p()],m.prototype,"_triggerTargetValue",2),l([p()],m.prototype,"_triggerDeltaMode",2),l([p()],m.prototype,"_triggerBaselineValue",2),l([p()],m.prototype,"_liveBaselineValue",2),l([p()],m.prototype,"_autoCompleteOnRecovery",2),l([p()],m.prototype,"_triggerFromState",2),l([p()],m.prototype,"_triggerToState",2),l([p()],m.prototype,"_triggerTargetChanges",2),l([p()],m.prototype,"_triggerRuntimeHours",2),l([p()],m.prototype,"_triggerOnStates",2),l([p()],m.prototype,"_compoundLogic",2),l([p()],m.prototype,"_compoundConditions",2),l([p()],m.prototype,"_suggestedAttributes",2),l([p()],m.prototype,"_availableAttributes",2),l([p()],m.prototype,"_entityDomain",2),l([p()],m.prototype,"_lastPerformed",2),l([p()],m.prototype,"_nfcTagId",2),l([p()],m.prototype,"_readingUnit",2),l([p()],m.prototype,"_consumesParts",2),l([p()],m.prototype,"_partsLoadFailed",2),l([p()],m.prototype,"_availableTags",2),l([p()],m.prototype,"_responsibleUserId",2),l([p()],m.prototype,"_assigneePool",2),l([p()],m.prototype,"_rotationStrategy",2),l([p()],m.prototype,"_availableUsers",2),l([p()],m.prototype,"_checklistText",2),l([p()],m.prototype,"_requiredCompletion",2),l([p()],m.prototype,"_scheduleTime",2),l([p()],m.prototype,"_actionService",2),l([p()],m.prototype,"_actionTargetEntity",2),l([p()],m.prototype,"_actionData",2),l([p()],m.prototype,"_actionDataJsonFallback",2),l([p()],m.prototype,"_actionTesting",2),l([p()],m.prototype,"_actionTestResult",2),l([p()],m.prototype,"_actionTestError",2),l([p()],m.prototype,"_qcNotes",2),l([p()],m.prototype,"_qcCost",2),l([p()],m.prototype,"_qcDuration",2),l([p()],m.prototype,"_qcFeedback",2),l([p()],m.prototype,"_environmentalEntity",2),l([p()],m.prototype,"_environmentalAttribute",2);ct=m;customElements.get("maintenance-task-dialog")||customElements.define("maintenance-task-dialog",ct)});var W,si=w(()=>{"use strict";I();M();L();re();W=class extends k{constructor(){super(...arguments);this._open=!1;this._saving=!1;this._error="";this._draft=null;this._originalSnapshot=null}get _lang(){return this.hass?.language||"en"}openEdit(e){this._draft={...e},this._originalSnapshot={...e},this._error="",this._open=!0}close(){this._open=!1,this._error="",this._draft=null,this._originalSnapshot=null}_set(e,t){this._draft&&(this._draft={...this._draft,[e]:t})}async _save(){if(!(!this._draft||!this._originalSnapshot)){this._saving=!0,this._error="";try{let e={type:"maintenance_supporter/task/history/update",entry_id:this._draft.entry_id,task_id:this._draft.task_id,original_timestamp:this._originalSnapshot.original_timestamp};if(this._draft.timestamp!==this._originalSnapshot.timestamp&&(e.timestamp=this._draft.timestamp),this._draft.notes!==this._originalSnapshot.notes&&(e.notes=this._draft.notes),this._draft.cost!==this._originalSnapshot.cost&&(e.cost=this._draft.cost),this._draft.duration!==this._originalSnapshot.duration&&(e.duration=this._draft.duration),this._draft.completed_by!==this. Line truncated
`,l([b({attribute:!1})],m.prototype,"hass",2),l([b({type:Boolean,attribute:"checklists-enabled"})],m.prototype,"checklistsEnabled",2),l([b({type:Boolean,attribute:"schedule-time-enabled"})],m.prototype,"scheduleTimeEnabled",2),l([b({type:Boolean,attribute:"completion-actions-enabled"})],m.prototype,"completionActionsEnabled",2),l([b({type:Number,attribute:"default-warning-days"})],m.prototype,"defaultWarningDays",2),l([p()],m.prototype,"parts",2),l([p()],m.prototype,"_foreignOwners",2),l([p()],m.prototype,"_open",2),l([p()],m.prototype,"_loading",2),l([p()],m.prototype,"_error",2),l([p()],m.prototype,"_entryId",2),l([p()],m.prototype,"_taskId",2),l([p()],m.prototype,"_objectChoices",2),l([p()],m.prototype,"_name",2),l([p()],m.prototype,"_type",2),l([p()],m.prototype,"_scheduleType",2),l([p()],m.prototype,"_intervalDays",2),l([p()],m.prototype,"_intervalUnit",2),l([p()],m.prototype,"_dueDate",2),l([p()],m.prototype,"_warningDays",2),l([p()],m.prototype,"_earliestCompletionDays",2),l([p()],m.prototype,"_intervalAnchor",2),l([p()],m.prototype,"_weekdays",2),l([p()],m.prototype,"_nth",2),l([p()],m.prototype,"_nthWeekday",2),l([p()],m.prototype,"_domDay",2),l([p()],m.prototype,"_domLastDay",2),l([p()],m.prototype,"_domBusiness",2),l([p()],m.prototype,"_calOffset",2),l([p()],m.prototype,"_seasonMonths",2),l([p()],m.prototype,"_endsMode",2),l([p()],m.prototype,"_endsCount",2),l([p()],m.prototype,"_endsUntil",2),l([p()],m.prototype,"_schedulePreview",2),l([p()],m.prototype,"_schedulePreviewEnded",2),l([p()],m.prototype,"_notes",2),l([p()],m.prototype,"_documentationUrl",2),l([p()],m.prototype,"_customIcon",2),l([p()],m.prototype,"_priority",2),l([p()],m.prototype,"_labels",2),l([p()],m.prototype,"_enabled",2),l([p()],m.prototype,"_triggerEntityId",2),l([p()],m.prototype,"_triggerEntityIds",2),l([p()],m.prototype,"_triggerEntityLogic",2),l([p()],m.prototype,"_triggerAttribute",2),l([p()],m.prototype,"_triggerType",2),l([p()],m.prototype,"_triggerAbove",2),l([p()],m.prototype,"_triggerBelow",2),l([p()],m.prototype,"_triggerForMinutes",2),l([p()],m.prototype,"_triggerTargetValue",2),l([p()],m.prototype,"_triggerDeltaMode",2),l([p()],m.prototype,"_triggerBaselineValue",2),l([p()],m.prototype,"_liveBaselineValue",2),l([p()],m.prototype,"_autoCompleteOnRecovery",2),l([p()],m.prototype,"_triggerFromState",2),l([p()],m.prototype,"_triggerToState",2),l([p()],m.prototype,"_triggerTargetChanges",2),l([p()],m.prototype,"_triggerRuntimeHours",2),l([p()],m.prototype,"_triggerOnStates",2),l([p()],m.prototype,"_compoundLogic",2),l([p()],m.prototype,"_compoundConditions",2),l([p()],m.prototype,"_suggestedAttributes",2),l([p()],m.prototype,"_availableAttributes",2),l([p()],m.prototype,"_entityDomain",2),l([p()],m.prototype,"_lastPerformed",2),l([p()],m.prototype,"_nfcTagId",2),l([p()],m.prototype,"_readingUnit",2),l([p()],m.prototype,"_consumesParts",2),l([p()],m.prototype,"_partsLoadFailed",2),l([p()],m.prototype,"_availableTags",2),l([p()],m.prototype,"_responsibleUserId",2),l([p()],m.prototype,"_assigneePool",2),l([p()],m.prototype,"_rotationStrategy",2),l([p()],m.prototype,"_availableUsers",2),l([p()],m.prototype,"_checklistText",2),l([p()],m.prototype,"_requiredCompletion",2),l([p()],m.prototype,"_scheduleTime",2),l([p()],m.prototype,"_actionService",2),l([p()],m.prototype,"_actionTargetEntity",2),l([p()],m.prototype,"_actionData",2),l([p()],m.prototype,"_actionDataJsonFallback",2),l([p()],m.prototype,"_actionTesting",2),l([p()],m.prototype,"_actionTestResult",2),l([p()],m.prototype,"_actionTestError",2),l([p()],m.prototype,"_qcNotes",2),l([p()],m.prototype,"_qcCost",2),l([p()],m.prototype,"_qcDuration",2),l([p()],m.prototype,"_qcFeedback",2),l([p()],m.prototype,"_environmentalEntity",2),l([p()],m.prototype,"_environmentalAttribute",2);ct=m;customElements.get("maintenance-task-dialog")||customElements.define("maintenance-task-dialog",ct)});var W,ri=w(()=>{"use strict";I();z();L();re();W=class extends k{constructor(){super(...arguments);this._open=!1;this._saving=!1;this._error="";this._draft=null;this._originalSnapshot=null}get _lang(){return this.hass?.language||"en"}openEdit(e){this._draft={...e},this._originalSnapshot={...e},this._error="",this._open=!0}close(){this._open=!1,this._error="",this._draft=null,this._originalSnapshot=null}_set(e,t){this._draft&&(this._draft={...this._draft,[e]:t})}async _save(){if(!(!this._draft||!this._originalSnapshot)){this._saving=!0,this._error="";try{let e={type:"maintenance_supporter/task/history/update",entry_id:this._draft.entry_id,task_id:this._draft.task_id,original_timestamp:this._originalSnapshot.original_timestamp};if(this._draft.timestamp!==this._originalSnapshot.timestamp&&(e.timestamp=this._draft.timestamp),this._draft.notes!==this._originalSnapshot.notes&&(e.notes=this._draft.notes),this._draft.cost!==this._originalSnapshot.cost&&(e.cost=this._draft.cost),this._draft.duration!==this._originalSnapshot.duration&&(e.duration=this._draft.duration),this._draft.completed_by!==this. Line truncated
<div class="backdrop" @click=${this.close}></div>
<div class="dialog" role="dialog" aria-modal="true">
<h2>${r("history_edit_title",e)||"Edit history entry"}</h2>
@@ -2732,7 +2732,7 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
background: rgba(211,47,47,0.1);
border-radius: 6px;
}
`,l([y({attribute:!1})],W.prototype,"hass",2),l([p()],W.prototype,"_open",2),l([p()],W.prototype,"_saving",2),l([p()],W.prototype,"_error",2),l([p()],W.prototype,"_draft",2);customElements.get("maintenance-history-edit-dialog")||customElements.define("maintenance-history-edit-dialog",W)});function de(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function ri(a){return!a.startsWith("data:image/svg+xml,")&&!a.startsWith("data:image/png;base64,")?"":de(a)}function hs(a){return a.replace(/[/\\:*?"<>|#%]+/g,"").replace(/\s+/g,"-").toLowerCase().substring(0,100)}var N,ai=w(()=>{"use strict";I();M();L();N=class extends k{constructor(){super(...arguments);this.lang="en";this._open=!1;this._loading=!1;this._error="";this._viewResult=null;this._completeResult=null;this._urlMode="companion";this._entryId="";this._taskId=null;this._objectName="";this._taskName="";this._generateSeq=0}openForObject(e,t){this._entryId=e,this._taskId=null,this._objectName=t,this._taskName="",this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}openForTask(e,t,i,n){this._entryId=e,this._taskId=t,this._objectName=i,this._taskName=n,this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}async _generate(){let e=++this._generateSeq;this._loading=!0,this._error="",this._viewResult=null,this._completeResult=null;try{let t={type:"maintenance_supporter/qr/generate",entry_id:this._entryId,url_mode:this._urlMode};this._taskId&&(t.task_id=this._taskId);let i=[this.hass.connection.sendMessagePromise({...t,action:"view"})];this._taskId&&i.push(this.hass.connection.sendMessagePromise({...t,action:"complete"}));let n=await Promise.all(i);if(e!==this._generateSeq)return;this._viewResult=n[0],n.length>1&&(this._completeResult=n[1])}catch(t){if(e!==this._generateSeq)return;let i=t?.code,n=t?.message;this._error=i==="no_url"||typeof n=="string"&&n.includes("No Home Assistant URL")?r("qr_error_no_url",this.lang):r("qr_error",this.lang)}finally{e===this._generateSeq&&(this._loading=!1)}}_setUrlMode(e){this._urlMode!==e&&(this._urlMode=e,this._generate())}_print(){if(!this._viewResult)return;let e=this._viewResult,t=e.label.task_name?`${e.label.object_name} \u2014 ${e.label.task_name}`:e.label.object_name,i=[e.label.manufacturer,e.label.model].filter(Boolean).join(" "),n=window.open("","_blank","width=600,height=500");if(!n)return;let c=this.lang||"en",d=de(t),u=de(i),_=!!this._completeResult,v=de(r("qr_action_view",c)),f=de(r("qr_action_complete",c));n.document.write(`<!DOCTYPE html><html><head><meta charset="utf-8">
`,l([b({attribute:!1})],W.prototype,"hass",2),l([p()],W.prototype,"_open",2),l([p()],W.prototype,"_saving",2),l([p()],W.prototype,"_error",2),l([p()],W.prototype,"_draft",2);customElements.get("maintenance-history-edit-dialog")||customElements.define("maintenance-history-edit-dialog",W)});function de(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function ai(a){return!a.startsWith("data:image/svg+xml,")&&!a.startsWith("data:image/png;base64,")?"":de(a)}function us(a){return a.replace(/[/\\:*?"<>|#%]+/g,"").replace(/\s+/g,"-").toLowerCase().substring(0,100)}var N,ni=w(()=>{"use strict";I();z();L();N=class extends k{constructor(){super(...arguments);this.lang="en";this._open=!1;this._loading=!1;this._error="";this._viewResult=null;this._completeResult=null;this._urlMode="companion";this._entryId="";this._taskId=null;this._objectName="";this._taskName="";this._generateSeq=0}openForObject(e,t){this._entryId=e,this._taskId=null,this._objectName=t,this._taskName="",this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}openForTask(e,t,i,n){this._entryId=e,this._taskId=t,this._objectName=i,this._taskName=n,this._urlMode="companion",this._error="",this._viewResult=null,this._completeResult=null,this._open=!0,this._generate()}async _generate(){let e=++this._generateSeq;this._loading=!0,this._error="",this._viewResult=null,this._completeResult=null;try{let t={type:"maintenance_supporter/qr/generate",entry_id:this._entryId,url_mode:this._urlMode};this._taskId&&(t.task_id=this._taskId);let i=[this.hass.connection.sendMessagePromise({...t,action:"view"})];this._taskId&&i.push(this.hass.connection.sendMessagePromise({...t,action:"complete"}));let n=await Promise.all(i);if(e!==this._generateSeq)return;this._viewResult=n[0],n.length>1&&(this._completeResult=n[1])}catch(t){if(e!==this._generateSeq)return;let i=t?.code,n=t?.message;this._error=i==="no_url"||typeof n=="string"&&n.includes("No Home Assistant URL")?r("qr_error_no_url",this.lang):r("qr_error",this.lang)}finally{e===this._generateSeq&&(this._loading=!1)}}_setUrlMode(e){this._urlMode!==e&&(this._urlMode=e,this._generate())}_print(){if(!this._viewResult)return;let e=this._viewResult,t=e.label.task_name?`${e.label.object_name} \u2014 ${e.label.task_name}`:e.label.object_name,i=[e.label.manufacturer,e.label.model].filter(Boolean).join(" "),n=window.open("","_blank","width=600,height=500");if(!n)return;let c=this.lang||"en",d=de(t),u=de(i),_=!!this._completeResult,v=de(r("qr_action_view",c)),f=de(r("qr_action_complete",c));n.document.write(`<!DOCTYPE html><html><head><meta charset="utf-8">
<meta name="color-scheme" content="light">
<title>${d}</title>
<style>
@@ -2754,17 +2754,17 @@ Test pressure`,checklist_help:"One step per line. Max 100 items.",err_too_long:"
${u?`<div class="sub">${u}</div>`:""}
<div class="qr-row">
<div class="qr-col">
<img src="${ri(this._viewResult.svg_data_uri)}" alt="QR Info" />
<img src="${ai(this._viewResult.svg_data_uri)}" alt="QR Info" />
<div class="qr-label">${v}</div>
</div>
${_?`<div class="qr-col">
<img src="${ri(this._completeResult.svg_data_uri)}" alt="QR Complete" />
<img src="${ai(this._completeResult.svg_data_uri)}" alt="QR Complete" />
<div class="qr-label">${f}</div>
</div>`:""}
</div>
<div class="url">${de(this._viewResult.url)}</div>
<script>setTimeout(()=>window.print(),300)<\/script>
</body></html>`),n.document.close()}_downloadSvg(e,t){let i=decodeURIComponent(e.svg_data_uri.replace("data:image/svg+xml,","")),n=new Blob([i],{type:"image/svg+xml"}),c=URL.createObjectURL(n),d=document.createElement("a");d.href=c;let u=this._taskName?`${this._objectName}-${this._taskName}`:this._objectName;d.download=`qr-${hs(u)}-${t}.svg`,d.click(),URL.revokeObjectURL(c)}_close(){this._open=!1,this._viewResult=null,this._completeResult=null,this._error="",this._loading=!1}render(){if(!this._open)return o``;let e=this.lang||this.hass?.language||"en",t=this._taskName?`${r("qr_code",e)}: ${this._objectName} \u2014 ${this._taskName}`:`${r("qr_code",e)}: ${this._objectName}`,i=!!this._viewResult;return o`
</body></html>`),n.document.close()}_downloadSvg(e,t){let i=decodeURIComponent(e.svg_data_uri.replace("data:image/svg+xml,","")),n=new Blob([i],{type:"image/svg+xml"}),c=URL.createObjectURL(n),d=document.createElement("a");d.href=c;let u=this._taskName?`${this._objectName}-${this._taskName}`:this._objectName;d.download=`qr-${us(u)}-${t}.svg`,d.click(),URL.revokeObjectURL(c)}_close(){this._open=!1,this._viewResult=null,this._completeResult=null,this._error="",this._loading=!1}render(){if(!this._open)return o``;let e=this.lang||this.hass?.language||"en",t=this._taskName?`${r("qr_code",e)}: ${this._objectName} \u2014 ${this._taskName}`:`${r("qr_code",e)}: ${this._objectName}`,i=!!this._viewResult;return o`
<ha-dialog open @closed=${this._close}>
<div class="dialog-title">${t}</div>
<div class="content">
@@ -2943,30 +2943,30 @@ ${u?`<div class="sub">${u}</div>`:""}
color: var(--text-primary-color, #fff);
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
`,l([y({attribute:!1})],N.prototype,"hass",2),l([y()],N.prototype,"lang",2),l([p()],N.prototype,"_open",2),l([p()],N.prototype,"_loading",2),l([p()],N.prototype,"_error",2),l([p()],N.prototype,"_viewResult",2),l([p()],N.prototype,"_completeResult",2),l([p()],N.prototype,"_urlMode",2);customElements.get("maintenance-qr-dialog")||customElements.define("maintenance-qr-dialog",N)});function ni(a,s){let e=a.interval_analysis,t=e?.weibull_beta,i=e?.weibull_eta;if(t==null||i==null||i<=0)return h;let n=a.interval_days??0,c=a.suggested_interval??n;return o`
`,l([b({attribute:!1})],N.prototype,"hass",2),l([b()],N.prototype,"lang",2),l([p()],N.prototype,"_open",2),l([p()],N.prototype,"_loading",2),l([p()],N.prototype,"_error",2),l([p()],N.prototype,"_viewResult",2),l([p()],N.prototype,"_completeResult",2),l([p()],N.prototype,"_urlMode",2);customElements.get("maintenance-qr-dialog")||customElements.define("maintenance-qr-dialog",N)});function oi(a,s){let e=a.interval_analysis,t=e?.weibull_beta,i=e?.weibull_eta;if(t==null||i==null||i<=0)return h;let n=a.interval_days??0,c=a.suggested_interval??n;return o`
<div class="weibull-section">
<div class="weibull-title">
<ha-svg-icon aria-hidden="true" path="M3,14L3.5,14.07L8.07,9.5C7.89,8.85 8.06,8.11 8.59,7.59C9.37,6.8 10.63,6.8 11.41,7.59C11.94,8.11 12.11,8.85 11.93,9.5L14.5,12.07L15,12C15.18,12 15.35,12 15.5,12.07L19.07,8.5C19,8.35 19,8.18 19,8A2,2 0 0,1 21,6A2,2 0 0,1 23,8A2,2 0 0,1 21,10C20.82,10 20.65,10 20.5,9.93L16.93,13.5C17,13.65 17,13.82 17,14A2,2 0 0,1 15,16A2,2 0 0,1 13,14L13.07,13.5L10.5,10.93C10.18,11 9.82,11 9.5,10.93L4.93,15.5L5,16A2,2 0 0,1 3,18A2,2 0 0,1 1,16A2,2 0 0,1 3,14Z"></ha-svg-icon>
${r("weibull_reliability_curve",s)}
${us(t,s)}
${_s(t,s)}
</div>
${_s(t,i,n,c,s)}
${gs(e,s)}
${e?.confidence_interval_low!=null?ms(e,a,s):h}
${gs(t,i,n,c,s)}
${ms(e,s)}
${e?.confidence_interval_low!=null?fs(e,a,s):h}
</div>
`}function us(a,s){let e,t,i;return a<.8?(e="early_failures",t="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z",i="beta_early_failures"):a<=1.2?(e="random_failures",t="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,17H11V15H13V17M13,13H11V7H13V13Z",i="beta_random_failures"):a<=3.5?(e="wear_out",t="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4M12,6A6,6 0 0,1 18,12H12V6Z",i="beta_wear_out"):(e="highly_predictable",t="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M11,16.5L18,9.5L16.59,8.09L11,13.67L7.91,10.59L6.5,12L11,16.5Z",i="beta_highly_predictable"),o`
`}function _s(a,s){let e,t,i;return a<.8?(e="early_failures",t="M13,14H11V10H13M13,18H11V16H13M1,21H23L12,2L1,21Z",i="beta_early_failures"):a<=1.2?(e="random_failures",t="M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,17H11V15H13V17M13,13H11V7H13V13Z",i="beta_random_failures"):a<=3.5?(e="wear_out",t="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M12,4A8,8 0 0,0 4,12A8,8 0 0,0 12,20A8,8 0 0,0 20,12A8,8 0 0,0 12,4M12,6A6,6 0 0,1 18,12H12V6Z",i="beta_wear_out"):(e="highly_predictable",t="M12,2A10,10 0 0,1 22,12A10,10 0 0,1 12,22A10,10 0 0,1 2,12A10,10 0 0,1 12,2M11,16.5L18,9.5L16.59,8.09L11,13.67L7.91,10.59L6.5,12L11,16.5Z",i="beta_highly_predictable"),o`
<span class="beta-badge ${e}">
<ha-svg-icon path="${t}"></ha-svg-icon>
${r(i,s)} (\u03B2=${a.toFixed(2)})
</span>
`}function _s(a,s,e,t,i){let g=Math.max(e,t,s,1)*1.3,x=50,H=[];for(let z=0;z<=x;z++){let O=z/x*g,Si=1-Math.exp(-Math.pow(O/s,a)),Ai=32+O/g*260,Ti=136-Si*128;H.push([Ai,Ti])}let j=H.map(([z,O])=>`${z.toFixed(1)},${O.toFixed(1)}`).join(" "),S="M32,136 "+H.map(([z,O])=>`L${z.toFixed(1)},${O.toFixed(1)}`).join(" ")+` L${H[x][0].toFixed(1)},136 Z`,C=32+e/g*260,$e=1-Math.exp(-Math.pow(e/s,a)),ke=136-$e*128,ki=((1-$e)*100).toFixed(0),ut=32+t/g*260,Ei=[0,.25,.5,.75,1];return o`
`}function gs(a,s,e,t,i){let g=Math.max(e,t,s,1)*1.3,x=50,H=[];for(let M=0;M<=x;M++){let O=M/x*g,Ai=1-Math.exp(-Math.pow(O/s,a)),Ti=32+O/g*260,Ci=136-Ai*128;H.push([Ti,Ci])}let j=H.map(([M,O])=>`${M.toFixed(1)},${O.toFixed(1)}`).join(" "),S="M32,136 "+H.map(([M,O])=>`L${M.toFixed(1)},${O.toFixed(1)}`).join(" ")+` L${H[x][0].toFixed(1)},136 Z`,C=32+e/g*260,$e=1-Math.exp(-Math.pow(e/s,a)),ke=136-$e*128,Ei=((1-$e)*100).toFixed(0),ut=32+t/g*260,Si=[0,.25,.5,.75,1];return o`
<div class="weibull-chart">
<svg viewBox="0 0 ${300} ${160}" preserveAspectRatio="xMidYMid meet" role="img" aria-label="${r("chart_weibull",i)}">
${Ei.map(z=>{let O=136-z*128;return oe`
${Si.map(M=>{let O=136-M*128;return oe`
<line x1="${32}" y1="${O.toFixed(1)}" x2="${292}" y2="${O.toFixed(1)}"
stroke="var(--divider-color)" stroke-width="0.5" stroke-dasharray="${z===.5?"4,3":h}" />
stroke="var(--divider-color)" stroke-width="0.5" stroke-dasharray="${M===.5?"4,3":h}" />
<text x="${28}" y="${(O+3).toFixed(1)}" fill="var(--secondary-text-color)"
font-size="8" text-anchor="end">${(z*100).toFixed(0)}%</text>
font-size="8" text-anchor="end">${(M*100).toFixed(0)}%</text>
`})}
<text x="${32}" y="${156}" fill="var(--secondary-text-color)" font-size="8" text-anchor="middle">0</text>
@@ -2983,7 +2983,7 @@ ${u?`<div class="sub">${u}</div>`:""}
<circle cx="${C.toFixed(1)}" cy="${ke.toFixed(1)}" r="3"
fill="var(--primary-color, #03a9f4)" />
<text x="${(C+4).toFixed(1)}" y="${(ke-6).toFixed(1)}" fill="var(--primary-color, #03a9f4)"
font-size="9" font-weight="600">R=${ki}%</text>
font-size="9" font-weight="600">R=${Ei}%</text>
`:h}
${t>0&&t!==e?oe`
@@ -3002,7 +3002,7 @@ ${u?`<div class="sub">${u}</div>`:""}
${e>0?o`<span class="legend-item"><span class="legend-swatch" style="background:var(--primary-color, #03a9f4); opacity:0.5"></span> ${r("current_interval_marker",i)}</span>`:h}
${t>0&&t!==e?o`<span class="legend-item"><span class="legend-swatch" style="background:var(--success-color, #4caf50)"></span> ${r("recommended_marker",i)}</span>`:h}
</div>
`}function gs(a,s){return o`
`}function ms(a,s){return o`
<div class="weibull-info-row">
<div class="weibull-info-item">
<span>${r("characteristic_life",s)}</span>
@@ -3015,7 +3015,7 @@ ${u?`<div class="sub">${u}</div>`:""}
</div>
`:h}
</div>
`}function ms(a,s,e){let t=a.confidence_interval_low,i=a.confidence_interval_high,n=s.suggested_interval??s.interval_days??0,c=s.interval_days??0,d=Math.max(0,t-5),_=i+5-d,v=(t-d)/_*100,f=(i-t)/_*100,b=(n-d)/_*100,g=c>0?(c-d)/_*100:-1;return o`
`}function fs(a,s,e){let t=a.confidence_interval_low,i=a.confidence_interval_high,n=s.suggested_interval??s.interval_days??0,c=s.interval_days??0,d=Math.max(0,t-5),_=i+5-d,v=(t-d)/_*100,f=(i-t)/_*100,y=(n-d)/_*100,g=c>0?(c-d)/_*100:-1;return o`
<div class="confidence-range">
<div class="confidence-range-title">
${r("confidence_interval",e)}: ${n} ${r("days",e)} (${t}\u2013${i})
@@ -3023,14 +3023,14 @@ ${u?`<div class="sub">${u}</div>`:""}
<div class="confidence-bar">
<div class="confidence-fill" style="left:${v.toFixed(1)}%;width:${f.toFixed(1)}%"></div>
${g>=0?o`<div class="confidence-marker current" style="left:${g.toFixed(1)}%"></div>`:h}
<div class="confidence-marker recommended" style="left:${b.toFixed(1)}%"></div>
<div class="confidence-marker recommended" style="left:${y.toFixed(1)}%"></div>
</div>
<div class="confidence-labels">
<span class="confidence-text low">${r("confidence_conservative",e)} (${t}${r("days",e).charAt(0)})</span>
<span class="confidence-text high">${r("confidence_aggressive",e)} (${i}${r("days",e).charAt(0)})</span>
</div>
</div>
`}var oi=w(()=>{"use strict";I();L()});function li(a,s,e){let t=a.degradation_trend!=null&&a.degradation_trend!=="insufficient_data",i=a.days_until_threshold!=null,n=a.environmental_factor!=null&&a.environmental_factor!==1;if(!t&&!i&&!n)return h;let c=a.degradation_trend==="rising"?"M16,6L18.29,8.29L13.41,13.17L9.41,9.17L2,16.59L3.41,18L9.41,12L13.41,16L19.71,9.71L22,12V6H16Z":a.degradation_trend==="falling"?"M16,18L18.29,15.71L13.41,10.83L9.41,14.83L2,7.41L3.41,6L9.41,12L13.41,8L19.71,14.29L22,12V18H16Z":"M22,12L18,8V11H3V13H18V16L22,12Z";return o`
`}var li=w(()=>{"use strict";I();L()});function ci(a,s,e){let t=a.degradation_trend!=null&&a.degradation_trend!=="insufficient_data",i=a.days_until_threshold!=null,n=a.environmental_factor!=null&&a.environmental_factor!==1;if(!t&&!i&&!n)return h;let c=a.degradation_trend==="rising"?"M16,6L18.29,8.29L13.41,13.17L9.41,9.17L2,16.59L3.41,18L9.41,12L13.41,16L19.71,9.71L22,12V6H16Z":a.degradation_trend==="falling"?"M16,18L18.29,15.71L13.41,10.83L9.41,14.83L2,7.41L3.41,6L9.41,12L13.41,8L19.71,14.29L22,12V18H16Z":"M22,12L18,8V11H3V13H18V16L22,12Z";return o`
<div class="prediction-section">
${a.sensor_prediction_urgency?o`
<div class="prediction-urgency-banner">
@@ -3065,12 +3065,12 @@ ${u?`<div class="sub">${u}</div>`:""}
<ha-svg-icon path="M15,13V5A3,3 0 0,0 12,2A3,3 0 0,0 9,5V13A5,5 0 0,0 7,17A5,5 0 0,0 12,22A5,5 0 0,0 17,17A5,5 0 0,0 15,13M12,4A1,1 0 0,1 13,5V8H11V5A1,1 0 0,1 12,4Z"></ha-svg-icon>
<span class="prediction-label">${r("environmental_adjustment",s)}</span>
<span class="prediction-value">${a.environmental_factor.toFixed(2)}x</span>
${a.environmental_entity?o`<span class="prediction-entity entity-link" @click=${d=>Jt(d,a.environmental_entity)}>${a.environmental_entity}</span>`:h}
${a.environmental_entity?o`<span class="prediction-entity entity-link" @click=${d=>Qt(d,a.environmental_entity)}>${a.environmental_entity}</span>`:h}
</div>
`:h}
</div>
</div>
`}var ci=w(()=>{"use strict";I();L()});function di(a,s,e,t){let i=Math.max(a||1,s);return o`
`}var di=w(()=>{"use strict";I();L()});function pi(a,s,e,t){let i=Math.max(a||1,s);return o`
<div class="interval-comparison">
<div class="interval-bar">
<div class="interval-label">
@@ -3088,7 +3088,7 @@ ${u?`<div class="sub">${u}</div>`:""}
style="width: ${Math.min(s/i*100,100)}%"></div>
</div>
</div>
`}var pi=w(()=>{"use strict";I();L()});function ui(a,s,e){if(!e.seasonal||!a.seasonal_factor||a.seasonal_factor===1)return h;let t=hi.map(d=>r(d,s)),i=new Date().getMonth(),n=a.seasonal_factors||a.interval_analysis?.seasonal_factors||null,c=n&&n.length===12?n:t.map((d,u)=>{let _=a.seasonal_factor||1,v=Math.sin((u-6)*Math.PI/6)*.3;return Math.max(.7,Math.min(1.3,_+v))});return o`
`}var hi=w(()=>{"use strict";I();L()});function _i(a,s,e){if(!e.seasonal||!a.seasonal_factor||a.seasonal_factor===1)return h;let t=ui.map(d=>r(d,s)),i=new Date().getMonth(),n=a.seasonal_factors||a.interval_analysis?.seasonal_factors||null,c=n&&n.length===12?n:t.map((d,u)=>{let _=a.seasonal_factor||1,v=Math.sin((u-6)*Math.PI/6)*.3;return Math.max(.7,Math.min(1.3,_+v))});return o`
<div class="seasonal-card-compact">
<h4>${r("seasonal_awareness",s)}</h4>
<div class="seasonal-mini-chart">
@@ -3105,7 +3105,7 @@ ${u?`<div class="sub">${u}</div>`:""}
<span class="legend-item"><span class="dot high"></span> ${r("longer",s)||"L\xE4nger"}</span>
</div>
</div>
`}function _i(a,s){return fs(a,s)}function fs(a,s){let e=a.seasonal_factors??a.interval_analysis?.seasonal_factors;if(!e||e.length!==12)return h;let t=a.interval_analysis?.seasonal_reason,i=new Date().getMonth(),n=300,c=100,d=8,_=c-d-4,v=Math.max(...e,1.5),f=n/12,b=f*.65,g=d+_-1/v*_;return o`
`}function gi(a,s){return vs(a,s)}function vs(a,s){let e=a.seasonal_factors??a.interval_analysis?.seasonal_factors;if(!e||e.length!==12)return h;let t=a.interval_analysis?.seasonal_reason,i=new Date().getMonth(),n=300,c=100,d=8,_=c-d-4,v=Math.max(...e,1.5),f=n/12,y=f*.65,g=d+_-1/v*_;return o`
<div class="seasonal-chart">
<div class="seasonal-chart-title">
<ha-svg-icon aria-hidden="true" path="M17.75 4.09L15.22 6.03L16.13 9.09L13.5 7.28L10.87 9.09L11.78 6.03L9.25 4.09L12.44 4L13.5 1L14.56 4L17.75 4.09M21.25 11L19.61 12.25L20.2 14.23L18.5 13.06L16.8 14.23L17.39 12.25L15.75 11L17.81 10.95L18.5 9L19.19 10.95L21.25 11M18.97 15.95C19.8 15.87 20.69 17.05 20.16 17.8C19.84 18.25 19.5 18.67 19.08 19.07C15.17 23 8.84 23 4.94 19.07C1.03 15.17 1.03 8.83 4.94 4.93C5.34 4.53 5.76 4.17 6.21 3.85C6.96 3.32 8.14 4.21 8.06 5.04C7.79 7.9 8.75 10.87 10.95 13.06C13.14 15.26 16.1 16.22 18.97 15.95Z"></ha-svg-icon>
@@ -3115,20 +3115,20 @@ ${u?`<div class="sub">${u}</div>`:""}
<svg viewBox="0 0 ${n} ${c}" preserveAspectRatio="xMidYMid meet" role="img" aria-label="${r("chart_seasonal",s)}">
<line x1="0" y1="${g.toFixed(1)}" x2="${n}" y2="${g.toFixed(1)}"
stroke="var(--divider-color)" stroke-width="1" stroke-dasharray="4,3" />
${e.map((x,H)=>{let j=x/v*_,S=H*f+(f-b)/2,C=d+_-j,$e=H===i,ke=x<1?"var(--success-color, #4caf50)":x>1?"var(--warning-color, #ff9800)":"var(--secondary-text-color)";return oe`
${e.map((x,H)=>{let j=x/v*_,S=H*f+(f-y)/2,C=d+_-j,$e=H===i,ke=x<1?"var(--success-color, #4caf50)":x>1?"var(--warning-color, #ff9800)":"var(--secondary-text-color)";return oe`
<rect x="${S.toFixed(1)}" y="${C.toFixed(1)}"
width="${b.toFixed(1)}" height="${j.toFixed(1)}"
width="${y.toFixed(1)}" height="${j.toFixed(1)}"
fill="${ke}" opacity="${$e?1:.5}" rx="2" />
`})}
</svg>
<div class="seasonal-labels">
${hi.map((x,H)=>o`<span class="seasonal-label ${H===i?"active-month":""}">${r(x,s)}</span>`)}
${ui.map((x,H)=>o`<span class="seasonal-label ${H===i?"active-month":""}">${r(x,s)}</span>`)}
</div>
</div>
`}var hi,gi=w(()=>{"use strict";I();L();hi=["month_jan","month_feb","month_mar","month_apr","month_may","month_jun","month_jul","month_aug","month_sep","month_oct","month_nov","month_dec"]});var T,mi=w(()=>{"use strict";I();M();L();re();oi();ci();pi();gi();T=class extends k{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._taskId=null;this._task=null;this._objectName="";this._busy=!1;this._error="";this._showSkip=!1;this._showReset=!1;this._showDetails=!1;this._showAdaptive=!1;this._skipReason="";this._resetDate="";this._features={adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1};this._toast="";this._featuresLoaded=!1}get _lang(){return this.hass?.language||"en"}async openFor(e,t){this._entryId=e,this._taskId=t,this._error="",this._showSkip=!1,this._showReset=!1,this._showAdaptive=!1,this._skipReason="",this._resetDate=new Date().toISOString().slice(0,10),this._open=!0,await Promise.all([this._loadTask(),this._loadFeatures()])}async _loadFeatures(){if(!this._featuresLoaded)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/settings"});e?.features&&(this._features={...this._features,...e.features}),this._featuresLoaded=!0}catch{}}close(){this._open=!1,this._task=null,this._error=""}async _loadTask(){if(!(!this._entryId||!this._taskId))try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._objectName=e.object?.name||"";let t=(e.tasks||[]).find(i=>i.id===this._taskId);this._task=t??null}catch(e){this._error=P(e,this._lang)}}async _runWs(e){this._busy=!0,this._error="";try{return await this.hass.connection.sendMessagePromise(e),this._busy=!1,!0}catch(t){return this._error=P(t,this._lang),this._busy=!1,!1}}_notifyChanged(e){this.dispatchEvent(new CustomEvent("task-action-fired",{detail:{entry_id:this._entryId,task_id:this._taskId,action:e},bubbles:!0,composed:!0}))}_onComplete(){!this._entryId||!this._taskId||!this._task||Promise.resolve().then(()=>(F(),G)).then(({openCompleteDialog:e})=>{e({entry_id:this._entryId,task_id:this._taskId,task_name:this._task.name,checklist:this._task.checklist||[],adaptive_enabled:!!this._task.adaptive_config?.enabled})&&(this._notifyChanged("complete"),this.close())})}async _onSkipConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/skip",entry_id:this._entryId,task_id:this._taskId,reason:this._skipReason.trim()||null})&&(this._notifyChanged("skip"),this.close())}async _onResetConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/reset",entry_id:this._entryId,task_id:this._taskId,date:this._resetDate||void 0})&&(this._notifyChanged("reset"),this.close())}_onEdit(){!this._entryId||!this._taskId||Promise.resolve().then(()=>(F(),G)).then(({openEditTaskDialog:e})=>{e(this._entryId,this._taskId),this.close()})}_onQr(){!this._entryId||!this._taskId||!this._task||Promise.resolve().then(()=>(F(),G)).then(({openQrDialog:e})=>{e({entry_id:this._entryId,task_id:this._taskId,task_name:this._task.name,object_name:this._objectName}),this.close()})}async _onDelete(){if(!this._entryId||!this._taskId)return;let e=r("delete_task_confirm",this._lang)||`Delete "${this._task?.name}"?`;if(!window.confirm(e))return;await this._runWs({type:"maintenance_supporter/task/delete",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("delete"),this.close())}async _onArchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/archive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("archive"),this.close())}async _onUnarchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/unarchive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("unarchive"),this.close())}_onOpenInPanel(){if(!this._entryId||!this._taskId)return;let e=`/maintenance-supporter?entry_id=${encodeURIComponent(this._entryId)}&task_id=${encodeURIComponent(this._taskId)}`;history.pushState(null,"",e),window.dispatchEvent(new CustomEvent("location-changed")),this.close()}async _applySuggestion(){if(!this._entryId||!this._taskId||!this._task?.suggested_interval)return;await this._runWs({type:"maintenance_supporter/task/apply_suggestion",entry_id:this._entryId,task_id:this._taskId,interval:this._task.suggested_interval})&&(this._toast=r("suggestion_applied",this._lang)||"Applied",this._notifyChanged("apply_suggestion"),await this._loadTask(),setTimeout(()=>{this._toast=""},2500))}async _reanalyzeInterval(){if(!(!this._entryId||!this._taskId)){this._busy=!0,this._error="";try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/analyze_interval",entry_id:this._entryId,task_id:this._taskId});this._toast=e.recommended_interval?`${r("reanalyze_result",this._lang)||"Recomputed"}: ${Re(e.rLine truncated
`}var ui,mi=w(()=>{"use strict";I();L();ui=["month_jan","month_feb","month_mar","month_apr","month_may","month_jun","month_jul","month_aug","month_sep","month_oct","month_nov","month_dec"]});var T,fi=w(()=>{"use strict";I();z();L();re();li();di();hi();mi();T=class extends k{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._taskId=null;this._task=null;this._objectName="";this._busy=!1;this._error="";this._showSkip=!1;this._showReset=!1;this._showDetails=!1;this._showAdaptive=!1;this._skipReason="";this._resetDate="";this._features={adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1};this._toast="";this._featuresLoaded=!1}get _lang(){return this.hass?.language||"en"}async openFor(e,t){this._entryId=e,this._taskId=t,this._error="",this._showSkip=!1,this._showReset=!1,this._showAdaptive=!1,this._skipReason="",this._resetDate=new Date().toISOString().slice(0,10),this._open=!0,await Promise.all([this._loadTask(),this._loadFeatures()])}async _loadFeatures(){if(!this._featuresLoaded)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/settings"});e?.features&&(this._features={...this._features,...e.features}),this._featuresLoaded=!0}catch{}}close(){this._open=!1,this._task=null,this._error=""}async _loadTask(){if(!(!this._entryId||!this._taskId))try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._objectName=e.object?.name||"";let t=(e.tasks||[]).find(i=>i.id===this._taskId);this._task=t??null}catch(e){this._error=P(e,this._lang)}}async _runWs(e){this._busy=!0,this._error="";try{return await this.hass.connection.sendMessagePromise(e),this._busy=!1,!0}catch(t){return this._error=P(t,this._lang),this._busy=!1,!1}}_notifyChanged(e){this.dispatchEvent(new CustomEvent("task-action-fired",{detail:{entry_id:this._entryId,task_id:this._taskId,action:e},bubbles:!0,composed:!0}))}_onComplete(){!this._entryId||!this._taskId||!this._task||Promise.resolve().then(()=>(F(),G)).then(({openCompleteDialog:e})=>{e({entry_id:this._entryId,task_id:this._taskId,task_name:this._task.name,checklist:this._task.checklist||[],adaptive_enabled:!!this._task.adaptive_config?.enabled})&&(this._notifyChanged("complete"),this.close())})}async _onSkipConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/skip",entry_id:this._entryId,task_id:this._taskId,reason:this._skipReason.trim()||null})&&(this._notifyChanged("skip"),this.close())}async _onResetConfirm(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/reset",entry_id:this._entryId,task_id:this._taskId,date:this._resetDate||void 0})&&(this._notifyChanged("reset"),this.close())}_onEdit(){!this._entryId||!this._taskId||Promise.resolve().then(()=>(F(),G)).then(({openEditTaskDialog:e})=>{e(this._entryId,this._taskId),this.close()})}_onQr(){!this._entryId||!this._taskId||!this._task||Promise.resolve().then(()=>(F(),G)).then(({openQrDialog:e})=>{e({entry_id:this._entryId,task_id:this._taskId,task_name:this._task.name,object_name:this._objectName}),this.close()})}async _onDelete(){if(!this._entryId||!this._taskId)return;let e=r("delete_task_confirm",this._lang)||`Delete "${this._task?.name}"?`;if(!window.confirm(e))return;await this._runWs({type:"maintenance_supporter/task/delete",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("delete"),this.close())}async _onArchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/archive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("archive"),this.close())}async _onUnarchive(){if(!this._entryId||!this._taskId)return;await this._runWs({type:"maintenance_supporter/task/unarchive",entry_id:this._entryId,task_id:this._taskId})&&(this._notifyChanged("unarchive"),this.close())}_onOpenInPanel(){if(!this._entryId||!this._taskId)return;let e=`/maintenance-supporter?entry_id=${encodeURIComponent(this._entryId)}&task_id=${encodeURIComponent(this._taskId)}`;history.pushState(null,"",e),window.dispatchEvent(new CustomEvent("location-changed")),this.close()}async _applySuggestion(){if(!this._entryId||!this._taskId||!this._task?.suggested_interval)return;await this._runWs({type:"maintenance_supporter/task/apply_suggestion",entry_id:this._entryId,task_id:this._taskId,interval:this._task.suggested_interval})&&(this._toast=r("suggestion_applied",this._lang)||"Applied",this._notifyChanged("apply_suggestion"),await this._loadTask(),setTimeout(()=>{this._toast=""},2500))}async _reanalyzeInterval(){if(!(!this._entryId||!this._taskId)){this._busy=!0,this._error="";try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/task/analyze_interval",entry_id:this._entryId,task_id:this._taskId});this._toast=e.recommended_interval?`${r("reanalyze_result",this._lang)||"Recomputed"}: ${Re(e.rLine truncated
<div class="recommendation-card">
<h4>${r("suggested_interval",t)}</h4>
${di(e.interval_days,e.suggested_interval,e.interval_confidence||"medium",t)}
${pi(e.interval_days,e.suggested_interval,e.interval_confidence||"medium",t)}
<div class="recommendation-actions">
<button class="btn primary"
@click=${this._applySuggestion} ?disabled=${this._busy}>
@@ -3148,11 +3148,11 @@ ${u?`<div class="sub">${u}</div>`:""}
<div class="adaptive-stack">
${this._toast?o`<div class="toast">${this._toast}</div>`:h}
${i?this._renderRecommendation(e):h}
${n?li(e,t,this._features):h}
${c?ni(e,t):h}
${n?ci(e,t,this._features):h}
${c?oi(e,t):h}
${d?o`
${ui(e,t,this._features)}
${e.seasonal_factors?.length===12||e.interval_analysis?.seasonal_factors?.length===12?_i(e,t):h}
${_i(e,t,this._features)}
${e.seasonal_factors?.length===12||e.interval_analysis?.seasonal_factors?.length===12?gi(e,t):h}
`:h}
</div>
`}_renderDetails(e){let t=this._lang,i=e.history||[],n=i.filter(u=>u.type==="completed"),c=n.reduce((u,_)=>u+(typeof _.cost=="number"?_.cost:0),0),d=(()=>{let u=n.map(_=>typeof _.duration=="number"?_.duration:null).filter(_=>_!=null);return u.length?Math.round(u.reduce((_,v)=>_+v,0)/u.length):null})();return o`
@@ -3181,7 +3181,7 @@ ${u?`<div class="sub">${u}</div>`:""}
<div class="history-entry">
<div class="history-line">
<span class="history-type type-${u.type}">${r(u.type,t)}</span>
<span class="history-date">${Kt(u.timestamp,t)}</span>
<span class="history-date">${Yt(u.timestamp,t)}</span>
${_?o`<button class="history-edit"
title="${r("history_edit_button",t)||"Edit"}"
@click=${()=>this._onEditHistoryEntry(u)}>
@@ -3214,7 +3214,7 @@ ${u?`<div class="sub">${u}</div>`:""}
<div class="quick-info">
${t.next_due?o`<span><strong>${r("next_due",e)||"Next due"}:</strong> ${B(t.next_due,e)}</span>`:h}
${t.last_performed?o`<span><strong>${r("last_performed",e)||"Last"}:</strong> ${B(t.last_performed,e)}</span>`:h}
${t.schedule?.kind&&!["manual","one_time"].includes(t.schedule.kind)||t.interval_days!=null?o`<span><strong>${r("interval",e)||"Interval"}:</strong> ${Yt(t,e)}</span>`:h}
${t.schedule?.kind&&!["manual","one_time"].includes(t.schedule.kind)||t.interval_days!=null?o`<span><strong>${r("interval",e)||"Interval"}:</strong> ${Jt(t,e)}</span>`:h}
</div>
</div>
@@ -3486,7 +3486,7 @@ ${u?`<div class="sub">${u}</div>`:""}
.weibull-section, .seasonal-card-compact { max-width: 100%; }
.weibull-chart svg { max-width: 100%; height: auto; }
.details-toggle { gap: 12px; flex-wrap: wrap; }
`],l([y({attribute:!1})],T.prototype,"hass",2),l([p()],T.prototype,"_open",2),l([p()],T.prototype,"_entryId",2),l([p()],T.prototype,"_taskId",2),l([p()],T.prototype,"_task",2),l([p()],T.prototype,"_objectName",2),l([p()],T.prototype,"_busy",2),l([p()],T.prototype,"_error",2),l([p()],T.prototype,"_showSkip",2),l([p()],T.prototype,"_showReset",2),l([p()],T.prototype,"_showDetails",2),l([p()],T.prototype,"_showAdaptive",2),l([p()],T.prototype,"_skipReason",2),l([p()],T.prototype,"_resetDate",2),l([p()],T.prototype,"_features",2),l([p()],T.prototype,"_toast",2);customElements.get("maintenance-task-quick-actions-dialog")||customElements.define("maintenance-task-quick-actions-dialog",T)});function fi(a){return!!a&&/^https?:\/\//i.test(a)}var vi=w(()=>{"use strict"});var U,bi=w(()=>{"use strict";I();vi();M();L();re();U=class extends k{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._data=null;this._busy=!1;this._error=""}get _lang(){return this.hass?.language||"en"}async openFor(e){this._entryId=e,this._error="",this._open=!0,await this._load()}close(){this._open=!1,this._data=null,this._error=""}async _load(){if(this._entryId)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._data=e}catch(e){this._error=P(e,this._lang)}}_onEditObject(){!this._entryId||!this._data||Promise.resolve().then(()=>(F(),G)).then(({openEditObjectDialog:e})=>{e(this._entryId,this._data.object),this.close()})}_onAddTask(){this._entryId&&Promise.resolve().then(()=>(F(),G)).then(({openCreateTaskDialog:e})=>{e(),this.close()})}async _onDelete(){if(!this._entryId||!this._data)return;let e=r("delete_object_confirm",this._lang)||`Delete "${this._data.object.name}" and all its tasks?`;if(window.confirm(e)){this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/delete",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-deleted",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=P(t,this._lang)}finally{this._busy=!1}}}async _onArchiveObject(){if(!this._entryId||!this._data)return;let e=!!this._data.object.archived;if(!e){let t=r("confirm_archive_object",this._lang)||"Archive this object and its tasks?";if(!window.confirm(t))return}this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:e?"maintenance_supporter/object/unarchive":"maintenance_supporter/object/archive",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-changed",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=P(t,this._lang)}finally{this._busy=!1}}_onTaskClick(e){this._entryId&&Promise.resolve().then(()=>(F(),G)).then(({openTaskQuickActions:t})=>{t(this._entryId,e)})}render(){if(!this._open)return h;let e=this._lang,t=this._data,i=t?.object,n=t?.tasks||[],c=this.hass?.user?.is_admin??!0;return o`
`],l([b({attribute:!1})],T.prototype,"hass",2),l([p()],T.prototype,"_open",2),l([p()],T.prototype,"_entryId",2),l([p()],T.prototype,"_taskId",2),l([p()],T.prototype,"_task",2),l([p()],T.prototype,"_objectName",2),l([p()],T.prototype,"_busy",2),l([p()],T.prototype,"_error",2),l([p()],T.prototype,"_showSkip",2),l([p()],T.prototype,"_showReset",2),l([p()],T.prototype,"_showDetails",2),l([p()],T.prototype,"_showAdaptive",2),l([p()],T.prototype,"_skipReason",2),l([p()],T.prototype,"_resetDate",2),l([p()],T.prototype,"_features",2),l([p()],T.prototype,"_toast",2);customElements.get("maintenance-task-quick-actions-dialog")||customElements.define("maintenance-task-quick-actions-dialog",T)});function vi(a){return!!a&&/^https?:\/\//i.test(a)}var bi=w(()=>{"use strict"});var U,yi=w(()=>{"use strict";I();bi();z();L();re();U=class extends k{constructor(){super(...arguments);this._open=!1;this._entryId=null;this._data=null;this._busy=!1;this._error=""}get _lang(){return this.hass?.language||"en"}async openFor(e){this._entryId=e,this._error="",this._open=!0,await this._load()}close(){this._open=!1,this._data=null,this._error=""}async _load(){if(this._entryId)try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:this._entryId});this._data=e}catch(e){this._error=P(e,this._lang)}}_onEditObject(){!this._entryId||!this._data||Promise.resolve().then(()=>(F(),G)).then(({openEditObjectDialog:e})=>{e(this._entryId,this._data.object),this.close()})}_onAddTask(){this._entryId&&Promise.resolve().then(()=>(F(),G)).then(({openCreateTaskDialog:e})=>{e(),this.close()})}async _onDelete(){if(!this._entryId||!this._data)return;let e=r("delete_object_confirm",this._lang)||`Delete "${this._data.object.name}" and all its tasks?`;if(window.confirm(e)){this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/object/delete",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-deleted",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=P(t,this._lang)}finally{this._busy=!1}}}async _onArchiveObject(){if(!this._entryId||!this._data)return;let e=!!this._data.object.archived;if(!e){let t=r("confirm_archive_object",this._lang)||"Archive this object and its tasks?";if(!window.confirm(t))return}this._busy=!0,this._error="";try{await this.hass.connection.sendMessagePromise({type:e?"maintenance_supporter/object/unarchive":"maintenance_supporter/object/archive",entry_id:this._entryId}),this.dispatchEvent(new CustomEvent("object-changed",{detail:{entry_id:this._entryId},bubbles:!0,composed:!0})),this.close()}catch(t){this._error=P(t,this._lang)}finally{this._busy=!1}}_onTaskClick(e){this._entryId&&Promise.resolve().then(()=>(F(),G)).then(({openTaskQuickActions:t})=>{t(this._entryId,e)})}render(){if(!this._open)return h;let e=this._lang,t=this._data,i=t?.object,n=t?.tasks||[],c=this.hass?.user?.is_admin??!0;return o`
<div class="backdrop" @click=${this.close}></div>
<div class="dialog" role="dialog" aria-modal="true">
${t&&i?o`
@@ -3549,7 +3549,7 @@ ${u?`<div class="sub">${u}</div>`:""}
${i.map(([n,c])=>o`
<div class="meta-item">
<span class="meta-label">${n}</span>
<span class="meta-value">${fi(c)?o`<a href="${c}" target="_blank" rel="noopener noreferrer">${c}</a>`:c}</span>
<span class="meta-value">${vi(c)?o`<a href="${c}" target="_blank" rel="noopener noreferrer">${c}</a>`:c}</span>
</div>
`)}
</div>
@@ -3612,7 +3612,7 @@ ${u?`<div class="sub">${u}</div>`:""}
.btn ha-icon { --mdc-icon-size: 16px; }
.loading { padding: 24px; text-align: center; color: var(--secondary-text-color); }
.error { padding: 8px; border-radius: 6px; background: rgba(211,47,47,0.1); color: var(--error-color); font-size: 13px; }
`,l([y({attribute:!1})],U.prototype,"hass",2),l([p()],U.prototype,"_open",2),l([p()],U.prototype,"_entryId",2),l([p()],U.prototype,"_data",2),l([p()],U.prototype,"_busy",2),l([p()],U.prototype,"_error",2);customElements.get("maintenance-object-quick-actions-dialog")||customElements.define("maintenance-object-quick-actions-dialog",U)});var G={};Li(G,{openCompleteDialog:()=>Ss,openCreateObjectDialog:()=>dt,openCreateTaskDialog:()=>pt,openEditObjectDialog:()=>$s,openEditTaskDialog:()=>ks,openHistoryEditDialog:()=>Es,openObjectQuickActions:()=>Ts,openQrDialog:()=>As,openTaskQuickActions:()=>ht});function De(){return document.querySelector("home-assistant")?.hass}function K(a){let s=document.body.querySelector(a);return s||(s=document.createElement(a),document.body.appendChild(s)),s}function Y(a){let s=De();if(!s)return!1;a.hass=s;let e=s.language||"en";return He(e)||Ne(e).then(()=>{a.requestUpdate?.()}),!0}function $i(a){return Oe||(Oe=a.connection.sendMessagePromise({type:"maintenance_supporter/settings"}).then(s=>({features:s.features??yi.features,defaultWarningDays:s.general?.default_warning_days??7})).catch(()=>yi),Oe)}function dt(){let a=K(xi);return Y(a)?(a.openCreate(),!0):!1}function $s(a,s){let e=K(xi);return Y(e)?(e.openEdit(a,s),!0):!1}function pt(){let a=K(wi);if(!Y(a))return!1;let s=De();return s?((async()=>{let e=await $i(s),t=a;t.checklistsEnabled=e.features.checklists,t.scheduleTimeEnabled=e.features.schedule_time,t.completionActionsEnabled=e.features.completion_actions,t.defaultWarningDays=e.defaultWarningDays,t.openCreate()})(),!0):!1}function ks(a,s){let e=K(wi);if(!Y(e))return!1;let t=De();return t?((async()=>{try{let[i,n]=await Promise.all([t.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:a}),$i(t)]),c=(i.tasks||[]).find(u=>u.id===s);if(!c){console.warn(`openEditTaskDialog: task ${s} not found in entry ${a}`);return}let d=e;d.checklistsEnabled=n.features.checklists,d.scheduleTimeEnabled=n.features.schedule_time,d.completionActionsEnabled=n.features.completion_actions,d.defaultWarningDays=n.defaultWarningDays,await d.openEdit(a,c)}catch(i){console.warn("openEditTaskDialog: failed to load task/features",i)}})(),!0):!1}function Es(a){let s=K(vs);return Y(s)?(s.openEdit(a),!0):!1}function Ss(a){let s=K(bs);return Y(s)?(s.entryId=a.entry_id,s.taskId=a.task_id,s.taskName=a.task_name,s.checklist=a.checklist??[],s.adaptiveEnabled=!!a.adaptive_enabled,s.requiredFields=a.required_completion_fields??[],s.lang=De()?.language||"en",s.open(),!0):!1}function As(a){let s=K(ys);return Y(s)?(s.openForTask(a.entry_id,a.task_id,a.object_name,a.task_name),!0):!1}function ht(a,s){let e=K(xs);return Y(e)?(e.openFor(a,s),!0):!1}function Ts(a){let s=K(ws);return Y(s)?(s.openFor(a),!0):!1}var xi,wi,vs,bs,ys,xs,ws,yi,Oe,F=w(()=>{"use strict";ei();ii();nt();si();ai();mi();bi();L();xi="maintenance-object-dialog",wi="maintenance-task-dialog",vs="maintenance-history-edit-dialog",bs="maintenance-complete-dialog",ys="maintenance-qr-dialog",xs="maintenance-task-quick-actions-dialog",ws="maintenance-object-quick-actions-dialog";yi={features:{adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1},defaultWarningDays:7},Oe=null});I();M();L();rt();ze();I();M();L();var Zi=["overdue","triggered","due_soon","ok"],D=class extends k{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-card"};this._objects=[];this._loadingObjects=!0;this._loadError=!1;this._views=[];this._objectsLoaded=!1;this._onEntitiesChanged=e=>{this._valueChanged("entity_ids",e.detail.value||[])}}get _lang(){return this.hass?.language||"en"}setConfig(e){this._config={...e}}updated(e){super.updated(e),e.has("hass")&&this.hass&&!this._objectsLoaded&&(this._objectsLoaded=!0,this._loadObjects())}async _loadObjects(){try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects"});this._objects=e.objects||[],this._loadError=!1}catch{this._objects=[],this._loadError=!0}this._loadingObjects=!1;try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/views/list"});this._views=e.views||[]}catch{this._views=[]}}_valueChanged(e,t){let i={...this._config,[e]:t};(Array.isArray(t)&&t.length===0||t==="")&&delete i[e],this._config=i,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:i}}))}_toggleStatus(e,t){let i=new Set(this._config.filter_status||[]);t?i.add(e):i.delete(e),this._valueChanged("filter_status",[...i])}_toggleObject(e,t){let i=new Set(this._config.filter_objects||[]);t?i.add(e):i.delete(e),this._valueChanged("filter_objects",[...i])}_toggleLabel(e,t){let i=new Set(this._config.filter_labels||[]);t?i.add(e):i.delete(e),this._valueChanged("filter_labels",[...i])}_toggleArea(e,t){let i=new Set(this._config.filter_areas||[]);t?i.add(e):i.delete(e),this._valueChanged("filter_areas",[...i])}render(){let e=this._lang,t=new Set(this._config.filter_status||[]),i=n Line truncated
`,l([b({attribute:!1})],U.prototype,"hass",2),l([p()],U.prototype,"_open",2),l([p()],U.prototype,"_entryId",2),l([p()],U.prototype,"_data",2),l([p()],U.prototype,"_busy",2),l([p()],U.prototype,"_error",2);customElements.get("maintenance-object-quick-actions-dialog")||customElements.define("maintenance-object-quick-actions-dialog",U)});var G={};Ii(G,{openCompleteDialog:()=>As,openCreateObjectDialog:()=>dt,openCreateTaskDialog:()=>pt,openEditObjectDialog:()=>ks,openEditTaskDialog:()=>Es,openHistoryEditDialog:()=>Ss,openObjectQuickActions:()=>Cs,openQrDialog:()=>Ts,openTaskQuickActions:()=>ht});function De(){return document.querySelector("home-assistant")?.hass}function K(a){let s=document.body.querySelector(a);return s||(s=document.createElement(a),document.body.appendChild(s)),s}function Y(a){let s=De();if(!s)return!1;a.hass=s;let e=s.language||"en";return He(e)||Ne(e).then(()=>{a.requestUpdate?.()}),!0}function ki(a){return Oe||(Oe=a.connection.sendMessagePromise({type:"maintenance_supporter/settings"}).then(s=>({features:s.features??xi.features,defaultWarningDays:s.general?.default_warning_days??7})).catch(()=>xi),Oe)}function dt(){let a=K(wi);return Y(a)?(a.openCreate(),!0):!1}function ks(a,s){let e=K(wi);return Y(e)?(e.openEdit(a,s),!0):!1}function pt(){let a=K($i);if(!Y(a))return!1;let s=De();return s?((async()=>{let e=await ki(s),t=a;t.checklistsEnabled=e.features.checklists,t.scheduleTimeEnabled=e.features.schedule_time,t.completionActionsEnabled=e.features.completion_actions,t.defaultWarningDays=e.defaultWarningDays,t.openCreate()})(),!0):!1}function Es(a,s){let e=K($i);if(!Y(e))return!1;let t=De();return t?((async()=>{try{let[i,n]=await Promise.all([t.connection.sendMessagePromise({type:"maintenance_supporter/object",entry_id:a}),ki(t)]),c=(i.tasks||[]).find(u=>u.id===s);if(!c){console.warn(`openEditTaskDialog: task ${s} not found in entry ${a}`);return}let d=e;d.checklistsEnabled=n.features.checklists,d.scheduleTimeEnabled=n.features.schedule_time,d.completionActionsEnabled=n.features.completion_actions,d.defaultWarningDays=n.defaultWarningDays,await d.openEdit(a,c)}catch(i){console.warn("openEditTaskDialog: failed to load task/features",i)}})(),!0):!1}function Ss(a){let s=K(bs);return Y(s)?(s.openEdit(a),!0):!1}function As(a){let s=K(ys);return Y(s)?(s.entryId=a.entry_id,s.taskId=a.task_id,s.taskName=a.task_name,s.checklist=a.checklist??[],s.adaptiveEnabled=!!a.adaptive_enabled,s.requiredFields=a.required_completion_fields??[],s.lang=De()?.language||"en",s.open(),!0):!1}function Ts(a){let s=K(xs);return Y(s)?(s.openForTask(a.entry_id,a.task_id,a.object_name,a.task_name),!0):!1}function ht(a,s){let e=K(ws);return Y(e)?(e.openFor(a,s),!0):!1}function Cs(a){let s=K($s);return Y(s)?(s.openFor(a),!0):!1}var wi,$i,bs,ys,xs,ws,$s,xi,Oe,F=w(()=>{"use strict";ti();si();nt();ri();ni();fi();yi();L();wi="maintenance-object-dialog",$i="maintenance-task-dialog",bs="maintenance-history-edit-dialog",ys="maintenance-complete-dialog",xs="maintenance-qr-dialog",ws="maintenance-task-quick-actions-dialog",$s="maintenance-object-quick-actions-dialog";xi={features:{adaptive:!1,predictions:!1,seasonal:!1,environmental:!1,budget:!1,groups:!1,checklists:!1,schedule_time:!1,completion_actions:!1},defaultWarningDays:7},Oe=null});I();function jt(a,s){if(s.objects)return s.objects;let e=s.delta||[],t=s.removed||[];if(!e.length&&!t.length)return null;let i=new Map(a.map(n=>[n.entry_id,n]));for(let n of e)i.set(n.entry_id,n);for(let n of t)i.delete(n);return[...i.values()]}z();L();rt();Me();I();z();L();var Xi=["overdue","triggered","due_soon","ok"],D=class extends k{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-card"};this._objects=[];this._loadingObjects=!0;this._loadError=!1;this._views=[];this._objectsLoaded=!1;this._onEntitiesChanged=e=>{this._valueChanged("entity_ids",e.detail.value||[])}}get _lang(){return this.hass?.language||"en"}setConfig(e){this._config={...e}}updated(e){super.updated(e),e.has("hass")&&this.hass&&!this._objectsLoaded&&(this._objectsLoaded=!0,this._loadObjects())}async _loadObjects(){try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects"});this._objects=e.objects||[],this._loadError=!1}catch{this._objects=[],this._loadError=!0}this._loadingObjects=!1;try{let e=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/views/list"});this._views=e.views||[]}catch{this._views=[]}}_valueChanged(e,t){let i={...this._config,[e]:t};(Array.isArray(t)&&t.length===0||t==="")&&delete i[e],this._config=i,this.dispatchEvent(new CustomEvent("config-changed",{detail:{config:i}}))}_toggleStatus(e,t){let i=new Set(this._config.filter_status||[]);t?i.add(e):i.delete(e),this._valueChanged("filter_status",[...i])}_toggleObject(e,t){let i=new Set(this._config.filter_objects||[]);t?i.add(e):i.delete(e),this._valueChanged("filter_objects",[...i])}_toggleLabel(e,t){let i=new Set(this._config.filter_labels||[]);t?i.add(e):i.delete(e), Line truncated
<div class="editor">
<ha-textfield
label="${r("card_title",e)}"
@@ -3624,7 +3624,7 @@ ${u?`<div class="sub">${u}</div>`:""}
<div class="field">
<div class="field-label">${r("card_filter_status",e)}</div>
<div class="chip-row">
${Zi.map(g=>o`
${Xi.map(g=>o`
<label class="chip ${t.has(g)?"active":""}">
<input type="checkbox"
.checked=${t.has(g)}
@@ -3695,7 +3695,7 @@ ${u?`<div class="sub">${u}</div>`:""}
.hass=${this.hass}
.value=${this._config.entity_ids||[]}
.includeDomains=${["sensor","binary_sensor"]}
.includeEntities=${b}
.includeEntities=${y}
@value-changed=${this._onEntitiesChanged}
></ha-entities-picker>
<div class="field-help">${r("card_filter_entities_help",e)}</div>
@@ -3845,7 +3845,7 @@ ${u?`<div class="sub">${u}</div>`:""}
font-size: 14px;
max-width: 320px;
}
`,l([y({attribute:!1})],D.prototype,"hass",2),l([p()],D.prototype,"_config",2),l([p()],D.prototype,"_objects",2),l([p()],D.prototype,"_loadingObjects",2),l([p()],D.prototype,"_loadError",2),l([p()],D.prototype,"_views",2);customElements.get("maintenance-supporter-card-editor")||customElements.define("maintenance-supporter-card-editor",D);nt();F();var q=class extends k{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-card"};this._objects=[];this._stats=null;this._unsub=null;this._viewFilters=null;this._userNames={};this._userService=null;this._userNamesLoaded=!1;this._taskDocs={};this._docsLoadedFor=new Set;this._dataLoaded=!1;this._lastConnection=null;this._onCompleted=async()=>{await this._loadData()}}get _lang(){return this.hass?.language||"en"}static getConfigElement(){return document.createElement("maintenance-supporter-card-editor")}static getStubConfig(){return{type:"custom:maintenance-supporter-card",show_header:!0,show_actions:!0,filter_status:["overdue","triggered","due_soon"],max_items:10}}setConfig(e){let t=e.view_id!==this._config.view_id;this._config=e,t&&this._dataLoaded&&this.hass&&this._loadViewFilters()}getCardSize(){return 3}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._unsub&&(this._unsub(),this._unsub=null),this._dataLoaded=!1,this._lastConnection=null}updated(e){super.updated(e),e.has("hass")&&Wt(this.hass?.locale);let t=this.hass?.language;if(t&&!He(t)&&Ne(t).then(()=>this.requestUpdate()),this.hass&&!this._userNamesLoaded&&this._config.show_assignee!==!1&&this._objects.some(i=>i.tasks.some(n=>n.responsible_user_id))&&this._loadUserNames(),this.hass&&this._config.show_documents!==!1)for(let i of this._objects)this._docsLoadedFor.has(i.entry_id)||i.tasks.some(n=>(n.document_count??0)>0)&&this._loadDocuments(i.entry_id);if(e.has("hass")&&this.hass){if(!this._dataLoaded)this._dataLoaded=!0,this._lastConnection=this.hass.connection,this._loadData(),this._subscribe();else if(this.hass.connection!==this._lastConnection){if(this._lastConnection=this.hass.connection,this._unsub){try{this._unsub()}catch{}this._unsub=null}this._subscribe(),this._loadData()}}}async _loadData(){try{let[e,t]=await Promise.all([this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects"}),this.hass.connection.sendMessagePromise({type:"maintenance_supporter/statistics"})]);this._objects=e.objects,this._stats=t}catch{}await this._loadViewFilters()}_assigneeName(e){if(this._config.show_assignee===!1)return"";let t=e.responsible_user_id;return t&&this._userNames[t]||""}async _loadUserNames(){this._userNamesLoaded=!0,this._userService?this._userService.updateHass(this.hass):this._userService=new ce(this.hass);try{let e=await this._userService.getUsers();this._userNames=Object.fromEntries(e.map(t=>[t.id,t.name]))}catch{}}async _loadDocuments(e){this._docsLoadedFor.add(e);try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/documents/list",entry_id:e}),i={};for(let n of t.documents||[])for(let c of n.task_ids||[])(i[c]||=[]).push({id:n.id,title:n.title,kind:n.kind,url:n.url});this._taskDocs={...this._taskDocs,[e]:i}}catch{}}_docsFor(e,t){if(this._config.show_documents===!1)return[];let n=[...this._taskDocs[e]?.[t.id]||[]];return t.documentation_url&&n.push({id:`url:${t.id}`,title:r("documentation_label",this._lang),kind:"weblink",url:t.documentation_url}),n}async _openDoc(e){if(e.kind==="weblink"&&e.url){window.open(e.url,"_blank","noopener");return}let t=window.open("about:blank","_blank");try{let i=await this.hass.connection.sendMessagePromise({type:"auth/sign_path",path:`/api/maintenance_supporter/document/${e.id}`,expires:300});t&&(t.location.href=new URL(i.path,window.location.origin).href)}catch{t&&t.close()}}async _loadViewFilters(){if(!this._config.view_id){this._viewFilters=null;return}try{let t=((await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/views/list"})).views||[]).find(i=>i.id===this._config.view_id);this._viewFilters=t?t.filters:null}catch{this._viewFilters=null}}async _subscribe(){try{let e=await this.hass.connection.subscribeMessage(t=>{let i=t;this._objects=i.objects},{type:"maintenance_supporter/subscribe"});if(!this.isConnected){e();return}this._unsub=e}catch{}}get _flatTasks(){let e=[],{filter_status:t,filter_objects:i,entity_ids:n,filter_due_min_days:c,filter_due_max_days:d,filter_labels:u,filter_areas:_,max_items:v}=this._config,f=n?.length?new Set(n):null,b=c!==void 0||d!==void 0,g=this._viewFilters,x=g?.user_id==="current_user"?this.hass.user?.id??null:g?.user_id??null;for(let j of this._objects)if(!(i?.length&&!i.includes(j.object.name))){if(_?.length){let S=j.object.area_id;if(!S||!_.includes(S))continue}for(let S of j.tasks)if(!S.is_done&&!(S.archived||j.object.archived)&&!(t?.length&&!t.includes(S.status))&&!(u?.length&&!(S.labels||[]).some(C=>u.includes(C)))&&!(f&&!(S.sensor_entity_id&&f.has(S.sensor_entity_id)||S.binary_se Line truncated
`,l([b({attribute:!1})],D.prototype,"hass",2),l([p()],D.prototype,"_config",2),l([p()],D.prototype,"_objects",2),l([p()],D.prototype,"_loadingObjects",2),l([p()],D.prototype,"_loadError",2),l([p()],D.prototype,"_views",2);customElements.get("maintenance-supporter-card-editor")||customElements.define("maintenance-supporter-card-editor",D);nt();F();var q=class extends k{constructor(){super(...arguments);this._config={type:"custom:maintenance-supporter-card"};this._objects=[];this._stats=null;this._unsub=null;this._viewFilters=null;this._userNames={};this._userService=null;this._userNamesLoaded=!1;this._taskDocs={};this._docsLoadedFor=new Set;this._dataLoaded=!1;this._lastConnection=null;this._onCompleted=async()=>{await this._loadData()}}get _lang(){return this.hass?.language||"en"}static getConfigElement(){return document.createElement("maintenance-supporter-card-editor")}static getStubConfig(){return{type:"custom:maintenance-supporter-card",show_header:!0,show_actions:!0,filter_status:["overdue","triggered","due_soon"],max_items:10}}setConfig(e){let t=e.view_id!==this._config.view_id;this._config=e,t&&this._dataLoaded&&this.hass&&this._loadViewFilters()}getCardSize(){return 3}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this._unsub&&(this._unsub(),this._unsub=null),this._dataLoaded=!1,this._lastConnection=null}updated(e){super.updated(e),e.has("hass")&&Gt(this.hass?.locale);let t=this.hass?.language;if(t&&!He(t)&&Ne(t).then(()=>this.requestUpdate()),this.hass&&!this._userNamesLoaded&&this._config.show_assignee!==!1&&this._objects.some(i=>i.tasks.some(n=>n.responsible_user_id))&&this._loadUserNames(),this.hass&&this._config.show_documents!==!1)for(let i of this._objects)this._docsLoadedFor.has(i.entry_id)||i.tasks.some(n=>(n.document_count??0)>0)&&this._loadDocuments(i.entry_id);if(e.has("hass")&&this.hass){if(!this._dataLoaded)this._dataLoaded=!0,this._lastConnection=this.hass.connection,this._loadData(),this._subscribe();else if(this.hass.connection!==this._lastConnection){if(this._lastConnection=this.hass.connection,this._unsub){try{this._unsub()}catch{}this._unsub=null}this._subscribe(),this._loadData()}}}async _loadData(){try{let[e,t]=await Promise.all([this.hass.connection.sendMessagePromise({type:"maintenance_supporter/objects"}),this.hass.connection.sendMessagePromise({type:"maintenance_supporter/statistics"})]);this._objects=e.objects,this._stats=t}catch{}await this._loadViewFilters()}_assigneeName(e){if(this._config.show_assignee===!1)return"";let t=e.responsible_user_id;return t&&this._userNames[t]||""}async _loadUserNames(){this._userNamesLoaded=!0,this._userService?this._userService.updateHass(this.hass):this._userService=new ce(this.hass);try{let e=await this._userService.getUsers();this._userNames=Object.fromEntries(e.map(t=>[t.id,t.name]))}catch{}}async _loadDocuments(e){this._docsLoadedFor.add(e);try{let t=await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/documents/list",entry_id:e}),i={};for(let n of t.documents||[])for(let c of n.task_ids||[])(i[c]||=[]).push({id:n.id,title:n.title,kind:n.kind,url:n.url});this._taskDocs={...this._taskDocs,[e]:i}}catch{}}_docsFor(e,t){if(this._config.show_documents===!1)return[];let n=[...this._taskDocs[e]?.[t.id]||[]];return t.documentation_url&&n.push({id:`url:${t.id}`,title:r("documentation_label",this._lang),kind:"weblink",url:t.documentation_url}),n}async _openDoc(e){if(e.kind==="weblink"&&e.url){window.open(e.url,"_blank","noopener");return}let t=window.open("about:blank","_blank");try{let i=await this.hass.connection.sendMessagePromise({type:"auth/sign_path",path:`/api/maintenance_supporter/document/${e.id}`,expires:300});t&&(t.location.href=new URL(i.path,window.location.origin).href)}catch{t&&t.close()}}async _loadViewFilters(){if(!this._config.view_id){this._viewFilters=null;return}try{let t=((await this.hass.connection.sendMessagePromise({type:"maintenance_supporter/views/list"})).views||[]).find(i=>i.id===this._config.view_id);this._viewFilters=t?t.filters:null}catch{this._viewFilters=null}}async _subscribe(){try{let e=await this.hass.connection.subscribeMessage(t=>{let i=jt(this._objects,t);i!==null&&(this._objects=i)},{type:"maintenance_supporter/subscribe",deltas:!0});if(!this.isConnected){e();return}this._unsub=e}catch{}}get _flatTasks(){let e=[],{filter_status:t,filter_objects:i,entity_ids:n,filter_due_min_days:c,filter_due_max_days:d,filter_labels:u,filter_areas:_,max_items:v}=this._config,f=n?.length?new Set(n):null,y=c!==void 0||d!==void 0,g=this._viewFilters,x=g?.user_id==="current_user"?this.hass.user?.id??null:g?.user_id??null;for(let j of this._objects)if(!(i?.length&&!i.includes(j.object.name))){if(_?.length){let S=j.object.area_id;if(!S||!_.includes(S))continue}for(let S of j.tasks)if(!S.is_done&&!(S.archived||j.object.archived)&&!(t?.length&&!t.includes(S.status))&&!(u?.length&&!(S.labels||[]).some(C=>u.includes(C)))&&!(f&&!(S.sensor_entity_id&&f.has( Line truncated
<ha-card>
<div class="card-header">
<h1>${t}</h1>
@@ -3907,15 +3907,15 @@ ${u?`<div class="sub">${u}</div>`:""}
</div>`}
</div>
${this._docsFor(_,f).length?o`<div class="doc-chips">
${this._docsFor(_,f).map(b=>o`
${this._docsFor(_,f).map(y=>o`
<button
type="button"
class="doc-chip"
title="${b.title}"
@click=${g=>{g.stopPropagation(),this._openDoc(b)}}
title="${y.title}"
@click=${g=>{g.stopPropagation(),this._openDoc(y)}}
>
<ha-icon icon=${b.kind==="weblink"?"mdi:link-variant":"mdi:file-document-outline"}></ha-icon>
<span>${b.title}</span>
<ha-icon icon=${y.kind==="weblink"?"mdi:link-variant":"mdi:file-document-outline"}></ha-icon>
<span>${y.title}</span>
</button>
`)}
</div>`:h}
@@ -3926,7 +3926,7 @@ ${u?`<div class="sub">${u}</div>`:""}
<mwc-icon-button
class="complete-btn"
title="${r("complete",e)}"
@click=${b=>{b.stopPropagation();let g=this.shadowRoot.querySelector("maintenance-complete-dialog");g.entryId=_,g.taskId=f.id,g.taskName=f.name,g.checklist=f.checklist||[],g.adaptiveEnabled=!!f.adaptive_config?.enabled,g.taskType=f.type||"",g.readingUnit=f.reading_unit||"",g.requiredFields=f.required_completion_fields||[],g.lang=e;let x=!!f.part_ref;g.parts=x?[]:Zt(f,_,this._objects,e),g.consumesParts=x?[]:f.consumes_parts||[],g.open()}}
@click=${y=>{y.stopPropagation();let g=this.shadowRoot.querySelector("maintenance-complete-dialog");g.entryId=_,g.taskId=f.id,g.taskName=f.name,g.checklist=f.checklist||[],g.adaptiveEnabled=!!f.adaptive_config?.enabled,g.taskType=f.type||"",g.readingUnit=f.reading_unit||"",g.requiredFields=f.required_completion_fields||[],g.lang=e;let x=!!f.part_ref;g.parts=x?[]:Xt(f,_,this._objects,e),g.consumesParts=x?[]:f.consumes_parts||[],g.open()}}
>
<ha-icon icon="mdi:check"></ha-icon>
</mwc-icon-button>
@@ -4072,7 +4072,7 @@ ${u?`<div class="sub">${u}</div>`:""}
--mdc-icon-size: 18px;
color: var(--primary-color);
}
`],l([y({attribute:!1})],q.prototype,"hass",2),l([p()],q.prototype,"_config",2),l([p()],q.prototype,"_objects",2),l([p()],q.prototype,"_stats",2),l([p()],q.prototype,"_unsub",2),l([p()],q.prototype,"_viewFilters",2),l([p()],q.prototype,"_userNames",2),l([p()],q.prototype,"_taskDocs",2);customElements.get("maintenance-supporter-card")||customElements.define("maintenance-supporter-card",q);window.customCards=window.customCards||[];window.customCards.push({type:"maintenance-supporter-card",name:"Maintenance Supporter",description:"Overview of your maintenance tasks with quick actions.",preview:!0});export{q as MaintenanceSupporterCard};
`],l([b({attribute:!1})],q.prototype,"hass",2),l([p()],q.prototype,"_config",2),l([p()],q.prototype,"_objects",2),l([p()],q.prototype,"_stats",2),l([p()],q.prototype,"_unsub",2),l([p()],q.prototype,"_viewFilters",2),l([p()],q.prototype,"_userNames",2),l([p()],q.prototype,"_taskDocs",2);customElements.get("maintenance-supporter-card")||customElements.define("maintenance-supporter-card",q);window.customCards=window.customCards||[];window.customCards.push({type:"maintenance-supporter-card",name:"Maintenance Supporter",description:"Overview of your maintenance tasks with quick actions.",preview:!0});export{q as MaintenanceSupporterCard};
/*! Bundled license information:
@lit/reactive-element/css-tag.js: