iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
11 lines • 41.4 kB
JavaScript
export const __webpack_ids__=["23251"];export const __webpack_modules__={17803:function(e,t,i){i.d(t,{I:()=>n});const n=(e,t,i,n)=>{const[a,o,r]=e.split(".",3);return Number(a)>t||Number(a)===t&&(void 0===n?Number(o)>=i:Number(o)>i)||void 0!==n&&Number(a)===t&&Number(o)===i&&Number(r)>=n}},64214:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{DG:()=>g,E8:()=>_,W0:()=>p,o0:()=>u,yD:()=>v});var a=i(16485),o=i(27486),r=i(46467),d=i(33570),s=i(11104),l=i(16922),c=e([a,r,d,s]);[a,r,d,s]=c.then?(await c)():c;const u=(e,t,i)=>h(t,i.time_zone).format(e),h=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,l.y)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.y)(e)?"h12":"h23",timeZone:(0,s.f)(e.time_zone,t)}))),p=e=>m().format(e),m=(0,o.Z)((()=>new Intl.DateTimeFormat(void 0,{year:"numeric",month:"long",day:"numeric",hour:"2-digit",minute:"2-digit"}))),g=(e,t,i)=>f(t,i.time_zone).format(e),f=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"short",day:"numeric",hour:(0,l.y)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.y)(e)?"h12":"h23",timeZone:(0,s.f)(e.time_zone,t)}))),v=(e,t,i)=>y(t,i.time_zone).format(e),y=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{month:"short",day:"numeric",hour:(0,l.y)(e)?"numeric":"2-digit",minute:"2-digit",hourCycle:(0,l.y)(e)?"h12":"h23",timeZone:(0,s.f)(e.time_zone,t)}))),_=(e,t,i)=>k(t,i.time_zone).format(e),k=(0,o.Z)(((e,t)=>new Intl.DateTimeFormat(e.language,{year:"numeric",month:"long",day:"numeric",hour:(0,l.y)(e)?"numeric":"2-digit",minute:"2-digit",second:"2-digit",hourCycle:(0,l.y)(e)?"h12":"h23",timeZone:(0,s.f)(e.time_zone,t)})));n()}catch(e){n(e)}}))},11104:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{Q:()=>s,f:()=>l});var a=i(16485),o=i(20382),r=e([a]);a=(r.then?(await r)():r)[0];const d=Intl.DateTimeFormat?.().resolvedOptions?.().timeZone,s=d??"UTC",l=(e,t)=>e===o.c_.local&&d?s:t;n()}catch(e){n(e)}}))},49976:function(e,t,i){i.d(t,{U:()=>n});const n=e=>e.stopPropagation()},50602:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{SL:()=>s,l4:()=>h,sJ:()=>l,uf:()=>u});var a=i(16485),o=i(20382),r=i(34618),d=e([a]);a=(d.then?(await d)():d)[0];const s=e=>l(e.attributes),l=(e,t)=>!!e.unit_of_measurement||!!e.state_class||(t||[]).includes(e.device_class||""),c=e=>{switch(e.number_format){case o.y4.comma_decimal:return["en-US","en"];case o.y4.decimal_comma:return["de","es","it"];case o.y4.space_comma:return["fr","sv","cs"];case o.y4.system:return;default:return e.language}},u=(e,t,i)=>{const n=t?c(t):void 0;return Number.isNaN=Number.isNaN||function e(t){return"number"==typeof t&&e(t)},t?.number_format===o.y4.none||Number.isNaN(Number(e))?Number.isNaN(Number(e))||""===e||t?.number_format!==o.y4.none?"string"==typeof e?e:`${(0,r.N)(e,i?.maximumFractionDigits).toString()}${"currency"===i?.style?` ${i.currency}`:""}`:new Intl.NumberFormat("en-US",p(e,{...i,useGrouping:!1})).format(Number(e)):new Intl.NumberFormat(n,p(e,i)).format(Number(e))},h=(e,t)=>{const i=t?.display_precision;return null!=i?{maximumFractionDigits:i,minimumFractionDigits:i}:Number.isInteger(Number(e?.attributes?.step))&&Number.isInteger(Number(e?.state))?{maximumFractionDigits:0}:void 0},p=(e,t)=>{const i={maximumFractionDigits:2,...t};if("string"!=typeof e)return i;if(!t||void 0===t.minimumFractionDigits&&void 0===t.maximumFractionDigits){const t=e.indexOf(".")>-1?e.split(".")[1].length:0;i.minimumFractionDigits=t,i.maximumFractionDigits=t}return i};n()}catch(e){n(e)}}))},49542:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{o:()=>p});var a=i(44249),o=(i(9359),i(70104),i(16485)),r=i(57243),d=i(15093),s=i(27486),l=i(36522),c=i(49976),u=i(1416),h=(i(7285),i(92824),e([o]));o=(h.then?(await h)():h)[0];const p=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","YE","YT","ZA","ZM","ZW"];(0,a.Z)([(0,d.Mo)("ha-country-picker")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,d.Cb)()],key:"language",value:()=>"en"},{kind:"field",decorators:[(0,d.Cb)()],key:"value",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"label",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Array})],key:"countries",value:void 0},{kind:"field",decorators:[(0,d.Cb)()],key:"helper",value:void 0},{kind:"field",decorators:[(0,d.Cb)({type:Boolean})],key:"required",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"field",decorators:[(0,d.Cb)({attribute:"no-sort",type:Boolean})],key:"noSort",value:()=>!1},{kind:"field",key:"_getOptions",value(){return(0,s.Z)(((e,t)=>{let i=[];const n=new Intl.DisplayNames(e,{type:"region",fallback:"code"});return i=t?t.map((e=>({value:e,label:n?n.of(e):e}))):p.map((e=>({value:e,label:n?n.of(e):e}))),this.noSort||i.sort(((t,i)=>(0,u.fe)(t.label,i.label,e))),i}))}},{kind:"method",key:"render",value:function(){const e=this._getOptions(this.language,this.countries);return r.dy` <ha-select .label="${this.label}" .value="${this.value}" .required="${this.required}" .helper="${this.helper}" .disabled="${this.disabled}" @selected="${this._changed}" @closed="${c.U}" fixedMenuPosition naturalMenuWidth> ${e.map((e=>r.dy` <ha-list-item .value="${e.value}">${e.label}</ha-list-item> `))} </ha-select> `}},{kind:"field",static:!0,key:"styles",value:()=>r.iv`ha-select{width:100%}`},{kind:"method",key:"_changed",value:function(e){const t=e.target;""!==t.value&&t.value!==this.value&&(this.value=t.value,(0,l.B)(this,"value-changed",{value:this.value}))}}]}}),r.oi);n()}catch(e){n(e)}}))},55486:function(e,t,i){var n=i(44249),a=i(4918),o=i(6394),r=i(57243),d=i(15093),s=i(35359),l=i(36522);(0,n.Z)([(0,d.Mo)("ha-formfield")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,d.Cb)({type:Boolean,reflect:!0})],key:"disabled",value:()=>!1},{kind:"method",key:"render",value:function(){const e={"mdc-form-field--align-end":this.alignEnd,"mdc-form-field--space-between":this.spaceBetween,"mdc-form-field--nowrap":this.nowrap};return r.dy` <div class="mdc-form-field ${(0,s.$)(e)}"> <slot></slot> <label class="mdc-label" @click="${this._labelClick}"> <slot name="label">${this.label}</slot> </label> </div>`}},{kind:"method",key:"_labelClick",value:function(){const e=this.input;if(e&&(e.focus(),!e.disabled))switch(e.tagName){case"HA-CHECKBOX":e.checked=!e.checked,(0,l.B)(e,"change");break;case"HA-RADIO":e.checked=!0,(0,l.B)(e,"change");break;default:e.click()}}},{kind:"field",static:!0,key:"styles",value:()=>[o.W,r.iv`:host(:not([alignEnd])) ::slotted(ha-switch){margin-right:10px;margin-inline-end:10px;margin-inline-start:inline}.mdc-form-field{align-items:var(--ha-formfield-align-items,center);gap:4px}.mdc-form-field>label{direction:var(--direction);margin-inline-start:0;margin-inline-end:auto;padding:0}:host([disabled]) label{color:var(--disabled-text-color)}`]}]}}),a.a)},7285:function(e,t,i){var n=i(44249),a=i(72621),o=i(65703),r=i(46289),d=i(57243),s=i(15093);(0,n.Z)([(0,s.Mo)("ha-list-item")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"method",key:"renderRipple",value:function(){return this.noninteractive?"":(0,a.Z)(i,"renderRipple",this,3)([])}},{kind:"get",static:!0,key:"styles",value:function(){return[r.W,d.iv`:host{padding-left:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-inline-start:var(--mdc-list-side-padding-left,var(--mdc-list-side-padding,20px));padding-right:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px));padding-inline-end:var(--mdc-list-side-padding-right,var(--mdc-list-side-padding,20px))}:host([graphic=avatar]:not([twoLine])),:host([graphic=icon]:not([twoLine])){height:48px}span.material-icons:first-of-type{margin-inline-start:0px!important;margin-inline-end:var(--mdc-list-item-graphic-margin,16px)!important;direction:var(--direction)!important}span.material-icons:last-of-type{margin-inline-start:auto!important;margin-inline-end:0px!important;direction:var(--direction)!important}.mdc-deprecated-list-item__meta{display:var(--mdc-list-item-meta-display);align-items:center;flex-shrink:0}:host([graphic=icon]:not([twoline])) .mdc-deprecated-list-item__graphic{margin-inline-end:var(--mdc-list-item-graphic-margin,20px)!important}:host([multiline-secondary]){height:auto}:host([multiline-secondary]) .mdc-deprecated-list-item__text{padding:8px 0}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text{text-overflow:initial;white-space:normal;overflow:auto;display:inline-block;margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text{margin-top:10px}:host([multiline-secondary]) .mdc-deprecated-list-item__secondary-text::before{display:none}:host([multiline-secondary]) .mdc-deprecated-list-item__primary-text::before{display:none}:host([disabled]){color:var(--disabled-text-color)}:host([noninteractive]){pointer-events:unset}`,"rtl"===document.dir?d.iv`span.material-icons:first-of-type,span.material-icons:last-of-type{direction:rtl!important;--direction:rtl}`:d.iv``]}}]}}),o.K)},72781:function(e,t,i){var n=i(44249),a=i(47711),o=i(81577),r=i(57243),d=i(15093);(0,n.Z)([(0,d.Mo)("ha-radio")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",static:!0,key:"styles",value:()=>[o.W,r.iv`:host{--mdc-theme-secondary:var(--primary-color)}`]}]}}),a.J)},92824:function(e,t,i){var n=i(44249),a=i(72621),o=i(60930),r=i(9714),d=i(57243),s=i(15093),l=i(22381),c=i(76320);i(23334);(0,n.Z)([(0,s.Mo)("ha-select")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean,reflect:!0})],key:"clearable",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({attribute:"inline-arrow",type:Boolean})],key:"inlineArrow",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)()],key:"options",value:void 0},{kind:"method",key:"render",value:function(){return d.dy` ${(0,a.Z)(i,"render",this,3)([])} ${this.clearable&&!this.required&&!this.disabled&&this.value?d.dy`<ha-icon-button label="clear" @click="${this._clearValue}" .path="${"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"}"></ha-icon-button>`:d.Ld} `}},{kind:"method",key:"renderLeadingIcon",value:function(){return this.icon?d.dy`<span class="mdc-select__icon"><slot name="icon"></slot></span>`:d.Ld}},{kind:"method",key:"connectedCallback",value:function(){(0,a.Z)(i,"connectedCallback",this,3)([]),window.addEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"firstUpdated",value:async function(){(0,a.Z)(i,"firstUpdated",this,3)([]),this.inlineArrow&&this.shadowRoot?.querySelector(".mdc-select__selected-text-container")?.classList.add("inline-arrow")}},{kind:"method",key:"updated",value:function(e){if((0,a.Z)(i,"updated",this,3)([e]),e.has("inlineArrow")){const e=this.shadowRoot?.querySelector(".mdc-select__selected-text-container");this.inlineArrow?e?.classList.add("inline-arrow"):e?.classList.remove("inline-arrow")}e.get("options")&&(this.layoutOptions(),this.selectByValue(this.value))}},{kind:"method",key:"disconnectedCallback",value:function(){(0,a.Z)(i,"disconnectedCallback",this,3)([]),window.removeEventListener("translations-updated",this._translationsUpdated)}},{kind:"method",key:"_clearValue",value:function(){!this.disabled&&this.value&&(this.valueSetDirectly=!0,this.select(-1),this.mdcFoundation.handleChange())}},{kind:"field",key:"_translationsUpdated",value(){return(0,l.D)((async()=>{await(0,c.y)(),this.layoutOptions()}),500)}},{kind:"field",static:!0,key:"styles",value:()=>[r.W,d.iv`:host([clearable]){position:relative}.mdc-select:not(.mdc-select--disabled) .mdc-select__icon{color:var(--secondary-text-color)}.mdc-select__anchor{width:var(--ha-select-min-width,200px)}.mdc-select--filled .mdc-select__anchor{height:var(--ha-select-height,56px)}.mdc-select--filled .mdc-floating-label{inset-inline-start:12px;inset-inline-end:initial;direction:var(--direction)}.mdc-select--filled.mdc-select--with-leading-icon .mdc-floating-label{inset-inline-start:48px;inset-inline-end:initial;direction:var(--direction)}.mdc-select .mdc-select__anchor{padding-inline-start:12px;padding-inline-end:0px;direction:var(--direction)}.mdc-select__anchor .mdc-floating-label--float-above{transform-origin:var(--float-start)}.mdc-select__selected-text-container{padding-inline-end:var(--select-selected-text-padding-end,0px)}:host([clearable]) .mdc-select__selected-text-container{padding-inline-end:var(--select-selected-text-padding-end,12px)}ha-icon-button{position:absolute;top:10px;right:28px;--mdc-icon-button-size:36px;--mdc-icon-size:20px;color:var(--secondary-text-color);inset-inline-start:initial;inset-inline-end:28px;direction:var(--direction)}.inline-arrow{flex-grow:0}`]}]}}),o.K)},17170:function(e,t,i){i.a(e,(async function(e,t){try{var n=i(44249),a=i(72621),o=i(97677),r=i(43580),d=i(57243),s=i(15093),l=e([o]);o=(l.then?(await l)():l)[0];(0,n.Z)([(0,s.Mo)("ha-spinner")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)()],key:"size",value:void 0},{kind:"method",key:"updated",value:function(e){if((0,a.Z)(i,"updated",this,3)([e]),e.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")}}},{kind:"field",static:!0,key:"styles",value:()=>[r.Z,d.iv`: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)}`]}]}}),o.Z);t()}catch(e){t(e)}}))},83166:function(e,t,i){var n=i(44249),a=i(72621),o=i(1105),r=i(33990),d=i(57243),s=i(15093),l=i(5111);(0,n.Z)([(0,s.Mo)("ha-textfield")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"icon",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)({type:Boolean})],key:"iconTrailing",value:()=>!1},{kind:"field",decorators:[(0,s.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,s.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,s.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,s.IO)("input")],key:"formElement",value:void 0},{kind:"method",key:"updated",value:function(e){(0,a.Z)(i,"updated",this,3)([e]),(e.has("invalid")||e.has("errorMessage"))&&(this.setCustomValidity(this.invalid?this.errorMessage||this.validationMessage||"Invalid":""),(this.invalid||this.validateOnInitialRender||e.has("invalid")&&void 0!==e.get("invalid"))&&this.reportValidity()),e.has("autocomplete")&&(this.autocomplete?this.formElement.setAttribute("autocomplete",this.autocomplete):this.formElement.removeAttribute("autocomplete")),e.has("autocorrect")&&(this.autocorrect?this.formElement.setAttribute("autocorrect",this.autocorrect):this.formElement.removeAttribute("autocorrect")),e.has("inputSpellcheck")&&(this.inputSpellcheck?this.formElement.setAttribute("spellcheck",this.inputSpellcheck):this.formElement.removeAttribute("spellcheck"))}},{kind:"method",key:"renderIcon",value:function(e,t=!1){const i=t?"trailing":"leading";return d.dy` <span class="mdc-text-field__icon mdc-text-field__icon--${i}" tabindex="${t?1:-1}"> <slot name="${i}Icon"></slot> </span> `}},{kind:"field",static:!0,key:"styles",value:()=>[r.W,d.iv`.mdc-text-field__input{width:var(--ha-textfield-input-width,100%)}.mdc-text-field:not(.mdc-text-field--with-leading-icon){padding:var(--text-field-padding,0px 16px)}.mdc-text-field__affix--suffix{padding-left:var(--text-field-suffix-padding-left,12px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,12px);padding-inline-end:var(--text-field-suffix-padding-right,0px);direction:ltr}.mdc-text-field--with-leading-icon{padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,16px);direction:var(--direction)}.mdc-text-field--with-leading-icon.mdc-text-field--with-trailing-icon{padding-left:var(--text-field-suffix-padding-left,0px);padding-right:var(--text-field-suffix-padding-right,0px);padding-inline-start:var(--text-field-suffix-padding-left,0px);padding-inline-end:var(--text-field-suffix-padding-right,0px)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--suffix{color:var(--secondary-text-color)}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__icon{color:var(--secondary-text-color)}.mdc-text-field__icon--leading{margin-inline-start:16px;margin-inline-end:8px;direction:var(--direction)}.mdc-text-field__icon--trailing{padding:var(--textfield-icon-trailing-padding,12px)}.mdc-floating-label:not(.mdc-floating-label--float-above){text-overflow:ellipsis;width:inherit;padding-right:30px;padding-inline-end:30px;padding-inline-start:initial;box-sizing:border-box;direction:var(--direction)}input{text-align:var(--text-field-text-align,start)}input[type=color]{height:20px}::-ms-reveal{display:none}:host([no-spinner]) input::-webkit-inner-spin-button,:host([no-spinner]) input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}input[type=color]::-webkit-color-swatch-wrapper{padding:0}:host([no-spinner]) input[type=number]{-moz-appearance:textfield}.mdc-text-field__ripple{overflow:hidden}.mdc-text-field{overflow:var(--text-field-overflow)}.mdc-floating-label{inset-inline-start:16px!important;inset-inline-end:initial!important;transform-origin:var(--float-start);direction:var(--direction);text-align:var(--float-start)}.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label{max-width:calc(100% - 48px - var(--text-field-suffix-padding-left,0px));inset-inline-start:calc(48px + var(--text-field-suffix-padding-left,0px))!important;inset-inline-end:initial!important;direction:var(--direction)}.mdc-text-field__input[type=number]{direction:var(--direction)}.mdc-text-field__affix--prefix{padding-right:var(--text-field-prefix-padding-right,2px);padding-inline-end:var(--text-field-prefix-padding-right,2px);padding-inline-start:initial}.mdc-text-field:not(.mdc-text-field--disabled) .mdc-text-field__affix--prefix{color:var(--mdc-text-field-label-ink-color)}#helper-text ha-markdown{display:inline-block}`,"rtl"===l.E.document.dir?d.iv`.mdc-floating-label,.mdc-text-field--with-leading-icon,.mdc-text-field--with-leading-icon.mdc-text-field--filled .mdc-floating-label,.mdc-text-field__icon--leading,.mdc-text-field__input[type=number]{direction:rtl;--direction:rtl}`:d.iv``]}]}}),o.P)},66929:function(e,t,i){i.d(t,{HL:()=>a,S7:()=>n});const n=(e,t)=>e.callWS({type:"config/core/update",...t}),a=e=>e.callWS({type:"config/core/detect"})},87602:function(e,t,i){i.d(t,{l:()=>n});const n={BD:"BDT",BE:"EUR",BF:"XOF",BG:"BGN",BA:"BAM",BB:"BBD",WF:"XPF",BL:"EUR",BM:"BMD",BN:"BND",BO:"BOB",BH:"BHD",BI:"BIF",BJ:"XOF",BT:"BTN",JM:"JMD",BV:"NOK",BW:"BWP",WS:"WST",BQ:"USD",BR:"BRL",BS:"BSD",JE:"GBP",BY:"BYN",BZ:"BZD",RU:"RUB",RW:"RWF",RS:"RSD",TL:"USD",RE:"EUR",TM:"TMT",TJ:"TJS",RO:"RON",TK:"NZD",GW:"XOF",GU:"USD",GT:"GTQ",GS:"GBP",GR:"EUR",GQ:"XAF",GP:"EUR",JP:"JPY",GY:"GYD",GG:"GBP",GF:"EUR",GE:"GEL",GD:"XCD",GB:"GBP",GA:"XAF",SV:"USD",GN:"GNF",GM:"GMD",GL:"DKK",GI:"GIP",GH:"GHS",OM:"OMR",TN:"TND",JO:"JOD",HR:"EUR",HT:"HTG",HU:"HUF",HK:"HKD",HN:"HNL",HM:"AUD",VE:"VED",PR:"USD",PS:"ILS",PW:"USD",PT:"EUR",SJ:"NOK",PY:"PYG",IQ:"IQD",PA:"PAB",PF:"XPF",PG:"PGK",PE:"PEN",PK:"PKR",PH:"PHP",PN:"NZD",PL:"PLN",PM:"EUR",ZM:"ZMW",EH:"MAD",EE:"EUR",EG:"EGP",ZA:"ZAR",EC:"USD",IT:"EUR",VN:"VND",SB:"SBD",ET:"ETB",SO:"SOS",ZW:"ZWL",SA:"SAR",ES:"EUR",ER:"ERN",ME:"EUR",MD:"MDL",MG:"MGA",MF:"EUR",MA:"MAD",MC:"EUR",UZ:"UZS",MM:"MMK",ML:"XOF",MO:"MOP",MN:"MNT",MH:"USD",MK:"MKD",MU:"MUR",MT:"EUR",MW:"MWK",MV:"MVR",MQ:"EUR",MP:"USD",MS:"XCD",MR:"MRO",IM:"GBP",UG:"UGX",TZ:"TZS",MY:"MYR",MX:"MXN",IL:"ILS",FR:"EUR",IO:"USD",SH:"SHP",FI:"EUR",FJ:"FJD",FK:"FKP",FM:"USD",FO:"DKK",NI:"NIO",NL:"EUR",NO:"NOK",NA:"NAD",VU:"VUV",NC:"XPF",NE:"XOF",NF:"AUD",NG:"NGN",NZ:"NZD",NP:"NPR",NR:"AUD",NU:"NZD",CK:"NZD",XK:"EUR",CI:"XOF",CH:"CHF",CO:"COP",CN:"CNY",CM:"XAF",CL:"CLP",CC:"AUD",CA:"CAD",CG:"XAF",CF:"XAF",CD:"CDF",CZ:"CZK",CY:"EUR",CX:"AUD",CR:"CRC",CW:"ANG",CV:"CVE",CU:"CUP",SZ:"SZL",SY:"SYP",SX:"ANG",KG:"KGS",KE:"KES",SS:"SSP",SR:"SRD",KI:"AUD",KH:"KHR",KN:"XCD",KM:"KMF",ST:"STD",SK:"EUR",KR:"KRW",SI:"EUR",KP:"KPW",KW:"KWD",SN:"XOF",SM:"EUR",SL:"SLL",SC:"SCR",KZ:"KZT",KY:"KYD",SG:"SGD",SE:"SEK",SD:"SDG",DO:"DOP",DM:"XCD",DJ:"DJF",DK:"DKK",VG:"USD",DE:"EUR",YE:"YER",DZ:"DZD",US:"USD",UY:"UYU",YT:"EUR",UM:"USD",LB:"LBP",LC:"XCD",LA:"LAK",TV:"AUD",TW:"TWD",TT:"TTD",TR:"TRY",LK:"LKR",LI:"CHF",LV:"EUR",TO:"TOP",LT:"EUR",LU:"EUR",LR:"LRD",LS:"LSL",TH:"THB",TF:"EUR",TG:"XOF",TD:"XAF",TC:"USD",LY:"LYD",VA:"EUR",VC:"XCD",AE:"AED",AD:"EUR",AG:"XCD",AF:"AFN",AI:"XCD",VI:"USD",IS:"ISK",IR:"IRR",AM:"AMD",AL:"ALL",AO:"AOA",AQ:"",AS:"USD",AR:"ARS",AU:"AUD",AT:"EUR",AW:"AWG",IN:"INR",AX:"EUR",AZ:"AZN",IE:"EUR",ID:"IDR",UA:"UAH",QA:"QAR",MZ:"MZN"}},54754:function(e,t,i){i.d(t,{a:()=>a,k:()=>n});const n=(e,t,i,n)=>fetch(`https://nominatim.openstreetmap.org/search.php?q=${e}&format=jsonv2${n?`&limit=${n}`:""}${i?"&addressdetails=1":""}&accept-language=${t.locale.language}&email=abuse@home-assistant.io`,{headers:{"User-Agent":`HomeAssistant/${t.config.version}`}}).then((e=>{if(e.ok)return e.json();throw new Error(e.statusText)})),a=(e,t,i)=>fetch(`https://nominatim.openstreetmap.org/reverse.php?lat=${e[0]}&lon=${e[1]}&accept-language=${t.locale.language}&zoom=${i??18}&format=jsonv2&email=abuse@home-assistant.io`,{headers:{"User-Agent":`HomeAssistant/${t.config.version}`}}).then((e=>{if(e.ok)return e.json();throw new Error(e.statusText)}))},69919:function(e,t,i){i.a(e,(async function(e,n){try{i.d(t,{EX:()=>s,SO:()=>l,Sk:()=>u,TN:()=>v,UJ:()=>h,Ym:()=>f,hF:()=>c});i(9359),i(56475),i(70104);var a=i(73358),o=i(75278),r=i(50602),d=(i(1416),e([r]));r=(d.then?(await d)():d)[0];let s=function(e){return e[e.INSTALL=1]="INSTALL",e[e.SPECIFIC_VERSION=2]="SPECIFIC_VERSION",e[e.PROGRESS=4]="PROGRESS",e[e.BACKUP=8]="BACKUP",e[e.RELEASE_NOTES=16]="RELEASE_NOTES",e}({});const l=e=>(0,o.e)(e,s.PROGRESS)&&null!==e.attributes.update_percentage,c=(e,t=!1)=>(e.state===a.uo||t&&Boolean(e.attributes.skipped_version))&&(0,o.e)(e,s.INSTALL),u=e=>!!e.attributes.in_progress,h=(e,t)=>e.callWS({type:"update/release_notes",entity_id:t}),p="ioBroker Core",m="ioBroker Supervisor",g="ioBroker Operating System",f=(e,t)=>{const i=e.state,n=e.attributes;if("off"===i){return n.latest_version&&n.skipped_version===n.latest_version?n.latest_version:t.formatEntityState(e)}if("on"===i&&u(e)){return(0,o.e)(e,s.PROGRESS)&&null!==n.update_percentage?t.localize("ui.card.update.installing_with_progress",{progress:(0,r.uf)(n.update_percentage,t.locale,{maximumFractionDigits:n.display_precision,minimumFractionDigits:n.display_precision})}):t.localize("ui.card.update.installing")}return t.formatEntityState(e)},v=(e,t)=>{const i=e.entity_id,n=t[i]?.domain;if("hassio"!==n)return"generic";const a=e.attributes.title||"";return a===p?"home_assistant":[p,m,g].includes(a)?"generic":"addon"};n()}catch(e){n(e)}}))},85590:function(e,t,i){i.a(e,(async function(e,n){try{i.r(t);var a=i(44249),o=i(72621),r=(i(31622),i(57243)),d=i(15093),s=i(11104),l=i(36522),c=(i(99426),i(17170)),u=i(49542),h=i(66929),p=i(87602),m=i(37013),g=i(44180),f=i(66982),v=e([c,f,s,u]);[c,f,s,u]=v.then?(await v)():v;(0,a.Z)([(0,d.Mo)("onboarding-core-config")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"onboardingLocalize",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_working",value:()=>!1},{kind:"field",decorators:[(0,d.SB)()],key:"_location",value:void 0},{kind:"field",key:"_elevation",value:()=>"0"},{kind:"field",key:"_timeZone",value:()=>s.Q},{kind:"field",key:"_language",value:()=>(0,g.sS)()},{kind:"field",decorators:[(0,d.SB)()],key:"_country",value:void 0},{kind:"field",key:"_unitSystem",value:void 0},{kind:"field",key:"_currency",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_skipCore",value:()=>!1},{kind:"method",key:"render",value:function(){return this._location?this._skipCore?r.dy`<div class="row center"> <ha-spinner></ha-spinner> </div>`:r.dy` ${this._error?r.dy`<ha-alert alert-type="error">${this._error}</ha-alert>`:r.Ld} <p> ${this.onboardingLocalize("ui.panel.page-onboarding.core-config.country_intro")} </p> <ha-country-picker class="flex" .language="${this.hass.locale.language}" .label="${this.hass.localize("ui.panel.config.core.section.core.core_config.country")||"Country"}" required .disabled="${this._working}" .value="${this._countryValue}" @value-changed="${this._handleCountryChanged}"> </ha-country-picker> <div class="footer"> <mwc-button @click="${this._save}" .disabled="${this._working}"> ${this.onboardingLocalize("ui.panel.page-onboarding.core-config.finish")} </mwc-button> </div> `:r.dy`<onboarding-location .hass="${this.hass}" .onboardingLocalize="${this.onboardingLocalize}" @value-changed="${this._locationChanged}"></onboarding-location>`}},{kind:"method",key:"firstUpdated",value:function(e){(0,o.Z)(i,"firstUpdated",this,3)([e]),this.addEventListener("keyup",(e=>{this._location&&"Enter"===e.key&&this._save(e)}))}},{kind:"get",key:"_countryValue",value:function(){return this._country||""}},{kind:"method",key:"_handleCountryChanged",value:function(e){this._country=e.detail.value}},{kind:"method",key:"_locationChanged",value:async function(e){if(this._location=e.detail.value.location,e.detail.value.country&&(this._country=e.detail.value.country),e.detail.value.elevation&&(this._elevation=e.detail.value.elevation),e.detail.value.currency&&(this._currency=e.detail.value.currency),e.detail.value.language&&(this._language=e.detail.value.language),e.detail.value.timezone&&(this._timeZone=e.detail.value.timezone),e.detail.value.unit_system&&(this._unitSystem=e.detail.value.unit_system),this._country)return this._skipCore=!0,void this._save(e);let t;if(navigator.language){const e=navigator.language.split("-").pop().toUpperCase();u.o.includes(e)&&(t=e)}this._country=t,(0,l.B)(this,"onboarding-progress",{increase:.5}),await this.updateComplete,setTimeout((()=>this.renderRoot.querySelector("ha-country-picker").focus()),100)}},{kind:"method",key:"_save",value:async function(e){if(this._location&&this._country){e.preventDefault(),this._working=!0;try{await(0,h.S7)(this.hass,{location_name:this.onboardingLocalize("ui.panel.page-onboarding.core-config.location_name_default"),latitude:this._location[0],longitude:this._location[1],elevation:Number(this._elevation),unit_system:this._unitSystem||["US","MM","LR"].includes(this._country)?"us_customary":"metric",time_zone:this._timeZone||"UTC",currency:this._currency||p.l[this._country]||"EUR",country:this._country,language:this._language});const e=await(0,m.Rj)(this.hass);(0,l.B)(this,"onboarding-step",{type:"core_config",result:e})}catch(e){this._skipCore=!1,this._working=!1,this._error=e.message}}}},{kind:"field",static:!0,key:"styles",value:()=>r.iv`.row{display:flex;flex-direction:row;margin:0 -8px;align-items:center;--ha-select-min-width:100px}.secondary{color:var(--secondary-text-color)}p{font-size:14px;line-height:20px}ha-textfield{display:block}.flex{flex:1}.middle-text{margin:16px 0}.row{margin-top:16px}.center{justify-content:center}.row>*{margin:0 8px}.radio-group{display:flex;flex-direction:column;flex:1}.footer{margin-top:16px;text-align:right}a{color:var(--primary-color)}`}]}}),r.oi);n()}catch(e){n(e)}}))},66982:function(e,t,i){i.a(e,(async function(e,t){try{var n=i(44249),a=i(72621),o=(i(9359),i(1331),i(70104),i(31622),i(2060),i(57243)),r=i(15093),d=i(27486),s=i(36522),l=(i(99426),i(17170)),c=(i(55486),i(7285),i(72781),i(83166),i(5346)),u=i(66929),h=i(54754),p=i(76131),m=i(17409),g=e([l,c]);[l,c]=g.then?(await g)():g;const f="M12,8A4,4 0 0,1 16,12A4,4 0 0,1 12,16A4,4 0 0,1 8,12A4,4 0 0,1 12,8M3.05,13H1V11H3.05C3.5,6.83 6.83,3.5 11,3.05V1H13V3.05C17.17,3.5 20.5,6.83 20.95,11H23V13H20.95C20.5,17.17 17.17,20.5 13,20.95V23H11V20.95C6.83,20.5 3.5,17.17 3.05,13M12,5A7,7 0 0,0 5,12A7,7 0 0,0 12,19A7,7 0 0,0 19,12A7,7 0 0,0 12,5Z",v="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",y="M12,11.5A2.5,2.5 0 0,1 9.5,9A2.5,2.5 0 0,1 12,6.5A2.5,2.5 0 0,1 14.5,9A2.5,2.5 0 0,1 12,11.5M12,2A7,7 0 0,0 5,9C5,14.25 12,22 12,22C12,22 19,14.25 19,9A7,7 0 0,0 12,2Z",_="M15.5,12C18,12 20,14 20,16.5C20,17.38 19.75,18.2 19.31,18.9L22.39,22L21,23.39L17.88,20.32C17.19,20.75 16.37,21 15.5,21C13,21 11,19 11,16.5C11,14 13,12 15.5,12M15.5,14A2.5,2.5 0 0,0 13,16.5A2.5,2.5 0 0,0 15.5,19A2.5,2.5 0 0,0 18,16.5A2.5,2.5 0 0,0 15.5,14M19.5,2A0.5,0.5 0 0,1 20,2.5V11.81C19.42,11.26 18.75,10.81 18,10.5V4.7L15,5.86V10C14.3,10.07 13.62,10.24 13,10.5V5.87L9,4.47V16.13H9V16.5C9,17.14 9.09,17.76 9.26,18.34L8,17.9L2.66,19.97L2.5,20A0.5,0.5 0 0,1 2,19.5V4.38C2,4.15 2.15,3.97 2.36,3.9L8,2L14,4.1L19.34,2.03L19.5,2M4,5.46V17.31L7,16.15V4.45L4,5.46Z",k=[52.3731339,4.8903147],b=matchMedia("(prefers-color-scheme: dark)"),x="location";(0,n.Z)([(0,r.Mo)("onboarding-location")],(function(e,t){class i extends t{constructor(...t){super(...t),e(this)}}return{F:i,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,r.Cb)({attribute:!1})],key:"onboardingLocalize",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_working",value:()=>!1},{kind:"field",decorators:[(0,r.SB)()],key:"_location",value:()=>k},{kind:"field",decorators:[(0,r.SB)()],key:"_places",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_error",value:void 0},{kind:"field",decorators:[(0,r.SB)()],key:"_search",value:()=>!1},{kind:"field",decorators:[(0,r.SB)()],key:"_highlightedMarker",value:void 0},{kind:"field",key:"_elevation",value:void 0},{kind:"field",key:"_unitSystem",value:void 0},{kind:"field",key:"_currency",value:void 0},{kind:"field",key:"_timeZone",value:void 0},{kind:"field",key:"_country",value:void 0},{kind:"field",decorators:[(0,r.IO)("ha-locations-editor",!0)],key:"map",value:void 0},{kind:"method",key:"render",value:function(){const e=this.onboardingLocalize("ui.panel.page-onboarding.core-config.location_address",{openstreetmap:o.dy`<a href="https://www.openstreetmap.org/" target="_blank" rel="noopener noreferrer">OpenStreetMap</a>`,osm_privacy_policy:o.dy`<a href="https://wiki.osmfoundation.org/wiki/Privacy_Policy" target="_blank" rel="noopener noreferrer">${this.onboardingLocalize("ui.panel.page-onboarding.core-config.osm_privacy_policy")}</a>`});return o.dy` <h1> ${this.onboardingLocalize("ui.panel.page-onboarding.core-config.location_header")} </h1> ${this._error?o.dy`<ha-alert alert-type="error">${this._error}</ha-alert>`:o.Ld} <p> ${this.onboardingLocalize("ui.panel.page-onboarding.core-config.intro_location")} </p> <div class="location-search"> <ha-textfield label="${this.onboardingLocalize("ui.panel.page-onboarding.core-config.address_label")}" .disabled="${this._working}" icon iconTrailing @keyup="${this._addressSearch}"> <ha-svg-icon slot="leadingIcon" .path="${v}"></ha-svg-icon> ${this._working?o.dy` <ha-spinner slot="trailingIcon" size="small"></ha-spinner> `:o.dy` <ha-icon-button @click="${this._handleButtonClick}" slot="trailingIcon" .disabled="${this._working}" .label="${this.onboardingLocalize(this._search?"ui.common.search":"ui.panel.page-onboarding.core-config.button_detect")}" .path="${this._search?_:f}"></ha-icon-button> `} </ha-textfield> ${void 0!==this._places?o.dy` <mwc-list activatable> ${this._places?.length?this._places.map((e=>{const t=[e.name||e.address[e.category],e.address.house_number,e.address.road||e.address.waterway,e.address.village||e.address.town,e.address.suburb||e.address.subdivision,e.address.city||e.address.municipality].filter(Boolean).join(", "),i=[e.address.county||e.address.state_district||e.address.region,e.address.state,e.address.country].filter(Boolean).join(", ");return o.dy`<ha-list-item @click="${this._itemClicked}" .placeId="${e.place_id}" .selected="${this._highlightedMarker===e.place_id}" .activated="${this._highlightedMarker===e.place_id}" .twoline="${t&&i}"> ${t||i} <span slot="secondary">${t?i:""}</span> </ha-list-item>`})):o.dy`<ha-list-item noninteractive>${null===this._places?"":"No results"}</ha-list-item>`} </mwc-list> `:o.Ld} </div> <ha-locations-editor class="flex" .hass="${this.hass}" .locations="${this._markerLocations(this._location,this._places,this._highlightedMarker)}" zoom="14" .themeMode="${b.matches?"dark":"light"}" .disabled="${this._working}" @location-updated="${this._locationChanged}" @marker-clicked="${this._markerClicked}"></ha-locations-editor> <p class="attribution">${e}</p> <div class="footer"> <mwc-button @click="${this._save}" unelevated .disabled="${this._working}"> ${this.onboardingLocalize("ui.panel.page-onboarding.core-config.finish")} </mwc-button> </div> `}},{kind:"method",key:"firstUpdated",value:function(e){(0,a.Z)(i,"firstUpdated",this,3)([e]),setTimeout((()=>this.renderRoot.querySelector("ha-textfield").focus()),100),this.addEventListener("keyup",(e=>{"Enter"===e.key&&this._save(e)}))}},{kind:"method",key:"updated",value:function(e){if(e.has("_highlightedMarker")&&this._highlightedMarker){const e=this._places?.find((e=>e.place_id===this._highlightedMarker));4===e?.boundingbox?.length?this.map.fitBounds([[e.boundingbox[0],e.boundingbox[2]],[e.boundingbox[1],e.boundingbox[3]]],{zoom:16,pad:0}):this.map.fitMarker(String(this._highlightedMarker),{zoom:16})}}},{kind:"field",key:"_markerLocations",value:()=>(0,d.Z)(((e,t,i)=>t?t?.length?t.map((t=>({id:String(t.place_id),iconPath:t.place_id===i?void 0:y,latitude:e&&t.place_id===i?e[0]:Number(t.lat),longitude:e&&t.place_id===i?e[1]:Number(t.lon),location_editable:t.place_id===i}))):[]:[{id:x,latitude:(e||k)[0],longitude:(e||k)[1],location_editable:!0}]))},{kind:"method",key:"_locationChanged",value:function(e){this._location=e.detail.location,e.detail.id!==x&&this._reverseGeocode()}},{kind:"method",key:"_markerClicked",value:function(e){if(e.detail.id===x)return;this._highlightedMarker=Number(e.detail.id);const t=this._places.find((t=>t.place_id===Number(e.detail.id)));this._location=[Number(t.lat),Number(t.lon)],this._country=t.address.country_code.toUpperCase()}},{kind:"method",key:"_itemClicked",value:function(e){this._highlightedMarker=e.currentTarget.placeId;const t=this._places.find((t=>t.place_id===e.currentTarget.placeId));this._location=[Number(t.lat),Number(t.lon)],this._country=t.address.country_code.toUpperCase()}},{kind:"method",key:"_addressSearch",value:async function(e){e.stopPropagation(),this._search=e.currentTarget.value.length>0,"Enter"===e.key&&this._searchAddress(e.currentTarget.value)}},{kind:"method",key:"_searchAddress",value:async function(e){this._working=!0,this._highlightedMarker=void 0,this._error=void 0,this._places=null,this.map.addEventListener("markers-updated",(()=>{setTimeout((()=>{(this._places?.length||0)>2&&this.map.fitMap({pad:.5})}),500)}),{once:!0});try{this._places=await(0,h.k)(e,this.hass,!0,3),this._places?.length&&(this._highlightedMarker=this._places[0].place_id,this._location=[Number(this._places[0].lat),Number(this._places[0].lon)],this._country=this._places[0].address.country_code.toUpperCase())}catch(e){this._places=void 0,this._error=e.message}finally{this._working=!1}}},{kind:"method",key:"_reverseGeocode",value:async function(){if(!this._location)return;this._places=null;const e=await(0,h.a)(this._location,this.hass);this._country=e.address.country_code.toUpperCase(),this._places=[e],this._highlightedMarker=e.place_id}},{kind:"method",key:"_handleButtonClick",value:async function(e){this._search?this._searchAddress(e.target.parentElement.value):this._detectLocation()}},{kind:"method",key:"_detectLocation",value:function(){if(window.isSecureContext&&navigator.geolocation){this._working=!0;const e={enableHighAccuracy:!0,timeout:5e3,maximumAge:0};navigator.geolocation.getCurrentPosition((async e=>{this.map.addEventListener("markers-updated",(()=>{this.map.fitMarker(x)}),{once:!0}),this._location=[e.coords.latitude,e.coords.longitude],e.coords.altitude&&(this._elevation=String(Math.round(e.coords.altitude)));try{await this._reverseGeocode()}finally{this._working=!1}}),(()=>{this._working=!1,this._whoAmI()}),e)}else this._whoAmI()}},{kind:"method",key:"_whoAmI",value:async function(){if(await(0,p.showConfirmationDialog)(this,{title:this.onboardingLocalize("ui.panel.page-onboarding.core-config.title_location_detect"),text:this.onboardingLocalize("ui.panel.page-onboarding.core-config.intro_location_detect")})){this._working=!0;try{const e=await(0,u.HL)(this.hass);e.latitude&&e.longitude&&(this.map.addEventListener("markers-updated",(()=>{this.map.fitMarker(x)}),{once:!0}),this._location=[Number(e.latitude),Number(e.longitude)]),e.elevation&&(this._elevation=String(e.elevation)),e.unit_system&&(this._unitSystem=e.unit_system),e.time_zone&&(this._timeZone=e.time_zone),e.currency&&(this._currency=e.currency),e.country&&(this._country=e.country)}catch(e){this._error=`Failed to detect location information: ${e.message}`}finally{this._working=!1}}}},{kind:"method",key:"_save",value:async function(e){this._location&&(e.preventDefault(),(0,s.B)(this,"value-changed",{value:{location:this._location,country:this._country,elevation:this._elevation,unit_system:this._unitSystem,time_zone:this._timeZone,currency:this._currency}}))}},{kind:"get",static:!0,key:"styles",value:function(){return[m.I,o.iv`.location-search{margin-top:32px;margin-bottom:32px}ha-textfield{display:block}ha-textfield>ha-icon-button{position:absolute;top:10px;right:10px;inset-inline-end:10px;inset-inline-start:initial;--mdc-icon-button-size:36px;--mdc-icon-size:20px;color:var(--secondary-text-color);inset-inline-start:initial;inset-inline-end:10px;direction:var(--direction)}ha-textfield>ha-spinner{position:relative;left:12px;inset-inline-start:12px;inset-inline-end:initial}ha-locations-editor{display:block;height:300px;margin-top:8px;border-radius:var(--mdc-shape-large,16px);overflow:hidden}mwc-list{width:100%;border:1px solid var(--divider-color);box-sizing:border-box;border-top-width:0;border-bottom-left-radius:var(--mdc-shape-small,4px);border-bottom-right-radius:var(--mdc-shape-small,4px);--mdc-list-vertical-padding:0}ha-list-item{height:72px}.attribution{margin:0;padding:4px 16px 12px 16px;color:var(--mdc-text-field-label-ink-color,rgba(0,0,0,.6));font-family:var(
--mdc-typography-caption-font-family,
var(--mdc-typography-font-family, Roboto, sans-serif)
);font-size:var(--mdc-typography-caption-font-size, .75rem);font-weight:var(--mdc-typography-caption-font-weight,400);letter-spacing:var(
--mdc-typography-caption-letter-spacing,
.0333333333em
);text-decoration:var(--mdc-typography-caption-text-decoration,inherit);text-transform:var(--mdc-typography-caption-text-transform,inherit)}.attribution a{color:inherit}`]}}]}}),o.oi);t()}catch(e){t(e)}}))}};
//# sourceMappingURL=23251.ef6ed5da460e9ed7.js.map