"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["39031"],{96273:function(t,a,o){o.d(a,{Bt:function(){return c},Qf:function(){return l},Su:function(){return h},Wu:function(){return i},bK:function(){return s},dd:function(){return u},f3:function(){return n},h1:function(){return e},wZ:function(){return r}});o(3362);var i=function(t){return t.BIND="bind",t.CIFS="cifs",t.NFS="nfs",t}({}),e=function(t){return t.BACKUP="backup",t.MEDIA="media",t.SHARE="share",t}({}),n=function(t){return t.ACTIVE="active",t.FAILED="failed",t.UNKNOWN="unknown",t}({});const s=async t=>t.callWS({type:"supervisor/api",endpoint:"/mounts",method:"get",timeout:null}),l=async(t,a)=>t.callWS({type:"supervisor/api",endpoint:"/mounts",method:"post",timeout:null,data:a}),c=async(t,a)=>t.callWS({type:"supervisor/api",endpoint:`/mounts/${a.name}`,method:"put",timeout:null,data:a}),r=async(t,a)=>t.callWS({type:"supervisor/api",endpoint:`/mounts/${a}`,method:"delete",timeout:null}),u=async(t,a)=>t.callWS({type:"supervisor/api",endpoint:`/mounts/${a.name}/reload`,method:"post",timeout:null}),h=async(t,a)=>t.callWS({type:"supervisor/api",endpoint:"/mounts/options",method:"post",timeout:null,data:a})},74186:function(t,a,o){o.a(t,async function(t,i){try{o.r(a);o(3362),o(62953);var e=o(40445),n=o(96196),s=o(77845),l=o(1087),c=o(38962),r=o(18350),u=(o(93444),o(72554)),h=o(52763),p=o(47351),d=o(96273),_=o(14503),m=t([c,r,u,h]);[c,r,u,h]=m.then?(await m)():m;let g,f,b,y=t=>t;const k=[{name:"default_backup_mount",required:!0,selector:{backup_location:{}}}];class v extends n.WF{async showDialog(t){this._dialogParams=t,this._open=!0}closeDialog(){this._open=!1}_dialogClosed(){this._data=void 0,this._error=void 0,this._waiting=void 0,this._dialogParams=void 0,(0,l.r)(this,"dialog-closed",{dialog:this.localName})}render(){return this._dialogParams?(0,n.qy)(g||(g=y` <ha-dialog .hass="${0}" .open="${0}" header-title="${0}" prevent-scrim-close @closed="${0}"> ${0} <p> ${0} </p> <ha-form autofocus .hass="${0}" .data="${0}" .schema="${0}" .computeLabel="${0}" @value-changed="${0}"></ha-form> <ha-alert alert-type="info"> ${0} </ha-alert> <ha-dialog-footer slot="footer"> <ha-button slot="secondaryAction" appearance="plain" @click="${0}"> ${0} </ha-button> <ha-button .disabled="${0}" slot="primaryAction" @click="${0}"> ${0} </ha-button> </ha-dialog-footer> </ha-dialog> `),this.hass,this._open,this.hass.localize("ui.panel.config.backup.dialogs.local_backup_location.title"),this._dialogClosed,this._error?(0,n.qy)(f||(f=y`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):n.s6,this.hass.localize("ui.panel.config.backup.dialogs.local_backup_location.description"),this.hass,this._data,k,this._computeLabelCallback,this._valueChanged,this.hass.localize("ui.panel.config.backup.dialogs.local_backup_location.note"),this.closeDialog,this.hass.localize("ui.common.cancel"),this._waiting||!this._data,this._changeMount,this.hass.localize("ui.common.save")):n.s6}_valueChanged(t){const a=t.detail.value.default_backup_mount;this._data={default_backup_mount:"/backup"===a?null:a}}async _changeMount(){if(this._data){this._error=void 0,this._waiting=!0;try{await(0,d.Su)(this.hass,this._data)}catch(t){return this._error=(0,p.VR)(t),void(this._waiting=!1)}this.closeDialog()}}static get styles(){return[_.RF,_.nA,(0,n.AH)(b||(b=y`ha-form{display:block;margin-bottom:16px}`))]}constructor(...t){super(...t),this._open=!1,this._computeLabelCallback=t=>this.hass.localize(`ui.panel.config.backup.dialogs.local_backup_location.options.${t.name}.name`)||t.name}}(0,e.Cg)([(0,s.MZ)({attribute:!1})],v.prototype,"hass",void 0),(0,e.Cg)([(0,s.wk)()],v.prototype,"_dialogParams",void 0),(0,e.Cg)([(0,s.wk)()],v.prototype,"_data",void 0),(0,e.Cg)([(0,s.wk)()],v.prototype,"_waiting",void 0),(0,e.Cg)([(0,s.wk)()],v.prototype,"_error",void 0),(0,e.Cg)([(0,s.wk)()],v.prototype,"_open",void 0),v=(0,e.Cg)([(0,s.EM)("dialog-local-backup-location")],v),i()}catch(g){i(g)}})}}]);
//# sourceMappingURL=39031.0cb795f82d02bea6.js.map