UNPKG

iobroker.plenticore-g3

Version:

Adapter to communicate with a KOSTAL Plenticore Plus via local network (non-modbus)

2 lines 1.8 MB
/*! For license information please see main.673c8b1d.js.LICENSE.txt */ (()=>{var e={7725(e,t,r){"use strict";r.d(t,{A:()=>oe});var n=r(5236),o=Math.abs,a=String.fromCharCode,i=Object.assign;function s(e){return e.trim()}function l(e,t,r){return e.replace(t,r)}function c(e,t){return e.indexOf(t)}function d(e,t){return 0|e.charCodeAt(t)}function u(e,t,r){return e.slice(t,r)}function p(e){return e.length}function h(e){return e.length}function m(e,t){return t.push(e),e}var f=1,v=1,g=0,y=0,b=0,_="";function w(e,t,r,n,o,a,i){return{value:e,root:t,parent:r,type:n,props:o,children:a,line:f,column:v,length:i,return:""}}function x(e,t){return i(w("",null,null,"",null,null,0),e,{length:-e.length},t)}function S(){return b=y>0?d(_,--y):0,v--,10===b&&(v=1,f--),b}function A(){return b=y<g?d(_,y++):0,v++,10===b&&(v=1,f++),b}function k(){return d(_,y)}function C(){return y}function E(e,t){return u(_,e,t)}function T(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function O(e){return f=v=1,g=p(_=e),y=0,[]}function j(e){return _="",e}function D(e){return s(E(y-1,I(91===e?e+2:40===e?e+1:e)))}function N(e){for(;(b=k())&&b<33;)A();return T(e)>2||T(b)>3?"":" "}function M(e,t){for(;--t&&A()&&!(b<48||b>102||b>57&&b<65||b>70&&b<97););return E(e,C()+(t<6&&32==k()&&32==A()))}function I(e){for(;A();)switch(b){case e:return y;case 34:case 39:34!==e&&39!==e&&I(b);break;case 40:41===e&&I(e);break;case 92:A()}return y}function z(e,t){for(;A()&&e+b!==57&&(e+b!==84||47!==k()););return"/*"+E(t,y-1)+"*"+a(47===e?e:A())}function P(e){for(;!T(k());)A();return E(e,y)}var R="-ms-",F="-moz-",L="-webkit-",B="comm",W="rule",q="decl",H="@keyframes";function U(e,t){for(var r="",n=h(e),o=0;o<n;o++)r+=t(e[o],o,e,t)||"";return r}function V(e,t,r,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case q:return e.return=e.return||e.value;case B:return"";case H:return e.return=e.value+"{"+U(e.children,n)+"}";case W:e.value=e.props.join(",")}return p(r=U(e.children,n))?e.return=e.value+"{"+r+"}":""}function X(e){return j($("",null,null,null,[""],e=O(e),0,[0],e))}function $(e,t,r,n,o,i,s,u,h){for(var f=0,v=0,g=s,y=0,b=0,_=0,w=1,x=1,E=1,T=0,O="",j=o,I=i,R=n,F=O;x;)switch(_=T,T=A()){case 40:if(108!=_&&58==d(F,g-1)){-1!=c(F+=l(D(T),"&","&\f"),"&\f")&&(E=-1);break}case 34:case 39:case 91:F+=D(T);break;case 9:case 10:case 13:case 32:F+=N(_);break;case 92:F+=M(C()-1,7);continue;case 47:switch(k()){case 42:case 47:m(G(z(A(),C()),t,r),h);break;default:F+="/"}break;case 123*w:u[f++]=p(F)*E;case 125*w:case 59:case 0:switch(T){case 0:case 125:x=0;case 59+v:-1==E&&(F=l(F,/\f/g,"")),b>0&&p(F)-g&&m(b>32?Y(F+";",n,r,g-1):Y(l(F," ","")+";",n,r,g-2),h);break;case 59:F+=";";default:if(m(R=J(F,t,r,f,v,o,u,O,j=[],I=[],g),i),123===T)if(0===v)$(F,t,R,R,j,i,g,u,I);else switch(99===y&&110===d(F,3)?100:y){case 100:case 108:case 109:case 115:$(e,R,R,n&&m(J(e,R,R,0,0,o,u,O,o,j=[],g),I),o,I,g,u,n?j:I);break;default:$(F,R,R,R,[""],I,0,u,I)}}f=v=b=0,w=E=1,O=F="",g=s;break;case 58:g=1+p(F),b=_;default:if(w<1)if(123==T)--w;else if(125==T&&0==w++&&125==S())continue;switch(F+=a(T),T*w){case 38:E=v>0?1:(F+="\f",-1);break;case 44:u[f++]=(p(F)-1)*E,E=1;break;case 64:45===k()&&(F+=D(A())),y=k(),v=g=p(O=F+=P(C())),T++;break;case 45:45===_&&2==p(F)&&(w=0)}}return i}function J(e,t,r,n,a,i,c,d,p,m,f){for(var v=a-1,g=0===a?i:[""],y=h(g),b=0,_=0,x=0;b<n;++b)for(var S=0,A=u(e,v+1,v=o(_=c[b])),k=e;S<y;++S)(k=s(_>0?g[S]+" "+A:l(A,/&\f/g,g[S])))&&(p[x++]=k);return w(e,t,r,0===a?W:d,p,m,f)}function G(e,t,r){return w(e,t,r,B,a(b),u(e,2,-2),0)}function Y(e,t,r,n){return w(e,t,r,q,u(e,0,n),u(e,n+1,-1),n)}var K=function(e,t,r){for(var n=0,o=0;n=o,o=k(),38===n&&12===o&&(t[r]=1),!T(o);)A();return E(e,y)},Z=function(e,t){return j(function(e,t){var r=-1,n=44;do{switch(T(n)){case 0:38===n&&12===k()&&(t[r]=1),e[r]+=K(y-1,t,r);break;case 2:e[r]+=D(n);break;case 4:if(44===n){e[++r]=58===k()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=a(n)}}while(n=A());return e}(O(e),t))},Q=new WeakMap,ee=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Q.get(r))&&!n){Q.set(e,!0);for(var o=[],a=Z(t,o),i=r.props,s=0,l=0;s<a.length;s++)for(var c=0;c<i.length;c++,l++)e.props[l]=o[s]?a[s].replace(/&\f/g,i[c]):i[c]+" "+a[s]}}},te=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function re(e,t){switch(function(e,t){return 45^d(e,0)?(((t<<2^d(e,0))<<2^d(e,1))<<2^d(e,2))<<2^d(e,3):0}(e,t)){case 5103:return L+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return L+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return L+e+F+e+R+e+e;case 6828:case 4268:return L+e+R+e+e;case 6165:return L+e+R+"flex-"+e+e;case 5187:return L+e+l(e,/(\w+).+(:[^]+)/,L+"box-$1$2"+R+"flex-$1$2")+e;case 5443:return L+e+R+"flex-item-"+l(e,/flex-|-self/,"")+e;case 4675:return L+e+R+"flex-line-pack"+l(e,/align-content|flex-|-self/,"")+e;case 5548:return L+e+R+l(e,"shrink","negative")+e;case 5292:return L+e+R+l(e,"basis","preferred-size")+e;case 6060:return L+"box-"+l(e,"-grow","")+L+e+R+l(e,"grow","positive")+e;case 4554:return L+l(e,/([^-])(transform)/g,"$1"+L+"$2")+e;case 6187:return l(l(l(e,/(zoom-|grab)/,L+"$1"),/(image-set)/,L+"$1"),e,"")+e;case 5495:case 3959:return l(e,/(image-set\([^]*)/,L+"$1$`$1");case 4968:return l(l(e,/(.+:)(flex-)?(.*)/,L+"box-pack:$3"+R+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+L+e+e;case 4095:case 3583:case 4068:case 2532:return l(e,/(.+)-inline(.+)/,L+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(p(e)-1-t>6)switch(d(e,t+1)){case 109:if(45!==d(e,t+4))break;case 102:return l(e,/(.+:)(.+)-([^]+)/,"$1"+L+"$2-$3$1"+F+(108==d(e,t+3)?"$3":"$2-$3"))+e;case 115:return~c(e,"stretch")?re(l(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==d(e,t+1))break;case 6444:switch(d(e,p(e)-3-(~c(e,"!important")&&10))){case 107:return l(e,":",":"+L)+e;case 101:return l(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+L+(45===d(e,14)?"inline-":"")+"box$3$1"+L+"$2$3$1"+R+"$2box$3")+e}break;case 5936:switch(d(e,t+11)){case 114:return L+e+R+l(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return L+e+R+l(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return L+e+R+l(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return L+e+R+e+e}return e}var ne=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case q:e.return=re(e.value,e.length);break;case H:return U([x(e,{value:l(e.value,"@","@"+L)})],n);case W:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return U([x(e,{props:[l(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return U([x(e,{props:[l(t,/:(plac\w+)/,":"+L+"input-$1")]}),x(e,{props:[l(t,/:(plac\w+)/,":-moz-$1")]}),x(e,{props:[l(t,/:(plac\w+)/,R+"input-$1")]})],n)}return""})}}],oe=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var o,a,i=e.stylisPlugins||ne,s={},l=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r<t.length;r++)s[t[r]]=!0;l.push(e)});var c,d,u=[V,(d=function(e){c.insert(e)},function(e){e.root||(e=e.return)&&d(e)})],p=function(e){var t=h(e);return function(r,n,o,a){for(var i="",s=0;s<t;s++)i+=e[s](r,n,o,a)||"";return i}}([ee,te].concat(i,u));a=function(e,t,r,n){c=r,U(X(e?e+"{"+t.styles+"}":t.styles),p),n&&(m.inserted[t.name]=!0)};var m={key:t,sheet:new n.v({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:a};return m.sheet.hydrate(l),m}},918(e,t,r){"use strict";function n(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}r.d(t,{A:()=>n})},9369(e,t,r){"use strict";r.d(t,{C:()=>c,E:()=>v,T:()=>u,c:()=>m,h:()=>p,w:()=>d});var n=r(5043),o=r(7725),a=r(1722),i=r(6598),s=r(7055),l=n.createContext("undefined"!==typeof HTMLElement?(0,o.A)({key:"css"}):null),c=l.Provider,d=function(e){return(0,n.forwardRef)(function(t,r){var o=(0,n.useContext)(l);return e(t,o,r)})},u=n.createContext({});var p={}.hasOwnProperty,h="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",m=function(e,t){var r={};for(var n in t)p.call(t,n)&&(r[n]=t[n]);return r[h]=e,r},f=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return(0,a.SF)(t,r,n),(0,s.s)(function(){return(0,a.sk)(t,r,n)}),null},v=d(function(e,t,r){var o=e.css;"string"===typeof o&&void 0!==t.registered[o]&&(o=t.registered[o]);var s=e[h],l=[o],c="";"string"===typeof e.className?c=(0,a.Rk)(t.registered,l,e.className):null!=e.className&&(c=e.className+" ");var d=(0,i.J)(l,void 0,n.useContext(u));c+=t.key+"-"+d.name;var m={};for(var v in e)p.call(e,v)&&"css"!==v&&v!==h&&(m[v]=e[v]);return m.className=c,r&&(m.ref=r),n.createElement(n.Fragment,null,n.createElement(f,{cache:t,serialized:d,isStringTag:"string"===typeof s}),n.createElement(s,m))})},3290(e,t,r){"use strict";r.d(t,{AH:()=>d,i7:()=>u,mL:()=>c});var n=r(9369),o=r(5043),a=r(1722),i=r(7055),s=r(6598),l=(r(7725),r(219),function(e,t){var r=arguments;if(null==t||!n.h.call(t,"css"))return o.createElement.apply(void 0,r);var a=r.length,i=new Array(a);i[0]=n.E,i[1]=(0,n.c)(e,t);for(var s=2;s<a;s++)i[s]=r[s];return o.createElement.apply(null,i)});!function(e){var t;t||(t=e.JSX||(e.JSX={}))}(l||(l={}));var c=(0,n.w)(function(e,t){var r=e.styles,l=(0,s.J)([r],void 0,o.useContext(n.T)),c=o.useRef();return(0,i.i)(function(){var e=t.key+"-global",r=new t.sheet.constructor({key:e,nonce:t.sheet.nonce,container:t.sheet.container,speedy:t.sheet.isSpeedy}),n=!1,o=document.querySelector('style[data-emotion="'+e+" "+l.name+'"]');return t.sheet.tags.length&&(r.before=t.sheet.tags[0]),null!==o&&(n=!0,o.setAttribute("data-emotion",e),r.hydrate([o])),c.current=[r,n],function(){r.flush()}},[t]),(0,i.i)(function(){var e=c.current,r=e[0];if(e[1])e[1]=!1;else{if(void 0!==l.next&&(0,a.sk)(t,l.next,!0),r.tags.length){var n=r.tags[r.tags.length-1].nextElementSibling;r.before=n,r.flush()}t.insert("",l,r,!1)}},[t,l.name]),null});function d(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,s.J)(t)}function u(){var e=d.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}},6598(e,t,r){"use strict";r.d(t,{J:()=>m});var n={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},o=r(918),a=/[A-Z]|^ms/g,i=/_EMO_([^_]+?)_([^]*?)_EMO_/g,s=function(e){return 45===e.charCodeAt(1)},l=function(e){return null!=e&&"boolean"!==typeof e},c=(0,o.A)(function(e){return s(e)?e:e.replace(a,"-$&").toLowerCase()}),d=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(i,function(e,t,r){return p={name:t,styles:r,next:p},t})}return 1===n[e]||s(e)||"number"!==typeof t||0===t?t:t+"px"};function u(e,t,r){if(null==r)return"";var n=r;if(void 0!==n.__emotion_styles)return n;switch(typeof r){case"boolean":return"";case"object":var o=r;if(1===o.anim)return p={name:o.name,styles:o.styles,next:p},o.name;var a=r;if(void 0!==a.styles){var i=a.next;if(void 0!==i)for(;void 0!==i;)p={name:i.name,styles:i.styles,next:p},i=i.next;return a.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=u(e,t,r[o])+";";else for(var a in r){var i=r[a];if("object"!==typeof i){var s=i;null!=t&&void 0!==t[s]?n+=a+"{"+t[s]+"}":l(s)&&(n+=c(a)+":"+d(a,s)+";")}else if(!Array.isArray(i)||"string"!==typeof i[0]||null!=t&&void 0!==t[i[0]]){var p=u(e,t,i);switch(a){case"animation":case"animationName":n+=c(a)+":"+p+";";break;default:n+=a+"{"+p+"}"}}else for(var h=0;h<i.length;h++)l(i[h])&&(n+=c(a)+":"+d(a,i[h])+";")}return n}(e,t,r);case"function":if(void 0!==e){var s=p,h=r(e);return p=s,u(e,t,h)}}var m=r;if(null==t)return m;var f=t[m];return void 0!==f?f:m}var p,h=/label:\s*([^\s;{]+)\s*(;|$)/g;function m(e,t,r){if(1===e.length&&"object"===typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,o="";p=void 0;var a=e[0];null==a||void 0===a.raw?(n=!1,o+=u(r,t,a)):o+=a[0];for(var i=1;i<e.length;i++){if(o+=u(r,t,e[i]),n)o+=a[i]}h.lastIndex=0;for(var s,l="";null!==(s=h.exec(o));)l+="-"+s[1];var c=function(e){for(var t,r=0,n=0,o=e.length;o>=4;++n,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(o){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)}(o)+l;return{name:c,styles:o,next:p}}},5236(e,t,r){"use strict";r.d(t,{v:()=>n});var n=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{r.insertRule(e,r.cssRules.length)}catch(n){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}()},5903(e,t,r){"use strict";r.d(t,{A:()=>v});var n=r(8168),o=r(9369),a=r(6598),i=r(7055),s=r(1722),l=r(5043),c=r(918),d=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|popover|popoverTarget|popoverTargetAction|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,u=(0,c.A)(function(e){return d.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),p=function(e){return"theme"!==e},h=function(e){return"string"===typeof e&&e.charCodeAt(0)>96?u:p},m=function(e,t,r){var n;if(t){var o=t.shouldForwardProp;n=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!==typeof n&&r&&(n=e.__emotion_forwardProp),n},f=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return(0,s.SF)(t,r,n),(0,i.s)(function(){return(0,s.sk)(t,r,n)}),null},v=function e(t,r){var i,c,d=t.__emotion_real===t,u=d&&t.__emotion_base||t;void 0!==r&&(i=r.label,c=r.target);var p=m(t,r,d),v=p||h(u),g=!v("as");return function(){var y=arguments,b=d&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==i&&b.push("label:"+i+";"),null==y[0]||void 0===y[0].raw)b.push.apply(b,y);else{var _=y[0];b.push(_[0]);for(var w=y.length,x=1;x<w;x++)b.push(y[x],_[x])}var S=(0,o.w)(function(e,t,r){var n=g&&e.as||u,i="",d=[],m=e;if(null==e.theme){for(var y in m={},e)m[y]=e[y];m.theme=l.useContext(o.T)}"string"===typeof e.className?i=(0,s.Rk)(t.registered,d,e.className):null!=e.className&&(i=e.className+" ");var _=(0,a.J)(b.concat(d),t.registered,m);i+=t.key+"-"+_.name,void 0!==c&&(i+=" "+c);var w=g&&void 0===p?h(n):v,x={};for(var S in e)g&&"as"===S||w(S)&&(x[S]=e[S]);return x.className=i,r&&(x.ref=r),l.createElement(l.Fragment,null,l.createElement(f,{cache:t,serialized:_,isStringTag:"string"===typeof n}),l.createElement(n,x))});return S.displayName=void 0!==i?i:"Styled("+("string"===typeof u?u:u.displayName||u.name||"Component")+")",S.defaultProps=t.defaultProps,S.__emotion_real=S,S.__emotion_base=u,S.__emotion_styles=b,S.__emotion_forwardProp=p,Object.defineProperty(S,"toString",{value:function(){return"."+c}}),S.withComponent=function(t,o){return e(t,(0,n.A)({},r,o,{shouldForwardProp:m(S,o,!0)})).apply(void 0,b)},S}}.bind(null);["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){v[e]=v(e)})},7055(e,t,r){"use strict";var n;r.d(t,{i:()=>s,s:()=>i});var o=r(5043),a=!!(n||(n=r.t(o,2))).useInsertionEffect&&(n||(n=r.t(o,2))).useInsertionEffect,i=a||function(e){return e()},s=a||o.useLayoutEffect},1722(e,t,r){"use strict";r.d(t,{Rk:()=>n,SF:()=>o,sk:()=>a});function n(e,t,r){var n="";return r.split(" ").forEach(function(r){void 0!==e[r]?t.push(e[r]+";"):r&&(n+=r+" ")}),n}var o=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},a=function(e,t,r){o(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do{e.insert(t===a?"."+n:"",a,e.sheet,!0),a=a.next}while(void 0!==a)}}},4371(e,t,r){"use strict";var n,o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a=r(5043),i=(n=a)&&n.__esModule?n:{default:n};t.A=function(e){var t=e.fill,r=void 0===t?"currentColor":t,n=e.width,a=void 0===n?24:n,s=e.height,l=void 0===s?24:s,c=e.style,d=void 0===c?{}:c,u=function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["fill","width","height","style"]);return i.default.createElement("svg",o({viewBox:"0 0 24 24",style:o({fill:r,width:a,height:l},d)},u),i.default.createElement("path",{d:"M21,7L9,19L3.5,13.5L4.91,12.09L9,16.17L19.59,5.59L21,7Z"}))}},9128(e,t,r){"use strict";var n,o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},a=r(5043),i=(n=a)&&n.__esModule?n:{default:n};t.A=function(e){var t=e.fill,r=void 0===t?"currentColor":t,n=e.width,a=void 0===n?24:n,s=e.height,l=void 0===s?24:s,c=e.style,d=void 0===c?{}:c,u=function(e,t){var r={};for(var n in e)t.indexOf(n)>=0||Object.prototype.hasOwnProperty.call(e,n)&&(r[n]=e[n]);return r}(e,["fill","width","height","style"]);return i.default.createElement("svg",o({viewBox:"0 0 24 24",style:o({fill:r,width:a,height:l},d)},u),i.default.createElement("path",{d:"M12,18.17L8.83,15L7.42,16.41L12,21L16.59,16.41L15.17,15M12,5.83L15.17,9L16.58,7.59L12,3L7.41,7.59L8.83,9L12,5.83Z"}))}},4090(e,t,r){"use strict";r.d(t,{Ju:()=>fs,F2:()=>ui,aH:()=>si,gu:()=>Yg,Ix:()=>li});var n,o,a=r(9379),i=r(8813),s=r(4467),l=r(5043),c=r.t(l,2);function d(e){var t;return null!==(t=null===e||void 0===e?void 0:e.rows.map(e=>e.value).filter(e=>!!e))&&void 0!==t?t:[]}function u(e){var t;return null!==(t=e)&&void 0!==t&&t.startsWith("system.host.")||(e="system.host.".concat(e)),e}function p(e){return new Promise(t=>{setTimeout(t,e)})}function h(e){const t="*"===(e=(e||"").toString())[0],r="*"===e[e.length-1];return(t?"":"^")+(e=e.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*"))+(r?"":"$")}"undefined"!==typeof globalThis.process&&(globalThis.location||(globalThis.location={href:"http://localhost:8081/",protocol:"http:",host:"localhost:8081",pathname:"/",hostname:"localhost",reload:()=>{}}),globalThis.localStorage||(globalThis.localStorage={_keys:{},setItem:(e,t)=>{globalThis.localStorage._keys[e]=t},getItem:e=>e in globalThis.localStorage._keys?globalThis.localStorage._keys[e]:null,removeItem:e=>{e in globalThis.localStorage._keys&&delete globalThis.localStorage._keys[e]}}),globalThis.sessionStorage||(globalThis.sessionStorage=globalThis.localStorage),globalThis.navigator||(globalThis.navigator={language:"en"})),function(e){e[e.CONNECTING=0]="CONNECTING",e[e.CONNECTED=1]="CONNECTED",e[e.OBJECTS_LOADED=2]="OBJECTS_LOADED",e[e.READY=3]="READY"}(n||(n={})),function(e){e.PERMISSION_ERROR="permissionError",e.NOT_CONNECTED="notConnectedError",e.TIMEOUT="timeout",e.NOT_ADMIN="Allowed only in admin",e.NOT_SUPPORTED="Not supported"}(o||(o={}));o.PERMISSION_ERROR,o.NOT_CONNECTED;const m=["material","echarts","vis"];class f{constructor(e){(0,s.A)(this,"props",void 0),(0,s.A)(this,"connId",void 0),(0,s.A)(this,"lastAccessToken",null),(0,s.A)(this,"ignoreState",""),(0,s.A)(this,"connected",!1),(0,s.A)(this,"subscribed",!1),(0,s.A)(this,"firstConnect",!0),(0,s.A)(this,"waitForRestart",!1),(0,s.A)(this,"loaded",!1),(0,s.A)(this,"simStates",{}),(0,s.A)(this,"objectViewCached",void 0),(0,s.A)(this,"statesSubscribes",{}),(0,s.A)(this,"filesSubscribes",{}),(0,s.A)(this,"objectsSubscribes",{}),(0,s.A)(this,"objects",{}),(0,s.A)(this,"states",{}),(0,s.A)(this,"acl",null),(0,s.A)(this,"isSecure",!1),(0,s.A)(this,"onReadyDone",!1),(0,s.A)(this,"onConnectionHandlers",[]),(0,s.A)(this,"onLogHandlers",[]),(0,s.A)(this,"onCmdStdoutHandler",void 0),(0,s.A)(this,"onCmdStderrHandler",void 0),(0,s.A)(this,"onCmdExitHandler",void 0),(0,s.A)(this,"_socket",void 0),(0,s.A)(this,"_waitForSocketPromise",void 0),(0,s.A)(this,"_waitForFirstConnectionPromise",function(){let e,t;const r=new Promise((r,n)=>{e=r,t=n});return r.resolve=e,r.reject=t,r}()),(0,s.A)(this,"_instanceSubscriptions",{}),(0,s.A)(this,"_promises",{}),(0,s.A)(this,"_authTimer",null),(0,s.A)(this,"_refreshTimer",null),(0,s.A)(this,"_systemConfig",void 0),(0,s.A)(this,"systemLang","en"),(0,s.A)(this,"onAccessTokenUpdated",e=>{if("iob_tokens"===e.key){const e=f.readTokens();e&&(console.log("Tab ".concat(this.connId," received updated token: ").concat(e.access_token)),this.updateTokenExpiration(e.access_token))}}),this.props=this.applyDefaultProps(e),this.connId="".concat(this.props.name?"".concat(this.props.name,"-"):"").concat(Math.round(1e6*Math.random()).toString().padStart(6,"0")),this.waitForSocketLib().then(()=>this.startSocket()).catch(e=>{alert("Socket connection could not be initialized: ".concat(e))})}applyDefaultProps(e){var t,r,n,o;return(0,a.A)((0,a.A)({},e),{},{protocol:e.protocol||globalThis.location.protocol,host:e.host||globalThis.location.hostname,port:e.port||("3000"===globalThis.location.port?8081:globalThis.location.port),ioTimeout:Math.max(e.ioTimeout||2e4,2e4),cmdTimeout:Math.max(e.cmdTimeout||5e3,5e3),admin5only:e.admin5only||!1,autoSubscribes:null!==(t=e.autoSubscribes)&&void 0!==t?t:[],autoSubscribeLog:null!==(r=e.autoSubscribeLog)&&void 0!==r&&r,doNotLoadACL:null===(n=e.doNotLoadACL)||void 0===n||n,doNotLoadAllObjects:null===(o=e.doNotLoadAllObjects)||void 0===o||o})}onError(e){var t;(null!==(t=this.props.onError)&&void 0!==t?t:console.error)(e)}get systemConfig(){return this._systemConfig}static isWeb(){return void 0!==globalThis.socketUrl}waitForSocketLib(){return this._waitForSocketPromise||(this._waitForSocketPromise=new Promise(async(e,t)=>{if(this.props.connect)e();else if("undefined"===typeof globalThis.io&&"undefined"===typeof globalThis.iob)if("function"===typeof globalThis.registerSocketOnLoad)globalThis.registerSocketOnLoad(()=>e());else{for(let t=1;t<=30;t++){if(globalThis.io||globalThis.iob)return e();await p(100)}t(new Error("Socket library could not be loaded!"))}else e()})),this._waitForSocketPromise}async startSocket(){if(this._socket)return;let e=this.props.host,t=this.props.port,r=(this.props.protocol||globalThis.location.protocol).replace(":",""),o=globalThis.location.pathname;if("iobroker.net"===globalThis.location.hostname||"iobroker.pro"===globalThis.location.hostname)o="";else{if(globalThis.socketUrl){const n=new globalThis.URL(globalThis.socketUrl);e=n.hostname,t=n.port,r=n.protocol.replace(":","")}const n=o.lastIndexOf("/");if(-1!==n&&(o=o.substring(0,n+1)),f.isWeb()){const e=o.split("/");e.length>2&&(e.pop(),e.pop(),m.includes(e[e.length-1])&&e.pop(),o=e.join("/"),o.endsWith("/")||(o+="/"))}}const a=t?"".concat(r,"://").concat(e,":").concat(t):"".concat(r,"://").concat(e),s=this.props.connect||(globalThis.io||globalThis.iob).connect;return this._socket=s(a,{path:o.endsWith("/")?"".concat(o,"socket.io"):"".concat(o,"/socket.io"),query:"ws=true",name:this.props.name,timeout:this.props.ioTimeout,uuid:this.props.uuid,token:this.props.token}),this._socket.on("connect",e=>{var t;null===(t=globalThis.addEventListener)||void 0===t||t.call(globalThis,"storage",this.onAccessTokenUpdated);const r=f.readTokens();if(r&&!r.owner){const e=Date.now();this.saveTokens({access_token:r.access_token,refresh_token:r.refresh_token,expires_in:Math.round((r.expires_in.getTime()-e)/1e3),refresh_token_expires_in:Math.round((r.refresh_token_expires_in.getTime()-e)/1e3),token_type:"Bearer"},r.stayLoggedIn)}this.onReadyDone=!1,!0!==e?(this.connected=!0,setTimeout(()=>this.getVersion().then(e=>{const t=e.version.split("."),r=(0,i.A)(t,3),n=r[0],o=r[1],a=r[2];1e4*parseInt(n,10)+100*parseInt(o,10)+parseInt(a,10)<40102?(this._authTimer=null,this.onPreConnect(!1,!1)):this._socket.emit("authenticate",(e,t)=>this.onPreConnect(e,t))}).catch(e=>this.onError({message:e.toString(),operation:"getVersion"})),500)):this._socket.emit("authenticate",(e,t)=>{this.onPreConnect(e,t)})}),this._socket.on("reconnect",()=>{var e,t;this.onReadyDone=!1,null===(e=(t=this.props).onProgress)||void 0===e||e.call(t,n.READY),this.connected=!0,this.waitForRestart?globalThis.location.reload():(this._subscribe(!0),this.onConnectionHandlers.forEach(e=>e(!0)))}),this._socket.on("disconnect",()=>{var e,t;this.onReadyDone=!1,this.connected=!1,this.subscribed=!1,null===(e=(t=this.props).onProgress)||void 0===e||e.call(t,n.CONNECTING),this.onConnectionHandlers.forEach(e=>e(!1))}),this._socket.on("reauthenticate",()=>this.authenticate()),this._socket.on("log",e=>{var t,r;null===(t=(r=this.props).onLog)||void 0===t||t.call(r,e),this.onLogHandlers.forEach(t=>t(e))}),this._socket.on("error",e=>{let t;void 0==e?t="":"function"===typeof e.toString?t=e.toString():(t=JSON.stringify(e),console.error("Received strange error: ".concat(t))),t.includes("User not authorized")?this.authenticate():t.includes("websocket error")?(console.error("Socket Error => reload: ".concat(e)),globalThis.location.reload()):console.error("Socket Error: ".concat(e))}),this._socket.on("connect_error",e=>console.error("Connect error: ".concat(e))),this._socket.on("permissionError",e=>this.onError({message:"no permission",operation:e.operation,type:e.type,id:e.id||""})),this._socket.on("objectChange",(e,t)=>{setTimeout(()=>this.objectChange(e,t),0)}),this._socket.on("stateChange",(e,t)=>{setTimeout(()=>this.stateChange(e,t),0)}),this._socket.on("im",(e,t,r)=>{setTimeout(()=>this.instanceMessage(e,t,r),0)}),this._socket.on("fileChange",(e,t,r)=>{setTimeout(()=>this.fileChange(e,t,r),0)}),this._socket.on("cmdStdout",(e,t)=>{var r;null===(r=this.onCmdStdoutHandler)||void 0===r||r.call(this,e,t)}),this._socket.on("cmdStderr",(e,t)=>{var r;null===(r=this.onCmdStderrHandler)||void 0===r||r.call(this,e,t)}),this._socket.on("cmdExit",(e,t)=>{var r;null===(r=this.onCmdExitHandler)||void 0===r||r.call(this,e,t)}),Promise.resolve()}onPreConnect(e,t){if(this._authTimer&&(clearTimeout(this._authTimer),this._authTimer=null),this.connected=!0,this.isSecure=t,this.waitForRestart)globalThis.location.reload();else{var r,o;if(this.firstConnect)this.loadData().catch(e=>{console.error("Cannot load data: ".concat(e))});else null===(r=(o=this.props).onProgress)||void 0===r||r.call(o,n.READY);this._subscribe(!0),this.onConnectionHandlers.forEach(e=>e(!0)),this.checkAccessTokenExpire()}this._waitForFirstConnectionPromise.resolve()}static readTokens(){let e=globalThis.sessionStorage.getItem("iob_tokens");const t=!e;if(e||(e=globalThis.localStorage.getItem("iob_tokens")),!e)return null;const r=e.split(";"),n=(0,i.A)(r,5),o=n[0],a=n[1],s=n[2],l=n[3],c=n[4],d=new Date(a);return d.getTime()<Date.now()?null:{refresh_token:o,refresh_token_expires_in:d,access_token:s,expires_in:new Date(l),owner:c,stayLoggedIn:t}}static saveTokensStatic(e,t,r){const n="".concat(e.refresh_token,";").concat(new Date(Date.now()+1e3*e.refresh_token_expires_in).toISOString(),";").concat(e.access_token,";").concat(new Date(Date.now()+1e3*e.expires_in).toISOString()).concat(r?";".concat(r):"");t?globalThis.localStorage.setItem("iob_tokens",n):globalThis.sessionStorage.setItem("iob_tokens",n)}saveTokens(e,t){f.saveTokensStatic(e,t,this.connId)}static deleteTokensStatic(){globalThis.localStorage.removeItem("iob_tokens"),globalThis.sessionStorage.removeItem("iob_tokens")}deleteTokens(e,t){const r=f.readTokens();r&&(t?f.deleteTokensStatic():r.stayLoggedIn===e&&r.owner===this.connId&&(r.stayLoggedIn?globalThis.localStorage.removeItem("iob_tokens"):globalThis.sessionStorage.removeItem("iob_tokens")))}updateTokenExpiration(e){this.lastAccessToken!==e&&(this.lastAccessToken=e,this._socket.emit("updateTokenExpiration",e,(t,r)=>{t?(console.error("[UPDATE/".concat((new Date).toISOString(),"] cannot say to server about new token: ").concat(t)),globalThis.location.reload()):r?console.log("[UPDATE/".concat((new Date).toISOString(),"] server accepted new token: ").concat(e)):(console.error("[UPDATE/".concat((new Date).toISOString(),"] cannot say to server about new token")),globalThis.location.reload())})),this.checkAccessTokenExpire()}refreshTokens(e,t){if(!e)return console.log("[REFRESH/".concat((new Date).toISOString(),"] No token structure found => reloading the page")),void setTimeout(()=>globalThis.location.reload(),500);t||!e.owner||e.owner===this.connId?(console.log("[REFRESH/".concat((new Date).toISOString(),"] claim ownership of the token")),this.acquireTokenLock()?(console.log("[REFRESH/".concat((new Date).toISOString(),"] refreshing token")),fetch("./oauth/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:"grant_type=refresh_token&refresh_token=".concat(e.refresh_token,"&client_id=ioBroker&stayloggedin=").concat(e.stayLoggedIn)}).then(e=>{if(e.ok)return e.json();throw new Error("Cannot refresh access token")}).then(t=>{if(!t.access_token)throw new Error("Cannot get access token");console.log("[REFRESH/".concat((new Date).toISOString(),"] received new token: ").concat(t.access_token)),this.saveTokens(t,e.stayLoggedIn),this.releaseTokenLock(),this.updateTokenExpiration(t.access_token)}).catch(t=>{console.warn("[REFRESH/".concat((new Date).toISOString(),"] cannot refresh token: ").concat(t)),this.releaseTokenLock(),this.deleteTokens(e.stayLoggedIn),console.error(t),globalThis.location.reload()})):(console.log("[REFRESH/".concat((new Date).toISOString(),"] Someone else is updating the token, so wait for the next check")),this.checkAccessTokenExpire())):this.lastAccessToken!==e.access_token&&this.updateTokenExpiration(e.access_token)}acquireTokenLock(){const e=Date.now(),t=globalThis.localStorage.getItem("iob_token_semaphore");if(t)try{if(e<JSON.parse(t).expiry)return!1}catch(n){}const r={connId:this.connId,expiry:e+1e4};return globalThis.localStorage.setItem("iob_token_semaphore",JSON.stringify(r)),!0}releaseTokenLock(){const e=globalThis.localStorage.getItem("iob_token_semaphore");if(e)try{JSON.parse(e).connId===this.connId&&globalThis.localStorage.removeItem("iob_token_semaphore")}catch(t){globalThis.localStorage.removeItem("iob_token_semaphore")}}checkAccessTokenExpire(){if(this._refreshTimer&&(clearTimeout(this._refreshTimer),this._refreshTimer=null),this.isSecure){const e=f.readTokens();if(e){const t=e.expires_in.getTime();if(t<Date.now()+3e4){const r=t<Date.now()+5500;console.log("[TOKEN/".concat((new Date).toISOString(),"] Updating refresh token ").concat(e.access_token)),e.refresh_token?e.owner===this.connId||r?(e.owner===this.connId?console.log("[TOKEN/".concat((new Date).toISOString(),"] We are the owner of the token")):console.log("[TOKEN/".concat((new Date).toISOString(),"] We are not the owner of the token, but we will take ownership")),this.props.tokenTimeoutHandler?(console.log("[TOKEN/".concat((new Date).toISOString(),"] Asking GUI if we should prolong the token")),this.props.tokenTimeoutHandler(t).then(n=>{n?(console.log("[TOKEN/".concat((new Date).toISOString(),"] Token will be prolonged")),this.refreshTokens(e,r)):(console.log("[TOKEN/".concat((new Date).toISOString(),"] Token will not be prolonged. Reloading the page")),setTimeout(()=>globalThis.location.reload(),Date.now()>t?500:t-Date.now()))})):(console.log("[TOKEN/".concat((new Date).toISOString(),"] No tokenTimeoutHandler defined. Prolonging the token")),this.refreshTokens(e,r))):this.lastAccessToken!==e.access_token?(console.log("[TOKEN/".concat((new Date).toISOString(),"] We are not the owner of the token, but we will inform the server about new token")),this.refreshTokens(e)):(console.log("[TOKEN/".concat((new Date).toISOString(),"] We are not the owner of the token and the token did not change. Check in 3 seconds if the owner updated the token")),this._refreshTimer=setTimeout(()=>{this._refreshTimer=null,this.checkAccessTokenExpire()},3e3)):(console.log("[TOKEN/".concat((new Date).toISOString(),"] We do not have a refresh token, so we need to reauthenticate")),setTimeout(()=>globalThis.location.reload(),Date.now()>t?500:t-Date.now()))}else this._refreshTimer=setTimeout(()=>{this._refreshTimer=null,this.checkAccessTokenExpire()},t-Date.now()-3e4>12e4?12e4:t-Date.now()-3e4)}}}static isCloud(){return!(!globalThis.location.hostname.includes("amazonaws.com")&&!globalThis.location.hostname.includes("iobroker.in"))||"undefined"!==typeof globalThis.socketUrl&&(globalThis.socketUrl.includes("iobroker.in")||globalThis.socketUrl.includes("amazonaws"))}isConnected(){return this.connected}waitForFirstConnection(){return this._waitForFirstConnectionPromise}async getUserPermissions(){return this.request({commandTimeout:!1,executor:(e,t)=>{this._socket.emit("getUserPermissions",(r,n)=>{r?t(r):e(n||null)})}})}async loadData(){if(this.loaded)return;for(let e=1;e<=10;e++){if(this.doLoadData().catch(e=>console.error("Cannot load data: ".concat(e))),this.loaded)return;await p(f.isCloud()?5e3:1e3)}}async doLoadData(){var e,t,r,o,a,i;if(!this.loaded){if(!this.props.doNotLoadACL)try{this.acl=await this.getUserPermissions()}catch(d){return void this.onError("Cannot read user permissions: ".concat(d))}try{!this.props.admin5only||f.isWeb()||globalThis.vendorPrefix&&"@@vendorPrefix@@"!==globalThis.vendorPrefix?this._systemConfig=await this.getSystemConfig():this._systemConfig=await this.getCompactSystemConfig()}catch(d){return void this.onError("Cannot read system config: ".concat(d))}var s,l,c;if(this._systemConfig)this.systemLang=null===(s=this._systemConfig.common)||void 0===s?void 0:s.language,this.systemLang||(this.systemLang=globalThis.navigator.userLanguage||globalThis.navigator.language,/^(en|de|ru|pt|nl|fr|it|es|pl|uk)-?/.test(this.systemLang)?this.systemLang=this.systemLang.substring(0,2):/^(en|de|ru|pt|nl|fr|it|es|pl|uk|zh-cn)$/.test(this.systemLang)||(this.systemLang="en"),this._systemConfig.common.language=this.systemLang);if(null===(e=(t=this.props).onLanguage)||void 0===e||e.call(t,this.systemLang),this.loaded=!0,null===(r=(o=this.props).onProgress)||void 0===r||r.call(o,n.CONNECTED),this.firstConnect=!1,this.props.doNotLoadAllObjects?this.props.admin5only?this.objects={}:this.objects={"system.config":this._systemConfig}:this.objects=await this.getObjects(),null===(a=(i=this.props).onProgress)||void 0===a||a.call(i,n.READY),!this.onReadyDone)this.onReadyDone=!0,null===(l=(c=this.props).onReady)||void 0===l||l.call(c,this.objects)}}authenticate(){globalThis.location.search.includes("&href=")?globalThis.location.href="".concat(globalThis.location.protocol,"//").concat(globalThis.location.host).concat(globalThis.location.pathname).concat(globalThis.location.search):globalThis.location.href="".concat(globalThis.location.protocol,"//").concat(globalThis.location.host).concat(globalThis.location.pathname,"?login&href=").concat(encodeURIComponent(globalThis.location.search+globalThis.location.hash))}async subscribeState(){let e,t,r,n;for(var o=arguments.length,a=new Array(o),s=0;s<o;s++)a[s]=arguments[s];if(3===a.length?(e=a[0],t=a[1],r=a[2]):(e=a[0],r=a[1],t=!1),n=Array.isArray(e)?e:[e],"function"!==typeof r)throw new Error("The state change handler must be a function!");const l=[];for(let i=0;i<n.length;i++){const t=n[i];this.statesSubscribes[t]?!this.statesSubscribes[t].cbs.includes(r)&&this.statesSubscribes[t].cbs.push(r):(this.statesSubscribes[t]={reg:new RegExp(h(t)),cbs:[r]},e!==this.ignoreState&&l.push(t))}if(this.connected)if(l.length&&this._socket.emit("subscribe",l),t){let e;for(let t=0;t<n.length;t++){try{e=await this.getBinaryState(n[t])}catch(u){console.error('Cannot getBinaryState "'.concat(n[t],'": ').concat(JSON.stringify(u))),e=void 0}void 0!=e&&r(n[t],e)}}else if(n.find(e=>e.includes("*"))){let e;for(let t=0;t<n.length;t++){try{e=await this.getForeignStates(n[t])}catch(u){return void console.error('Cannot getForeignStates "'.concat(n[t],'": ').concat(JSON.stringify(u)))}if(e)for(const t of Object.entries(e)){var c=(0,i.A)(t,2);const e=r(c[0],c[1]);e instanceof Promise&&e.catch(e=>console.error("Cannot call state change handler: ".concat(e)))}}}else try{const e=await(f.isWeb()?this.getStates(n):this.getForeignStates(n));if(e)for(const t of Object.entries(e)){var d=(0,i.A)(t,2);const e=d[0],n=r(e,d[1]);n instanceof Promise&&n.catch(e=>console.error("Cannot call state change handler: ".concat(e)))}}catch(u){return void console.error('Cannot getState "'.concat(n.join(", "),'": ').concat(u.message))}}async subscribeStateAsync(e,t){return this.subscribeState(e,t)}unsubscribeState(e,t){let r;r=Array.isArray(e)?e:[e];const n=[];for(let a=0;a<r.length;a++){const e=r[a];if(this.statesSubscribes[e]){var o;const r=this.statesSubscribes[e];if(t){const e=r.cbs.indexOf(t);-1!==e&&r.cbs.splice(e,1)}else r.cbs=[];null!==(o=r.cbs)&&void 0!==o&&o.length||(delete this.statesSubscribes[e],e!==this.ignoreState&&n.push(e))}}this.connected&&n.length&&this._socket.emit("unsubscribe",r)}subscribeObject(e,t){let r;if(r=Array.isArray(e)?e:[e],"function"!==typeof t)throw new Error("The object change handler must be a function!");const n=[];for(let o=0;o<r.length;o++){const e=r[o];this.objectsSubscribes[e]?!this.objectsSubscribes[e].cbs.includes(t)&&this.objectsSubscribes[e].cbs.push(t):(this.objectsSubscribes[e]={reg:new RegExp(h(e)),cbs:[t]},n.push(e))}return this.connected&&n.length&&this._socket.emit("subscribeObjects",n),Promise.resolve()}unsubscribeObject(e,t){let r;r=Array.isArray(e)?e:[e];const n=[];for(let a=0;a<r.length;a++){const e=r[a];if(this.objectsSubscribes[e]){var o;const r=this.objectsSubscribes[e];if(t){const e=r.cbs.indexOf(t);-1!==e&&r.cbs.splice(e,1)}else r.cbs=[];null!==(o=r.cbs)&&void 0!==o&&o.length||(delete this.objectsSubscribes[e],n.push(e))}}return this.connected&&n.length&&this._socket.emit("unsubscribeObjects",n),Promise.resolve()}objectChange(e,t){let r;this.objects[e]&&(r={_id:e,type:this.objects[e].type});let n=!1;t?(t._rev&&this.objects[e]&&(this.objects[e]._rev=t._rev),this.objects[e]&&JSON.stringify(this.objects[e])===JSON.stringify(t)||(this.objects[e]=t,n=!0)):this.objects[e]&&(delete this.objects[e],n=!0);for(const l of Object.entries(this.objectsSubscribes)){var o=(0,i.A)(l,2);const n=o[0],a=o[1];(n===e||a.reg.test(e))&&a.cbs.forEach(n=>{try{const o=n(e,t,r);o instanceof Promise&&o.catch(e=>console.error("Cannot call object change handler: ".concat(e)))}catch(o){console.error("Error by callback of objectChange: ".concat(o))}})}if(n){var a,s;const r=null===(a=(s=this.props).onObjectChange)||void 0===a?void 0:a.call(s,e,t);r instanceof Promise&&r.catch(e=>console.error("Cannot call object change handler: ".concat(e)))}}stateChange(e,t){for(const n of Object.values(this.statesSubscribes))if(n.reg.test(e))for(const o of n.cbs)try{const r=o(e,null!==t&&void 0!==t?t:null);r instanceof Promise&&r.catch(e=>console.error("Cannot call state change handler: ".concat(e)))}catch(r){console.error("Error by callback of stateChanged: ".concat(r))}}instanceMessage(e,t,r){var n;null===(n=this._instanceSubscriptions[t])||void 0===n||n.forEach(n=>{if(n.messageType===e){const o=n.callback(r,t,e);o instanceof Promise&&o.catch(e=>console.error("Cannot call instance message handler: ".concat(e)))}})}fileChange(e,t,r){for(const o of Object.values(this.filesSubscribes))if(o.regId.test(e)&&o.regFilePattern.test(t))for(const a of o.cbs)try{a(e,t,r)}catch(n){console.error("Error by callback of fileChange: ".concat(n))}}async subscribeFiles(e,t,r){if("function"!==typeof r)throw new Error("The state change handler must be a function!");let n;n=Array.isArray(t)?t:[t];const o=[];for(let a=0;a<n.length;a++){const t=n[a],i="".concat(e,"$%$").concat(t);this.filesSubscribes[i]?!this.filesSubscribes[i].cbs.includes(r)&&this.filesSubscribes[i].cbs.push(r):(this.filesSubscribes[i]={regId:new RegExp(h(e)),regFilePattern:new RegExp(h(t)),cbs:[r]},o.push(t))}return this.connected&&o.length&&this._socket.emit("subscribeFiles",e,o),Promise.resolve()}unsubscribeFiles(e,t,r){let n;n=Array.isArray(t)?t:[t];const o=[];for(let i=0;i<n.length;i++){const t=n[i],s="".concat(e,"$%$").concat(t);if(this.filesSubscribes[s]){var a;const e=this.filesSubscribes[s];if(r){const t=e.cbs.indexOf(r);-1!==t&&e.cbs.splice(t,1)}else e.cbs=[];null!==(a=e.cbs)&&void 0!==a&&a.length||(delete this.filesSubscribes[s],o.push(t))}}this.connected&&o.length&&this._socket.emit("unsubscribeFiles",e,o)}async request(e){let t=e.cacheKey,r=e.forceUpdate,n=e.commandTimeout,a=e.onTimeout,i=e.requireAdmin,s=e.requireFeatures,l=e.executor;if(i&&f.isWeb())return Promise.reject(new Error(o.NOT_ADMIN));if(t&&!r&&t in this._promises)return this._promises[t];if(!this.connected)return Promise.reject(new Error(o.NOT_CONNECTED));if(null!==s&&void 0!==s&&s.length)for(const d of s)if(!await this.checkFeatureSupported(d))throw new Error(o.NOT_SUPPORTED);const c=new Promise(async(e,r)=>{const i={elapsed:!1,clearTimeout:()=>{}};let s;!1!==n&&(s=setTimeout(()=>{i.elapsed=!0,null===a||void 0===a||a(),t&&this._promises[t]instanceof Promise&&delete this._promises[t],r(new Error(o.TIMEOUT))},null!==n&&void 0!==n?n:this.props.cmdTimeout),i.clearTimeout=()=>{clearTimeout(s)});try{await l(e,r,i)}catch(c){t&&this._promises[t]instanceof Promise&&delete this._promises[t],r(new Error(c.toString()))}});return t&&(this._promises[t]=c),c}resetCache(e,t){t?Object.keys(this._promises).filter(t=>t.startsWith(e)).forEach(e=>{delete this._promises[e]}):delete this._promises[e]}getStates(e){return this.request({commandTimeout:!1,executor:(t,r)=>{this._socket.emit("getStates",e,(e,n)=>{this.states=null!==n&&void 0!==n?n:{},e?r(e):t(this.states)})}})}getState(e){return this.request({commandTimeout:!1,executor:(t,r)=>{e&&e===this.ignoreState?t(this.simStates[e]||{val:null,ack:!0}):this._socket.emit("getState",e,(e,n)=>{e?r(e):t(n)})}})}getBinaryState(e){return this.request({commandTimeout:!1,executor:(t,r)=>{this._socket.emit("getBinaryState",e,(e,n)=>{e?r(e):t(n)})}})}setBinaryState(e,t){return this.request({commandTimeout:!1,executor:(r,n)=>{this._socket.emit("setBinaryState",e,t,e=>{e?n(e):r()})}})}setState(e,t,r){return"boolean"===typeof r&&(t={val:t,ack:r}),this.request({commandTimeout:!1,executor:(n,o)=>{if(e&&e===this.ignoreState){let o;if(o="boolean"===typeof r||"object"===typeof t&&void 0!==t.val?t:{val:t,ack:!1,ts:Date.now(),lc:Date.now(),from:"system.adapter.vis.0"},this.simStates[e]=o,this.statesSubscribes[e])for(const t of this.statesSubscribes[e].cbs)try{const r=t(e,o);r instanceof Promise&&r.catch(e=>console.error("Cannot call st