export const __rspack_esm_id="11844";export const __rspack_esm_ids=["11844"];export const __webpack_modules__={7466(t,e,s){s.a(t,async function(t,a){try{s.r(e),s.d(e,{CloudForgotPasswordCard:()=>u});var r=s(62826),o=s(96196),i=s(44457),n=s(1087),l=s(89300),d=(s(38962),s(76776),s(75709),s(14503)),h=s(71117),c=s(79007),p=t([l]);l=(p.then?(await p)():p)[0];class u extends o.WF{render(){return this.cardLess?this._renderContent():o.qy` <ha-card outlined .header="${this.localize(`ui.panel.${this.translationKeyPanel}.subtitle`)}"> ${this._renderContent()} </ha-card> `}_renderContent(){return o.qy` <div class="card-content"> <p> ${this.localize(`ui.panel.${this.translationKeyPanel}.instructions`)} </p> ${this._error?o.qy`<ha-alert alert-type="error">${this._error}</ha-alert>`:o.s6} <ha-textfield autofocus id="email" label="${this.localize(`ui.panel.${this.translationKeyPanel}.email`)}" .value="${this.email??""}" type="email" required .disabled="${this._inProgress}" @keydown="${this._keyDown}" .validationMessage="${this.localize(`ui.panel.${this.translationKeyPanel}.email_error_msg`)}"></ha-textfield> </div> <div class="card-actions"> <ha-progress-button @click="${this._handleEmailPasswordReset}" .progress="${this._inProgress}"> ${this.localize(`ui.panel.${this.translationKeyPanel}.send_reset_email`)} </ha-progress-button> </div> `}_keyDown(t){"Enter"===t.key&&this._handleEmailPasswordReset()}async _handleEmailPasswordReset(){const t=this.emailField,e=t.value;t.reportValidity()?(this._inProgress=!0,this._resetPassword(e)):t.focus()}static get styles(){return[d.RF,o.AH`ha-card{max-width:600px;margin:0 auto;margin-top:24px}h1{margin:0}ha-textfield{width:100%}.card-actions{display:flex;justify-content:flex-end;align-items:center}`]}constructor(...t){super(...t),this.translationKeyPanel="config.cloud.forgot_password",this.cardLess=!1,this._inProgress=!1,this._resetPassword=async t=>{this._inProgress=!0;try{this.hass?await(0,h.Ut)(this.hass,t):await(0,c.zN)(t),(0,n.r)(this,"cloud-email-changed",{value:t}),this._inProgress=!1,(0,n.r)(this,"cloud-done",{flashMessage:this.localize(`ui.panel.${this.translationKeyPanel}.check_your_email`)})}catch(e){this._inProgress=!1;"usernotfound"===(e&&e.body&&e.body.code)&&t!==t.toLowerCase()?await this._resetPassword(t.toLowerCase()):this._error=e&&e.body&&e.body.message?e.body.message:"Unknown error"}}}}(0,r.Cg)([(0,i.MZ)({attribute:!1})],u.prototype,"hass",void 0),(0,r.Cg)([(0,i.MZ)({attribute:!1})],u.prototype,"localize",void 0),(0,r.Cg)([(0,i.MZ)({attribute:"translation-key-panel"})],u.prototype,"translationKeyPanel",void 0),(0,r.Cg)([(0,i.MZ)()],u.prototype,"email",void 0),(0,r.Cg)([(0,i.MZ)({type:Boolean,attribute:"card-less"})],u.prototype,"cardLess",void 0),(0,r.Cg)([(0,i.wk)()],u.prototype,"_inProgress",void 0),(0,r.Cg)([(0,i.wk)()],u.prototype,"_error",void 0),(0,r.Cg)([(0,i.P)("#email",!0)],u.prototype,"emailField",void 0),u=(0,r.Cg)([(0,i.EM)("cloud-forgot-password-card")],u),a()}catch(t){a(t)}})},92949(t,e,s){s.a(t,async function(t,a){try{s.r(e),s.d(e,{CloudForgotPassword:()=>h});var r=s(62826),o=s(96196),i=s(44457),n=s(7466),l=(s(81310),s(14503)),d=t([n]);n=(d.then?(await d)():d)[0];class h extends o.WF{render(){return o.qy` <hass-subpage .hass="${this.hass}" .narrow="${this.narrow}" .header="${this.hass.localize("ui.panel.config.cloud.forgot_password.title")}"> <div class="content"> <cloud-forgot-password-card .hass="${this.hass}" .localize="${this.hass.localize}" .email="${this.email}"></cloud-forgot-password-card> </div> </hass-subpage> `}static get styles(){return[l.RF,o.AH`.content{padding-bottom:24px}`]}constructor(...t){super(...t),this.narrow=!1,this._requestInProgress=!1}}(0,r.Cg)([(0,i.MZ)({attribute:!1})],h.prototype,"hass",void 0),(0,r.Cg)([(0,i.MZ)({type:Boolean})],h.prototype,"narrow",void 0),(0,r.Cg)([(0,i.MZ)()],h.prototype,"email",void 0),(0,r.Cg)([(0,i.wk)()],h.prototype,"_requestInProgress",void 0),h=(0,r.Cg)([(0,i.EM)("cloud-forgot-password")],h),a()}catch(t){a(t)}})}};
//# sourceMappingURL=11844.0114cc31120a3dfc.js.map