UNPKG

iobroker.lovelace

Version:

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

66 lines 29.7 kB
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[60114],{26218:function(o,a,t){t.d(a,{a:function(){return r}});t(16280);const e=(0,t(77796).n)(o=>{history.replaceState({scrollPosition:o},"")},300);function r(o){return(a,t)=>{if("object"==typeof t)throw new Error("This decorator does not support this compilation type.");const r=a.connectedCallback;a.connectedCallback=function(){r.call(this);const a=this[t];a&&this.updateComplete.then(()=>{const t=this.renderRoot.querySelector(o);t&&setTimeout(()=>{t.scrollTop=a},0)})};const i=Object.getOwnPropertyDescriptor(a,t);let n;if(void 0===i)n={get(){var o;return this[`__${String(t)}`]||(null===(o=history.state)||void 0===o?void 0:o.scrollPosition)},set(o){e(o),this[`__${String(t)}`]=o},configurable:!0,enumerable:!0};else{const o=i.set;n=Object.assign(Object.assign({},i),{},{set(a){e(a),this[`__${String(t)}`]=a,null==o||o.call(this,a)}})}Object.defineProperty(a,t,n)}}},77796:function(o,a,t){t.d(a,{n:function(){return e}});t(62953);const e=(o,a,t=!0,e=!0)=>{let r,i=0;const n=(...n)=>{const s=()=>{i=!1===t?0:Date.now(),r=void 0,o(...n)},l=Date.now();i||!1!==t||(i=l);const c=a-(l-i);c<=0||c>a?(r&&(clearTimeout(r),r=void 0),i=l,o(...n)):r||!1===e||(r=window.setTimeout(s,c))};return n.cancel=()=>{clearTimeout(r),r=void 0,i=0},n}},9503:function(o,a,t){var e=t(40445),r=t(97577),i=t(5124),n=t(67576);let s,l=o=>o;class c extends r.A{get value(){var o;return null!==(o=this._value)&&void 0!==o?o:null}set value(o){this._value=o}static get styles(){return[r.A.styles,(0,i.AH)(s||(s=l`:host{--wa-form-control-toggle-size:var(--ha-checkbox-size, 20px);--wa-form-control-border-color:var( --ha-checkbox-border-color, var(--ha-color-border-neutral-normal) );--wa-form-control-background-color:var( --ha-checkbox-background-color, var(--wa-form-control-background-color) );--checked-icon-color:var( --ha-checkbox-checked-icon-color, var(--wa-color-brand-on-loud) );--wa-form-control-activated-color:var( --ha-checkbox-checked-background-color, var(--ha-color-fill-primary-loud-resting) );-webkit-tap-highlight-color:transparent;--checked-icon-scale:var(--ha-checkbox-checked-icon-scale, 0.9);--wa-form-control-required-content:var( --ha-checkbox-required-marker, var(--ha-input-required-marker, "*") );--wa-form-control-required-content-offset:var( --ha-checkbox-required-marker-offset, 0.1rem )}[part~=base]{align-items:center;gap:var(--ha-space-2)}[part~=control]{border-radius:var(--ha-checkbox-border-radius,var(--ha-border-radius-sm));border-width:var(--ha-checkbox-border-width,var(--ha-border-width-md));margin-inline-end:0}[part~=label]{line-height:1}#hint{font-size:var(--ha-font-size-xs);color:var(--ha-color-text-secondary)}label:has(input:not(:disabled)):hover{--wa-form-control-border-color:var( --ha-checkbox-border-color-hover, var(--ha-checkbox-border-color, var(--ha-color-border-neutral-loud)) )}label:has(input:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-background-color-hover,var(--ha-color-form-background-hover))}label:has(input:checked:not(:disabled)):hover [part~=control],label:has(input:indeterminate:not(:disabled)):hover [part~=control]{background-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover));border-color:var(--ha-checkbox-checked-background-color-hover,var(--ha-color-fill-primary-loud-hover))}`))]}}c=(0,e.Cg)([(0,n.EM)("ha-checkbox")],c)},65829:function(o,a,t){t.a(o,async function(o,e){try{t.r(a),t.d(a,{HaSpinner:function(){return d}});var r=t(40445),i=t(55262),n=t(5124),s=t(67576),l=o([i]);i=(l.then?(await l)():l)[0];let c,h=o=>o;class d extends i.A{updated(o){if(super.updated(o),o.has("size"))switch(this.size){case"tiny":this.style.setProperty("--ha-spinner-size","16px");break;case"small":this.style.setProperty("--ha-spinner-size","28px");break;case"medium":this.style.setProperty("--ha-spinner-size","48px");break;case"large":this.style.setProperty("--ha-spinner-size","68px");break;case void 0:this.style.removeProperty("--ha-progress-ring-size")}}static get styles(){return[i.A.styles,(0,n.AH)(c||(c=h`:host{--indicator-color:var( --ha-spinner-indicator-color, var(--primary-color) );--track-color:var(--ha-spinner-divider-color, var(--divider-color));--track-width:4px;--speed:3.5s;font-size:var(--ha-spinner-size, 48px)}`))]}}(0,r.Cg)([(0,s.MZ)()],d.prototype,"size",void 0),d=(0,r.Cg)([(0,s.EM)("ha-spinner")],d),e()}catch(c){e(c)}})},34127:function(o,a,t){t.a(o,async function(o,a){try{t(62953);var e=t(40445),r=t(52630),i=t(5124),n=t(67576),s=o([r]);r=(s.then?(await s)():s)[0];let l,c=o=>o;class h extends r.A{static get styles(){return[r.A.styles,(0,i.AH)(l||(l=c`:host{--wa-tooltip-background-color:var( --ha-tooltip-background-color, var(--ha-color-surface-default) );--wa-tooltip-content-color:var( --ha-tooltip-text-color, var(--primary-text-color) );--wa-tooltip-font-family:var( --ha-tooltip-font-family, var(--ha-font-family-body) );--wa-tooltip-font-size:var( --ha-tooltip-font-size, var(--ha-font-size-m) );--wa-tooltip-font-weight:var( --ha-tooltip-font-weight, var(--ha-font-weight-medium) );--wa-tooltip-line-height:var( --ha-tooltip-line-height, var(--ha-line-height-condensed) );--wa-tooltip-padding:var(--ha-tooltip-padding, var(--ha-space-2));--wa-tooltip-border-radius:var( --ha-tooltip-border-radius, var(--ha-border-radius-md) );--wa-tooltip-arrow-size:var(--ha-tooltip-arrow-size, 0px);--wa-tooltip-border-width:0px;--wa-z-index-tooltip:1000}.tooltip::part(popup){animation-duration:var(--ha-tooltip-animation-duration, 0)}.body{box-shadow:var(--ha-tooltip-box-shadow,var(--ha-box-shadow-m))}`))]}constructor(...o){super(...o),this.showDelay=350,this.hideDelay=150}}(0,e.Cg)([(0,n.MZ)({attribute:"show-delay",type:Number})],h.prototype,"showDelay",void 0),(0,e.Cg)([(0,n.MZ)({attribute:"hide-delay",type:Number})],h.prototype,"hideDelay",void 0),h=(0,e.Cg)([(0,n.EM)("ha-tooltip")],h),a()}catch(l){a(l)}})},36866:function(o,a,t){t.a(o,async function(o,a){try{t(62953);var e=t(40445),r=t(5124),i=t(67576),n=t(91485),s=o([n]);n=(s.then?(await s)():s)[0];let l,c,h=o=>o;const d="M9.5,3A6.5,6.5 0 0,1 16,9.5C16,11.11 15.41,12.59 14.44,13.73L14.71,14H15.5L20.5,19L19,20.5L14,15.5V14.71L13.73,14.44C12.59,15.41 11.11,16 9.5,16A6.5,6.5 0 0,1 3,9.5A6.5,6.5 0 0,1 9.5,3M9.5,5C7,5 5,7 5,9.5C5,12 7,14 9.5,14C12,14 14,12 14,9.5C14,7 12,5 9.5,5Z";class p extends n.U{willUpdate(o){var a,t;(super.willUpdate(o),this.label||this.placeholder||this.hasUpdated&&!o.has("_i18n"))||(this.placeholder=(null===(a=this.i18n)||void 0===a||null===(t=a.localize)||void 0===t?void 0:t.call(a,"ui.common.search"))||"Search")}renderStartDefault(){return(0,r.qy)(l||(l=h`<ha-svg-icon slot="start" .path="${0}"></ha-svg-icon>`),d)}constructor(){super(),this.withClear=!0,this.autocomplete=this.autocomplete||"off"}}p.styles=[...n.U.styles,(0,r.AH)(c||(c=h`:host([appearance=outlined]) wa-input.no-label::part(base){height:40px}`))],p=(0,e.Cg)([(0,i.EM)("ha-input-search")],p),a()}catch(l){a(l)}})},22130:function(o,a,t){t.r(a),t.d(a,{fetchAddonInfo:function(){return w},fetchHassioAddonChangelog:function(){return l},fetchHassioAddonDocumentation:function(){return h},fetchHassioAddonInfo:function(){return s},fetchHassioAddonLogs:function(){return c},fetchHassioAddonsInfo:function(){return n},installHassioAddon:function(){return f},rebuildLocalAddon:function(){return x},reloadHassioAddons:function(){return i},restartHassioAddon:function(){return b},setHassioAddonOption:function(){return d},setHassioAddonSecurity:function(){return g},startHassioAddon:function(){return u},stopHassioAddon:function(){return v},uninstallHassioAddon:function(){return y},updateHassioAddon:function(){return m},validateHassioAddonOption:function(){return p}});t(16280),t(18111),t(20116),t(3362);var e=t(35541),r=t(47351);const i=async o=>{await o.callWS({type:"supervisor/api",endpoint:"/addons/reload",method:"post"})},n=async o=>o.callWS({type:"supervisor/api",endpoint:"/addons",method:"get"}),s=async(o,a)=>o({type:"supervisor/api",endpoint:`/addons/${a}/info`,method:"get"}),l=async(o,a)=>o.callApi("GET",`hassio/addons/${a}/changelog`),c=async(o,a)=>o.callApi("GET",`hassio/addons/${a}/logs`),h=async(o,a)=>o.callApi("GET",`hassio/addons/${a}/documentation`),d=async(o,a,t)=>{const e=await o({type:"supervisor/api",endpoint:`/addons/${a}/options`,method:"post",data:t});if("error"===e.result)throw Error((0,r.VR)(e));return e},p=async(o,a,t)=>o({type:"supervisor/api",endpoint:`/addons/${a}/options/validate`,method:"post",data:t}),u=async(o,a)=>o({type:"supervisor/api",endpoint:`/addons/${a}/start`,method:"post",timeout:null}),v=async(o,a)=>o({type:"supervisor/api",endpoint:`/addons/${a}/stop`,method:"post",timeout:null}),g=async(o,a,t)=>{await o({type:"supervisor/api",endpoint:`/addons/${a}/security`,method:"post",data:t})},f=async(o,a)=>{await o({type:"supervisor/api",endpoint:`/addons/${a}/install`,method:"post",timeout:null})},m=async(o,a,t)=>{await o.callWS({type:"hassio/update/addon",addon:a,backup:t})},b=async(o,a)=>{await o({type:"supervisor/api",endpoint:`/addons/${a}/restart`,method:"post",timeout:null})},y=async(o,a,t)=>{await o({type:"supervisor/api",endpoint:`/addons/${a}/uninstall`,method:"post",timeout:null,data:{remove_config:t}})},w=(o,a,t)=>{var r;return(0,e.X)(o,null!==(r=a.addon)&&void 0!==r&&r.addons.find(o=>o.slug===t)?`/addons/${t}/info`:`/store/addons/${t}`)},x=async(o,a)=>o({type:"supervisor/api",endpoint:`/addons/${a}/rebuild`,method:"post",timeout:null})},47351:function(o,a,t){t.d(a,{PS:function(){return e},Tv:function(){return n},VR:function(){return r},lE:function(){return s}});t(74423),t(3362),t(17642),t(58004),t(33853),t(45876),t(32475),t(15024),t(31698),t(62953);const e=o=>o.data,r=o=>"object"==typeof o?"object"==typeof o.body?o.body.message||"Unknown error, see supervisor logs":o.body||o.message||"Unknown error, see supervisor logs":o,i=new Set([502,503,504]),n=o=>!!(o&&o.status_code&&i.has(o.status_code))||!(!o||!o.message||!o.message.includes("ERR_CONNECTION_CLOSED")&&!o.message.includes("ERR_CONNECTION_RESET")),s=async(o,a)=>o({type:"supervisor/api",endpoint:`/${a}/stats`,method:"get"})},35541:function(o,a,t){t.d(a,{X:function(){return i}});t(3362);var e=t(62384),r=t(47351);const i=async(o,a,t)=>{var i;return(0,e.v)(o.config.version,2021,2,4)?o.callWS({type:"supervisor/api",endpoint:a,method:(null==t?void 0:t.method)||"get",timeout:null!==(i=null==t?void 0:t.timeout)&&void 0!==i?i:null,data:null==t?void 0:t.data}):(0,r.PS)(await o.callApi((t.method||"get").toUpperCase(),`hassio${a}`,null==t?void 0:t.data))}},81562:function(o,a,t){t.r(a),t.d(a,{addStoreRepository:function(){return n},fetchStoreRepositories:function(){return i},fetchSupervisorStore:function(){return r},removeStoreRepository:function(){return s}});t(3362);var e=t(35541);const r=async o=>(0,e.X)(o,"/store"),i=async o=>(0,e.X)(o,"/store/repositories"),n=async(o,a)=>(0,e.X)(o,"/store/repositories",{method:"post",data:{repository:a}}),s=async(o,a)=>(0,e.X)(o,`/store/repositories/${a}`,{method:"delete"})},23296:function(o,a,t){t.a(o,async function(o,e){try{t.r(a);t(62953);var r=t(40445),i=t(5124),n=t(67576),s=t(91926),l=t(65829),c=t(90248),h=t(2054),d=t(14503),p=o([l,c,h]);[l,c,h]=p.then?(await p)():p;let u,v,g,f,m,b,y=o=>o;class w extends i.WF{render(){var o;return(0,i.qy)(u||(u=y` ${0} <div class="content"> <ha-spinner></ha-spinner> ${0} </div> `),this.noToolbar?"":(0,i.qy)(v||(v=y`<div class="toolbar"> ${0} </div>`),this.rootnav||null!==(o=history.state)&&void 0!==o&&o.root?(0,i.qy)(g||(g=y` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):(0,i.qy)(f||(f=y` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._handleBack)),this.message?(0,i.qy)(m||(m=y`<div id="loading-text">${0}</div>`),this.message):i.s6)}_handleBack(){(0,s.OE)()}static get styles(){return[d.RF,(0,i.AH)(b||(b=y`:host{display:block;height:100%;background-color:var(--primary-background-color)}.toolbar{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);padding:8px 12px;pointer-events:none;background-color:var(--app-header-background-color);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box}@media (max-width:599px){.toolbar{padding:4px}}ha-icon-button-arrow-prev,ha-menu-button{pointer-events:auto}.content{height:calc(100% - var(--header-height));display:flex;flex-direction:column;align-items:center;justify-content:center}#loading-text{max-width:350px;margin-top:16px}`))]}constructor(...o){super(...o),this.noToolbar=!1,this.rootnav=!1,this.narrow=!1}}(0,r.Cg)([(0,n.MZ)({attribute:!1})],w.prototype,"hass",void 0),(0,r.Cg)([(0,n.MZ)({type:Boolean,attribute:"no-toolbar"})],w.prototype,"noToolbar",void 0),(0,r.Cg)([(0,n.MZ)({type:Boolean})],w.prototype,"rootnav",void 0),(0,r.Cg)([(0,n.MZ)({type:Boolean})],w.prototype,"narrow",void 0),(0,r.Cg)([(0,n.MZ)()],w.prototype,"message",void 0),w=(0,r.Cg)([(0,n.EM)("hass-loading-screen")],w),e()}catch(u){e(u)}})},81310:function(o,a,t){t.a(o,async function(o,a){try{t(62953);var e=t(40445),r=t(5124),i=t(67576),n=t(6412),s=t(26218),l=t(91926),c=t(90248),h=t(2054),d=t(14503),p=o([c,h]);[c,h]=p.then?(await p)():p;let u,v,g,f,m,b=o=>o;class y extends r.WF{render(){var o;return(0,r.qy)(u||(u=b` <div class="toolbar ${0}"> <div class="toolbar-content"> ${0} <div class="main-title"> <slot name="header">${0}</slot> </div> <slot name="toolbar-icon"></slot> </div> </div> <div class="${0}" @scroll="${0}"> <slot></slot> </div> <div id="fab"> <slot name="fab"></slot> </div> `),(0,n.H)({narrow:this.narrow}),this.mainPage||null!==(o=history.state)&&void 0!==o&&o.root?(0,r.qy)(v||(v=b` <ha-menu-button .hass="${0}" .narrow="${0}"></ha-menu-button> `),this.hass,this.narrow):this.backPath?(0,r.qy)(g||(g=b` <ha-icon-button-arrow-prev href="${0}" .hass="${0}"></ha-icon-button-arrow-prev> `),this.backPath,this.hass):(0,r.qy)(f||(f=b` <ha-icon-button-arrow-prev .hass="${0}" @click="${0}"></ha-icon-button-arrow-prev> `),this.hass,this._backTapped),this.header,(0,n.H)({content:!0,"ha-scrollbar":this.scrollable,"not-scrollable":!this.scrollable}),this._saveScrollPos)}_saveScrollPos(o){this._savedScrollPos=o.target.scrollTop}_backTapped(){this.backCallback?this.backCallback():(0,l.OE)()}static get styles(){return[d.dp,(0,r.AH)(m||(m=b`:host{display:block;height:100%;background-color:var(--primary-background-color);overflow:hidden;position:relative}:host([narrow]){width:100%;position:fixed}.toolbar{background-color:var(--app-header-background-color);padding-top:var(--safe-area-inset-top);padding-right:var(--safe-area-inset-right)}:host([narrow]) .toolbar{padding-left:var(--safe-area-inset-left)}.toolbar-content{display:flex;align-items:center;font-size:var(--ha-font-size-xl);height:var(--header-height);font-weight:var(--ha-font-weight-normal);color:var(--app-header-text-color,#fff);border-bottom:var(--app-header-border-bottom,none);box-sizing:border-box;padding:8px 12px}.toolbar a{color:var(--sidebar-text-color);text-decoration:none}::slotted([slot=toolbar-icon]),ha-icon-button-arrow-prev,ha-menu-button{display:flex;align-items:center;pointer-events:auto;color:var(--sidebar-icon-color)}.main-title{margin-inline-start:var(--ha-space-6);line-height:var(--ha-line-height-normal);min-width:0;flex-grow:1;overflow-wrap:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis}.narrow .main-title{margin-inline-start:var(--ha-space-2)}.content{position:relative;width:calc(100% - var(--safe-area-inset-right,0px));height:calc(100% - 1px - var(--header-height,0px) - var(--safe-area-inset-top,0px) - var(--safe-area-inset-bottom,0px));padding-bottom:var(--safe-area-inset-bottom,0px);margin-right:var(--safe-area-inset-right);overflow-y:auto;overflow:auto;-webkit-overflow-scrolling:touch}.content.not-scrollable{overflow:hidden;display:flex;flex-direction:column}:host([narrow]) .content{width:calc(100% - var(--safe-area-inset-left,0px) - var(--safe-area-inset-right,0px));margin-left:var(--safe-area-inset-left)}#fab{position:absolute;right:calc(16px + var(--safe-area-inset-right,0px));inset-inline-end:calc(16px + var(--safe-area-inset-right,0px));inset-inline-start:initial;bottom:calc(16px + var(--safe-area-inset-bottom,0px));z-index:1;display:flex;flex-wrap:wrap;justify-content:flex-end;gap:var(--ha-space-2);--ha-button-box-shadow:var(--ha-box-shadow-l)}:host([narrow]) #fab.tabs{bottom:calc(84px + var(--safe-area-inset-bottom,0px))}#fab[is-wide]{bottom:calc(24px + var(--safe-area-inset-bottom,0px));right:calc(24px + var(--safe-area-inset-right,0px));inset-inline-end:calc(24px + var(--safe-area-inset-right,0px));inset-inline-start:initial}`))]}constructor(...o){super(...o),this.mainPage=!1,this.narrow=!1,this.scrollable=!0}}(0,e.Cg)([(0,i.MZ)({attribute:!1})],y.prototype,"hass",void 0),(0,e.Cg)([(0,i.MZ)()],y.prototype,"header",void 0),(0,e.Cg)([(0,i.MZ)({type:Boolean,attribute:"main-page"})],y.prototype,"mainPage",void 0),(0,e.Cg)([(0,i.MZ)({type:String,attribute:"back-path"})],y.prototype,"backPath",void 0),(0,e.Cg)([(0,i.MZ)({attribute:!1})],y.prototype,"backCallback",void 0),(0,e.Cg)([(0,i.MZ)({type:Boolean,reflect:!0})],y.prototype,"narrow",void 0),(0,e.Cg)([(0,i.MZ)({type:Boolean})],y.prototype,"scrollable",void 0),(0,e.Cg)([(0,s.a)(".content")],y.prototype,"_savedScrollPos",void 0),(0,e.Cg)([(0,i.Ls)({passive:!0})],y.prototype,"_saveScrollPos",null),y=(0,e.Cg)([(0,i.EM)("hass-subpage")],y),a()}catch(u){a(u)}})},91245:function(o,a,t){t.a(o,async function(o,e){try{t.r(a),t.d(a,{HaConfigAppsRepositories:function(){return L}});t(74423),t(26910),t(18111),t(22489),t(20116),t(61701),t(13579),t(3362),t(62953);var r=t(40445),i=t(5124),n=t(67576),s=t(22786),l=t(1087),c=t(52220),h=t(6030),d=t(48091),p=t(18350),u=t(26300),v=(t(67094),t(34127)),g=t(22130),f=t(47351),m=t(81562),b=t(65063),y=t(28794),w=t(23296),x=t(81310),k=o([d,p,u,v,y,w,x]);[d,p,u,v,y,w,x]=k.then?(await k)():k;let _,$,z,A,C,H=o=>o;const R="M19,4H15.5L14.5,3H9.5L8.5,4H5V6H19M6,19A2,2 0 0,0 8,21H16A2,2 0 0,0 18,19V7H6V19Z",S="M2 5.27L3.28 4L5 5.72L5.28 6L6.28 7L18 18.72L20 20.72L18.73 22L17.27 20.54C16.93 20.83 16.5 21 16 21H8C6.9 21 6 20.1 6 19V9.27L2 5.27M19 4V6H7.82L5.82 4H8.5L9.5 3H14.5L15.5 4H19M18 7V16.18L8.82 7H18Z",M="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z";class L extends i.WF{firstUpdated(){this._loadData().then(()=>{const o=(0,h.p9)("repository_url");o&&this._addRepository(o)})}render(){if(this._error)return(0,i.qy)(_||(_=H` <hass-error-screen .hass="${0}" .error="${0}"></hass-error-screen> `),this.hass,this._error);if(!this._repositories||!this._addon)return(0,i.qy)($||($=H` <hass-loading-screen .hass="${0}" .narrow="${0}"></hass-loading-screen> `),this.hass,this.narrow);const o=this._filteredRepositories(this._repositories),a=this._filteredUsedRepositories(o,this._addon.addons);return(0,i.qy)(z||(z=H` <hass-subpage .hass="${0}" .narrow="${0}" .route="${0}" back-path="/config/apps/available" .header="${0}"> <ha-data-table .columns="${0}" .data="${0}" .noDataText="${0}" id="slug" has-fab></ha-data-table> <ha-button size="large" @click="${0}"> <ha-svg-icon slot="start" .path="${0}"></ha-svg-icon> ${0} </ha-button> </hass-subpage> `),this.hass,this.narrow,this.route,this.hass.localize("ui.panel.config.apps.store.repositories"),this._columns(this.hass.localize,a),this._data(o),this.hass.localize("ui.panel.config.apps.repositories.no_repositories"),this._showAddRepositoryDialog,M,this.hass.localize("ui.panel.config.apps.repositories.add"))}async _showAddRepositoryDialog(){(0,b.an)(this,{title:this.hass.localize("ui.panel.config.apps.repositories.add_title"),inputLabel:this.hass.localize("ui.panel.config.apps.repositories.url"),inputType:"url",confirmText:this.hass.localize("ui.panel.config.apps.repositories.add"),action:async o=>{try{await(0,m.addStoreRepository)(this.hass,o),await this._loadData(),(0,l.r)(this,"apps-collection-refresh",{collection:"store"})}catch(a){throw(0,b.showAlertDialog)(this,{text:(0,f.VR)(a)}),a}}})}async _addRepository(o){try{await(0,m.addStoreRepository)(this.hass,o),await this._loadData(),(0,l.r)(this,"apps-collection-refresh",{collection:"store"})}catch(a){(0,b.showAlertDialog)(this,{text:(0,f.VR)(a)})}}async _loadData(){try{const[o,a]=await Promise.all([(0,m.fetchStoreRepositories)(this.hass),(0,g.fetchHassioAddonsInfo)(this.hass)]);this._repositories=o,this._addon=a}catch(o){this._error=(0,f.VR)(o)}}constructor(...o){super(...o),this.narrow=!1,this._columns=(0,s.A)((o,a)=>({name:{title:o("ui.panel.config.apps.store.repositories"),main:!0,sortable:!0,filterable:!0,direction:"asc",flex:2},maintainer:{title:o("ui.panel.config.apps.repositories.maintainer"),sortable:!0,filterable:!0,flex:1},url:{title:o("ui.panel.config.apps.repositories.url"),sortable:!0,filterable:!0,flex:2},actions:{title:"",label:o("ui.panel.config.apps.repositories.remove"),type:"icon-button",showNarrow:!0,lastFixed:!0,template:t=>{const e=a.includes(t.slug);return(0,i.qy)(A||(A=H` <ha-tooltip .for="delete-btn-${0}"> ${0} </ha-tooltip> <ha-icon-button .id="delete-btn-${0}" .disabled="${0}" .slug="${0}" .path="${0}" @click="${0}" class="delete"></ha-icon-button> `),t.slug,o(e?"ui.panel.config.apps.repositories.used":"ui.panel.config.apps.repositories.remove"),t.slug,e,t.slug,e?S:R,this._removeRepository)}}})),this._filteredRepositories=(0,s.A)(o=>o.filter(o=>"core"!==o.slug&&"local"!==o.slug&&"a0d7b954"!==o.slug&&"5c53de3b"!==o.slug&&"d5369777"!==o.slug).sort((o,a)=>(0,c.SH)(o.name,a.name,this.hass.locale.language))),this._filteredUsedRepositories=(0,s.A)((o,a)=>o.filter(o=>a.some(a=>a.repository===o.slug)).map(o=>o.slug)),this._data=(0,s.A)(o=>o.map(o=>({slug:o.slug,name:o.name,maintainer:o.maintainer,url:o.url}))),this._removeRepository=async o=>{var a;const t=o.currentTarget.slug,e=null===(a=this._repositories)||void 0===a?void 0:a.find(o=>o.slug===t);(0,b.dk)(this,{title:this.hass.localize("ui.panel.config.apps.repositories.remove"),text:this.hass.localize("ui.panel.config.apps.repositories.confirm_remove",{name:(null==e?void 0:e.name)||t}),destructive:!0,confirmText:this.hass.localize("ui.panel.config.apps.repositories.remove"),action:async()=>{try{await(0,m.removeStoreRepository)(this.hass,t),await this._loadData(),(0,l.r)(this,"apps-collection-refresh",{collection:"store"})}catch(o){throw(0,b.showAlertDialog)(this,{text:(0,f.VR)(o)}),o}}})}}}L.styles=(0,i.AH)(C||(C=H`:host{display:block;height:100%;background-color:var(--primary-background-color)}ha-data-table{width:100%;height:100%;--data-table-border-width:0}ha-icon-button.delete{color:var(--error-color)}ha-button[size=large]{position:fixed;right:calc(var(--ha-space-4) + var(--safe-area-inset-right));bottom:calc(var(--ha-space-4) + var(--safe-area-inset-bottom));inset-inline-end:calc(var(--ha-space-4) + var(--safe-area-inset-right));inset-inline-start:initial;z-index:1;--ha-button-box-shadow:var(--ha-box-shadow-l)}`)),(0,r.Cg)([(0,n.MZ)({attribute:!1})],L.prototype,"hass",void 0),(0,r.Cg)([(0,n.MZ)({type:Boolean})],L.prototype,"narrow",void 0),(0,r.Cg)([(0,n.MZ)({attribute:!1})],L.prototype,"route",void 0),(0,r.Cg)([(0,n.wk)()],L.prototype,"_repositories",void 0),(0,r.Cg)([(0,n.wk)()],L.prototype,"_addon",void 0),(0,r.Cg)([(0,n.wk)()],L.prototype,"_error",void 0),L=(0,r.Cg)([(0,n.EM)("ha-config-apps-repositories")],L),e()}catch(_){e(_)}})},69235:function(o,a,t){t.a(o,async function(o,a){try{t(3362),t(62953);"function"!=typeof window.ResizeObserver&&(window.ResizeObserver=(await t.e(71055).then(t.bind(t,52370))).default),a()}catch(e){a(e)}},1)},14503:function(o,a,t){t.d(a,{RF:function(){return p},dp:function(){return g},kO:function(){return v},nA:function(){return u},og:function(){return d}});var e=t(5124);let r,i,n,s,l,c,h=o=>o;const d=(0,e.AH)(r||(r=h`button.link{background:0 0;color:inherit;border:none;padding:0;font:inherit;text-align:left;text-decoration:underline;cursor:pointer;outline:0}`)),p=(0,e.AH)(i||(i=h`:host{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-m);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}app-header div[sticky]{height:48px}app-toolbar [main-title]{margin-left:20px;margin-inline-start:20px;margin-inline-end:initial}.header{transition:box-shadow .2s linear,width var(--ha-animation-duration-normal) ease,padding-left var(--ha-animation-duration-normal) ease,padding-right var(--ha-animation-duration-normal) ease}@media (prefers-reduced-motion:reduce){.header{transition:box-shadow .2s linear}}h1{font-family:var(--ha-font-family-heading);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-2xl);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-condensed)}h2{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:var(--ha-font-size-xl);font-weight:var(--ha-font-weight-medium);line-height:var(--ha-line-height-normal)}h3{font-family:var(--ha-font-family-body);-webkit-font-smoothing:var(--ha-font-smoothing);-moz-osx-font-smoothing:var(--ha-moz-osx-font-smoothing);font-size:var(--ha-font-size-l);font-weight:var(--ha-font-weight-normal);line-height:var(--ha-line-height-normal)}a{color:var(--primary-color)}.secondary{color:var(--secondary-text-color)}.error{color:var(--error-color)}.warning{color:var(--error-color)}${0} .card-actions a{text-decoration:none}.card-actions .warning{--mdc-theme-primary:var(--error-color)}.layout.horizontal,.layout.vertical{display:flex}.layout.inline{display:inline-flex}.layout.horizontal{flex-direction:row}.layout.vertical{flex-direction:column}.layout.wrap{flex-wrap:wrap}.layout.no-wrap{flex-wrap:nowrap}.layout.center,.layout.center-center{align-items:center}.layout.bottom{align-items:flex-end}.layout.center-center,.layout.center-justified{justify-content:center}.flex{flex:1;flex-basis:0.000000001px}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.layout.justified{justify-content:space-between}`),d),u=(0,e.AH)(n||(n=h`ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:400px;--mdc-dialog-max-width:600px;--mdc-dialog-max-width:min(600px, 95vw);--justify-action-buttons:space-between;--dialog-container-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--dialog-surface-padding:0px}ha-adaptive-dialog .form,ha-dialog .form{color:var(--primary-text-color)}a{color:var(--primary-color)}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--mdc-dialog-min-width:100vw;--mdc-dialog-max-width:100vw;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--dialog-container-padding:0px;--dialog-surface-padding:var(--safe-area-inset-top, 0) var(--safe-area-inset-right, 0) var(--safe-area-inset-bottom, 0) var(--safe-area-inset-left, 0);--vertical-align-dialog:flex-end}ha-dialog{--ha-dialog-border-radius:var(--ha-border-radius-square)}}.error{color:var(--error-color)}`)),v=(0,e.AH)(s||(s=h`ha-adaptive-dialog,ha-dialog{--vertical-align-dialog:flex-start;--dialog-surface-margin-top:var(--ha-space-10);--mdc-dialog-max-height:calc( 100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var( --safe-area-inset-y, 0px ) );--mdc-dialog-max-height:calc( 100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var( --safe-area-inset-y, 0px ) );--ha-dialog-max-height:calc( 100vh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var( --safe-area-inset-y, 0px ) );--ha-dialog-max-height:calc( 100svh - var(--dialog-surface-margin-top) - var(--ha-space-2) - var( --safe-area-inset-y, 0px ) )}@media all and (max-width:450px),all and (max-height:500px){ha-adaptive-dialog,ha-dialog{--dialog-surface-margin-top:0px;--mdc-dialog-min-height:100vh;--mdc-dialog-min-height:100svh;--mdc-dialog-max-height:100vh;--mdc-dialog-max-height:100svh;--ha-dialog-max-height:100vh;--ha-dialog-max-height:100svh}}`)),g=(0,e.AH)(l||(l=h`.ha-scrollbar::-webkit-scrollbar{width:.4rem;height:.4rem}.ha-scrollbar::-webkit-scrollbar-thumb{border-radius:var(--ha-border-radius-sm);background:var(--scrollbar-thumb-color)}.ha-scrollbar{overflow-y:auto;scrollbar-color:var(--scrollbar-thumb-color) transparent;scrollbar-width:thin}`));(0,e.AH)(c||(c=h`body{background-color:var(--primary-background-color);color:var(--primary-text-color);height:calc(100vh - 32px);width:100vw}`))},85614:function(o,a,t){t.d(a,{i:function(){return e}});t(3362),t(62953);const e=async()=>{await Promise.all([t.e(38085),t.e(22309)]).then(t.bind(t,40772))}}}]);