UNPKG

iobroker.lovelace

Version:

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

2 lines 15 kB
export const __webpack_ids__=["65505"];export const __webpack_modules__={67351:function(e,t,a){a(9359),a(31526),a(21478);const r=new WeakMap,i=new WeakMap,o=new WeakMap,n=new WeakMap,s=new WeakMap,l=new WeakMap,c=new WeakMap,d=new WeakMap,u=new WeakMap,m=new WeakMap,h=new WeakMap,f=new WeakMap,p=new WeakMap,g=new WeakMap,y=new WeakMap;a(92745),a(56475),a(70104),a(92519),a(42179),a(89256),a(24931),a(88463),a(57449),a(19814);const w={ariaAtomic:"aria-atomic",ariaAutoComplete:"aria-autocomplete",ariaBrailleLabel:"aria-braillelabel",ariaBrailleRoleDescription:"aria-brailleroledescription",ariaBusy:"aria-busy",ariaChecked:"aria-checked",ariaColCount:"aria-colcount",ariaColIndex:"aria-colindex",ariaColIndexText:"aria-colindextext",ariaColSpan:"aria-colspan",ariaCurrent:"aria-current",ariaDescription:"aria-description",ariaDisabled:"aria-disabled",ariaExpanded:"aria-expanded",ariaHasPopup:"aria-haspopup",ariaHidden:"aria-hidden",ariaInvalid:"aria-invalid",ariaKeyShortcuts:"aria-keyshortcuts",ariaLabel:"aria-label",ariaLevel:"aria-level",ariaLive:"aria-live",ariaModal:"aria-modal",ariaMultiLine:"aria-multiline",ariaMultiSelectable:"aria-multiselectable",ariaOrientation:"aria-orientation",ariaPlaceholder:"aria-placeholder",ariaPosInSet:"aria-posinset",ariaPressed:"aria-pressed",ariaReadOnly:"aria-readonly",ariaRelevant:"aria-relevant",ariaRequired:"aria-required",ariaRoleDescription:"aria-roledescription",ariaRowCount:"aria-rowcount",ariaRowIndex:"aria-rowindex",ariaRowIndexText:"aria-rowindextext",ariaRowSpan:"aria-rowspan",ariaSelected:"aria-selected",ariaSetSize:"aria-setsize",ariaSort:"aria-sort",ariaValueMax:"aria-valuemax",ariaValueMin:"aria-valuemin",ariaValueNow:"aria-valuenow",ariaValueText:"aria-valuetext",role:"role"};function b(e){const t=n.get(e),{form:a}=t;R(e,a,t),L(e,t.labels)}const v=(e,t=!1)=>{const a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>n.has(e)?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});let r=a.nextNode();const i=!t||e.disabled;for(;r;)r.formDisabledCallback&&i&&F(r,e.disabled),r=a.nextNode()},E={attributes:!0,attributeFilter:["disabled","name"]},M=_()?new MutationObserver((e=>{for(const t of e){const e=t.target;if("disabled"===t.attributeName&&(e.constructor.formAssociated?F(e,e.hasAttribute("disabled")):"fieldset"===e.localName&&v(e)),"name"===t.attributeName&&e.constructor.formAssociated){const t=n.get(e),a=u.get(e);t.setFormValue(a)}}})):{};function T(e){e.forEach((e=>{const{addedNodes:t,removedNodes:a}=e,r=Array.from(t),i=Array.from(a);r.forEach((e=>{if(n.has(e)&&e.constructor.formAssociated&&b(e),m.has(e)){const t=m.get(e);Object.keys(w).filter((e=>null!==t[e])).forEach((a=>{x(e,w[a],t[a])})),m.delete(e)}if(y.has(e)){const t=y.get(e);x(e,"internals-valid",t.validity.valid.toString()),x(e,"internals-invalid",(!t.validity.valid).toString()),x(e,"aria-invalid",(!t.validity.valid).toString()),y.delete(e)}if("form"===e.localName){const t=d.get(e),a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>!n.has(e)||!e.constructor.formAssociated||t&&t.has(e)?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT});let r=a.nextNode();for(;r;)b(r),r=a.nextNode()}"fieldset"===e.localName&&(M.observe?.(e,E),v(e,!0))})),i.forEach((e=>{const t=n.get(e);if(t&&o.get(t)&&I(t),c.has(e)){c.get(e).disconnect()}}))}))}function k(e){e.forEach((e=>{const{removedNodes:t}=e;t.forEach((t=>{const a=p.get(e.target);n.has(t)&&P(t),a.disconnect()}))}))}_()&&new MutationObserver(T);const A={childList:!0,subtree:!0},x=(e,t,a)=>{e.getAttribute(t)!==a&&e.setAttribute(t,a)},F=(e,t)=>{e.toggleAttribute("internals-disabled",t),t?x(e,"aria-disabled","true"):e.removeAttribute("aria-disabled"),e.formDisabledCallback&&e.formDisabledCallback.apply(e,[t])},I=e=>{o.get(e).forEach((e=>{e.remove()})),o.set(e,[])},C=(e,t)=>{const a=document.createElement("input");return a.type="hidden",a.name=e.getAttribute("name"),e.after(a),o.get(t).push(a),a},L=(e,t)=>{if(t.length){const a=Array.from(t);a.forEach((t=>t.addEventListener("click",e.click.bind(e))));const[r]=a;let i=r.id;r.id||(i=`${r.htmlFor}_Label`,r.id=i),x(e,"aria-labelledby",i)}},S=e=>{const t=Array.from(e.elements).filter((e=>!e.tagName.includes("-")&&e.validity)).map((e=>e.validity.valid)),a=d.get(e)||[],r=[...t,...Array.from(a).filter((e=>e.isConnected)).map((e=>n.get(e).validity.valid))].includes(!1);e.toggleAttribute("internals-invalid",r),e.toggleAttribute("internals-valid",!r)},N=e=>{S(D(e.target))},O=e=>{S(D(e.target))},V=e=>{const t=d.get(e.target);t&&t.size&&t.forEach((e=>{e.constructor.formAssociated&&e.formResetCallback&&e.formResetCallback.apply(e)}))},R=(e,t,a)=>{if(t){const r=d.get(t);if(r)r.add(e);else{const a=new Set;a.add(e),d.set(t,a),(e=>{const t=["button[type=submit]","input[type=submit]","button:not([type])"].map((e=>`${e}:not([disabled])`)).map((t=>`${t}:not([form])${e.id?`,${t}[form='${e.id}']`:""}`)).join(",");e.addEventListener("click",(a=>{if(a.target.closest(t)){const t=d.get(e);if(e.noValidate)return;t.size&&Array.from(t).reverse().map((e=>n.get(e).reportValidity())).includes(!1)&&a.preventDefault()}}))})(t),t.addEventListener("reset",V),t.addEventListener("input",N),t.addEventListener("change",O)}l.set(t,{ref:e,internals:a}),e.constructor.formAssociated&&e.formAssociatedCallback&&setTimeout((()=>{e.formAssociatedCallback.apply(e,[t])}),0),S(t)}},D=e=>{let t=e.parentNode;return t&&"FORM"!==t.tagName&&(t=D(t)),t},W=(e,t,a=DOMException)=>{if(!e.constructor.formAssociated)throw new a(t)},H=(e,t,a)=>{const r=d.get(e);return r&&r.size&&r.forEach((e=>{n.get(e)[a]()||(t=!1)})),t},P=e=>{if(e.constructor.formAssociated){const t=n.get(e),{labels:a,form:r}=t;L(e,a),R(e,r,t)}};function _(){return"undefined"!=typeof MutationObserver}class ${constructor(){this.badInput=!1,this.customError=!1,this.patternMismatch=!1,this.rangeOverflow=!1,this.rangeUnderflow=!1,this.stepMismatch=!1,this.tooLong=!1,this.tooShort=!1,this.typeMismatch=!1,this.valid=!0,this.valueMissing=!1,Object.seal(this)}}const j=e=>{let t=!0;for(let a in e)"valid"!==a&&!1!==e[a]&&(t=!1);return t},z=new WeakMap;function q(e,t){e.toggleAttribute(t,!0),e.part&&e.part.add(t)}class U extends Set{static get isPolyfilled(){return!0}constructor(e){if(super(),!e||!e.tagName||-1===e.tagName.indexOf("-"))throw new TypeError("Illegal constructor");z.set(this,e)}add(e){if(!/^--/.test(e)||"string"!=typeof e)throw new DOMException(`Failed to execute 'add' on 'CustomStateSet': The specified value ${e} must start with '--'.`);const t=super.add(e),a=z.get(this),r=`state${e}`;return a.isConnected?q(a,r):setTimeout((()=>{q(a,r)})),t}clear(){for(let[e]of this.entries())this.delete(e);super.clear()}delete(e){const t=super.delete(e),a=z.get(this);return a.isConnected?(a.toggleAttribute(`state${e}`,!1),a.part&&a.part.remove(`state${e}`)):setTimeout((()=>{a.toggleAttribute(`state${e}`,!1),a.part&&a.part.remove(`state${e}`)})),t}}var B,K=function(e,t,a,r,i){if("m"===r)throw new TypeError("Private method is not writable");if("a"===r&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!i:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===r?i.call(e,a):i?i.value=a:t.set(e,a),a},G=function(e,t,a,r){if("a"===a&&!r)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===a?r:"a"===a?r.call(e):r?r.value:t.get(e)};class J{constructor(e){B.set(this,void 0),K(this,B,e,"f");for(let t=0;t<e.length;t++){let a=e[t];this[t]=a,a.hasAttribute("name")&&(this[a.getAttribute("name")]=a)}Object.freeze(this)}get length(){return G(this,B,"f").length}[(B=new WeakMap,Symbol.iterator)](){return G(this,B,"f")[Symbol.iterator]()}item(e){return null==this[e]?null:this[e]}namedItem(e){return null==this[e]?null:this[e]}}class Q{static get isPolyfilled(){return!0}constructor(e){if(!e||!e.tagName||-1===e.tagName.indexOf("-"))throw new TypeError("Illegal constructor");const t=e.getRootNode(),a=new $;this.states=new U(e),r.set(this,e),i.set(this,a),n.set(e,this),((e,t)=>{for(let a in w){t[a]=null;let r=null;const i=w[a];Object.defineProperty(t,a,{get:()=>r,set(a){r=a,e.isConnected?x(e,i,a):m.set(e,t)}})}})(e,this),((e,t)=>{o.set(t,[]),M.observe?.(e,E)})(e,this),Object.seal(this),t instanceof DocumentFragment&&(e=>{const t=new MutationObserver(k);window?.ShadyDOM?.inUse&&e.mode&&e.host&&(e=e.host),t.observe?.(e,{childList:!0}),p.set(e,t)})(t)}checkValidity(){const e=r.get(this);if(W(e,"Failed to execute 'checkValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const t=i.get(this);if(!t.valid){const t=new Event("invalid",{bubbles:!1,cancelable:!0,composed:!1});e.dispatchEvent(t)}return t.valid}get form(){const e=r.get(this);let t;return W(e,"Failed to read the 'form' property from 'ElementInternals': The target element is not a form-associated custom element."),!0===e.constructor.formAssociated&&(t=D(e)),t}get labels(){const e=r.get(this);W(e,"Failed to read the 'labels' property from 'ElementInternals': The target element is not a form-associated custom element.");const t=e.getAttribute("id"),a=e.getRootNode();return a&&t?a.querySelectorAll(`[for="${t}"]`):[]}reportValidity(){const e=r.get(this);if(W(e,"Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!this.willValidate)return!0;const t=this.checkValidity(),a=f.get(this);if(a&&!e.constructor.formAssociated)throw new DOMException("Failed to execute 'reportValidity' on 'ElementInternals': The target element is not a form-associated custom element.");return!t&&a&&(e.focus(),a.focus()),t}setFormValue(e){const t=r.get(this);if(W(t,"Failed to execute 'setFormValue' on 'ElementInternals': The target element is not a form-associated custom element."),I(this),null==e||e instanceof FormData)null!=e&&e instanceof FormData&&Array.from(e).reverse().forEach((([e,a])=>{if("string"==typeof a){const r=C(t,this);r.name=e,r.value=a}}));else if(t.getAttribute("name")){C(t,this).value=e}u.set(t,e)}setValidity(e,t,a){const o=r.get(this);if(W(o,"Failed to execute 'setValidity' on 'ElementInternals': The target element is not a form-associated custom element."),!e)throw new TypeError("Failed to execute 'setValidity' on 'ElementInternals': 1 argument required, but only 0 present.");f.set(this,a);const n=i.get(this),l={};for(const t in e)l[t]=e[t];var c;0===Object.keys(l).length&&((c=n).badInput=!1,c.customError=!1,c.patternMismatch=!1,c.rangeOverflow=!1,c.rangeUnderflow=!1,c.stepMismatch=!1,c.tooLong=!1,c.tooShort=!1,c.typeMismatch=!1,c.valid=!0,c.valueMissing=!1);const d={...n,...l};delete d.valid;const{valid:u}=((e,t,a)=>(e.valid=j(t),Object.keys(t).forEach((a=>e[a]=t[a])),a&&S(a),e))(n,d,this.form);if(!u&&!t)throw new DOMException("Failed to execute 'setValidity' on 'ElementInternals': The second argument should not be empty if one or more flags in the first argument are true.");s.set(this,u?"":t),o.isConnected?(o.toggleAttribute("internals-invalid",!u),o.toggleAttribute("internals-valid",u),x(o,"aria-invalid",`${!u}`)):y.set(o,this)}get shadowRoot(){const e=r.get(this),t=h.get(e);return t||null}get validationMessage(){const e=r.get(this);return W(e,"Failed to read the 'validationMessage' property from 'ElementInternals': The target element is not a form-associated custom element."),s.get(this)}get validity(){const e=r.get(this);W(e,"Failed to read the 'validity' property from 'ElementInternals': The target element is not a form-associated custom element.");return i.get(this)}get willValidate(){const e=r.get(this);return W(e,"Failed to read the 'willValidate' property from 'ElementInternals': The target element is not a form-associated custom element."),!(e.matches(":disabled")||e.disabled||e.hasAttribute("disabled")||e.hasAttribute("readonly"))}}let X=!1,Y=!1;function Z(e){Y||(Y=!0,window.CustomStateSet=U,e&&(HTMLElement.prototype.attachInternals=function(...t){const a=e.call(this,t);return a.states=new U(this),a}))}!!customElements.polyfillWrapFlushCallback||(function(){if("undefined"==typeof window||!window.ElementInternals||!HTMLElement.prototype.attachInternals)return!1;class e extends HTMLElement{constructor(){super(),this.internals=this.attachInternals()}}const t=`element-internals-feature-detection-${Math.random().toString(36).replace(/[^a-z]+/g,"")}`;customElements.define(t,e);const a=new e;return["shadowRoot","form","willValidate","validity","validationMessage","labels","setFormValue","setValidity","checkValidity","reportValidity"].every((e=>e in a.internals))}()?"undefined"==typeof window||window.CustomStateSet||Z(HTMLElement.prototype.attachInternals):function(e=!0){if(!X){if(X=!0,"undefined"!=typeof window&&(window.ElementInternals=Q),"undefined"!=typeof CustomElementRegistry){const t=CustomElementRegistry.prototype.define;CustomElementRegistry.prototype.define=function(e,a,r){if(a.formAssociated){const e=a.prototype.connectedCallback;a.prototype.connectedCallback=function(){g.has(this)||(g.set(this,!0),this.hasAttribute("disabled")&&F(this,!0)),null!=e&&e.apply(this),P(this)}}t.call(this,e,a,r)}}if("undefined"!=typeof HTMLElement&&(HTMLElement.prototype.attachInternals=function(){if(!this.tagName)return{};if(-1===this.tagName.indexOf("-"))throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': Unable to attach ElementInternals to non-custom elements.");if(n.has(this))throw new DOMException("DOMException: Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");return new Q(this)}),"undefined"!=typeof Element){function a(...e){const t=r.apply(this,e);if(h.set(this,t),_()){const e=new MutationObserver(T);window.ShadyDOM?e.observe(this,A):e.observe(t,A),c.set(this,e)}return t}const r=Element.prototype.attachShadow;Element.prototype.attachShadow=a}_()&&"undefined"!=typeof document&&new MutationObserver(T).observe(document.documentElement,A),"undefined"!=typeof HTMLFormElement&&function(){const e=HTMLFormElement.prototype.checkValidity;HTMLFormElement.prototype.checkValidity=function(...t){let a=e.apply(this,t);return H(this,a,"checkValidity")};const t=HTMLFormElement.prototype.reportValidity;HTMLFormElement.prototype.reportValidity=function(...e){let a=t.apply(this,e);return H(this,a,"reportValidity")};const{get:a}=Object.getOwnPropertyDescriptor(HTMLFormElement.prototype,"elements");Object.defineProperty(HTMLFormElement.prototype,"elements",{get(...e){const t=a.call(this,...e),r=Array.from(d.get(this)||[]);if(0===r.length)return t;const i=Array.from(t).concat(r).sort(((e,t)=>e.compareDocumentPosition?2&e.compareDocumentPosition(t)?1:-1:0));return new J(i)}})}(),(e||"undefined"!=typeof window&&!window.CustomStateSet)&&Z()}}(!1))}}; //# sourceMappingURL=65505.074d4638401f5fff.js.map