iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 15.9 kB
JavaScript
;(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[77072],{80915:function(e,t,r){r.d(t,{w:function(){return g}});r(44114),r(16280);var i=Math.round(9*Math.random()),n="function"==typeof Object.defineProperty,a=function(){function e(){this._id="__ec_inner_"+i++}return e.prototype.get=function(e){return this._guard(e)[this._id]},e.prototype.set=function(e,t){var r=this._guard(e);return n?Object.defineProperty(r,this._id,{value:t,enumerable:!1,configurable:!0}):r[this._id]=t,this},e.prototype.delete=function(e){return!!this.has(e)&&(delete this._guard(e)[this._id],!0)},e.prototype.has=function(e){return!!this._guard(e)[this._id]},e.prototype._guard=function(e){if(e!==Object(e))throw TypeError("Value of WeakMap is not a non-null object.");return e},e}(),l=r(46116),o=r(52577),h=r(88877),s=r(41144),u=r(6391),f=r(45042),c=new a,d=new l.Ay(100),p=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function g(e,t){if("none"===e)return null;var r=t.getDevicePixelRatio(),i=t.getZr(),n="svg"===i.painter.type;e.dirty&&c.delete(e);var a=c.get(e);if(a)return a;var l=(0,o.defaults)(e,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});"none"===l.backgroundColor&&(l.backgroundColor=null);var g={repeat:"repeat"};return function(e){for(var t,a=[r],c=!0,g=0;g<p.length;++g){var b=l[p[g]];if(null!=b&&!(0,o.isArray)(b)&&!(0,o.isString)(b)&&!(0,o.isNumber)(b)&&"boolean"!=typeof b){c=!1;break}a.push(b)}if(c){t=a.join(",")+(n?"-svg":"");var x=d.get(t);x&&(n?e.svgElement=x:e.image=x)}var w,_=v(l.dashArrayX),k=function(e){if(!e||"object"==typeof e&&0===e.length)return[0,0];if((0,o.isNumber)(e)){var t=Math.ceil(e);return[t,t]}var r=(0,o.map)(e,function(e){return Math.ceil(e)});return e.length%2?r.concat(r):r}(l.dashArrayY),T=y(l.symbol),A=(D=_,(0,o.map)(D,function(e){return m(e)})),P=m(k),S=!n&&f.yh.createCanvas(),C=n&&{tag:"g",attrs:{},key:"dcl",children:[]},B=function(){for(var e=1,t=0,r=A.length;t<r;++t)e=(0,h.lQ)(e,A[t]);var i=1;for(t=0,r=T.length;t<r;++t)i=(0,h.lQ)(i,T[t].length);e*=i;var n=P*A.length*T.length;0;return{width:Math.max(1,Math.min(e,l.maxTileWidth)),height:Math.max(1,Math.min(n,l.maxTileHeight))}}();var D;S&&(S.width=B.width*r,S.height=B.height*r,w=S.getContext("2d"));(function(){w&&(w.clearRect(0,0,S.width,S.height),l.backgroundColor&&(w.fillStyle=l.backgroundColor,w.fillRect(0,0,S.width,S.height)));for(var e=0,t=0;t<k.length;++t)e+=k[t];if(e<=0)return;var a=-P,o=0,h=0,f=0;for(;a<B.height;){if(o%2==0){for(var c=h/2%T.length,d=0,p=0,g=0;d<2*B.width;){var y=0;for(t=0;t<_[f].length;++t)y+=_[f][t];if(y<=0)break;if(p%2==0){var v=.5*(1-l.symbolSize),m=d+_[f][p]*v,b=a+k[o]*v,x=_[f][p]*l.symbolSize,A=k[o]*l.symbolSize,D=g/2%T[c].length;M(m,b,x,A,T[c][D])}d+=_[f][p],++g,++p===_[f].length&&(p=0)}++f===_.length&&(f=0)}a+=k[o],++h,++o===k.length&&(o=0)}function M(e,t,a,o,h){var f=n?1:r,c=(0,s.v5)(h,e*f,t*f,a*f,o*f,l.color,l.symbolKeepAspect);if(n){var d=i.painter.renderOneToVNode(c);d&&C.children.push(d)}else(0,u.Xi)(w,c)}})(),c&&d.put(t,S||C);e.image=S,e.svgElement=C,e.svgWidth=B.width,e.svgHeight=B.height}(g),g.rotation=l.rotation,g.scaleX=g.scaleY=n?1:1/r,c.set(e,g),e.dirty=!1,g}function y(e){if(!e||0===e.length)return[["rect"]];if((0,o.isString)(e))return[[e]];for(var t=!0,r=0;r<e.length;++r)if(!(0,o.isString)(e[r])){t=!1;break}if(t)return y([e]);var i=[];for(r=0;r<e.length;++r)(0,o.isString)(e[r])?i.push([e[r]]):i.push(e[r]);return i}function v(e){if(!e||0===e.length)return[[0,0]];if((0,o.isNumber)(e))return[[n=Math.ceil(e),n]];for(var t=!0,r=0;r<e.length;++r)if(!(0,o.isNumber)(e[r])){t=!1;break}if(t)return v([e]);var i=[];for(r=0;r<e.length;++r)if((0,o.isNumber)(e[r])){var n=Math.ceil(e[r]);i.push([n,n])}else{(n=(0,o.map)(e[r],function(e){return Math.ceil(e)})).length%2==1?i.push(n.concat(n)):i.push(n)}return i}function m(e){for(var t=0,r=0;r<e.length;++r)t+=e[r];return e.length%2==1?2*t:t}},41144:function(e,t,r){r.d(t,{$V:function(){return b},hV:function(){return T},v5:function(){return _},xU:function(){return k}});var i=r(52577),n=r(79231),a=r(46700),l=r(4017),o=r(43842),h=r(26322),s=r(35723),u=r(45287),f=r(88877),c=r(16418),d=n.Ay.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var r=t.cx,i=t.cy,n=t.width/2,a=t.height/2;e.moveTo(r,i-a),e.lineTo(r+n,i+a),e.lineTo(r-n,i+a),e.closePath()}}),p=n.Ay.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(e,t){var r=t.cx,i=t.cy,n=t.width/2,a=t.height/2;e.moveTo(r,i-a),e.lineTo(r+n,i),e.lineTo(r,i+a),e.lineTo(r-n,i),e.closePath()}}),g=n.Ay.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var r=t.x,i=t.y,n=t.width/5*3,a=Math.max(n,t.height),l=n/2,o=l*l/(a-l),h=i-a+l+o,s=Math.asin(o/l),u=Math.cos(s)*l,f=Math.sin(s),c=Math.cos(s),d=.6*l,p=.7*l;e.moveTo(r-u,h+o),e.arc(r,h,l,Math.PI-s,2*Math.PI+s),e.bezierCurveTo(r+u-f*d,h+o+c*d,r,i-p,r,i),e.bezierCurveTo(r,i-p,r-u+f*d,h+o+c*d,r-u,h+o),e.closePath()}}),y=n.Ay.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(e,t){var r=t.height,i=t.width,n=t.x,a=t.y,l=i/3*2;e.moveTo(n,a),e.lineTo(n+l,a+r),e.lineTo(n,a+r/4*3),e.lineTo(n-l,a+r),e.lineTo(n,a),e.closePath()}}),v={line:a.A,rect:l.A,roundRect:l.A,square:l.A,circle:o.A,diamond:p,pin:g,arrow:y,triangle:d},m={line:function(e,t,r,i,n){n.x1=e,n.y1=t+i/2,n.x2=e+r,n.y2=t+i/2},rect:function(e,t,r,i,n){n.x=e,n.y=t,n.width=r,n.height=i},roundRect:function(e,t,r,i,n){n.x=e,n.y=t,n.width=r,n.height=i,n.r=Math.min(r,i)/4},square:function(e,t,r,i,n){var a=Math.min(r,i);n.x=e,n.y=t,n.width=a,n.height=a},circle:function(e,t,r,i,n){n.cx=e+r/2,n.cy=t+i/2,n.r=Math.min(r,i)/2},diamond:function(e,t,r,i,n){n.cx=e+r/2,n.cy=t+i/2,n.width=r,n.height=i},pin:function(e,t,r,i,n){n.x=e+r/2,n.y=t+i/2,n.width=r,n.height=i},arrow:function(e,t,r,i,n){n.x=e+r/2,n.y=t+i/2,n.width=r,n.height=i},triangle:function(e,t,r,i,n){n.cx=e+r/2,n.cy=t+i/2,n.width=r,n.height=i}},b={};(0,i.each)(v,function(e,t){b[t]=new e});var x=n.Ay.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(e,t,r){var i=(0,u.X4)(e,t,r),n=this.shape;return n&&"pin"===n.symbolType&&"inside"===t.position&&(i.y=r.y+.4*r.height),i},buildPath:function(e,t,r){var i=t.symbolType;if("none"!==i){var n=b[i];n||(n=b[i="rect"]),m[i](t.x,t.y,t.width,t.height,n.shape),n.buildPath(e,n.shape,r)}}});function w(e,t){if("image"!==this.type){var r=this.style;this.__isEmptyBrush?(r.stroke=e,r.fill=t||c.A.color.neutral00,r.lineWidth=2):"line"===this.shape.symbolType?r.stroke=e:r.fill=e,this.markRedraw()}}function _(e,t,r,i,n,a,l){var o,u=0===e.indexOf("empty");return u&&(e=e.substr(5,1).toLowerCase()+e.substr(6)),(o=0===e.indexOf("image://")?h.makeImage(e.slice(8),new s.Ay(t,r,i,n),l?"center":"cover"):0===e.indexOf("path://")?h.makePath(e.slice(7),{},new s.Ay(t,r,i,n),l?"center":"cover"):new x({shape:{symbolType:e,x:t,y:r,width:i,height:n}})).__isEmptyBrush=u,o.setColor=w,a&&o.setColor(a),o}function k(e){return(0,i.isArray)(e)||(e=[+e,+e]),[e[0]||0,e[1]||0]}function T(e,t){if(null!=e)return(0,i.isArray)(e)||(e=[e,e]),[(0,f.lo)(e[0],t[0])||0,(0,f.lo)((0,i.retrieve2)(e[1],e[0]),t[1])||0]}},6391:function(e,t,r){r.d(t,{V$:function(){return O},v6:function(){return W},Xi:function(){return M},ZQ:function(){return x}});var i=r(85408),n=r(61316),a=r(22858),l=r(97616),o=r(79231),h=r(6715),s=r(53326),u=r(52577);function f(e){var t,r,i=e.style,n=i.lineDash&&i.lineWidth>0&&(t=i.lineDash,r=i.lineWidth,t&&"solid"!==t&&r>0?"dashed"===t?[4*r,2*r]:"dotted"===t?[r]:(0,u.isNumber)(t)?[t]:(0,u.isArray)(t)?t:null:null),a=i.lineDashOffset;if(n){var l=i.strokeNoScale&&e.getLineScale?e.getLineScale():1;l&&1!==l&&(n=(0,u.map)(n,function(e){return e/l}),a/=l)}return[n,a]}var c=r(84487),d=r(45042),p=new n.A(!0);function g(e){var t=e.stroke;return!(null==t||"none"===t||!(e.lineWidth>0))}function y(e){return"string"==typeof e&&"none"!==e}function v(e){var t=e.fill;return null!=t&&"none"!==t}function m(e,t){if(null!=t.fillOpacity&&1!==t.fillOpacity){var r=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=r}else e.fill()}function b(e,t){if(null!=t.strokeOpacity&&1!==t.strokeOpacity){var r=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=r}else e.stroke()}function x(e,t,r){var i=(0,a.OD)(t.image,t.__image,r);if((0,a.xA)(i)){var n=e.createPattern(i,t.repeat||"repeat");if("function"==typeof DOMMatrix&&n&&n.setTransform){var l=new DOMMatrix;l.translateSelf(t.x||0,t.y||0),l.rotateSelf(0,0,(t.rotation||0)*u.RADIAN_TO_DEGREE),l.scaleSelf(t.scaleX||1,t.scaleY||1),n.setTransform(l)}return n}}var w=["shadowBlur","shadowOffsetX","shadowOffsetY"],_=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function k(e,t,r,n,a){var l=!1;if(!n&&t===(r=r||{}))return!1;if(n||t.opacity!==r.opacity){D(e,a),l=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?i.oN.opacity:o}(n||t.blend!==r.blend)&&(l||(D(e,a),l=!0),e.globalCompositeOperation=t.blend||i.oN.blend);for(var h=0;h<w.length;h++){var s=w[h];(n||t[s]!==r[s])&&(l||(D(e,a),l=!0),e[s]=e.dpr*(t[s]||0))}return(n||t.shadowColor!==r.shadowColor)&&(l||(D(e,a),l=!0),e.shadowColor=t.shadowColor||i.oN.shadowColor),l}function T(e,t,r,i,n){var a=t.style,l=i?null:r&&r.style||{};if(a===l)return!1;var o=k(e,a,l,i,n);if((i||a.fill!==l.fill)&&(o||(D(e,n),o=!0),y(a.fill)&&(e.fillStyle=a.fill)),(i||a.stroke!==l.stroke)&&(o||(D(e,n),o=!0),y(a.stroke)&&(e.strokeStyle=a.stroke)),(i||a.opacity!==l.opacity)&&(o||(D(e,n),o=!0),e.globalAlpha=null==a.opacity?1:a.opacity),t.hasStroke()){var h=a.lineWidth/(a.strokeNoScale&&t.getLineScale?t.getLineScale():1);e.lineWidth!==h&&(o||(D(e,n),o=!0),e.lineWidth=h)}for(var s=0;s<_.length;s++){var u=_[s],f=u[0];(i||a[f]!==l[f])&&(o||(D(e,n),o=!0),e[f]=a[f]||u[1])}return o}function A(e,t){var r=t.transform,i=e.dpr||1;r?e.setTransform(i*r[0],i*r[1],i*r[2],i*r[3],i*r[4],i*r[5]):e.setTransform(i,0,0,i,0,0)}var P=1,S=2,C=3,B=4;function D(e,t){t.batchFill&&(t.batchFill=!1,e.fill()),t.batchStroke&&(t.batchStroke=!1,e.stroke())}function M(e,t){var r={inHover:!1,viewWidth:0,viewHeight:0,beforeBrushParam:{}};O(e,t,r),W(e,r)}function O(e,t,r){var i=t.transform;if(!t.shouldBePainted(r.viewWidth,r.viewHeight,!1,!1))return t.__dirty&=~c.M,void(t.__isRendered=!1);var n=t.__clipPaths,u=r.prevElClipPaths,y=t.style,w=!1,_=!1;if(u&&!(0,l.KU)(n,u)||(u&&(D(e,r),e.restore(),_=w=!0,r.prevElClipPaths=null,r.allClipped=!1,r.prevEl=null),n&&n.length&&(D(e,r),e.save(),function(e,t,r){for(var i=!1,n=0;n<e.length;n++){var a=e[n];i=i||a.isZeroArea(),A(t,a),t.beginPath(),a.buildPath(t,a.shape),t.clip()}r.allClipped=i}(n,e,r),w=!0,r.prevElClipPaths=n)),r.allClipped)return t.__dirty&=~c.M,void(t.__isRendered=!1);t.beforeBrush&&t.beforeBrush(r.beforeBrushParam),t.innerBeforeBrush();var M=r.prevEl;M||(_=w=!0);var E,F,H=t instanceof o.Ay&&t.autoBatch&&function(e){var t=v(e),r=g(e);return!(e.lineDash||!(+t^+r)||t&&"string"!=typeof e.fill||r&&"string"!=typeof e.stroke||e.strokePercent<1||e.strokeOpacity<1||e.fillOpacity<1)}(y);w||(E=i,F=M.transform,E&&F?E[0]!==F[0]||E[1]!==F[1]||E[2]!==F[2]||E[3]!==F[3]||E[4]!==F[4]||E[5]!==F[5]:E||F)?(D(e,r),A(e,t)):H||D(e,r),t instanceof o.Ay?(r.lastDrawType!==P&&(_=!0,r.lastDrawType=P),T(e,t,M,_,r),H&&(r.batchFill||r.batchStroke)||e.beginPath(),function(e,t,r,i,n){var a,o=g(r),h=v(r),s=r.strokePercent,u=s<1,d=!t.path;t.silent&&!u||!d||t.createPathProxy();var y=t.path||p,w=t.__dirty;if(!i){var _=r.fill,k=r.stroke,T=h&&!!_.colorStops,A=o&&!!k.colorStops,P=h&&!!_.image,S=o&&!!k.image,C=void 0,B=void 0,D=void 0,M=void 0,O=void 0;(T||A)&&(O=t.getBoundingRect()),T&&(C=w?(0,l.Ff)(e,_,O):t.__canvasFillGradient,t.__canvasFillGradient=C),A&&(B=w?(0,l.Ff)(e,k,O):t.__canvasStrokeGradient,t.__canvasStrokeGradient=B),P&&(D=w||!t.__canvasFillPattern?x(e,_,t):t.__canvasFillPattern,t.__canvasFillPattern=D),S&&(M=w||!t.__canvasStrokePattern?x(e,k,t):t.__canvasStrokePattern,t.__canvasStrokePattern=M),T?e.fillStyle=C:P&&(D?e.fillStyle=D:h=!1),A?e.strokeStyle=B:S&&(M?e.strokeStyle=M:o=!1)}var W,E,F=t.getGlobalScale();y.setScale(F[0],F[1],t.segmentIgnoreThreshold),e.setLineDash&&r.lineDash&&(W=(a=f(t))[0],E=a[1]);var H=!0;(d||w&c.Dl)&&(y.setDPR(e.dpr),u?y.setContext(null):(y.setContext(e),H=!1),y.reset(),t.buildPath(y,t.shape,i),y.toStatic(),t.pathUpdated()),H&&y.rebuildPath(e,u?s:1),W&&(e.setLineDash(W),e.lineDashOffset=E),i?(n.batchFill=h,n.batchStroke=o):r.strokeFirst?(o&&b(e,r),h&&m(e,r)):(h&&m(e,r),o&&b(e,r)),W&&e.setLineDash([])}(e,t,y,H,r)):t instanceof s.A?(r.lastDrawType!==C&&(_=!0,r.lastDrawType=C),T(e,t,M,_,r),function(e,t,r){var i,n=r.text;if(null!=n&&(n+=""),n){e.font=r.font||d.OH,e.textAlign=r.textAlign,e.textBaseline=r.textBaseline;var a=void 0,l=void 0;e.setLineDash&&r.lineDash&&(a=(i=f(t))[0],l=i[1]),a&&(e.setLineDash(a),e.lineDashOffset=l),r.strokeFirst?(g(r)&&e.strokeText(n,r.x,r.y),v(r)&&e.fillText(n,r.x,r.y)):(v(r)&&e.fillText(n,r.x,r.y),g(r)&&e.strokeText(n,r.x,r.y)),a&&e.setLineDash([])}}(e,t,y)):t instanceof h.Ay?(r.lastDrawType!==S&&(_=!0,r.lastDrawType=S),function(e,t,r,i,n){k(e,t.style,r&&r.style,i,n)}(e,t,M,_,r),function(e,t,r){var i=t.__image=(0,a.OD)(r.image,t.__image,t,t.onload);if(i&&(0,a.xA)(i)){var n=r.x||0,l=r.y||0,o=t.getWidth(),h=t.getHeight(),s=i.width/i.height;if(null==o&&null!=h?o=h*s:null==h&&null!=o?h=o/s:null==o&&null==h&&(o=i.width,h=i.height),r.sWidth&&r.sHeight){var u=r.sx||0,f=r.sy||0;e.drawImage(i,u,f,r.sWidth,r.sHeight,n,l,o,h)}else if(r.sx&&r.sy){var c=o-(u=r.sx),d=h-(f=r.sy);e.drawImage(i,u,f,c,d,n,l,o,h)}else e.drawImage(i,n,l,o,h)}}(e,t,y)):t.getTemporalDisplayables&&(r.lastDrawType!==B&&(_=!0,r.lastDrawType=B),function(e,t,r){var i=t.getDisplayables(),n=t.getTemporalDisplayables();e.save();var a,l,o={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:r.viewWidth,viewHeight:r.viewHeight,inHover:r.inHover,beforeBrushParam:{}};for(a=t.getCursor(),l=i.length;a<l;a++){(u=i[a]).beforeBrush&&u.beforeBrush(r.beforeBrushParam),u.innerBeforeBrush(),O(e,u,o),u.innerAfterBrush(),u.afterBrush&&u.afterBrush(),o.prevEl=u}W(e,o);for(var h=0,s=n.length;h<s;h++){var u;(u=n[h]).beforeBrush&&u.beforeBrush(r.beforeBrushParam),u.innerBeforeBrush(),O(e,u,o),u.innerAfterBrush(),u.afterBrush&&u.afterBrush(),o.prevEl=u}W(e,o),t.clearTemporalDisplayables(),t.notClear=!0,e.restore()}(e,t,r)),t.innerAfterBrush(),t.afterBrush&&(H&&D(e,r),t.afterBrush()),r.prevEl=t,t.__dirty=0,t.__isRendered=!0}function W(e,t){D(e,t),t.prevElClipPaths&&e.restore()}},97616:function(e,t,r){function i(e){return isFinite(e)}function n(e,t,r){for(var n="radial"===t.type?function(e,t,r){var n=r.width,a=r.height,l=Math.min(n,a),o=null==t.x?.5:t.x,h=null==t.y?.5:t.y,s=null==t.r?.5:t.r;return t.global||(o=o*n+r.x,h=h*a+r.y,s*=l),o=i(o)?o:.5,h=i(h)?h:.5,s=s>=0&&i(s)?s:.5,e.createRadialGradient(o,h,0,o,h,s)}(e,t,r):function(e,t,r){var n=null==t.x?0:t.x,a=null==t.x2?1:t.x2,l=null==t.y?0:t.y,o=null==t.y2?0:t.y2;return t.global||(n=n*r.width+r.x,a=a*r.width+r.x,l=l*r.height+r.y,o=o*r.height+r.y),n=i(n)?n:0,a=i(a)?a:1,l=i(l)?l:0,o=i(o)?o:0,e.createLinearGradient(n,l,a,o)}(e,t,r),a=t.colorStops,l=0;l<a.length;l++)n.addColorStop(a[l].offset,a[l].color);return n}function a(e,t){if(e===t||!e&&!t)return!1;if(!e||!t||e.length!==t.length)return!0;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!0;return!1}function l(e){return parseInt(e,10)}function o(e,t,r){var i=["width","height"][t],n=["clientWidth","clientHeight"][t],a=["paddingLeft","paddingTop"][t],o=["paddingRight","paddingBottom"][t];if(null!=r[i]&&"auto"!==r[i])return parseFloat(r[i]);var h=document.defaultView.getComputedStyle(e);return(e[n]||l(h[i])||l(e.style[i]))-(l(h[a])||0)-(l(h[o])||0)||0}r.d(t,{Ff:function(){return n},KU:function(){return a},YC:function(){return o}})}}]);