UNPKG

iobroker.lovelace

Version:

With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI

2 lines 15.7 kB
"use strict";(self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([["9113"],{51784:function(e,t,i){i.d(t,{dJ:()=>k,zB:()=>y});var a=i(61701),n=i(72621),o=(i(52247),i(71695),i(19423),i(40251),i(47021),i(67840)),d=i(88854),l=i(57243),r=i(50778);let s,c,u=e=>e;o.A.addInitializer((async e=>{await e.updateComplete;const t=e;t.dialog.prepend(t.scrim),t.scrim.style.inset=0,t.scrim.style.zIndex=0;const{getOpenAnimation:i,getCloseAnimation:a}=t;t.getOpenAnimation=()=>{var e,t;const a=i.call(void 0);return a.container=[...null!==(e=a.container)&&void 0!==e?e:[],...null!==(t=a.dialog)&&void 0!==t?t:[]],a.dialog=[],a},t.getCloseAnimation=()=>{var e,t;const i=a.call(void 0);return i.container=[...null!==(e=i.container)&&void 0!==e?e:[],...null!==(t=i.dialog)&&void 0!==t?t:[]],i.dialog=[],i}}));(0,a.Z)([(0,r.Mo)("ha-md-dialog")],(function(e,t){class a extends t{constructor(){super(),e(this),this.addEventListener("cancel",this._handleCancel),"function"!=typeof HTMLDialogElement&&(this.addEventListener("open",this._handleOpen),c||(c=i.e("73854").then(i.bind(i,85893)))),void 0===this.animate&&(this.quick=!0),void 0===this.animate&&(this.quick=!0)}}return{F:a,d:[{kind:"field",decorators:[(0,r.Cb)({attribute:"disable-cancel-action",type:Boolean})],key:"disableCancelAction",value(){return!1}},{kind:"field",key:"_polyfillDialogRegistered",value(){return!1}},{kind:"method",key:"_handleOpen",value:async function(e){var t;if(e.preventDefault(),this._polyfillDialogRegistered)return;this._polyfillDialogRegistered=!0,this._loadPolyfillStylesheet("/static/polyfills/dialog-polyfill.css");const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("dialog");(await c).default.registerDialog(i),this.removeEventListener("open",this._handleOpen),this.show()}},{kind:"method",key:"_loadPolyfillStylesheet",value:async function(e){const t=document.createElement("link");return t.rel="stylesheet",t.href=e,new Promise(((i,a)=>{var n;t.onload=()=>i(),t.onerror=()=>a(new Error(`Stylesheet failed to load: ${e}`)),null===(n=this.shadowRoot)||void 0===n||n.appendChild(t)}))}},{kind:"method",key:"_handleCancel",value:function(e){if(this.disableCancelAction){var t;e.preventDefault();const i=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("dialog .container");void 0!==this.animate&&(null==i||i.animate([{transform:"rotate(-1deg)","animation-timing-function":"ease-in"},{transform:"rotate(1.5deg)","animation-timing-function":"ease-out"},{transform:"rotate(0deg)","animation-timing-function":"ease-in"}],{duration:200,iterations:2}))}}},{kind:"field",static:!0,key:"styles",value(){return[...(0,n.Z)(a,"styles",this),(0,l.iv)(s||(s=u`:host{--md-dialog-container-color:var(--card-background-color);--md-dialog-headline-color:var(--primary-text-color);--md-dialog-supporting-text-color:var(--primary-text-color);--md-sys-color-scrim:#000000;--md-dialog-headline-weight:400;--md-dialog-headline-size:1.574rem;--md-dialog-supporting-text-size:1rem;--md-dialog-supporting-text-line-height:1.5rem}:host([type=alert]){min-width:320px}@media all and (max-width:450px),all and (max-height:500px){:host(:not([type=alert])){min-width:calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left));max-width:calc(100vw - env(safe-area-inset-right) - env(safe-area-inset-left));min-height:100%;max-height:100%;--md-dialog-container-shape:0}}::slotted(ha-dialog-header[slot=headline]){display:contents}.scroller{overflow:var(--dialog-content-overflow,auto)}slot[name=content]::slotted(*){padding:var(--dialog-content-padding,24px)}.scrim{z-index:10}`))]}}]}}),o.A);const h=Object.assign(Object.assign({},d.I),{},{dialog:[[[{transform:"translateY(50px)"},{transform:"translateY(0)"}],{duration:500,easing:"cubic-bezier(.3,0,0,1)"}]],container:[[[{opacity:0},{opacity:1}],{duration:50,easing:"linear",pseudoElement:"::before"}]]}),p=Object.assign(Object.assign({},d.G),{},{dialog:[[[{transform:"translateY(0)"},{transform:"translateY(50px)"}],{duration:150,easing:"cubic-bezier(.3,0,0,1)"}]],container:[[[{opacity:"1"},{opacity:"0"}],{delay:100,duration:50,easing:"linear",pseudoElement:"::before"}]]}),k=()=>window.matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches?h:d.I,y=()=>window.matchMedia("all and (max-width: 450px), all and (max-height: 500px)").matches?p:d.G},34326:function(e,t,i){var a=i(61701),n=(i(71695),i(47021),i(57243)),o=i(50778);i(23334),i(83166);let d,l,r,s=e=>e;(0,a.Z)([(0,o.Mo)("ha-password-field")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,o.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"invalid",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:"error-message"})],key:"errorMessage",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"icon",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"iconTrailing",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)()],key:"autocomplete",value:void 0},{kind:"field",decorators:[(0,o.Cb)()],key:"autocorrect",value:void 0},{kind:"field",decorators:[(0,o.Cb)({attribute:"input-spellcheck"})],key:"inputSpellcheck",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:String})],key:"value",value(){return""}},{kind:"field",decorators:[(0,o.Cb)({type:String})],key:"placeholder",value(){return""}},{kind:"field",decorators:[(0,o.Cb)({type:String})],key:"label",value(){return""}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"disabled",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"required",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"minLength",value(){return-1}},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"maxLength",value(){return-1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean,reflect:!0})],key:"outlined",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:String})],key:"helper",value(){return""}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"validateOnInitialRender",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:String})],key:"validationMessage",value(){return""}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"autoValidate",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:String})],key:"pattern",value(){return""}},{kind:"field",decorators:[(0,o.Cb)({type:Number})],key:"size",value(){return null}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"helperPersistent",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"charCounter",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"endAligned",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({type:String})],key:"prefix",value(){return""}},{kind:"field",decorators:[(0,o.Cb)({type:String})],key:"suffix",value(){return""}},{kind:"field",decorators:[(0,o.Cb)({type:String})],key:"name",value(){return""}},{kind:"field",decorators:[(0,o.Cb)({type:String,attribute:"input-mode"})],key:"inputMode",value:void 0},{kind:"field",decorators:[(0,o.Cb)({type:Boolean})],key:"readOnly",value(){return!1}},{kind:"field",decorators:[(0,o.Cb)({attribute:!1,type:String})],key:"autocapitalize",value(){return""}},{kind:"field",decorators:[(0,o.SB)()],key:"_unmaskedPassword",value(){return!1}},{kind:"field",decorators:[(0,o.IO)("ha-textfield")],key:"_textField",value:void 0},{kind:"method",key:"render",value:function(){var e;return(0,n.dy)(d||(d=s`<ha-textfield .invalid="${0}" .errorMessage="${0}" .icon="${0}" .iconTrailing="${0}" .autocomplete="${0}" .autocorrect="${0}" .inputSpellcheck="${0}" .value="${0}" .placeholder="${0}" .label="${0}" .disabled="${0}" .required="${0}" .minLength="${0}" .maxLength="${0}" .outlined="${0}" .helper="${0}" .validateOnInitialRender="${0}" .validationMessage="${0}" .autoValidate="${0}" .pattern="${0}" .size="${0}" .helperPersistent="${0}" .charCounter="${0}" .endAligned="${0}" .prefix="${0}" .name="${0}" .inputMode="${0}" .readOnly="${0}" .autocapitalize="${0}" .type="${0}" .suffix="${0}" @input="${0}" @change="${0}"></ha-textfield> <ha-icon-button .label="${0}" @click="${0}" .path="${0}"></ha-icon-button>`),this.invalid,this.errorMessage,this.icon,this.iconTrailing,this.autocomplete,this.autocorrect,this.inputSpellcheck,this.value,this.placeholder,this.label,this.disabled,this.required,this.minLength,this.maxLength,this.outlined,this.helper,this.validateOnInitialRender,this.validationMessage,this.autoValidate,this.pattern,this.size,this.helperPersistent,this.charCounter,this.endAligned,this.prefix,this.name,this.inputMode,this.readOnly,this.autocapitalize,this._unmaskedPassword?"text":"password",(0,n.dy)(l||(l=s`<div style="width:24px"></div>`)),this._handleInputEvent,this._handleChangeEvent,(null===(e=this.hass)||void 0===e?void 0:e.localize(this._unmaskedPassword?"ui.components.selectors.text.hide_password":"ui.components.selectors.text.show_password"))||(this._unmaskedPassword?"Hide password":"Show password"),this._toggleUnmaskedPassword,this._unmaskedPassword?"M11.83,9L15,12.16C15,12.11 15,12.05 15,12A3,3 0 0,0 12,9C11.94,9 11.89,9 11.83,9M7.53,9.8L9.08,11.35C9.03,11.56 9,11.77 9,12A3,3 0 0,0 12,15C12.22,15 12.44,14.97 12.65,14.92L14.2,16.47C13.53,16.8 12.79,17 12,17A5,5 0 0,1 7,12C7,11.21 7.2,10.47 7.53,9.8M2,4.27L4.28,6.55L4.73,7C3.08,8.3 1.78,10 1,12C2.73,16.39 7,19.5 12,19.5C13.55,19.5 15.03,19.2 16.38,18.66L16.81,19.08L19.73,22L21,20.73L3.27,3M12,7A5,5 0 0,1 17,12C17,12.64 16.87,13.26 16.64,13.82L19.57,16.75C21.07,15.5 22.27,13.86 23,12C21.27,7.61 17,4.5 12,4.5C10.6,4.5 9.26,4.75 8,5.2L10.17,7.35C10.74,7.13 11.35,7 12,7Z":"M12,9A3,3 0 0,0 9,12A3,3 0 0,0 12,15A3,3 0 0,0 15,12A3,3 0 0,0 12,9M12,17A5,5 0 0,1 7,12A5,5 0 0,1 12,7A5,5 0 0,1 17,12A5,5 0 0,1 12,17M12,4.5C7,4.5 2.73,7.61 1,12C2.73,16.39 7,19.5 12,19.5C17,19.5 21.27,16.39 23,12C21.27,7.61 17,4.5 12,4.5Z")}},{kind:"method",key:"focus",value:function(){this._textField.focus()}},{kind:"method",key:"checkValidity",value:function(){return this._textField.checkValidity()}},{kind:"method",key:"reportValidity",value:function(){return this._textField.reportValidity()}},{kind:"method",key:"setCustomValidity",value:function(e){return this._textField.setCustomValidity(e)}},{kind:"method",key:"layout",value:function(){return this._textField.layout()}},{kind:"method",key:"_toggleUnmaskedPassword",value:function(){this._unmaskedPassword=!this._unmaskedPassword}},{kind:"method",decorators:[(0,o.hO)({passive:!0})],key:"_handleInputEvent",value:function(e){this.value=e.target.value}},{kind:"method",decorators:[(0,o.hO)({passive:!0})],key:"_handleChangeEvent",value:function(e){this.value=e.target.value,this._reDispatchEvent(e)}},{kind:"method",key:"_reDispatchEvent",value:function(e){const t=new Event(e.type,e);this.dispatchEvent(t)}},{kind:"field",static:!0,key:"styles",value(){return(0,n.iv)(r||(r=s`:host{display:block;position:relative}ha-textfield{width:100%}ha-icon-button{position:absolute;top:8px;right:8px;inset-inline-start:initial;inset-inline-end:8px;--mdc-icon-button-size:40px;--mdc-icon-size:20px;color:var(--secondary-text-color);direction:var(--direction)}`))}}]}}),n.oi)},75639:function(e,t,i){i.a(e,(async function(e,a){try{i.r(t);var n=i(61701),o=(i(71695),i(40251),i(47021),i(57243)),d=i(50778),l=i(36522),r=(i(95198),i(23334),i(13928),i(51784),i(19993),i(74633),i(37583),i(34326),i(99426),i(26779)),s=i(28008),c=i(9807),u=e([r,c]);[r,c]=u.then?(await u)():u;let h,p,k,y,v=e=>e;const g="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,n.Z)([(0,d.Mo)("ha-dialog-download-decrypted-backup")],(function(e,t){return{F:class extends t{constructor(...t){super(...t),e(this)}},d:[{kind:"field",decorators:[(0,d.Cb)({attribute:!1})],key:"hass",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_opened",value(){return!1}},{kind:"field",decorators:[(0,d.SB)()],key:"_params",value:void 0},{kind:"field",decorators:[(0,d.IO)("ha-md-dialog")],key:"_dialog",value:void 0},{kind:"field",decorators:[(0,d.SB)()],key:"_encryptionKey",value(){return""}},{kind:"field",decorators:[(0,d.SB)()],key:"_error",value(){return""}},{kind:"method",key:"showDialog",value:function(e){this._opened=!0,this._params=e}},{kind:"method",key:"closeDialog",value:function(){var e;return null===(e=this._dialog)||void 0===e||e.close(),!0}},{kind:"method",key:"_dialogClosed",value:function(){this._opened&&(0,l.B)(this,"dialog-closed",{dialog:this.localName}),this._opened=!1,this._params=void 0,this._encryptionKey="",this._error=""}},{kind:"method",key:"render",value:function(){return this._opened&&this._params?(0,o.dy)(h||(h=v` <ha-md-dialog open @closed="${0}" disable-cancel-action> <ha-dialog-header slot="headline"> <ha-icon-button slot="navigationIcon" @click="${0}" .label="${0}" .path="${0}"></ha-icon-button> <span slot="title"> ${0} </span> </ha-dialog-header> <div slot="content"> <p> ${0} </p> <p> ${0} </p> <ha-password-field .label="${0}" @input="${0}"></ha-password-field> ${0} </div> <div slot="actions"> <ha-button @click="${0}"> ${0} </ha-button> <ha-button @click="${0}"> ${0} </ha-button> </div> </ha-md-dialog> `),this._dialogClosed,this.closeDialog,this.hass.localize("ui.common.close"),g,this.hass.localize("ui.panel.config.backup.dialogs.download.title"),this.hass.localize("ui.panel.config.backup.dialogs.download.description"),this.hass.localize("ui.panel.config.backup.dialogs.download.download_backup_encrypted",{download_it_encrypted:(0,o.dy)(p||(p=v`<button class="link" @click="${0}"> ${0} </button>`),this._downloadEncrypted,this.hass.localize("ui.panel.config.backup.dialogs.download.download_it_encrypted"))}),this.hass.localize("ui.panel.config.backup.dialogs.download.encryption_key"),this._keyChanged,this._error?(0,o.dy)(k||(k=v`<ha-alert alert-type="error">${0}</ha-alert>`),this._error):o.Ld,this._cancel,this.hass.localize("ui.common.cancel"),this._submit,this.hass.localize("ui.panel.config.backup.dialogs.download.download")):o.Ld}},{kind:"method",key:"_cancel",value:function(){this.closeDialog()}},{kind:"method",key:"_submit",value:async function(){if(""!==this._encryptionKey)try{await(0,r.fi)(this.hass,this._params.backup.backup_id,this._agentId,this._encryptionKey),(0,c.W)(this.hass,this._params.backup.backup_id,this._agentId,this._encryptionKey),this.closeDialog()}catch(e){"password_incorrect"===(null==e?void 0:e.code)?this._error=this.hass.localize("ui.panel.config.backup.dialogs.download.incorrect_encryption_key"):"decrypt_not_supported"===(null==e?void 0:e.code)?this._error=this.hass.localize("ui.panel.config.backup.dialogs.download.decryption_not_supported"):alert(e.message)}}},{kind:"method",key:"_keyChanged",value:function(e){this._encryptionKey=e.currentTarget.value,this._error=""}},{kind:"get",key:"_agentId",value:function(){var e;return null!==(e=this._params)&&void 0!==e&&e.agentId?this._params.agentId:(0,r.OT)(Object.keys(this._params.backup.agents))}},{kind:"method",key:"_downloadEncrypted",value:async function(){(0,c.W)(this.hass,this._params.backup.backup_id,this._agentId),this.closeDialog()}},{kind:"get",static:!0,key:"styles",value:function(){return[s.Qx,s.yu,(0,o.iv)(y||(y=v`ha-md-dialog{--dialog-content-padding:8px 24px;max-width:500px}@media all and (max-width:450px),all and (max-height:500px){ha-md-dialog{max-width:none}div[slot=content]{margin-top:0}}button.link{background:0 0;border:none;padding:0;font-size:14px;color:var(--primary-color);text-decoration:underline;cursor:pointer}`))]}}]}}),o.oi);a()}catch(h){a(h)}}))}}]); //# sourceMappingURL=9113.5d1b6538a4520fdd.js.map