UNPKG

iobroker.lovelace

Version:

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

3 lines 6.64 kB
/*! For license information please see chunk.0aaf6eb2d534ea9922d8.js.LICENSE.txt */ (self.webpackChunkhome_assistant_frontend=self.webpackChunkhome_assistant_frontend||[]).push([[1527],{67810:(t,e,r)=>{"use strict";r.d(e,{o:()=>n});r(43437);var o=r(87156);const n={properties:{scrollTarget:{type:HTMLElement,value:function(){return this._defaultScrollTarget}}},observers:["_scrollTargetChanged(scrollTarget, isAttached)"],_shouldHaveListener:!0,_scrollTargetChanged:function(t,e){if(this._oldScrollTarget&&(this._toggleScrollListener(!1,this._oldScrollTarget),this._oldScrollTarget=null),e)if("document"===t)this.scrollTarget=this._doc;else if("string"==typeof t){var r=this.domHost;this.scrollTarget=r&&r.$?r.$[t]:(0,o.vz)(this.ownerDocument).querySelector("#"+t)}else this._isValidScrollTarget()&&(this._oldScrollTarget=t,this._toggleScrollListener(this._shouldHaveListener,t))},_scrollHandler:function(){},get _defaultScrollTarget(){return this._doc},get _doc(){return this.ownerDocument.documentElement},get _scrollTop(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.pageYOffset:this.scrollTarget.scrollTop:0},get _scrollLeft(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.pageXOffset:this.scrollTarget.scrollLeft:0},set _scrollTop(t){this.scrollTarget===this._doc?window.scrollTo(window.pageXOffset,t):this._isValidScrollTarget()&&(this.scrollTarget.scrollTop=t)},set _scrollLeft(t){this.scrollTarget===this._doc?window.scrollTo(t,window.pageYOffset):this._isValidScrollTarget()&&(this.scrollTarget.scrollLeft=t)},scroll:function(t,e){var r;"object"==typeof t?(r=t.left,e=t.top):r=t,r=r||0,e=e||0,this.scrollTarget===this._doc?window.scrollTo(r,e):this._isValidScrollTarget()&&(this.scrollTarget.scrollLeft=r,this.scrollTarget.scrollTop=e)},get _scrollTargetWidth(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.innerWidth:this.scrollTarget.offsetWidth:0},get _scrollTargetHeight(){return this._isValidScrollTarget()?this.scrollTarget===this._doc?window.innerHeight:this.scrollTarget.offsetHeight:0},_isValidScrollTarget:function(){return this.scrollTarget instanceof HTMLElement},_toggleScrollListener:function(t,e){var r=e===this._doc?window:e;t?this._boundScrollHandler||(this._boundScrollHandler=this._scrollHandler.bind(this),r.addEventListener("scroll",this._boundScrollHandler)):this._boundScrollHandler&&(r.removeEventListener("scroll",this._boundScrollHandler),this._boundScrollHandler=null)},toggleScrollListener:function(t){this._shouldHaveListener=t,this._toggleScrollListener(t,this.scrollTarget)}}},4268:(t,e,r)=>{"use strict";function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function l(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach((function(e){o(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function i(t,e){if(null==t)return{};var r,o,n=function(t,e){if(null==t)return{};var r,o,n={},l=Object.keys(t);for(o=0;o<l.length;o++)r=l[o],e.indexOf(r)>=0||(n[r]=t[r]);return n}(t,e);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(o=0;o<l.length;o++)r=l[o],e.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function s(t,e){return!0===t?[]:!1===t?[e.fail()]:t}r.d(e,{DD:()=>a,Yj:()=>g,IX:()=>p,hu:()=>f,O7:()=>y,Rx:()=>b,Ry:()=>T,jt:()=>w,Z_:()=>v,n_:()=>O,dt:()=>j,G0:()=>S});class c{constructor(t){const{type:e,schema:r,coercer:o=(t=>t),validator:n=(()=>[]),refiner:l=(()=>[])}=t;this.type=e,this.schema=r,this.coercer=o,this.validator=n,this.refiner=l}}class a extends TypeError{constructor(t,e){const{path:r,value:o,type:n,branch:l}=t,s=i(t,["path","value","type","branch"]);super(`Expected a value of type \`${n}\`${r.length?` for \`${r.join(".")}\``:""} but received \`${JSON.stringify(o)}\`.`),this.value=o,Object.assign(this,s),this.type=n,this.path=r,this.branch=l,this.failures=function*(){yield t,yield*e},this.stack=(new Error).stack,this.__proto__=a.prototype}}function f(t,e){const r=h(t,e);if(r[0])throw r[0]}function u(t,e){const r=e.coercer(t);return f(r,e),r}function h(t,e,r=!1){r&&(t=e.coercer(t));const o=d(t,e),[n]=o;if(n){return[new a(n,o),void 0]}return[void 0,t]}function*d(t,e,r=[],o=[]){const{type:n}=e,i={value:t,type:n,branch:o,path:r,fail:(e={})=>l({value:t,type:n,path:r,branch:[...o,t]},e),check:(t,e,n,l)=>d(t,e,void 0!==n?[...r,l]:r,void 0!==n?[...o,n]:o)},c=s(e.validator(t,i),i),[a]=c;a?(yield a,yield*c):yield*s(e.refiner(t,i),i)}function g(){return O("any",(()=>!0))}function p(t){return new c({type:`Array<${t?t.type:"unknown"}>`,schema:t,coercer:e=>t&&Array.isArray(e)?e.map((e=>u(e,t))):e,*validator(e,r){if(Array.isArray(e)){if(t)for(const[o,n]of e.entries())yield*r.check(n,t,e,o)}else yield r.fail()}})}function y(){return O("boolean",(t=>"boolean"==typeof t))}function _(){return O("never",(()=>!1))}function b(){return O("number",(t=>"number"==typeof t&&!isNaN(t)))}function T(t){const e=t?Object.keys(t):[],r=_();return new c({type:t?`Object<{${e.join(",")}}>`:"Object",schema:t||null,coercer:t?m(t):t=>t,*validator(o,n){if("object"==typeof o&&null!=o){if(t){const l=new Set(Object.keys(o));for(const r of e){l.delete(r);const e=t[r],i=o[r];yield*n.check(i,e,o,r)}for(const t of l){const e=o[t];yield*n.check(e,r,o,t)}}}else yield n.fail()}})}function w(t){return new c({type:t.type+"?",schema:t.schema,validator:(e,r)=>void 0===e||r.check(e,t)})}function v(){return O("string",(t=>"string"==typeof t))}function O(t,e){return new c({type:t,validator:e,schema:null})}function j(t){const e=Object.keys(t);return O(`Type<{${e.join(",")}}>`,(function*(r,o){if("object"==typeof r&&null!=r)for(const n of e){const e=t[n],l=r[n];yield*o.check(l,e,r,n)}else yield o.fail()}))}function S(t){return O(""+t.map((t=>t.type)).join(" | "),(function*(e,r){for(const o of t){const[...t]=r.check(e,o);if(0===t.length)return}yield r.fail()}))}function m(t){const e=Object.keys(t);return r=>{if("object"!=typeof r||null==r)return r;const o={},n=new Set(Object.keys(r));for(const l of e){n.delete(l);const e=t[l],i=r[l];o[l]=u(i,e)}for(const t of n)o[t]=r[t];return o}}}}]); //# sourceMappingURL=chunk.0aaf6eb2d534ea9922d8.js.map