iobroker.lovelace
Version:
With this adapter you can build visualization for ioBroker with Home Assistant Lovelace UI
1 lines • 9.09 kB
JavaScript
"use strict";(self.rspackChunkhome_assistant_frontend=self.rspackChunkhome_assistant_frontend||[]).push([[72701],{54202:function(t,e,n){n.d(e,{A:function(){return v}});n(44114);var a=n(52577),d=n(56145);n(62953);function i(t){return"_EC_"+t}var o=function(){function t(t){this.type="graph",this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=t||!1}return t.prototype.isDirected=function(){return this._directed},t.prototype.addNode=function(t,e){t=null==t?""+e:""+t;var n=this._nodesMap;if(!n[i(t)]){var a=new r(t,e);return a.hostGraph=this,this.nodes.push(a),n[i(t)]=a,a}},t.prototype.getNodeByIndex=function(t){var e=this.data.getRawIndex(t);return this.nodes[e]},t.prototype.getNodeById=function(t){return this._nodesMap[i(t)]},t.prototype.addEdge=function(t,e,n){var d=this._nodesMap,o=this._edgesMap;if(a.isNumber(t)&&(t=this.nodes[t]),a.isNumber(e)&&(e=this.nodes[e]),t instanceof r||(t=d[i(t)]),e instanceof r||(e=d[i(e)]),t&&e){var u=t.id+"-"+e.id,h=new s(t,e,n);return h.hostGraph=this,this._directed&&(t.outEdges.push(h),e.inEdges.push(h)),t.edges.push(h),t!==e&&e.edges.push(h),this.edges.push(h),o[u]=h,h}},t.prototype.getEdgeByIndex=function(t){var e=this.edgeData.getRawIndex(t);return this.edges[e]},t.prototype.getEdge=function(t,e){t instanceof r&&(t=t.id),e instanceof r&&(e=e.id);var n=this._edgesMap;return this._directed?n[t+"-"+e]:n[t+"-"+e]||n[e+"-"+t]},t.prototype.eachNode=function(t,e){for(var n=this.nodes,a=n.length,d=0;d<a;d++)n[d].dataIndex>=0&&t.call(e,n[d],d)},t.prototype.eachEdge=function(t,e){for(var n=this.edges,a=n.length,d=0;d<a;d++)n[d].dataIndex>=0&&n[d].node1.dataIndex>=0&&n[d].node2.dataIndex>=0&&t.call(e,n[d],d)},t.prototype.breadthFirstTraverse=function(t,e,n,a){if(e instanceof r||(e=this._nodesMap[i(e)]),e){for(var d="out"===n?"outEdges":"in"===n?"inEdges":"edges",o=0;o<this.nodes.length;o++)this.nodes[o].__visited=!1;if(!t.call(a,e,null))for(var s=[e];s.length;){var u=s.shift(),h=u[d];for(o=0;o<h.length;o++){var c=h[o],g=c.node1===u?c.node2:c.node1;if(!g.__visited){if(t.call(a,g,u))return;s.push(g),g.__visited=!0}}}}},t.prototype.update=function(){for(var t=this.data,e=this.edgeData,n=this.nodes,a=this.edges,d=0,i=n.length;d<i;d++)n[d].dataIndex=-1;for(d=0,i=t.count();d<i;d++)n[t.getRawIndex(d)].dataIndex=d;e.filterSelf(function(t){var n=a[e.getRawIndex(t)];return n.node1.dataIndex>=0&&n.node2.dataIndex>=0});for(d=0,i=a.length;d<i;d++)a[d].dataIndex=-1;for(d=0,i=e.count();d<i;d++)a[e.getRawIndex(d)].dataIndex=d},t.prototype.clone=function(){for(var e=new t(this._directed),n=this.nodes,a=this.edges,d=0;d<n.length;d++)e.addNode(n[d].id,n[d].dataIndex);for(d=0;d<a.length;d++){var i=a[d];e.addEdge(i.node1.id,i.node2.id,i.dataIndex)}return e},t}(),r=function(){function t(t,e){this.inEdges=[],this.outEdges=[],this.edges=[],this.dataIndex=-1,this.id=null==t?"":t,this.dataIndex=null==e?-1:e}return t.prototype.degree=function(){return this.edges.length},t.prototype.inDegree=function(){return this.inEdges.length},t.prototype.outDegree=function(){return this.outEdges.length},t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.data.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){for(var t={edge:[],node:[]},e=0;e<this.edges.length;e++){var n=this.edges[e];n.dataIndex<0||(t.edge.push(n.dataIndex),t.node.push(n.node1.dataIndex,n.node2.dataIndex))}return t},t.prototype.getTrajectoryDataIndices=function(){for(var t=a.createHashMap(),e=a.createHashMap(),n=0,d=this.edges.length;n<d;n++){var i=this.edges[n];if(!(i.dataIndex<0)){t.set(i.dataIndex,!0);for(var o=[i.node1],r=[i.node2],s=0;s<o.length;){var u=o[s];s++,e.set(u.dataIndex,!0);for(var h=u.inEdges,c=0,g=h.length,f=void 0,p=void 0;c<g;c++)(p=(f=h[c]).dataIndex)>=0&&!t.hasKey(p)&&(t.set(p,!0),o.push(f.node1))}for(s=0;s<r.length;){var l=r[s];s++,e.set(l.dataIndex,!0);for(var v=l.outEdges,I=(c=0,v.length),x=void 0,y=void 0;c<I;c++)(y=(x=v[c]).dataIndex)>=0&&!t.hasKey(y)&&(t.set(y,!0),r.push(x.node2))}}}return{edge:t.keys(),node:e.keys()}},t}(),s=function(){function t(t,e,n){this.dataIndex=-1,this.node1=t,this.node2=e,this.dataIndex=null==n?-1:n}return t.prototype.getModel=function(t){if(!(this.dataIndex<0))return this.hostGraph.edgeData.getItemModel(this.dataIndex).getModel(t)},t.prototype.getAdjacentDataIndices=function(){return{edge:[this.dataIndex],node:[this.node1.dataIndex,this.node2.dataIndex]}},t.prototype.getTrajectoryDataIndices=function(){var t=a.createHashMap(),e=a.createHashMap();t.set(this.dataIndex,!0);for(var n=[this.node1],d=[this.node2],i=0;i<n.length;){var o=n[i];i++,e.set(o.dataIndex,!0);for(var r=0,s=o.inEdges.length,u=void 0,h=void 0;r<s;r++)(h=(u=o.inEdges[r]).dataIndex)>=0&&!t.hasKey(h)&&(t.set(h,!0),n.push(u.node1))}for(i=0;i<d.length;){var c=d[i];i++,e.set(c.dataIndex,!0);r=0,s=c.outEdges.length;for(var g=void 0,f=void 0;r<s;r++)(f=(g=c.outEdges[r]).dataIndex)>=0&&!t.hasKey(f)&&(t.set(f,!0),d.push(g.node2))}return{edge:t.keys(),node:e.keys()}},t}();function u(t,e){return{getValue:function(n){var a=this[t][e];return a.getStore().get(a.getDimensionIndex(n||"value"),this.dataIndex)},setVisual:function(n,a){this.dataIndex>=0&&this[t][e].setItemVisual(this.dataIndex,n,a)},getVisual:function(n){return this[t][e].getItemVisual(this.dataIndex,n)},setLayout:function(n,a){this.dataIndex>=0&&this[t][e].setItemLayout(this.dataIndex,n,a)},getLayout:function(){return this[t][e].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[t][e].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[t][e].getRawIndex(this.dataIndex)}}}a.mixin(r,u("hostGraph","data")),a.mixin(s,u("hostGraph","edgeData"));var h=o,c=n(7770),g=n(6166),f=n(71034),p=n(87717),l=n(6471);function v(t,e,n,i,o){for(var r=new h(i),s=0;s<t.length;s++)r.addNode(a.retrieve(t[s].id,t[s].name,s),s);var u=[],v=[],I=0;for(s=0;s<e.length;s++){var x=e[s],y=x.source,m=x.target;r.addEdge(y,m,I)&&(v.push(x),u.push(a.retrieve((0,l.vS)(x.id,null),y+" > "+m)),I++)}var E,D=n.get("coordinateSystem");if("cartesian2d"===D||"polar"===D||"matrix"===D)E=(0,p.A)(t,n);else{var _=f.Ay.get(D),A=_&&_.dimensions||[];a.indexOf(A,"value")<0&&A.concat(["value"]);var M=(0,g.A)(t,{coordDimensions:A,encodeDefine:n.getEncode()}).dimensions;(E=new d.A(M,n)).initData(t)}var w=new d.A(["value"],n);return w.initData(v,u),o&&o(E,w),(0,c.A)({mainData:E,struct:r,structAttr:"graph",datas:{node:E,edge:w},datasAttr:{node:"data",edge:"edgeData"}}),r.update(),r}},42605:function(t,e,n){n.d(e,{Bs:function(){return g},LZ:function(){return p},QB:function(){return h},ao:function(){return l},jg:function(){return u}});var a=n(66834),d=n(11975),i=n(26322),o=n(35723),r=n(6471),s=n(52577);function u(t,e,n,o,r,u,h,c){function g(n){var a=t.mainType,o=(0,i.payloadDisableAnimation)((0,s.defaults)({type:f(a,t.subType,d.Ev)},n));c&&(o.componentType=a),o[a+"Id"]=t.id,e.dispatchAction(o)}(0,a.Nl)(t)?(n.enable((0,s.retrieve2)(t.get("roam"),h),{api:e,zInfo:{component:t},triggerInfo:{roamTrigger:t.get("roamTrigger"),isInSelf:o,isInClip:function(t,e,n){return!r||r.contain(e,n)}}}),n.off("pan").off("zoom").on("pan",function(t){u&&u("pan"),g({dx:t.dx,dy:t.dy})}).on("zoom",function(t){u&&u("zoom"),g({zoom:t.scale,originX:t.originX,originY:t.originY})})):n.disable()}function h(t){return function(e,n,a){return c.copy(t.getBoundingRect()),c.applyTransform(t.getComputedTransform()),c.contain(n,a)}}var c=new o.Ay(0,0,0,0);function g(t,e,n){var i=f(e,n,d.Ev);t.registerAction({type:i,event:i,update:"none"},function(t,d,i){d.eachComponent((0,r.dr)(t,e,n),function(e){(0,a.X$)(t,e),(0,a.jR)(t,e,d,i)})})}function f(t,e,n){return(t!==d.t7?t:"map"===e?"geo":e)+n}function p(t){return null!=t.zoom}function l(t,e,n,d,i,o,r){var s=new a.Ay(null,(0,a.kx)(t.ecModel,e));return(0,a.Q3)(s,n,d,i,o),r?(0,a.Xj)(s,r.x,r.y,r.width,r.height):(0,a.Xj)(s,n,d,i,o),(0,a.dh)(s,t),s}},7770:function(t,e,n){var a=n(52577),d=(0,n(6471).$r)();function i(t,e){if(d(i=this).mainData===i){var n=(0,a.extend)({},d(this).datas);n[this.dataType]=e,h(e,n,t)}else c(e,this.dataType,d(this).mainData,t);var i;return e}function o(t,e){return t.struct&&t.struct.update(),e}function r(t,e){return(0,a.each)(d(e).datas,function(n,a){n!==e&&c(n.cloneShallow(),a,e,t)}),e}function s(t){var e=d(this).mainData;return null==t||null==e?e:d(e).datas[t]}function u(){var t=d(this).mainData;return null==t?[{data:t}]:(0,a.map)((0,a.keys)(d(t).datas),function(e){return{type:e,data:d(t).datas[e]}})}function h(t,e,n){d(t).datas={},(0,a.each)(e,function(e,a){c(e,a,t,n)})}function c(t,e,n,a){d(n).datas[e]=t,d(t).mainData=n,t.dataType=e,a.struct&&(t[a.structAttr]=a.struct,a.struct[a.datasAttr[e]]=t),t.getLinkedData=s,t.getLinkedDataAll=u}e.A=function(t){var e=t.mainData,n=t.datas;n||(n={main:e},t.datasAttr={main:"data"}),t.datas=t.mainData=null,h(e,n,t),(0,a.each)(n,function(n){(0,a.each)(e.TRANSFERABLE_METHODS,function(e){n.wrapMethod(e,(0,a.curry)(i,t))})}),e.wrapMethod("cloneShallow",(0,a.curry)(r,t)),(0,a.each)(e.CHANGABLE_METHODS,function(n){e.wrapMethod(n,(0,a.curry)(o,t))}),(0,a.assert)(n[e.dataType]===e)}}}]);