export const __rspack_esm_id="31854";export const __rspack_esm_ids=["31854"];export const __webpack_modules__={55782(i,s,e){e.d(s,{AU:()=>n,Ik:()=>c,Qk:()=>r,TP:()=>u,UL:()=>d,ZF:()=>l,do:()=>_,vR:()=>h});var t=e(35518),a=e(9899);const r={critical:1,error:2,warning:3},o=i=>i.sendMessagePromise({type:"repairs/list_issues"}),n=(i,s,e)=>i.sendMessagePromise({type:"repairs/get_issue_data",domain:s,issue_id:e}),c=async(i,s,e)=>i.callWS({type:"repairs/ignore_issue",issue_id:s.issue_id,domain:s.domain,ignore:e}),h=(i,s,e)=>i.callApi("POST","repairs/issues/fix",{handler:s,issue_id:e}),l=(i,s)=>i.callApi("GET",`repairs/issues/fix/${s}`),_=(i,s,e)=>i.callApi("POST",`repairs/issues/fix/${s}`,e),d=(i,s)=>i.callApi("DELETE",`repairs/issues/fix/${s}`),p=(i,s)=>i.subscribeEvents((0,a.s)(()=>o(i).then(i=>s.setState(i,!0)),500,!0),"repairs_issue_registry_updated"),u=(i,s)=>(0,t.N)("_repairsIssueRegistry",o,p,i,s)},84029(i,s,e){e.r(s),e.d(s,{HuiRepairsCard:()=>p});e(18111),e(22489);var t=e(62826),a=e(96196),r=e(97735),o=e(1087),n=e(91926),c=(e(76776),e(22573),e(80933),e(32248),e(55782)),h=e(54706),l=e(37544),_=e(97176),d=e(51989);class p extends((0,h.E)(a.WF)){hassSubscribe(){return[(0,c.TP)(this.hass.connection,i=>{this._repairsIssues=i.issues.filter(i=>!1!==i.active&&!i.ignored)})]}setConfig(i){this._config=i}getCardSize(){return this._config?.vertical?2:1}getGridOptions(){let i=6,s=1;return this._config?.vertical&&(s++,i=3),{columns:6,rows:s,min_columns:i,min_rows:s}}async _handleAction(i){"tap"!==i.detail.action||(0,_.h)(this._config?.tap_action)?(0,l.$)(this,this.hass,this._config,i.detail.action):(0,n.o)("/config/repairs")}get _hasCardAction(){return!this._config?.tap_action||(0,_.h)(this._config?.tap_action)||(0,_.h)(this._config?.hold_action)||(0,_.h)(this._config?.double_tap_action)}willUpdate(i){if(super.willUpdate(i),!this._config||!this.hass)return;const s=Boolean(!this.hass.user?.is_admin||this._config.hide_empty&&0===this._repairsIssues.length);s!==this.hidden&&(this.style.display=s?"none":"",this.toggleAttribute("hidden",s),(0,o.r)(this,"card-visibility-changed",{value:!s}))}render(){if(!this._config||!this.hass||this.hidden)return a.s6;const i=this._repairsIssues.length,s=this.hass.localize("ui.card.repairs.title"),e=i>0?this.hass.localize("ui.card.repairs.count_issues",{count:i}):this.hass.localize("ui.card.repairs.no_issues");return a.qy` <ha-card> <ha-tile-container .vertical="${Boolean(this._config.vertical)}" .interactive="${this._hasCardAction}" .actionHandlerOptions="${{hasHold:(0,_.h)(this._config.hold_action),hasDoubleClick:(0,_.h)(this._config.double_tap_action)}}" @action="${this._handleAction}"> <ha-tile-icon slot="icon" .iconPath="${"M22.7,19L13.6,9.9C14.5,7.6 14,4.9 12.1,3C10.1,1 7.1,0.6 4.7,1.7L9,6L6,9L1.6,4.7C0.4,7.1 0.9,10.1 2.9,12.1C4.8,14 7.5,14.5 9.8,13.6L18.9,22.7C19.3,23.1 19.9,23.1 20.3,22.7L22.6,20.4C23.1,20 23.1,19.3 22.7,19Z"}"></ha-tile-icon> <ha-tile-info slot="info" .primary="${s}" .secondary="${e}"></ha-tile-info> </ha-tile-container> </ha-card> `}constructor(...i){super(...i),this.connectedWhileHidden=!0,this._repairsIssues=[]}}p.styles=[d.c,a.AH`:host{--tile-color:var(--warning-color)}`],(0,t.Cg)([(0,r.MZ)({attribute:!1})],p.prototype,"hass",void 0),(0,t.Cg)([(0,r.wk)()],p.prototype,"_config",void 0),(0,t.Cg)([(0,r.wk)()],p.prototype,"_repairsIssues",void 0),p=(0,t.Cg)([(0,r.EM)("hui-repairs-card")],p)}};
//# sourceMappingURL=31854.e87e09abb9480d48.js.map