UNPKG

iobroker.lovelace

Version:

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

2 lines 19.1 kB
/*! For license information please see 45743.2c256b390193e146.js.LICENSE.txt */ export const __rspack_esm_id=45743;export const __rspack_esm_ids=[45743];export const __webpack_modules__={35370(t,e,i){var o=i(26198);t.exports=function(t,e,i){for(var s=0,r=arguments.length>2?i:o(e),a=new t(r);r>s;)a[s]=e[s++];return a}},93900(t,e,i){i.a(t,async function(t,e){try{var o=i(5124),s=i(22441),r=i(6412),a=i(63672),n=i(17051),l=i(42462),c=i(28438),d=i(98779),h=i(27259),u=i(25877),p=i(31247),f=i(4444),g=i(92070),v=i(9395),b=i(717),w=i(17060),m=i(88496),y=i(91470),k=t([m,w]);[m,w]=k.then?(await k)():k;var $=Object.defineProperty,C=Object.getOwnPropertyDescriptor,_=(t,e,i,o)=>{for(var s,r=o>1?void 0:o?C(e,i):e,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o?s(e,i,r):s(r))||r);return o&&r&&$(e,i,r),r};let x=class extends b.A{firstUpdated(){this.open&&(this.addOpenListeners(),this.dialog.showModal(),(0,f.JG)(this))}disconnectedCallback(){super.disconnectedCallback(),(0,f.I7)(this),this.removeOpenListeners()}async requestClose(t){const e=new c.L({source:t});if(this.dispatchEvent(e),e.defaultPrevented)return this.open=!0,void(0,h.Ud)(this.dialog,"pulse");this.removeOpenListeners(),await(0,h.Ud)(this.dialog,"hide"),this.open=!1,this.dialog.close(),(0,f.I7)(this);const i=this.originalTrigger;"function"==typeof i?.focus&&setTimeout(()=>i.focus()),this.dispatchEvent(new n.Z)}addOpenListeners(){document.addEventListener("keydown",this.handleDocumentKeyDown),(0,u.AZ)(this)}removeOpenListeners(){document.removeEventListener("keydown",this.handleDocumentKeyDown),(0,u.Fw)(this)}handleDialogCancel(t){t.preventDefault(),!this.dialog.classList.contains("hide")&&t.target===this.dialog&&(0,u.a0)(this)&&this.requestClose(this.dialog)}handleDialogClick(t){const e=t.target.closest('[data-dialog="close"]');e&&(t.stopPropagation(),this.requestClose(e))}async handleDialogPointerDown(t){t.target===this.dialog&&(this.lightDismiss?this.requestClose(this.dialog):await(0,h.Ud)(this.dialog,"pulse"))}handleOpenChange(){this.open&&!this.dialog.open?this.show():!this.open&&this.dialog.open&&(this.open=!0,this.requestClose(this.dialog))}async show(){const t=new d.k;this.dispatchEvent(t),t.defaultPrevented?this.open=!1:(this.addOpenListeners(),this.originalTrigger=document.activeElement,this.open=!0,this.dialog.showModal(),(0,f.JG)(this),requestAnimationFrame(()=>{const t=this.querySelector("[autofocus]");t&&"function"==typeof t.focus?t.focus():this.dialog.focus()}),await(0,h.Ud)(this.dialog,"show"),this.dispatchEvent(new l.q))}render(){const t=!this.withoutHeader,e=this.hasUpdated?this.hasSlotController.test("footer"):this.withFooter;return o.qy` <dialog aria-labelledby="${this.ariaLabelledby??"title"}" aria-describedby="${(0,a.J)(this.ariaDescribedby)}" part="dialog" class="${(0,r.H)({dialog:!0,open:this.open})}" @cancel="${this.handleDialogCancel}" @click="${this.handleDialogClick}" @pointerdown="${this.handleDialogPointerDown}"> ${t?o.qy` <header part="header" class="header"> <h2 part="title" class="title" id="title"> <slot name="label"> ${this.label.length>0?this.label:String.fromCharCode(8203)} </slot> </h2> <div part="header-actions" class="header-actions"> <slot name="header-actions"></slot> <wa-button part="close-button" exportparts="base:close-button__base" class="close" appearance="plain" @click="${t=>this.requestClose(t.target)}"> <wa-icon name="xmark" label="${this.localize.term("close")}" library="system" variant="solid"></wa-icon> </wa-button> </div> </header> `:""} <div part="body" class="body"><slot></slot></div> ${e?o.qy` <footer part="footer" class="footer"> <slot name="footer"></slot> </footer> `:""} </dialog> `}constructor(){super(...arguments),this.localize=new w.c(this),this.hasSlotController=new g.X(this,"footer","header-actions","label"),this.open=!1,this.label="",this.withoutHeader=!1,this.lightDismiss=!1,this.withFooter=!1,this.handleDocumentKeyDown=t=>{"Escape"===t.key&&this.open&&(0,u.a0)(this)&&(t.preventDefault(),t.stopPropagation(),this.requestClose(this.dialog))}}};x.css=y.A,_([(0,s.P)(".dialog")],x.prototype,"dialog",2),_([(0,s.MZ)({type:Boolean,reflect:!0})],x.prototype,"open",2),_([(0,s.MZ)({reflect:!0})],x.prototype,"label",2),_([(0,s.MZ)({attribute:"without-header",type:Boolean,reflect:!0})],x.prototype,"withoutHeader",2),_([(0,s.MZ)({attribute:"light-dismiss",type:Boolean})],x.prototype,"lightDismiss",2),_([(0,s.MZ)({attribute:"aria-labelledby"})],x.prototype,"ariaLabelledby",2),_([(0,s.MZ)({attribute:"aria-describedby"})],x.prototype,"ariaDescribedby",2),_([(0,s.MZ)({attribute:"with-footer",type:Boolean})],x.prototype,"withFooter",2),_([(0,v.w)("open",{waitUntilFirstUpdate:!0})],x.prototype,"handleOpenChange",1),x=_([(0,s.EM)("wa-dialog")],x),o.S$||(document.addEventListener("click",t=>{const e=t.target.closest("[data-dialog]");if(e instanceof Element){const[t,i]=(0,p.v)(e.getAttribute("data-dialog")||"");if("open"===t&&i?.length){const t=e.getRootNode().getElementById(i);"wa-dialog"===t?.localName?t.open=!0:console.warn(`A dialog with an ID of "${i}" could not be found in this document.`)}}}),document.addEventListener("pointerdown",()=>{})),e()}catch(t){e(t)}})},91470(t,e,i){i.d(e,{A:()=>o});var o=i(5124).AH`:host{--width:31rem;--spacing:var(--wa-space-l);--backdrop-filter:none;--show-duration:200ms;--hide-duration:200ms;display:none}:host([open]){display:block}.dialog{display:flex;flex-direction:column;top:0;right:0;bottom:0;left:0;width:var(--width);max-width:calc(100% - var(--wa-space-2xl));max-height:calc(100% - var(--wa-space-2xl));color:inherit;background-color:var(--wa-color-surface-raised);border-radius:var(--wa-panel-border-radius);border:none;box-shadow:var(--wa-shadow-l);padding:0;margin:auto}.dialog.show{animation:show-dialog var(--show-duration) ease}.dialog.show::backdrop{animation:show-backdrop var(--show-duration,200ms) ease}.dialog.hide{animation:show-dialog var(--hide-duration) ease reverse}.dialog.hide::backdrop{animation:show-backdrop var(--hide-duration,200ms) ease reverse}.dialog.pulse{animation:pulse 250ms ease}.dialog:focus{outline:0}@media screen and (max-width:420px){.dialog{max-height:80vh}}.open{display:flex;opacity:1}.header{flex:0 0 auto;display:flex;flex-wrap:nowrap;padding-inline-start:var(--spacing);padding-block-end:0;padding-inline-end:calc(var(--spacing) - var(--wa-form-control-padding-block));padding-block-start:calc(var(--spacing) - var(--wa-form-control-padding-block))}.title{align-self:center;flex:1 1 auto;font-family:inherit;font-size:var(--wa-font-size-l);font-weight:var(--wa-font-weight-heading);line-height:var(--wa-line-height-condensed);margin:0}.header-actions{align-self:start;display:flex;flex-shrink:0;flex-wrap:wrap;justify-content:end;gap:var(--wa-space-2xs);padding-inline-start:var(--spacing)}.header-actions ::slotted(wa-button),.header-actions wa-button{flex:0 0 auto;display:flex;align-items:center}.body{flex:1 1 auto;display:block;padding:var(--spacing);overflow:auto;-webkit-overflow-scrolling:touch}.body:focus{outline:0}.body:focus-visible{outline:var(--wa-focus-ring);outline-offset:var(--wa-focus-ring-offset)}.footer{flex:0 0 auto;display:flex;flex-wrap:wrap;gap:var(--wa-space-xs);justify-content:end;padding:var(--spacing);padding-block-start:0}.footer ::slotted(wa-button:not(:first-of-type)){margin-inline-start:var(--wa-spacing-xs)}.dialog::backdrop{background-color:var(--wa-color-overlay-modal,rgb(0 0 0 / .25));-webkit-backdrop-filter:var(--backdrop-filter);backdrop-filter:var(--backdrop-filter)}@keyframes pulse{0%{scale:1}50%{scale:1.02}100%{scale:1}}@keyframes show-dialog{from{opacity:0;scale:0.8}to{opacity:1;scale:1}}@keyframes show-backdrop{from{opacity:0}to{opacity:1}}@media (forced-colors:active){.dialog{border:solid 1px #fff}}`},68825(t,e,i){var o=i(22441),s=i(9395),r=i(717),a=i(5124).AH`:host{--color:var(--wa-color-surface-border);--width:var(--wa-border-width-s);--spacing:var(--wa-space-m)}:host(:not([orientation=vertical])){display:block;border-top:solid var(--width) var(--color);margin:var(--spacing) 0}:host([orientation=vertical]){display:inline-block;height:100%;border-inline-start:solid var(--width) var(--color);margin:0 var(--spacing);min-block-size:1lh}`,n=Object.defineProperty,l=Object.getOwnPropertyDescriptor,c=(t,e,i,o)=>{for(var s,r=o>1?void 0:o?l(e,i):e,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o?s(e,i,r):s(r))||r);return o&&r&&n(e,i,r),r};let d=class extends r.A{connectedCallback(){super.connectedCallback(),this.setAttribute("role","separator")}handleVerticalChange(){this.setAttribute("aria-orientation",this.orientation)}constructor(){super(...arguments),this.orientation="horizontal"}};d.css=a,c([(0,o.MZ)({reflect:!0})],d.prototype,"orientation",2),c([(0,s.w)("orientation")],d.prototype,"handleVerticalChange",1),d=c([(0,o.EM)("wa-divider")],d)},65686(t,e,i){i.a(t,async function(t,o){try{i.d(e,{A:()=>f});var s=i(5124),r=i(22441),a=i(89784),n=i(717),l=i(17060),c=i(42320),d=t([l]);l=(d.then?(await d)():d)[0];var h=Object.defineProperty,u=Object.getOwnPropertyDescriptor,p=(t,e,i,o)=>{for(var s,r=o>1?void 0:o?u(e,i):e,a=t.length-1;a>=0;a--)(s=t[a])&&(r=(o?s(e,i,r):s(r))||r);return o&&r&&h(e,i,r),r};let f=class extends n.A{updated(t){if(super.updated(t),t.has("value")){const t=parseFloat(getComputedStyle(this.indicator).getPropertyValue("r")),e=2*Math.PI*t,i=e-this.value/100*e;this.indicatorOffset=`${i}px`}}render(){return s.qy` <div part="base" class="progress-ring" role="progressbar" aria-label="${this.label.length>0?this.label:this.localize.term("progress")}" aria-describedby="label" aria-valuemin="0" aria-valuemax="100" aria-valuenow="${this.value}" style="${(0,a.W)({"--percentage":this.value/100})}"> <svg class="image"> <circle part="track" class="track"></circle> <circle part="indicator" class="indicator" style="${(0,a.W)({"stroke-dashoffset":this.indicatorOffset})}"></circle> </svg> <slot id="label" part="label" class="label"></slot> </div> `}constructor(){super(...arguments),this.localize=new l.c(this),this.value=0,this.label=""}};f.css=c.A,p([(0,r.P)(".indicator")],f.prototype,"indicator",2),p([(0,r.wk)()],f.prototype,"indicatorOffset",2),p([(0,r.MZ)({type:Number,reflect:!0})],f.prototype,"value",2),p([(0,r.MZ)()],f.prototype,"label",2),f=p([(0,r.EM)("wa-progress-ring")],f),f.disableWarning?.("change-in-update"),o()}catch(t){o(t)}})},42320(t,e,i){i.d(e,{A:()=>o});var o=i(5124).AH`:host{--size:8rem;--track-width:0.25em;--track-color:var(--wa-color-neutral-fill-normal);--indicator-width:var(--track-width);--indicator-color:var(--wa-color-brand-fill-loud);--indicator-transition-duration:0.35s;display:inline-flex}.progress-ring{display:inline-flex;align-items:center;justify-content:center;position:relative}.image{width:var(--size);height:var(--size);rotate:-90deg;transform-origin:50% 50%}.indicator,.track{--radius:calc(var(--size) / 2 - max(var(--track-width), var(--indicator-width)) * 0.5);--circumference:calc(var(--radius) * 2 * 3.141592654);fill:none;r:var(--radius);cx:calc(var(--size)/ 2);cy:calc(var(--size)/ 2)}.track{stroke:var(--track-color);stroke-width:var(--track-width)}.indicator{stroke:var(--indicator-color);stroke-width:var(--indicator-width);stroke-linecap:round;transition-property:stroke-dashoffset;transition-duration:var(--indicator-transition-duration);stroke-dasharray:var(--circumference) var(--circumference);stroke-dashoffset:calc(var(--circumference) - var(--percentage) * var(--circumference))}.label{display:flex;align-items:center;justify-content:center;position:absolute;top:0;left:0;width:100%;height:100%;text-align:center;user-select:none;-webkit-user-select:none}`},95010(t,e,i){i.d(e,{q:()=>o,N:()=>s});i(16573),i(78100),i(77936),i(37467),i(44732),i(79577),i(16632),i(34226),i(9486),i(20456);function o(t,e,i){const o=t=>Object.is(t,-0)?0:t;return o(t<e?e:t>i?i:t)}function s(t=""){return`${t}${((t=21)=>{let e="",i=crypto.getRandomValues(new Uint8Array(t|=0));for(;t--;)e+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[63&i[t]];return e})()}`}},31247(t,e,i){i.d(e,{v:()=>o});i(18111),i(22489),i(61701);function o(t){return t.split(" ").map(t=>t.trim()).filter(t=>""!==t)}},4444(t,e,i){i.d(e,{JG:()=>s,Rt:()=>a,I7:()=>r});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);const o=new Set;function s(t){if(o.add(t),!document.documentElement.classList.contains("wa-scroll-lock")){const t=function(){const t=document.documentElement.clientWidth;return Math.abs(window.innerWidth-t)}()+function(){const t=Number(getComputedStyle(document.body).paddingRight.replace(/px/,""));return isNaN(t)||!t?0:t}();let e=getComputedStyle(document.documentElement).scrollbarGutter;e&&"auto"!==e||(e="stable"),t<2&&(e=""),document.documentElement.style.setProperty("--wa-scroll-lock-gutter",e),document.documentElement.classList.add("wa-scroll-lock"),document.documentElement.style.setProperty("--wa-scroll-lock-size",`${t}px`)}}function r(t){o.delete(t),0===o.size&&(document.documentElement.classList.remove("wa-scroll-lock"),document.documentElement.style.removeProperty("--wa-scroll-lock-size"))}function a(t,e,i="vertical",o="smooth"){const s=function(t,e){return{top:Math.round(t.getBoundingClientRect().top-e.getBoundingClientRect().top),left:Math.round(t.getBoundingClientRect().left-e.getBoundingClientRect().left)}}(t,e),r=s.top+e.scrollTop,a=s.left+e.scrollLeft,n=e.scrollLeft,l=e.scrollLeft+e.offsetWidth,c=e.scrollTop,d=e.scrollTop+e.offsetHeight;"horizontal"!==i&&"both"!==i||(a<n?e.scrollTo({left:a,behavior:o}):a+t.clientWidth>l&&e.scrollTo({left:a-e.offsetWidth+t.clientWidth,behavior:o})),"vertical"!==i&&"both"!==i||(r<c?e.scrollTo({top:r,behavior:o}):r+t.clientHeight>d&&e.scrollTo({top:r-e.offsetHeight+t.clientHeight,behavior:o}))}},88696(t,e,i){i.d(e,{P:()=>r});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var o=i(37540),s=i(42017);class r{handleChanges(t){this.value=this.callback?.(t,this.u)}hostConnected(){for(const t of this.t)this.observe(t)}hostDisconnected(){this.disconnect()}async hostUpdated(){!this.o&&this.i&&this.handleChanges([]),this.i=!1}observe(t){this.t.add(t),this.u.observe(t,this.l),this.i=!0,this.h.requestUpdate()}unobserve(t){this.t.delete(t),this.u.unobserve(t)}disconnect(){this.u.disconnect()}target(t){return a(this,t)}constructor(t,{target:e,config:i,callback:o,skipInitial:s}){this.t=new Set,this.o=!1,this.i=!1,this.h=t,null!==e&&this.t.add(e??t),this.l=i,this.o=s??this.o,this.callback=o,window.ResizeObserver?(this.u=new ResizeObserver(t=>{this.handleChanges(t),this.h.requestUpdate()}),t.addController(this)):console.warn("ResizeController error: browser does not support ResizeObserver.")}}const a=(0,s.u$)(class extends o.Kq{render(t,e){}update(t,[e,i]){this.controller=e,this.part=t,this.observe=i,!1===i?(e.unobserve(t.element),this.observing=!1):!1===this.observing&&(e.observe(t.element),this.observing=!0)}disconnected(){this.controller?.unobserve(this.part.element),this.observing=!1}reconnected(){!1!==this.observe&&!1===this.observing&&(this.controller?.observe(this.part.element),this.observing=!0)}constructor(){super(...arguments),this.observing=!1}})},95192(t,e,i){i.d(e,{IU:()=>c,Jt:()=>n,Yd:()=>o,hZ:()=>l,y$:()=>s});i(44114),i(18111),i(7588),i(61701);function o(t){return new Promise((e,i)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>i(t.error)})}function s(t,e){let i;return(s,r)=>(()=>{if(i)return i;const s=indexedDB.open(t);return s.onupgradeneeded=()=>s.result.createObjectStore(e),i=o(s),i.then(t=>{t.onclose=()=>i=void 0},()=>{}),i})().then(t=>r(t.transaction(e,s).objectStore(e)))}let r;function a(){return r||(r=s("keyval-store","keyval")),r}function n(t,e=a()){return e("readonly",e=>o(e.get(t)))}function l(t,e,i=a()){return i("readwrite",i=>(i.put(e,t),o(i.transaction)))}function c(t=a()){return t("readwrite",t=>(t.clear(),o(t.transaction)))}},37540(t,e,i){i.d(e,{Kq:()=>h});i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var o=i(63937),s=i(42017);const r=(t,e)=>{const i=t._$AN;if(void 0===i)return!1;for(const t of i)t._$AO?.(e,!1),r(t,e);return!0},a=t=>{let e,i;do{if(void 0===(e=t._$AM))break;i=e._$AN,i.delete(t),t=e}while(0===i?.size)},n=t=>{for(let e;e=t._$AM;t=e){let i=e._$AN;if(void 0===i)e._$AN=i=new Set;else if(i.has(t))break;i.add(t),d(e)}};function l(t){void 0!==this._$AN?(a(this),this._$AM=t,n(this)):this._$AM=t}function c(t,e=!1,i=0){const o=this._$AH,s=this._$AN;if(void 0!==s&&0!==s.size)if(e)if(Array.isArray(o))for(let t=i;t<o.length;t++)r(o[t],!1),a(o[t]);else null!=o&&(r(o,!1),a(o));else r(this,t)}const d=t=>{t.type==s.OA.CHILD&&(t._$AP??=c,t._$AQ??=l)};class h extends s.WL{_$AT(t,e,i){super._$AT(t,e,i),n(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(r(this,t),a(this))}setValue(t){if((0,o.Rt)(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}constructor(){super(...arguments),this._$AN=void 0}}},89784(t,e,i){i.d(e,{W:()=>n});i(74423),i(18111),i(18237),i(17642),i(58004),i(33853),i(45876),i(32475),i(15024),i(31698);var o=i(5055),s=i(42017);const r="important",a=" !"+r,n=(0,s.u$)(class extends s.WL{render(t){return Object.keys(t).reduce((e,i)=>{const o=t[i];return null==o?e:e+`${i=i.includes("-")?i:i.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${o};`},"")}update(t,[e]){const{style:i}=t.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(e)),this.render(e);for(const t of this.ft)null==e[t]&&(this.ft.delete(t),t.includes("-")?i.removeProperty(t):i[t]=null);for(const t in e){const o=e[t];if(null!=o){this.ft.add(t);const e="string"==typeof o&&o.endsWith(a);t.includes("-")||e?i.setProperty(t,e?o.slice(0,-11):o,e?r:""):i[t]=o}}return o.c0}constructor(t){if(super(t),t.type!==s.OA.ATTRIBUTE||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}})},91450(t,e,i){i.d(e,{T:()=>u});i(18111),i(20116);var o=i(5055),s=i(63937),r=i(37540);class a{disconnect(){this.G=void 0}reconnect(t){this.G=t}deref(){return this.G}constructor(t){this.G=t}}class n{get(){return this.Y}pause(){this.Y??=new Promise(t=>this.Z=t)}resume(){this.Z?.(),this.Y=this.Z=void 0}constructor(){this.Y=void 0,this.Z=void 0}}var l=i(42017);const c=t=>!(0,s.sO)(t)&&"function"==typeof t.then,d=1073741823;class h extends r.Kq{render(...t){return t.find(t=>!c(t))??o.c0}update(t,e){const i=this._$Cbt;let s=i.length;this._$Cbt=e;const r=this._$CK,a=this._$CX;this.isConnected||this.disconnected();for(let t=0;t<e.length&&!(t>this._$Cwt);t++){const o=e[t];if(!c(o))return this._$Cwt=t,o;t<s&&o===i[t]||(this._$Cwt=d,s=0,Promise.resolve(o).then(async t=>{for(;a.get();)await a.get();const e=r.deref();if(void 0!==e){const i=e._$Cbt.indexOf(o);i>-1&&i<e._$Cwt&&(e._$Cwt=i,e.setValue(t))}}))}return o.c0}disconnected(){this._$CK.disconnect(),this._$CX.pause()}reconnected(){this._$CK.reconnect(this),this._$CX.resume()}constructor(){super(...arguments),this._$Cwt=d,this._$Cbt=[],this._$CK=new a(this),this._$CX=new n}}const u=(0,l.u$)(h)}};