export const id=5510;export const ids=[5510];export const modules={35510:(a,i,s)=>{s.a(a,(async(a,t)=>{try{s.r(i);var r=s(17463),e=(s(14271),s(68144)),o=s(79932),c=s(47181),l=(s(98762),s(9381),s(34821)),n=s(60538),d=s(41682),u=s(26765),h=s(11654),p=s(31595),k=a([p]);p=(k.then?(await k)():k)[0];(0,r.Z)([(0,o.Mo)("dialog-hassio-create-backup")],(function(a,i){return{F:class extends i{constructor(...i){super(...i),a(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_dialogParams",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,o.SB)()],key:"_creatingBackup",value:()=>!1},{kind:"field",decorators:[(0,o.IO)("supervisor-backup-content")],key:"_backupContent",value:void 0},{kind:"method",key:"showDialog",value:function(a){this._dialogParams=a,this._creatingBackup=!1}},{kind:"method",key:"closeDialog",value:function(){this._dialogParams=void 0,this._creatingBackup=!1,this._error=void 0,(0,c.B)(this,"dialog-closed",{dialog:this.localName})}},{kind:"method",key:"render",value:function(){return this._dialogParams?e.dy` <ha-dialog open scrimClickAction @closed="${this.closeDialog}" .heading="${(0,l.i)(this.hass,this._dialogParams.supervisor.localize("backup.create_backup"))}"> ${this._creatingBackup?e.dy`<ha-circular-progress active></ha-circular-progress>`:e.dy`<supervisor-backup-content .hass="${this.hass}" .supervisor="${this._dialogParams.supervisor}" dialogInitialFocus> </supervisor-backup-content>`} ${this._error?e.dy`<ha-alert alert-type="error">${this._error}</ha-alert>`:""} <mwc-button slot="secondaryAction" @click="${this.closeDialog}"> ${this._dialogParams.supervisor.localize("common.close")} </mwc-button> <mwc-button .disabled="${this._creatingBackup}" slot="primaryAction" @click="${this._createBackup}"> ${this._dialogParams.supervisor.localize("backup.create")} </mwc-button> </ha-dialog> `:e.Ld}},{kind:"method",key:"_createBackup",value:async function(){if("running"!==this._dialogParams.supervisor.info.state)return void(0,u.Ys)(this,{title:this._dialogParams.supervisor.localize("backup.could_not_create"),text:this._dialogParams.supervisor.localize("backup.create_blocked_not_running","state",this._dialogParams.supervisor.info.state)});const a=this._backupContent.backupDetails();if(this._creatingBackup=!0,this._error="",a.password&&!a.password.length)return this._error=this._dialogParams.supervisor.localize("backup.enter_password"),void(this._creatingBackup=!1);if(a.password&&a.password!==a.confirm_password)return this._error=this._dialogParams.supervisor.localize("backup.passwords_not_matching"),void(this._creatingBackup=!1);delete a.confirm_password;try{"full"===this._backupContent.backupType?await(0,n.vU)(this.hass,a):await(0,n.zU)(this.hass,a),this._dialogParams.onCreate(),this.closeDialog()}catch(a){this._error=(0,d.js)(a)}this._creatingBackup=!1}},{kind:"get",static:!0,key:"styles",value:function(){return[h.Qx,h.yu,e.iv`ha-circular-progress{display:block;text-align:center}`]}}]}}),e.oi);t()}catch(a){t(a)}}))}};
//# sourceMappingURL=5510-x2Z83T43lzY.js.map