3 lines
No EOL
50 KiB
JavaScript
3 lines
No EOL
50 KiB
JavaScript
/*! For license information please see 3252.96FXAq2UeSY.js.LICENSE.txt */
|
||
(self.webpackChunkhacs_frontend=self.webpackChunkhacs_frontend||[]).push([[3252,8245],{47540:function(e,t,i){var r={"./flow-preview-group":[72583,1866,2415,3687,9503,4303,6509,2583],"./flow-preview-group.ts":[72583,1866,2415,3687,9503,4303,6509,2583],"./flow-preview-template":[21904,1866,2415,3687,9503,4303,6509,1904],"./flow-preview-template.ts":[21904,1866,2415,3687,9503,4303,6509,1904]};function o(e){if(!i.o(r,e))return Promise.resolve().then((function(){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}));var t=r[e],o=t[0];return Promise.all(t.slice(1).map(i.e)).then((function(){return i(o)}))}o.keys=function(){return Object.keys(r)},o.id=47540,e.exports=o},7006:function(e,t,i){"use strict";var r,o=i(88962),n=i(46097),a=i(33368),s=i(71650),c=i(68308),l=i(82390),d=i(69205),u=i(91808),p=i(34541),h=i(47838),f=(i(97393),i(34131),i(22129)),v=i(5095),g=i(95260);(0,u.Z)([(0,g.Mo)("ha-circular-progress")],(function(e,t){var i=function(t){function i(){var t;(0,s.Z)(this,i);for(var r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];return t=(0,c.Z)(this,i,[].concat(o)),e((0,l.Z)(t)),t}return(0,d.Z)(i,t),(0,a.Z)(i)}(t);return{F:i,d:[{kind:"field",decorators:[(0,g.Cb)({attribute:"aria-label",type:String})],key:"ariaLabel",value:function(){return"Loading"}},{kind:"field",decorators:[(0,g.Cb)()],key:"size",value:function(){return"medium"}},{kind:"method",key:"updated",value:function(e){if((0,p.Z)((0,h.Z)(i.prototype),"updated",this).call(this,e),e.has("size"))switch(this.size){case"tiny":this.style.setProperty("--md-circular-progress-size","16px");break;case"small":this.style.setProperty("--md-circular-progress-size","28px");break;case"medium":this.style.setProperty("--md-circular-progress-size","48px");break;case"large":this.style.setProperty("--md-circular-progress-size","68px")}}},{kind:"get",static:!0,key:"styles",value:function(){return[].concat((0,n.Z)((0,p.Z)((0,h.Z)(i),"styles",this)),[(0,v.iv)(r||(r=(0,o.Z)([":host{--md-sys-color-primary:var(--primary-color);--md-circular-progress-size:48px}"])))])}}]}}),f.B)},9828:function(e,t,i){"use strict";i.d(t,{i:function(){return w}});var r,o,n,a=i(33368),s=i(71650),c=i(68308),l=i(82390),d=i(69205),u=i(91808),p=i(34541),h=i(47838),f=i(88962),v=(i(97393),i(91989),i(87762)),g=i(91632),m=i(5095),_=i(95260),y=i(60625),k=(i(54371),["button","ha-list-item"]),w=function(e,t){var i;return(0,m.dy)(r||(r=(0,f.Z)([' <div class="header_title"> <span>','</span> <ha-icon-button .label="','" .path="','" dialogAction="close" class="header_button"></ha-icon-button> </div> '])),t,null!==(i=null==e?void 0:e.localize("ui.dialogs.generic.close"))&&void 0!==i?i:"Close","M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z")};(0,u.Z)([(0,_.Mo)("ha-dialog")],(function(e,t){var i=function(t){function i(){var t;(0,s.Z)(this,i);for(var r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];return t=(0,c.Z)(this,i,[].concat(o)),e((0,l.Z)(t)),t}return(0,d.Z)(i,t),(0,a.Z)(i)}(t);return{F:i,d:[{kind:"field",key:y.gA,value:void 0},{kind:"method",key:"scrollToPos",value:function(e,t){var i;null===(i=this.contentElement)||void 0===i||i.scrollTo(e,t)}},{kind:"method",key:"renderHeading",value:function(){return(0,m.dy)(o||(o=(0,f.Z)(['<slot name="heading"> '," </slot>"])),(0,p.Z)((0,h.Z)(i.prototype),"renderHeading",this).call(this))}},{kind:"method",key:"firstUpdated",value:function(){var e;(0,p.Z)((0,h.Z)(i.prototype),"firstUpdated",this).call(this),this.suppressDefaultPressSelector=[this.suppressDefaultPressSelector,k].join(", "),this._updateScrolledAttribute(),null===(e=this.contentElement)||void 0===e||e.addEventListener("scroll",this._onScroll,{passive:!0})}},{kind:"method",key:"disconnectedCallback",value:function(){(0,p.Z)((0,h.Z)(i.prototype),"disconnectedCallback",this).call(this),this.contentElement.removeEventListener("scroll",this._onScroll)}},{kind:"field",key:"_onScroll",value:function(){var e=this;return function(){e._updateScrolledAttribute()}}},{kind:"method",key:"_updateScrolledAttribute",value:function(){this.contentElement&&this.toggleAttribute("scrolled",0!==this.contentElement.scrollTop)}},{kind:"field",static:!0,key:"styles",value:function(){return[g.W,(0,m.iv)(n||(n=(0,f.Z)([":host([scrolled]) ::slotted(ha-dialog-header){border-bottom:1px solid var(--mdc-dialog-scroll-divider-color,rgba(0,0,0,.12))}.mdc-dialog{--mdc-dialog-scroll-divider-color:var(\n --dialog-scroll-divider-color,\n var(--divider-color)\n );z-index:var(--dialog-z-index,8);-webkit-backdrop-filter:var(--dialog-backdrop-filter,none);backdrop-filter:var(--dialog-backdrop-filter,none);--mdc-dialog-box-shadow:var(--dialog-box-shadow, none);--mdc-typography-headline6-font-weight:400;--mdc-typography-headline6-font-size:1.574rem}.mdc-dialog__actions{justify-content:var(--justify-action-buttons,flex-end);padding-bottom:max(env(safe-area-inset-bottom),24px)}.mdc-dialog__actions span:first-child{flex:var(--secondary-action-button-flex,unset)}.mdc-dialog__actions span:nth-child(2){flex:var(--primary-action-button-flex,unset)}.mdc-dialog__container{align-items:var(--vertical-align-dialog,center)}.mdc-dialog__title{padding:24px 24px 0 24px}.mdc-dialog__actions{padding:12px 24px 12px 24px}.mdc-dialog__title::before{content:unset}.mdc-dialog .mdc-dialog__content{position:var(--dialog-content-position,relative);padding:var(--dialog-content-padding,24px)}:host([hideactions]) .mdc-dialog .mdc-dialog__content{padding-bottom:max(var(--dialog-content-padding,24px),env(safe-area-inset-bottom))}.mdc-dialog .mdc-dialog__surface{position:var(--dialog-surface-position,relative);top:var(--dialog-surface-top);margin-top:var(--dialog-surface-margin-top);min-height:var(--mdc-dialog-min-height,auto);border-radius:var(--ha-dialog-border-radius,28px)}:host([flexContent]) .mdc-dialog .mdc-dialog__content{display:flex;flex-direction:column}.header_title{position:relative;padding-right:40px;padding-inline-end:40px;padding-inline-start:initial;direction:var(--direction)}.header_title span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:block}.header_button{position:absolute;right:-8px;top:-8px;text-decoration:none;color:inherit;inset-inline-start:initial;inset-inline-end:-8px;direction:var(--direction)}.dialog-actions{inset-inline-start:initial!important;inset-inline-end:0px!important;direction:var(--direction)}"])))]}}]}}),v.M)},68245:function(e,t,i){"use strict";i.r(t),i.d(t,{HaIconNext:function(){return p}});var r=i(33368),o=i(71650),n=i(68308),a=i(82390),s=i(69205),c=i(91808),l=(i(97393),i(95260)),d=i(67684),u=i(37662),p=(0,c.Z)([(0,l.Mo)("ha-icon-next")],(function(e,t){var i=function(t){function i(){var t;(0,o.Z)(this,i);for(var r=arguments.length,s=new Array(r),c=0;c<r;c++)s[c]=arguments[c];return t=(0,n.Z)(this,i,[].concat(s)),e((0,a.Z)(t)),t}return(0,s.Z)(i,t),(0,r.Z)(i)}(t);return{F:i,d:[{kind:"field",decorators:[(0,l.Cb)()],key:"path",value:function(){return"rtl"===d.E.document.dir?"M15.41,16.58L10.83,12L15.41,7.41L14,6L8,12L14,18L15.41,16.58Z":"M8.59,16.58L13.17,12L8.59,7.41L10,6L16,12L10,18L8.59,16.58Z"}}]}}),u.HaSvgIcon)},92599:function(e,t,i){"use strict";i.d(t,{iI:function(){return o},oT:function(){return r}});i(99312),i(81043),i(83609),i(97393),i(46349),i(70320),i(22859),i(85717),i(46798),i(47084),i(88770),i(40271),i(60163),i(2094),"".concat(location.protocol,"//").concat(location.host);var r=function(e){return e.map((function(e){if("string"!==e.type)return e;switch(e.name){case"username":return Object.assign(Object.assign({},e),{},{autocomplete:"username"});case"password":return Object.assign(Object.assign({},e),{},{autocomplete:"current-password"});case"code":return Object.assign(Object.assign({},e),{},{autocomplete:"one-time-code"});default:return e}}))},o=function(e,t){return e.callWS({type:"auth/sign_path",path:t})}},61675:function(e,t,i){"use strict";i.r(t);var r,o,n,a,s,c,l,d,u,p,h,f,v,g,m,_,y,k,w,b,Z,x,C,S,z,D,F,L,A,E,M,P,B,T,H,O,I,U,j,R,N,q,V,K,Y,G,J,W,Q=i(88962),$=i(99312),X=i(81043),ee=i(33368),te=i(71650),ie=i(68308),re=i(82390),oe=i(69205),ne=i(91808),ae=i(34541),se=i(47838),ce=(i(97393),i(88770),i(40271),i(87438),i(46798),i(9849),i(22890),i(60163),i(47084),i(14271),i(5095)),le=i(95260),de=i(18394),ue=(i(7006),i(9828),i(54371),i(97477)),pe=i(16061),he=i(29950),fe=i(84728),ve=i(11285),ge=(i(51358),i(5239),i(98490),function(){return i.e(9821).then(i.bind(i,59821))}),me=i(62746),_e=(i(22859),i(94738),i(98214),i(65974),i(64346)),ye={"HA-Frontend-Base":"".concat(location.protocol,"//").concat(location.host)},ke=function(e,t){var i;return e.callApi("POST","config/config_entries/flow",{handler:t,show_advanced_options:Boolean(null===(i=e.userData)||void 0===i?void 0:i.showAdvanced)},ye)},we=function(e,t){return e.callApi("GET","config/config_entries/flow/".concat(t),void 0,ye)},be=function(e,t,i){return e.callApi("POST","config/config_entries/flow/".concat(t),i,ye)},Ze=function(e,t){return e.callApi("DELETE","config/config_entries/flow/".concat(t))},xe=i(46739),Ce=(0,ce.iv)(p||(p=(0,Q.Z)(["h2{margin:24px 38px 0 0;margin-inline-start:0px;margin-inline-end:38px;padding:0 24px;padding-inline-start:24px;padding-inline-end:24px;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;font-family:var(\n --mdc-typography-headline6-font-family,\n var(--mdc-typography-font-family, Roboto, sans-serif)\n );font-size:var(--mdc-typography-headline6-font-size, 1.25rem);line-height:var(--mdc-typography-headline6-line-height, 2rem);font-weight:var(--mdc-typography-headline6-font-weight,500);letter-spacing:var(--mdc-typography-headline6-letter-spacing, .0125em);text-decoration:var(--mdc-typography-headline6-text-decoration,inherit);text-transform:var(--mdc-typography-headline6-text-transform,inherit);box-sizing:border-box}.content,.preview{margin-top:20px;padding:0 24px}.buttons{position:relative;padding:8px 16px 8px 24px;margin:8px 0 0;color:var(--primary-color);display:flex;justify-content:flex-end}ha-markdown{overflow-wrap:break-word}ha-markdown a{color:var(--primary-color)}ha-markdown img:first-child:last-child{display:block;margin:0 auto}"]))),Se=((0,ne.Z)([(0,le.Mo)("step-flow-abort")],(function(e,t){var i,p=function(t){function i(){var t;(0,te.Z)(this,i);for(var r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];return t=(0,ie.Z)(this,i,[].concat(o)),e((0,re.Z)(t)),t}return(0,oe.Z)(i,t),(0,ee.Z)(i)}(t);return{F:p,d:[{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"params",value:void 0},{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"step",value:void 0},{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"domain",value:void 0},{kind:"method",key:"firstUpdated",value:function(e){(0,ae.Z)((0,se.Z)(p.prototype),"firstUpdated",this).call(this,e),"missing_credentials"===this.step.reason&&this._handleMissingCreds()}},{kind:"method",key:"render",value:function(){return"missing_credentials"===this.step.reason?ce.Ld:(0,ce.dy)(h||(h=(0,Q.Z)([" <h2>",'</h2> <div class="content"> ',' </div> <div class="buttons"> <mwc-button @click="','">',"</mwc-button> </div> "])),this.hass.localize("component.".concat(this.domain,".title")),this.params.flowConfig.renderAbortDescription(this.hass,this.step),this._flowDone,this.hass.localize("ui.panel.config.integrations.config_flow.close"))}},{kind:"method",key:"_handleMissingCreds",value:(i=(0,X.Z)((0,$.Z)().mark((function e(){var t=this;return(0,$.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._flowDone(),i=this.params.dialogParentElement,p={selectedDomain:this.domain,manifest:this.params.manifest,applicationCredentialAddedCallback:function(){var e,i,p,h,f;i=t.params.dialogParentElement,p={dialogClosedCallback:t.params.dialogClosedCallback,startFlowHandler:t.domain,showAdvanced:null===(e=t.hass.userData)||void 0===e?void 0:e.showAdvanced},(0,xe.w)(i,p,{flowType:"config_flow",loadDevicesAndAreas:!0,createFlow:(f=(0,X.Z)((0,$.Z)().mark((function e(t,i){var r,o,n;return(0,$.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all([ke(t,i),t.loadFragmentTranslation("config"),t.loadBackendTranslation("config",i),t.loadBackendTranslation("selector",i),t.loadBackendTranslation("title",i)]);case 2:return r=e.sent,o=(0,me.Z)(r,1),n=o[0],e.abrupt("return",n);case 6:case"end":return e.stop()}}),e)}))),function(e,t){return f.apply(this,arguments)}),fetchFlow:(h=(0,X.Z)((0,$.Z)().mark((function e(t,i){var r;return(0,$.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,we(t,i);case 2:return r=e.sent,e.next=5,t.loadFragmentTranslation("config");case 5:return e.next=7,t.loadBackendTranslation("config",r.handler);case 7:return e.next=9,t.loadBackendTranslation("selector",r.handler);case 9:return e.abrupt("return",r);case 10:case"end":return e.stop()}}),e)}))),function(e,t){return h.apply(this,arguments)}),handleFlowStep:be,deleteFlow:Ze,renderAbortDescription:function(e,t){var i=e.localize("component.".concat(t.handler,".config.abort.").concat(t.reason),t.description_placeholders);return i?(0,ce.dy)(r||(r=(0,Q.Z)([' <ha-markdown allowsvg breaks .content="','"></ha-markdown> '])),i):""},renderShowFormStepHeader:function(e,t){return e.localize("component.".concat(t.handler,".config.step.").concat(t.step_id,".title"),t.description_placeholders)||e.localize("component.".concat(t.handler,".title"))},renderShowFormStepDescription:function(e,t){var i=e.localize("component.".concat(t.handler,".config.step.").concat(t.step_id,".description"),t.description_placeholders);return i?(0,ce.dy)(o||(o=(0,Q.Z)([' <ha-markdown allowsvg breaks .content="','"></ha-markdown> '])),i):""},renderShowFormStepFieldLabel:function(e,t,i){return e.localize("component.".concat(t.handler,".config.step.").concat(t.step_id,".data.").concat(i.name))},renderShowFormStepFieldHelper:function(e,t,i){var r=e.localize("component.".concat(t.handler,".config.step.").concat(t.step_id,".data_description.").concat(i.name),t.description_placeholders);return r?(0,ce.dy)(n||(n=(0,Q.Z)(['<ha-markdown breaks .content="','"></ha-markdown>'])),r):""},renderShowFormStepFieldError:function(e,t,i){return e.localize("component.".concat(t.handler,".config.error.").concat(i),t.description_placeholders)||i},renderShowFormStepFieldLocalizeValue:function(e,t,i){return e.localize("component.".concat(t.handler,".selector.").concat(i))},renderShowFormStepSubmitButton:function(e,t){return e.localize("component.".concat(t.handler,".config.step.").concat(t.step_id,".submit"))||e.localize("ui.panel.config.integrations.config_flow.".concat(!1===t.last_step?"next":"submit"))},renderExternalStepHeader:function(e,t){return e.localize("component.".concat(t.handler,".config.step.").concat(t.step_id,".title"))||e.localize("ui.panel.config.integrations.config_flow.external_step.open_site")},renderExternalStepDescription:function(e,t){var i=e.localize("component.".concat(t.handler,".config.").concat(t.step_id,".description"),t.description_placeholders);return(0,ce.dy)(a||(a=(0,Q.Z)([" <p> "," </p> "," "])),e.localize("ui.panel.config.integrations.config_flow.external_step.description"),i?(0,ce.dy)(s||(s=(0,Q.Z)([' <ha-markdown allowsvg breaks .content="','"></ha-markdown> '])),i):"")},renderCreateEntryDescription:function(e,t){var i=e.localize("component.".concat(t.handler,".config.create_entry.").concat(t.description||"default"),t.description_placeholders);return(0,ce.dy)(c||(c=(0,Q.Z)([" "," <p> "," </p> "])),i?(0,ce.dy)(l||(l=(0,Q.Z)([' <ha-markdown allowsvg breaks .content="','"></ha-markdown> '])),i):"",e.localize("ui.panel.config.integrations.config_flow.created_config",{name:t.title}))},renderShowFormProgressHeader:function(e,t){return e.localize("component.".concat(t.handler,".config.step.").concat(t.step_id,".title"))||e.localize("component.".concat(t.handler,".title"))},renderShowFormProgressDescription:function(e,t){var i=e.localize("component.".concat(t.handler,".config.progress.").concat(t.progress_action),t.description_placeholders);return i?(0,ce.dy)(d||(d=(0,Q.Z)([' <ha-markdown allowsvg breaks .content="','"></ha-markdown> '])),i):""},renderMenuHeader:function(e,t){return e.localize("component.".concat(t.handler,".config.step.").concat(t.step_id,".title"))||e.localize("component.".concat(t.handler,".title"))},renderMenuDescription:function(e,t){var i=e.localize("component.".concat(t.handler,".config.step.").concat(t.step_id,".description"),t.description_placeholders);return i?(0,ce.dy)(u||(u=(0,Q.Z)([' <ha-markdown allowsvg breaks .content="','"></ha-markdown> '])),i):""},renderMenuOption:function(e,t,i){return e.localize("component.".concat(t.handler,".config.step.").concat(t.step_id,".menu_options.").concat(i),t.description_placeholders)},renderLoadingDescription:function(e,t,i,r){if("loading_flow"!==t&&"loading_step"!==t)return"";var o=(null==r?void 0:r.handler)||i;return e.localize("ui.panel.config.integrations.config_flow.loading.".concat(t),{integration:o?(0,_e.Lh)(e.localize,o):e.localize("ui.panel.config.integrations.config_flow.loading.fallback_title")})}})}},(0,de.B)(i,"show-dialog",{dialogTag:"dialog-add-application-credential",dialogImport:ge,dialogParams:p});case 2:case"end":return e.stop()}var i,p}),e,this)}))),function(){return i.apply(this,arguments)})},{kind:"method",key:"_flowDone",value:function(){(0,de.B)(this,"flow-update",{step:void 0})}},{kind:"get",static:!0,key:"styles",value:function(){return Ce}}]}}),ce.oi),i(46349),i(70320),i(25718),(0,ne.Z)([(0,le.Mo)("step-flow-create-entry")],(function(e,t){var i,r=function(t){function i(){var t;(0,te.Z)(this,i);for(var r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];return t=(0,ie.Z)(this,i,[].concat(o)),e((0,re.Z)(t)),t}return(0,oe.Z)(i,t),(0,ee.Z)(i)}(t);return{F:r,d:[{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"flowConfig",value:void 0},{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"step",value:void 0},{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"devices",value:void 0},{kind:"method",key:"render",value:function(){var e,t=this,i=this.hass.localize;return(0,ce.dy)(f||(f=(0,Q.Z)([" <h2>",'!</h2> <div class="content"> '," "," ",' </div> <div class="buttons"> <mwc-button @click="','">',"</mwc-button> </div> "])),i("ui.panel.config.integrations.config_flow.success"),this.flowConfig.renderCreateEntryDescription(this.hass,this.step),"not_loaded"===(null===(e=this.step.result)||void 0===e?void 0:e.state)?(0,ce.dy)(v||(v=(0,Q.Z)(['<span class="error">',"</span>"])),i("ui.panel.config.integrations.config_flow.not_loaded")):"",0===this.devices.length?"":(0,ce.dy)(g||(g=(0,Q.Z)([" <p> ",': </p> <div class="devices"> '," </div> "])),i("ui.panel.config.integrations.config_flow.found_following_devices"),this.devices.map((function(e){var i;return(0,ce.dy)(m||(m=(0,Q.Z)([' <div class="device"> <div> <b>',"</b><br> ",' </div> <ha-area-picker .hass="','" .device="','" .value="','" @value-changed="','"></ha-area-picker> </div> '])),(0,pe.jL)(e,t.hass),e.model||e.manufacturer?(0,ce.dy)(y||(y=(0,Q.Z)([""," ",""])),e.model,e.manufacturer?(0,ce.dy)(k||(k=(0,Q.Z)(["(",")"])),e.manufacturer):""):(0,ce.dy)(_||(_=(0,Q.Z)([" "]))),t.hass,e.id,null!==(i=e.area_id)&&void 0!==i?i:void 0,t._areaPicked)}))),this._flowDone,i("ui.panel.config.integrations.config_flow.finish"))}},{kind:"method",key:"_flowDone",value:function(){(0,de.B)(this,"flow-update",{step:void 0})}},{kind:"method",key:"_areaPicked",value:(i=(0,X.Z)((0,$.Z)().mark((function e(t){var i,r,o;return(0,$.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=t.currentTarget,r=i.device,o=t.detail.value,e.prev=3,e.next=6,(0,pe.t1)(this.hass,r,{area_id:o});case 6:e.next=12;break;case 8:e.prev=8,e.t0=e.catch(3),(0,ve.Ys)(this,{text:this.hass.localize("ui.panel.config.integrations.config_flow.error_saving_area",{error:e.t0.message})}),i.value=null;case 12:case"end":return e.stop()}}),e,this,[[3,8]])}))),function(e){return i.apply(this,arguments)})},{kind:"get",static:!0,key:"styles",value:function(){return[Ce,(0,ce.iv)(w||(w=(0,Q.Z)([".devices{display:flex;flex-wrap:wrap;margin:-4px;max-height:600px;overflow-y:auto}.device{border:1px solid var(--divider-color);padding:5px;border-radius:4px;margin:4px;display:inline-block;width:250px}.buttons>:last-child{margin-left:auto}@media all and (max-width:450px),all and (max-height:500px){.device{width:100%}}.error{color:var(--error-color)}"])))]}}]}}),ce.oi),(0,ne.Z)([(0,le.Mo)("step-flow-external")],(function(e,t){var i=function(t){function i(){var t;(0,te.Z)(this,i);for(var r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];return t=(0,ie.Z)(this,i,[].concat(o)),e((0,re.Z)(t)),t}return(0,oe.Z)(i,t),(0,ee.Z)(i)}(t);return{F:i,d:[{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"flowConfig",value:void 0},{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"step",value:void 0},{kind:"method",key:"render",value:function(){var e=this.hass.localize;return(0,ce.dy)(b||(b=(0,Q.Z)([" <h2>",'</h2> <div class="content"> ',' <div class="open-button"> <a href="','" target="_blank" rel="noreferrer"> <mwc-button raised> '," </mwc-button> </a> </div> </div> "])),this.flowConfig.renderExternalStepHeader(this.hass,this.step),this.flowConfig.renderExternalStepDescription(this.hass,this.step),this.step.url,e("ui.panel.config.integrations.config_flow.external_step.open_site"))}},{kind:"method",key:"firstUpdated",value:function(e){(0,ae.Z)((0,se.Z)(i.prototype),"firstUpdated",this).call(this,e),window.open(this.step.url)}},{kind:"get",static:!0,key:"styles",value:function(){return[Ce,(0,ce.iv)(Z||(Z=(0,Q.Z)([".open-button{text-align:center;padding:24px 0}.open-button a{text-decoration:none}"])))]}}]}}),ce.oi),i(85717),i(85472),i(90126),i(49089),i(50289),i(94167),i(33829),i(17267)),ze=i(6429),De=(i(23860),i(17692),i(51467),i(39663),i(21162),i(92599)),Fe=((0,ne.Z)([(0,le.Mo)("step-flow-form")],(function(e,t){var r,o=function(t){function i(){var t;(0,te.Z)(this,i);for(var r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];return t=(0,ie.Z)(this,i,[].concat(o)),e((0,re.Z)(t)),t}return(0,oe.Z)(i,t),(0,ee.Z)(i)}(t);return{F:o,d:[{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"flowConfig",value:void 0},{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"step",value:void 0},{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,le.SB)()],key:"_loading",value:function(){return!1}},{kind:"field",decorators:[(0,le.SB)()],key:"_stepData",value:void 0},{kind:"field",decorators:[(0,le.SB)()],key:"_errorMsg",value:void 0},{kind:"method",key:"disconnectedCallback",value:function(){(0,ae.Z)((0,se.Z)(o.prototype),"disconnectedCallback",this).call(this),this.removeEventListener("keydown",this._handleKeyDown)}},{kind:"method",key:"render",value:function(){var e=this.step,t=this._stepDataProcessed;return(0,ce.dy)(x||(x=(0,Q.Z)([" <h2>",'</h2> <div class="content" @click="','"> '," ",' <ha-form .hass="','" .data="','" .disabled="','" @value-changed="','" .schema="','" .error="','" .computeLabel="','" .computeHelper="','" .computeError="','" .localizeValue="','"></ha-form> </div> ',' <div class="buttons"> '," </div> "])),this.flowConfig.renderShowFormStepHeader(this.hass,this.step),this._clickHandler,this.flowConfig.renderShowFormStepDescription(this.hass,this.step),this._errorMsg?(0,ce.dy)(C||(C=(0,Q.Z)(['<ha-alert alert-type="error">',"</ha-alert>"])),this._errorMsg):"",this.hass,t,this._loading,this._stepDataChanged,(0,De.oT)(e.data_schema),e.errors,this._labelCallback,this._helperCallback,this._errorCallback,this._localizeValueCallback,e.preview?(0,ce.dy)(S||(S=(0,Q.Z)(['<div class="preview" @set-flow-errors="','"> <h3> ',": </h3> "," </div>"])),this._setError,this.hass.localize("ui.panel.config.integrations.config_flow.preview"),(0,Se.h)("flow-preview-".concat(this.step.preview),{hass:this.hass,flowType:this.flowConfig.flowType,handler:e.handler,stepId:e.step_id,flowId:e.flow_id,stepData:t})):ce.Ld,this._loading?(0,ce.dy)(z||(z=(0,Q.Z)([' <div class="submit-spinner"> <ha-circular-progress indeterminate></ha-circular-progress> </div> ']))):(0,ce.dy)(D||(D=(0,Q.Z)([' <div> <mwc-button @click="','"> '," </mwc-button> </div> "])),this._submitStep,this.flowConfig.renderShowFormStepSubmitButton(this.hass,this.step)))}},{kind:"method",key:"_setError",value:function(e){this.step=Object.assign(Object.assign({},this.step),{},{errors:e.detail})}},{kind:"method",key:"firstUpdated",value:function(e){var t=this;(0,ae.Z)((0,se.Z)(o.prototype),"firstUpdated",this).call(this,e),setTimeout((function(){return t.shadowRoot.querySelector("ha-form").focus()}),0),this.addEventListener("keydown",this._handleKeyDown)}},{kind:"method",key:"willUpdate",value:function(e){var t;(0,ae.Z)((0,se.Z)(o.prototype),"willUpdate",this).call(this,e),e.has("step")&&null!==(t=this.step)&&void 0!==t&&t.preview&&i(47540)("./flow-preview-".concat(this.step.preview))}},{kind:"method",key:"_clickHandler",value:function(e){(0,ze.J)(e,!1)&&(0,de.B)(this,"flow-update",{step:void 0})}},{kind:"field",key:"_handleKeyDown",value:function(){var e=this;return function(t){"Enter"===t.key&&e._submitStep()}}},{kind:"get",key:"_stepDataProcessed",value:function(){return void 0!==this._stepData||(this._stepData=(e=this.step.data_schema,t={},e.forEach((function(e){var i,r;if(void 0!==(null===(i=e.description)||void 0===i?void 0:i.suggested_value)&&null!==(null===(r=e.description)||void 0===r?void 0:r.suggested_value))t[e.name]=e.description.suggested_value;else if("default"in e)t[e.name]=e.default;else if(e.required)if("boolean"===e.type)t[e.name]=!1;else if("string"===e.type)t[e.name]="";else if("integer"===e.type)t[e.name]="valueMin"in e?e.valueMin:0;else if("constant"===e.type)t[e.name]=e.value;else if("float"===e.type)t[e.name]=0;else if("select"===e.type){if(e.options.length){var o=e.options[0];t[e.name]=Array.isArray(o)?o[0]:o}}else if("positive_time_period_dict"===e.type)t[e.name]={hours:0,minutes:0,seconds:0};else if("selector"in e){var n,a=e.selector;if("device"in a)t[e.name]=null!==(n=a.device)&&void 0!==n&&n.multiple?[]:"";else if("entity"in a){var s;t[e.name]=null!==(s=a.entity)&&void 0!==s&&s.multiple?[]:""}else if("area"in a){var c;t[e.name]=null!==(c=a.area)&&void 0!==c&&c.multiple?[]:""}else if("boolean"in a)t[e.name]=!1;else if("addon"in a||"attribute"in a||"file"in a||"icon"in a||"template"in a||"text"in a||"theme"in a)t[e.name]="";else if("number"in a){var l,d;t[e.name]=null!==(l=null===(d=a.number)||void 0===d?void 0:d.min)&&void 0!==l?l:0}else if("select"in a){var u;if(null!==(u=a.select)&&void 0!==u&&u.options.length){var p=a.select.options[0],h="string"==typeof p?p:p.value;t[e.name]=a.select.multiple?[h]:h}}else if("country"in a){var f;null!==(f=a.country)&&void 0!==f&&null!==(f=f.countries)&&void 0!==f&&f.length&&(t[e.name]=a.country.countries[0])}else if("duration"in a)t[e.name]={hours:0,minutes:0,seconds:0};else if("time"in a)t[e.name]="00:00:00";else if("date"in a||"datetime"in a){var v=(new Date).toISOString().slice(0,10);t[e.name]="".concat(v,"T00:00:00")}else if("color_rgb"in a)t[e.name]=[0,0,0];else if("color_temp"in a){var g,m;t[e.name]=null!==(g=null===(m=a.color_temp)||void 0===m?void 0:m.min_mireds)&&void 0!==g?g:153}else{if(!("action"in a||"media"in a||"target"in a))throw new Error("Selector not supported in initial form data");t[e.name]={}}}})),t)),this._stepData;var e,t}},{kind:"method",key:"_submitStep",value:(r=(0,X.Z)((0,$.Z)().mark((function e(){var t,i,r,o;return(0,$.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===(t=this._stepData||{})?void 0===this.step.data_schema.find((function(e){return e.required})):t&&this.step.data_schema.every((function(e){return!e.required||!["",void 0].includes(t[e.name])}))){e.next=5;break}return this._errorMsg=this.hass.localize("ui.panel.config.integrations.config_flow.not_all_required_fields"),e.abrupt("return");case 5:return this._loading=!0,this._errorMsg=void 0,i=this.step.flow_id,r={},Object.keys(t).forEach((function(e){var i=t[e];[void 0,""].includes(i)||(r[e]=i)})),e.prev=10,e.next=13,this.flowConfig.handleFlowStep(this.hass,this.step.flow_id,r);case 13:if(o=e.sent,this.step&&i===this.step.flow_id){e.next=16;break}return e.abrupt("return");case 16:(0,de.B)(this,"flow-update",{step:o}),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(10),this._errorMsg=e.t0&&e.t0.body&&e.t0.body.message||"Unknown error occurred";case 22:return e.prev=22,this._loading=!1,e.finish(22);case 25:case"end":return e.stop()}}),e,this,[[10,19,22,25]])}))),function(){return r.apply(this,arguments)})},{kind:"method",key:"_stepDataChanged",value:function(e){this._stepData=e.detail.value}},{kind:"field",key:"_labelCallback",value:function(){var e=this;return function(t){return e.flowConfig.renderShowFormStepFieldLabel(e.hass,e.step,t)}}},{kind:"field",key:"_helperCallback",value:function(){var e=this;return function(t){return e.flowConfig.renderShowFormStepFieldHelper(e.hass,e.step,t)}}},{kind:"field",key:"_errorCallback",value:function(){var e=this;return function(t){return e.flowConfig.renderShowFormStepFieldError(e.hass,e.step,t)}}},{kind:"field",key:"_localizeValueCallback",value:function(){var e=this;return function(t){return e.flowConfig.renderShowFormStepFieldLocalizeValue(e.hass,e.step,t)}}},{kind:"get",static:!0,key:"styles",value:function(){return[he.Qx,Ce,(0,ce.iv)(F||(F=(0,Q.Z)([".error{color:red}.submit-spinner{margin-right:16px}ha-alert,ha-form{margin-top:24px;display:block}h2{word-break:break-word;padding-inline-end:72px;direction:var(--direction)}"])))]}}]}}),ce.oi),(0,ne.Z)([(0,le.Mo)("step-flow-loading")],(function(e,t){var i=function(t){function i(){var t;(0,te.Z)(this,i);for(var r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];return t=(0,ie.Z)(this,i,[].concat(o)),e((0,re.Z)(t)),t}return(0,oe.Z)(i,t),(0,ee.Z)(i)}(t);return{F:i,d:[{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"flowConfig",value:void 0},{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,le.Cb)()],key:"loadingReason",value:void 0},{kind:"field",decorators:[(0,le.Cb)()],key:"handler",value:void 0},{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"step",value:void 0},{kind:"method",key:"render",value:function(){var e=this.flowConfig.renderLoadingDescription(this.hass,this.loadingReason,this.handler,this.step);return(0,ce.dy)(L||(L=(0,Q.Z)([' <div class="init-spinner"> '," <ha-circular-progress indeterminate></ha-circular-progress> </div> "])),e?(0,ce.dy)(A||(A=(0,Q.Z)(["<div>","</div>"])),e):"")}},{kind:"get",static:!0,key:"styles",value:function(){return(0,ce.iv)(E||(E=(0,Q.Z)([".init-spinner{padding:50px 100px;text-align:center}ha-circular-progress{margin-top:16px}"])))}}]}}),ce.oi),i(40039)),Le=(i(44577),i(68245),(0,ne.Z)([(0,le.Mo)("step-flow-menu")],(function(e,t){var i=function(t){function i(){var t;(0,te.Z)(this,i);for(var r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];return t=(0,ie.Z)(this,i,[].concat(o)),e((0,re.Z)(t)),t}return(0,oe.Z)(i,t),(0,ee.Z)(i)}(t);return{F:i,d:[{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"flowConfig",value:void 0},{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"step",value:void 0},{kind:"method",key:"render",value:function(){var e,t,i=this;if(Array.isArray(this.step.menu_options)){e=this.step.menu_options,t={};var r,o=(0,Fe.Z)(e);try{for(o.s();!(r=o.n()).done;){var n=r.value;t[n]=this.flowConfig.renderMenuOption(this.hass,this.step,n)}}catch(s){o.e(s)}finally{o.f()}}else e=Object.keys(this.step.menu_options),t=this.step.menu_options;var a=this.flowConfig.renderMenuDescription(this.hass,this.step);return(0,ce.dy)(M||(M=(0,Q.Z)([" <h2>","</h2> ",' <div class="options"> '," </div> "])),this.flowConfig.renderMenuHeader(this.hass,this.step),a?(0,ce.dy)(P||(P=(0,Q.Z)(['<div class="content">',"</div>"])),a):"",e.map((function(e){return(0,ce.dy)(B||(B=(0,Q.Z)([' <mwc-list-item hasMeta .step="','" @click="','"> <span>','</span> <ha-icon-next slot="meta"></ha-icon-next> </mwc-list-item> '])),e,i._handleStep,t[e])})))}},{kind:"method",key:"_handleStep",value:function(e){(0,de.B)(this,"flow-update",{stepPromise:this.flowConfig.handleFlowStep(this.hass,this.step.flow_id,{next_step_id:e.currentTarget.step})})}},{kind:"field",static:!0,key:"styles",value:function(){return[Ce,(0,ce.iv)(T||(T=(0,Q.Z)([".options{margin-top:20px;margin-bottom:8px}.content{padding-bottom:16px;border-bottom:1px solid var(--divider-color)}.content+.options{margin-top:8px}mwc-list-item{--mdc-list-side-padding:24px}"])))]}}]}}),ce.oi),(0,ne.Z)([(0,le.Mo)("step-flow-progress")],(function(e,t){var i=function(t){function i(){var t;(0,te.Z)(this,i);for(var r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];return t=(0,ie.Z)(this,i,[].concat(o)),e((0,re.Z)(t)),t}return(0,oe.Z)(i,t),(0,ee.Z)(i)}(t);return{F:i,d:[{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"flowConfig",value:void 0},{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,le.Cb)({attribute:!1})],key:"step",value:void 0},{kind:"method",key:"render",value:function(){return(0,ce.dy)(H||(H=(0,Q.Z)([" <h2> ",' </h2> <div class="content"> <ha-circular-progress indeterminate></ha-circular-progress> '," </div> "])),this.flowConfig.renderShowFormProgressHeader(this.hass,this.step),this.flowConfig.renderShowFormProgressDescription(this.hass,this.step))}},{kind:"get",static:!0,key:"styles",value:function(){return[Ce,(0,ce.iv)(O||(O=(0,Q.Z)([".content{padding:50px 100px;text-align:center}ha-circular-progress{margin-bottom:16px}"])))]}}]}}),ce.oi),0);(0,ne.Z)([(0,le.Mo)("dialog-data-entry-flow")],(function(e,t){var i,r,o,n,a,s=function(t){function i(){var t;(0,te.Z)(this,i);for(var r=arguments.length,o=new Array(r),n=0;n<r;n++)o[n]=arguments[n];return t=(0,ie.Z)(this,i,[].concat(o)),e((0,re.Z)(t)),t}return(0,oe.Z)(i,t),(0,ee.Z)(i)}(t);return{F:s,d:[{kind:"field",key:"hass",value:void 0},{kind:"field",decorators:[(0,le.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,le.SB)()],key:"_loading",value:void 0},{kind:"field",key:"_instance",value:function(){return Le}},{kind:"field",decorators:[(0,le.SB)()],key:"_step",value:void 0},{kind:"field",decorators:[(0,le.SB)()],key:"_devices",value:void 0},{kind:"field",decorators:[(0,le.SB)()],key:"_areas",value:void 0},{kind:"field",decorators:[(0,le.SB)()],key:"_handler",value:void 0},{kind:"field",key:"_unsubAreas",value:void 0},{kind:"field",key:"_unsubDevices",value:void 0},{kind:"field",key:"_unsubDataEntryFlowProgressed",value:void 0},{kind:"method",key:"showDialog",value:(a=(0,X.Z)((0,$.Z)().mark((function e(t){var i,r,o,n;return(0,$.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this._params=t,this._instance=Le++,i=this._instance,!t.startFlowHandler){e.next=23;break}return this._loading="loading_flow",this._handler=t.startFlowHandler,e.prev=6,e.next=9,this._params.flowConfig.createFlow(this.hass,t.startFlowHandler);case 9:r=e.sent,e.next=19;break;case 12:return e.prev=12,e.t0=e.catch(6),this.closeDialog(),"string"!=typeof(o=e.t0.message||e.t0.body||"Unknown error")&&(o=JSON.stringify(o)),(0,ve.Ys)(this,{title:this.hass.localize("ui.panel.config.integrations.config_flow.error"),text:"".concat(this.hass.localize("ui.panel.config.integrations.config_flow.could_not_load"),": ").concat(o)}),e.abrupt("return");case 19:if(i===this._instance){e.next=21;break}return e.abrupt("return");case 21:e.next=41;break;case 23:if(!t.continueFlowId){e.next=40;break}return this._loading="loading_flow",e.prev=25,e.next=28,t.flowConfig.fetchFlow(this.hass,t.continueFlowId);case 28:r=e.sent,e.next=38;break;case 31:return e.prev=31,e.t1=e.catch(25),this.closeDialog(),"string"!=typeof(n=e.t1.message||e.t1.body||"Unknown error")&&(n=JSON.stringify(n)),(0,ve.Ys)(this,{title:this.hass.localize("ui.panel.config.integrations.config_flow.error"),text:"".concat(this.hass.localize("ui.panel.config.integrations.config_flow.could_not_load"),": ").concat(n)}),e.abrupt("return");case 38:e.next=41;break;case 40:return e.abrupt("return");case 41:if(i===this._instance){e.next=43;break}return e.abrupt("return");case 43:this._processStep(r),this._loading=void 0;case 45:case"end":return e.stop()}}),e,this,[[6,12],[25,31]])}))),function(e){return a.apply(this,arguments)})},{kind:"method",key:"closeDialog",value:function(){if(this._params){var e,t=Boolean(this._step&&["create_entry","abort"].includes(this._step.type));if(!this._step||t||this._params.continueFlowId||this._params.flowConfig.deleteFlow(this.hass,this._step.flow_id),this._step&&this._params.dialogClosedCallback)this._params.dialogClosedCallback({flowFinished:t,entryId:"result"in this._step?null===(e=this._step.result)||void 0===e?void 0:e.entry_id:void 0});this._loading=void 0,this._step=void 0,this._params=void 0,this._devices=void 0,this._handler=void 0,this._unsubAreas&&(this._unsubAreas(),this._unsubAreas=void 0),this._unsubDevices&&(this._unsubDevices(),this._unsubDevices=void 0),this._unsubDataEntryFlowProgressed&&(this._unsubDataEntryFlowProgressed.then((function(e){e()})),this._unsubDataEntryFlowProgressed=void 0),(0,de.B)(this,"dialog-closed",{dialog:this.localName})}}},{kind:"method",key:"render",value:function(){var e,t,i,r;return this._params?(0,ce.dy)(I||(I=(0,Q.Z)([' <ha-dialog open @closed="','" scrimClickAction escapeKeyAction hideActions> <div> '," </div> </ha-dialog> "])),this.closeDialog,this._loading||null===this._step?(0,ce.dy)(U||(U=(0,Q.Z)([' <step-flow-loading .flowConfig="','" .hass="','" .loadingReason="','" .handler="','" .step="','"></step-flow-loading> '])),this._params.flowConfig,this.hass,this._loading,this._handler,this._step):void 0===this._step?"":(0,ce.dy)(j||(j=(0,Q.Z)([' <div class="dialog-actions"> ',' <ha-icon-button .label="','" .path="','" dialogAction="close"></ha-icon-button> </div> '," "])),["form","menu","external","progress","data_entry_flow_progressed"].includes(null===(e=this._step)||void 0===e?void 0:e.type)&&null!==(t=this._params.manifest)&&void 0!==t&&t.is_built_in||null!==(i=this._params.manifest)&&void 0!==i&&i.documentation?(0,ce.dy)(R||(R=(0,Q.Z)([' <a href="','" target="_blank" rel="noreferrer noopener"> <ha-icon-button .label="','" .path="','"> </ha-icon-button></a> '])),this._params.manifest.is_built_in?(0,fe.R)(this.hass,"/integrations/".concat(this._params.manifest.domain)):null===(r=this._params)||void 0===r||null===(r=r.manifest)||void 0===r?void 0:r.documentation,this.hass.localize("ui.common.help"),"M15.07,11.25L14.17,12.17C13.45,12.89 13,13.5 13,15H11V14.5C11,13.39 11.45,12.39 12.17,11.67L13.41,10.41C13.78,10.05 14,9.55 14,9C14,7.89 13.1,7 12,7A2,2 0 0,0 10,9H8A4,4 0 0,1 12,5A4,4 0 0,1 16,9C16,9.88 15.64,10.67 15.07,11.25M13,19H11V17H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12C22,6.47 17.5,2 12,2Z"):"",this.hass.localize("ui.panel.config.integrations.config_flow.dismiss"),"M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z","form"===this._step.type?(0,ce.dy)(N||(N=(0,Q.Z)([' <step-flow-form .flowConfig="','" .step="','" .hass="','"></step-flow-form> '])),this._params.flowConfig,this._step,this.hass):"external"===this._step.type?(0,ce.dy)(q||(q=(0,Q.Z)([' <step-flow-external .flowConfig="','" .step="','" .hass="','"></step-flow-external> '])),this._params.flowConfig,this._step,this.hass):"abort"===this._step.type?(0,ce.dy)(V||(V=(0,Q.Z)([' <step-flow-abort .params="','" .step="','" .hass="','" .domain="','"></step-flow-abort> '])),this._params,this._step,this.hass,this._step.handler):"progress"===this._step.type?(0,ce.dy)(K||(K=(0,Q.Z)([' <step-flow-progress .flowConfig="','" .step="','" .hass="','"></step-flow-progress> '])),this._params.flowConfig,this._step,this.hass):"menu"===this._step.type?(0,ce.dy)(Y||(Y=(0,Q.Z)([' <step-flow-menu .flowConfig="','" .step="','" .hass="','"></step-flow-menu> '])),this._params.flowConfig,this._step,this.hass):void 0===this._devices||void 0===this._areas?(0,ce.dy)(G||(G=(0,Q.Z)([' <step-flow-loading .flowConfig="','" .hass="','" loadingReason="loading_devices_areas"></step-flow-loading> '])),this._params.flowConfig,this.hass):(0,ce.dy)(J||(J=(0,Q.Z)([' <step-flow-create-entry .flowConfig="','" .step="','" .hass="','" .devices="','" .areas="','"></step-flow-create-entry> '])),this._params.flowConfig,this._step,this.hass,this._devices,this._areas))):ce.Ld}},{kind:"method",key:"firstUpdated",value:function(e){var t=this;(0,ae.Z)((0,se.Z)(s.prototype),"firstUpdated",this).call(this,e),this.addEventListener("flow-update",(function(e){var i=e.detail,r=i.step,o=i.stepPromise;t._processStep(r||o)}))}},{kind:"method",key:"willUpdate",value:function(e){(0,ae.Z)((0,se.Z)(s.prototype),"willUpdate",this).call(this,e),e.has("_step")&&this._step&&(["external","progress"].includes(this._step.type)&&this._subscribeDataEntryFlowProgressed(),"create_entry"===this._step.type&&(this._step.result&&this._params.flowConfig.loadDevicesAndAreas?(this._fetchDevices(this._step.result.entry_id),this._fetchAreas()):(this._devices=[],this._areas=[])))}},{kind:"method",key:"_fetchDevices",value:(n=(0,X.Z)((0,$.Z)().mark((function e(t){var i=this;return(0,$.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._unsubDevices=(0,pe.q4)(this.hass.connection,(function(e){i._devices=e.filter((function(e){return e.config_entries.includes(t)}))}));case 1:case"end":return e.stop()}}),e,this)}))),function(e){return n.apply(this,arguments)})},{kind:"method",key:"_fetchAreas",value:(o=(0,X.Z)((0,$.Z)().mark((function e(){var t=this;return(0,$.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this._unsubAreas=(0,ue.sG)(this.hass.connection,(function(e){t._areas=e}));case 1:case"end":return e.stop()}}),e,this)}))),function(){return o.apply(this,arguments)})},{kind:"method",key:"_processStep",value:(r=(0,X.Z)((0,$.Z)().mark((function e(t){var i;return(0,$.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(t instanceof Promise)){e.next=17;break}return this._loading="loading_step",e.prev=2,e.next=5,t;case 5:this._step=e.sent,e.next=13;break;case 8:return e.prev=8,e.t0=e.catch(2),this.closeDialog(),(0,ve.Ys)(this,{title:this.hass.localize("ui.panel.config.integrations.config_flow.error"),text:null===e.t0||void 0===e.t0||null===(i=e.t0.body)||void 0===i?void 0:i.message}),e.abrupt("return");case 13:return e.prev=13,this._loading=void 0,e.finish(13);case 16:return e.abrupt("return");case 17:if(void 0!==t){e.next=20;break}return this.closeDialog(),e.abrupt("return");case 20:return this._step=void 0,e.next=23,this.updateComplete;case 23:this._step=t;case 24:case"end":return e.stop()}}),e,this,[[2,8,13,16]])}))),function(e){return r.apply(this,arguments)})},{kind:"method",key:"_subscribeDataEntryFlowProgressed",value:(i=(0,X.Z)((0,$.Z)().mark((function e(){var t=this;return(0,$.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this._unsubDataEntryFlowProgressed){e.next=2;break}return e.abrupt("return");case 2:this._unsubDataEntryFlowProgressed=(i=this.hass.connection,r=function(){var e=(0,X.Z)((0,$.Z)().mark((function e(i){var r;return(0,$.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i.data.flow_id===(null===(r=t._step)||void 0===r?void 0:r.flow_id)){e.next=2;break}return e.abrupt("return");case 2:t._processStep(t._params.flowConfig.fetchFlow(t.hass,t._step.flow_id));case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),i.subscribeEvents(r,"data_entry_flow_progressed"));case 3:case"end":return e.stop()}var i,r}),e,this)}))),function(){return i.apply(this,arguments)})},{kind:"get",static:!0,key:"styles",value:function(){return[he.yu,(0,ce.iv)(W||(W=(0,Q.Z)(["ha-dialog{--dialog-content-padding:0}.dialog-actions{padding:16px;position:absolute;top:0;right:0;inset-inline-start:initial;inset-inline-end:0px;direction:var(--direction)}.dialog-actions>*{color:var(--secondary-text-color)}"])))]}}]}}),ce.oi)},84728:function(e,t,i){"use strict";i.d(t,{R:function(){return r}});i(97393),i(40271),i(60163);var r=function(e,t){return"https://".concat(e.config.version.includes("b")?"rc":e.config.version.includes("dev")?"next":"www",".home-assistant.io").concat(t)}},24038:function(e,t,i){"use strict";var r=i(13089);e.exports=function(e){try{if(r)return Function('return require("'+e+'")')()}catch(t){}}},95818:function(e,t,i){"use strict";i(68077)({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})},49089:function(e,t,i){"use strict";var r=i(68077),o=i(72208),n=i(9160),a=i(22933),s=i(73177);r({target:"Iterator",proto:!0,real:!0},{every:function(e){a(this),n(e);var t=s(this),i=0;return!o(t,(function(t,r){if(!e(t,i++))return r()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},22129:function(e,t,i){"use strict";i.d(t,{B:function(){return k}});var r,o,n,a=i(33368),s=i(71650),c=i(68308),l=i(69205),d=i(43204),u=i(95260),p=i(88962),h=i(5095),f=(i(76843),i(53180)),v=i(6157),g=function(e){function t(){var e;return(0,s.Z)(this,t),(e=(0,c.Z)(this,t,arguments)).value=0,e.max=1,e.indeterminate=!1,e.fourColor=!1,e}return(0,l.Z)(t,e),(0,a.Z)(t,[{key:"render",value:function(){var e=this.ariaLabel;return(0,h.dy)(r||(r=(0,p.Z)([' <div class="progress ','" role="progressbar" aria-label="','" aria-valuemin="0" aria-valuemax="','" aria-valuenow="','">',"</div> "])),(0,f.$)(this.getRenderClasses()),e||h.Ld,this.max,this.indeterminate?h.Ld:this.value,this.renderIndicator())}},{key:"getRenderClasses",value:function(){return{indeterminate:this.indeterminate,"four-color":this.fourColor}}}]),t}(h.oi);(0,v.d)(g),(0,d.__decorate)([(0,u.Cb)({type:Number})],g.prototype,"value",void 0),(0,d.__decorate)([(0,u.Cb)({type:Number})],g.prototype,"max",void 0),(0,d.__decorate)([(0,u.Cb)({type:Boolean})],g.prototype,"indeterminate",void 0),(0,d.__decorate)([(0,u.Cb)({type:Boolean,attribute:"four-color"})],g.prototype,"fourColor",void 0);var m,_=function(e){function t(){return(0,s.Z)(this,t),(0,c.Z)(this,t,arguments)}return(0,l.Z)(t,e),(0,a.Z)(t,[{key:"renderIndicator",value:function(){return this.indeterminate?this.renderIndeterminateContainer():this.renderDeterminateContainer()}},{key:"renderDeterminateContainer",value:function(){var e=100*(1-this.value/this.max);return(0,h.dy)(o||(o=(0,p.Z)([' <svg viewBox="0 0 4800 4800"> <circle class="track" pathLength="100"></circle> <circle class="active-track" pathLength="100" stroke-dashoffset="','"></circle> </svg> '])),e)}},{key:"renderIndeterminateContainer",value:function(){return(0,h.dy)(n||(n=(0,p.Z)([' <div class="spinner"> <div class="left"> <div class="circle"></div> </div> <div class="right"> <div class="circle"></div> </div> </div>'])))}}]),t}(g),y=(0,h.iv)(m||(m=(0,p.Z)([":host{--_active-indicator-color:var(--md-circular-progress-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_active-indicator-width:var(--md-circular-progress-active-indicator-width, 10);--_four-color-active-indicator-four-color:var(--md-circular-progress-four-color-active-indicator-four-color, var(--md-sys-color-tertiary-container, #ffd8e4));--_four-color-active-indicator-one-color:var(--md-circular-progress-four-color-active-indicator-one-color, var(--md-sys-color-primary, #6750a4));--_four-color-active-indicator-three-color:var(--md-circular-progress-four-color-active-indicator-three-color, var(--md-sys-color-tertiary, #7d5260));--_four-color-active-indicator-two-color:var(--md-circular-progress-four-color-active-indicator-two-color, var(--md-sys-color-primary-container, #eaddff));--_size:var(--md-circular-progress-size, 48px);display:inline-flex;vertical-align:middle;width:var(--_size);height:var(--_size);position:relative;align-items:center;justify-content:center;contain:strict;content-visibility:auto}.progress{flex:1;align-self:stretch;margin:4px}.active-track,.circle,.left,.progress,.right,.spinner,.track,svg{position:absolute;inset:0}svg{transform:rotate(-90deg)}circle{cx:50%;cy:50%;r:calc(50%*(1 - var(--_active-indicator-width)/ 100));stroke-width:calc(var(--_active-indicator-width)*1%);stroke-dasharray:100;fill:rgba(0,0,0,0)}.active-track{transition:stroke-dashoffset .5s cubic-bezier(0, 0, .2, 1);stroke:var(--_active-indicator-color)}.track{stroke:rgba(0,0,0,0)}.progress.indeterminate{animation:linear infinite linear-rotate;animation-duration:1.568s}.spinner{animation:infinite both rotate-arc;animation-duration:5332ms;animation-timing-function:cubic-bezier(0.4,0,0.2,1)}.left{overflow:hidden;inset:0 50% 0 0}.right{overflow:hidden;inset:0 0 0 50%}.circle{box-sizing:border-box;border-radius:50%;border:solid calc(var(--_active-indicator-width)/ 100*(var(--_size) - 8px));border-color:var(--_active-indicator-color) var(--_active-indicator-color) transparent transparent;animation:expand-arc;animation-iteration-count:infinite;animation-fill-mode:both;animation-duration:1333ms,5332ms;animation-timing-function:cubic-bezier(0.4,0,0.2,1)}.four-color .circle{animation-name:expand-arc,four-color}.left .circle{rotate:135deg;inset:0 -100% 0 0}.right .circle{rotate:100deg;inset:0 0 0 -100%;animation-delay:-.666s,0s}@media(forced-colors:active){.active-track{stroke:CanvasText}.circle{border-color:CanvasText CanvasText Canvas Canvas}}@keyframes expand-arc{0%{transform:rotate(265deg)}50%{transform:rotate(130deg)}100%{transform:rotate(265deg)}}@keyframes rotate-arc{12.5%{transform:rotate(135deg)}25%{transform:rotate(270deg)}37.5%{transform:rotate(405deg)}50%{transform:rotate(540deg)}62.5%{transform:rotate(675deg)}75%{transform:rotate(810deg)}87.5%{transform:rotate(945deg)}100%{transform:rotate(1080deg)}}@keyframes linear-rotate{to{transform:rotate(360deg)}}@keyframes four-color{0%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}15%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}25%{border-top-color:var(--_four-color-active-indicator-two-color);border-right-color:var(--_four-color-active-indicator-two-color)}40%{border-top-color:var(--_four-color-active-indicator-two-color);border-right-color:var(--_four-color-active-indicator-two-color)}50%{border-top-color:var(--_four-color-active-indicator-three-color);border-right-color:var(--_four-color-active-indicator-three-color)}65%{border-top-color:var(--_four-color-active-indicator-three-color);border-right-color:var(--_four-color-active-indicator-three-color)}75%{border-top-color:var(--_four-color-active-indicator-four-color);border-right-color:var(--_four-color-active-indicator-four-color)}90%{border-top-color:var(--_four-color-active-indicator-four-color);border-right-color:var(--_four-color-active-indicator-four-color)}100%{border-top-color:var(--_four-color-active-indicator-one-color);border-right-color:var(--_four-color-active-indicator-one-color)}}"]))),k=function(e){function t(){return(0,s.Z)(this,t),(0,c.Z)(this,t,arguments)}return(0,l.Z)(t,e),(0,a.Z)(t)}(_);k.styles=[y],k=(0,d.__decorate)([(0,u.Mo)("md-circular-progress")],k)}}]);
|
||
//# sourceMappingURL=3252.96FXAq2UeSY.js.map
|