UNPKG

iobroker.javascript

Version:
1 lines 1.77 MB
import{c as $,j as U,o as Pe,a as vM,b as bM,d as QM,P as S}from"./createSvgIcon-C_ElRFrf.js";import{i as f,R as M}from"./iobroker_javascript__loadShare__react__loadShare__-B-pIv4x_.js";import{i as j,c as Ne,C as Oe,a as nt,L as yL,g as TL,k as Ai,j as yN,H as TN,b as dN,S as dL,T as X,U as DL,V as hL,W as zL,X as wL,Y as UM,Z as CL,$ as IL,a0 as pL,a1 as AL,a2 as mL,a3 as $M,a4 as OL,a5 as EL,a6 as fL,a7 as xL,a8 as _L,a9 as SL,aa as kL,ab as YL,ac as vL,ad as bL,ae as QL,af as UL,ag as PM,ah as WM,ai as $L,aj as BM,t as PL,ak as WL,al as BL,am as JL,an as JM,ao as RL,ap as FL,aq as GL,N as HL,h as cn,I as $i}from"./index-DeFm7TiX.js";import{I as un}from"./Save--0ldNXLf.js";import{c as ir,g as VL}from"./_commonjsHelpers-Cpj98o6Y.js";import{u as ZL}from"./useTheme-CpAj0H76.js";import{t as B}from"./index-BompUVvy.js";import"./iobroker_javascript__mf_v__runtimeInit__mf_v__-CmuPLb0X.js";const XL=$(U.jsx("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z"}),"ArrowBack"),KL=$(U.jsx("path",{d:"m10 17 5-5-5-5z"}),"ArrowRight"),qL=$(U.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 11h-3v3.75c0 1.24-1.01 2.25-2.25 2.25S8.5 17.99 8.5 16.75s1.01-2.25 2.25-2.25c.46 0 .89.14 1.25.38V11h4zm-3-4V3.5L18.5 9z"}),"AudioFile"),eg=$([U.jsx("path",{d:"M16.5 12h-9c-.55 0-1 .45-1 1v1h11v-1c0-.55-.45-1-1-1M7.25 8.5h4v2h-4zm5.5 0h4v2h-4z"},"0"),U.jsx("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-1 15h-1.5v-1.5h-11V17H5v-3.83c0-.66.25-1.26.65-1.72V9c0-1.1.9-2 2-2H11c.37 0 .72.12 1 .32.28-.2.63-.32 1-.32h3.35c1.1 0 2 .9 2 2v2.45c.4.46.65 1.06.65 1.72z"},"1")],"BedroomParent"),tg=$(U.jsx("path",{d:"M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2"}),"Bookmark"),sg=$(U.jsx("path",{d:"M17 3H7c-1.1 0-1.99.9-1.99 2L5 21l7-3 7 3V5c0-1.1-.9-2-2-2m0 15-5-2.18L7 18V5h10z"}),"BookmarkBorder"),ig=$(U.jsx("path",{d:"M22 24H2v-4h20zM13.06 5.19l3.75 3.75L7.75 18H4v-3.75zm4.82 2.68-3.75-3.75 1.83-1.83c.39-.39 1.02-.39 1.41 0l2.34 2.34c.39.39.39 1.02 0 1.41z"}),"BorderColor"),rg=$(U.jsx("path",{d:"M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM12 18c-.89 0-1.74-.2-2.5-.55C11.56 16.5 13 14.42 13 12s-1.44-4.5-3.5-5.45C10.26 6.2 11.11 6 12 6c3.31 0 6 2.69 6 6s-2.69 6-6 6"}),"Brightness4"),og=$(U.jsx("path",{d:"M20 15.31 23.31 12 20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20zM12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6"}),"Brightness5"),Ma=$(U.jsx("path",{d:"M20 15.31 23.31 12 20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20zM12 18V6c3.31 0 6 2.69 6 6s-2.69 6-6 6"}),"Brightness6"),ng=$(U.jsx("path",{d:"M20 8.69V4h-4.69L12 .69 8.69 4H4v4.69L.69 12 4 15.31V20h4.69L12 23.31 15.31 20H20v-4.69L23.31 12zM12 18c-3.31 0-6-2.69-6-6s2.69-6 6-6 6 2.69 6 6-2.69 6-6 6m0-10c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4"}),"Brightness7"),ag=$(U.jsx("path",{d:"m22.7 19-9.1-9.1c.9-2.3.4-5-1.5-6.9-2-2-5-2.4-7.4-1.3L9 6 6 9 1.6 4.7C.4 7.1.9 10.1 2.9 12.1c1.9 1.9 4.6 2.4 6.9 1.5l9.1 9.1c.4.4 1 .4 1.4 0l2.3-2.3c.5-.4.5-1.1.1-1.4"}),"Build"),Mg=$(U.jsx("path",{d:"M20 3h-1V1h-2v2H7V1H5v2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m0 18H4V8h16z"}),"CalendarToday"),ca=$(U.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"}),"Code"),cg=$(U.jsx("path",{d:"m20.71 5.63-2.34-2.34a.996.996 0 0 0-1.41 0l-3.12 3.12-1.93-1.91-1.41 1.41 1.42 1.42L3 16.25V21h4.75l8.92-8.92 1.42 1.42 1.41-1.41-1.92-1.92 3.12-3.12c.4-.4.4-1.03.01-1.42M6.92 19 5 17.08l8.06-8.06 1.92 1.92z"}),"Colorize"),ug=$(U.jsx("path",{d:"m13.7826 15.1719 2.1213-2.1213 5.9963 5.9962-2.1213 2.1213zM17.5 10c1.93 0 3.5-1.57 3.5-3.5 0-.58-.16-1.12-.41-1.6l-2.7 2.7-1.49-1.49 2.7-2.7c-.48-.25-1.02-.41-1.6-.41C15.57 3 14 4.57 14 6.5c0 .41.08.8.21 1.16l-1.85 1.85-1.78-1.78.71-.71-1.41-1.41L12 3.49c-1.17-1.17-3.07-1.17-4.24 0L4.22 7.03l1.41 1.41H2.81l-.71.71 3.54 3.54.71-.71V9.15l1.41 1.41.71-.71 1.78 1.78-7.41 7.41 2.12 2.12L16.34 9.79c.36.13.75.21 1.16.21"}),"Construction"),lg=$(U.jsx("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2z"}),"Crop"),Ng=$(U.jsx("path",{d:"M4 7v2c0 .55-.45 1-1 1H2v4h1c.55 0 1 .45 1 1v2c0 1.65 1.35 3 3 3h3v-2H7c-.55 0-1-.45-1-1v-2c0-1.3-.84-2.42-2-2.83v-.34C5.16 11.42 6 10.3 6 9V7c0-.55.45-1 1-1h3V4H7C5.35 4 4 5.35 4 7m17 3c-.55 0-1-.45-1-1V7c0-1.65-1.35-3-3-3h-3v2h3c.55 0 1 .45 1 1v2c0 1.3.84 2.42 2 2.83v.34c-1.16.41-2 1.52-2 2.83v2c0 .55-.45 1-1 1h-3v2h3c1.65 0 3-1.35 3-3v-2c0-.55.45-1 1-1h1v-4z"}),"DataObject"),Kr=$(U.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm2 16H8v-2h8zm0-4H8v-2h8zm-3-5V3.5L18.5 9z"}),"Description"),Lg=$(U.jsx("path",{d:"M18.41 5.8 17.2 4.59c-.78-.78-2.05-.78-2.83 0l-2.68 2.68L3 15.96V20h4.04l8.74-8.74 2.63-2.63c.79-.78.79-2.05 0-2.83M6.21 18H5v-1.21l8.66-8.66 1.21 1.21zM11 20l4-4h6v4z"}),"DriveFileRenameOutline"),gg=$(U.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"}),"Error"),jg=$(U.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"}),"ExpandMore"),yg=$(U.jsx("path",{d:"M20 19.59V8l-6-6H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c.45 0 .85-.15 1.19-.4l-4.43-4.43c-.8.52-1.74.83-2.76.83-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5c0 1.02-.31 1.96-.83 2.75zM9 13c0 1.66 1.34 3 3 3s3-1.34 3-3-1.34-3-3-3-3 1.34-3 3"}),"FindInPage"),Tg=$(U.jsx("path",{d:"M20 6h-8l-2-2H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m0 12H4V8h16z"}),"FolderOpen"),dg=$(U.jsx("path",{d:"M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m-2.06 11L15 15.28 12.06 17l.78-3.33-2.59-2.24 3.41-.29L15 8l1.34 3.14 3.41.29-2.59 2.24z"}),"FolderSpecial"),Dg=$(U.jsx("path",{d:"M9.93 13.5h4.14L12 7.98zM20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2m-4.05 16.5-1.14-3H9.17l-1.12 3H5.96l5.11-13h1.86l5.11 13z"}),"FontDownload"),hg=$(U.jsx("path",{d:"M10 4v3h2.21l-3.42 8H6v3h8v-3h-2.21l3.42-8H18V4z"}),"FormatItalic"),zg=$(U.jsx("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"}),"Image"),ua=$(U.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),DN=$(U.jsx("path",{d:"M6 2c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zm7 7V3.5L18.5 9z"}),"InsertDriveFile"),wg=$(U.jsx("path",{d:"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z"}),"KeyboardReturn"),hN=$(U.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link"),Cg=$(U.jsx("path",{d:"M3 13h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm4 4h14v-2H7zm0 4h14v-2H7zM7 7v2h14V7z"}),"List"),Ig=$(U.jsx("path",{d:"M19 5v14H5V5zm1.1-2H3.9c-.5 0-.9.4-.9.9v16.2c0 .4.4.9.9.9h16.2c.4 0 .9-.5.9-.9V3.9c0-.5-.5-.9-.9-.9M11 7h6v2h-6zm0 4h6v2h-6zm0 4h6v2h-6zM7 7h2v2H7zm0 4h2v2H7zm0 4h2v2H7z"}),"ListAlt"),pg=$(U.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2m-5 14h-2V9h-2V7h4z"}),"LooksOne"),Ag=$(U.jsx("path",{d:"M12 3v10.55c-.59-.34-1.27-.55-2-.55-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4V7h4V3z"}),"MusicNote"),mg=$(U.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"NavigateNext"),la=$(U.jsx("path",{d:"M12 6c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2m0 10c2.7 0 5.8 1.29 6 2H6c.23-.72 3.31-2 6-2m0-12C9.79 4 8 5.79 8 8s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m0 10c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"}),"PersonOutlined"),Og=$(U.jsx("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"}),"Photo"),Sr=$(U.jsx("path",{d:"M5 4v2h14V4zm0 10h4v6h6v-6h4l-7-7z"}),"Publish"),zN=$(U.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"}),"Refresh"),Na=$(U.jsx("path",{d:"m20.2 5.9.8-.8C19.6 3.7 17.8 3 16 3s-3.6.7-5 2.1l.8.8C13 4.8 14.5 4.2 16 4.2s3 .6 4.2 1.7m-.9.8c-.9-.9-2.1-1.4-3.3-1.4s-2.4.5-3.3 1.4l.8.8c.7-.7 1.6-1 2.5-1s1.8.3 2.5 1zM19 13h-2V9h-2v4H5c-1.1 0-2 .9-2 2v4c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-4c0-1.1-.9-2-2-2M8 18H6v-2h2zm3.5 0h-2v-2h2zm3.5 0h-2v-2h2z"}),"Router"),Eg=$(U.jsx("path",{d:"M19 12v7H5v-7H3v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7zm-6 .67 2.59-2.58L17 11.5l-5 5-5-5 1.41-1.41L11 12.67V3h2z"}),"SaveAlt"),ln=$(U.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"}),"Settings"),kr=$(U.jsx("path",{d:"M12 10c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m7-7H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2m-1.75 9c0 .23-.02.46-.05.68l1.48 1.16c.13.11.17.3.08.45l-1.4 2.42c-.09.15-.27.21-.43.15l-1.74-.7c-.36.28-.76.51-1.18.69l-.26 1.85c-.03.17-.18.3-.35.3h-2.8c-.17 0-.32-.13-.35-.29l-.26-1.85c-.43-.18-.82-.41-1.18-.69l-1.74.7c-.16.06-.34 0-.43-.15l-1.4-2.42c-.09-.15-.05-.34.08-.45l1.48-1.16c-.03-.23-.05-.46-.05-.69s.02-.46.05-.68l-1.48-1.16c-.13-.11-.17-.3-.08-.45l1.4-2.42c.09-.15.27-.21.43-.15l1.74.7c.36-.28.76-.51 1.18-.69l.26-1.85c.03-.17.18-.3.35-.3h2.8c.17 0 .32.13.35.29l.26 1.85c.43.18.82.41 1.18.69l1.74-.7c.16-.06.34 0 .43.15l1.4 2.42c.09.15.05.34-.08.45l-1.48 1.16c.03.23.05.46.05.69"}),"SettingsApplications"),fg=$(U.jsx("path",{d:"m3.5 18.49 6-6.01 4 4L22 6.92l-1.41-1.41-7.09 7.97-4-4L2 16.99z"}),"ShowChart"),La=$(U.jsx("path",{d:"M11.99 2c-5.52 0-10 4.48-10 10s4.48 10 10 10 10-4.48 10-10-4.48-10-10-10m3.61 6.34c1.07 0 1.93.86 1.93 1.93s-.86 1.93-1.93 1.93-1.93-.86-1.93-1.93c-.01-1.07.86-1.93 1.93-1.93m-6-1.58c1.3 0 2.36 1.06 2.36 2.36s-1.06 2.36-2.36 2.36-2.36-1.06-2.36-2.36c0-1.31 1.05-2.36 2.36-2.36m0 9.13v3.75c-2.4-.75-4.3-2.6-5.14-4.96 1.05-1.12 3.67-1.69 5.14-1.69.53 0 1.2.08 1.9.22-1.64.87-1.9 2.02-1.9 2.68M11.99 20c-.27 0-.53-.01-.79-.04v-4.07c0-1.42 2.94-2.13 4.4-2.13 1.07 0 2.92.39 3.84 1.15-1.17 2.97-4.06 5.09-7.45 5.09"}),"SupervisedUserCircle"),xg=$(U.jsx("path",{d:"M2.5 4v3h5v12h3V7h5V4zm19 5h-9v3h3v7h3v-7h3z"}),"TextFields"),_g=$(U.jsx("path",{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8zm4 18H6V4h7v5h5zM8 15.01l1.41 1.41L11 14.84V19h2v-4.16l1.59 1.59L16 15.01 12.01 11z"}),"UploadFileOutlined"),Sg=$(U.jsx("path",{d:"M16 13h-3V3h-2v10H8l4 4zM4 19v2h16v-2z"}),"VerticalAlignBottom"),kg=$(U.jsx("path",{d:"M8 11h3v10h2V11h3l-4-4zM4 3v2h16V3z"}),"VerticalAlignTop"),Yg=$(U.jsx("path",{d:"M17 10.5V7c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v10c0 .55.45 1 1 1h12c.55 0 1-.45 1-1v-3.5l4 4v-11z"}),"Videocam"),vg=$(U.jsx("path",{d:"M14.67 5v14H9.33V5zm1 14H21V5h-5.33zm-7.34 0V5H3v14z"}),"ViewColumn"),bg=$(U.jsx("path",{d:"M4 15h16v-2H4zm0 4h16v-2H4zm0-8h16V9H4zm0-6v2h16V5z"}),"ViewHeadline"),Qg=$(U.jsx("path",{d:"M14.67 5v6.5H9.33V5zm1 6.5H21V5h-5.33zm-1 7.5v-6.5H9.33V19zm1-6.5V19H21v-6.5zm-7.34 0H3V19h5.33zm0-1V5H3v6.5z"}),"ViewModule"),Ug=$(U.jsx("path",{d:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3"}),"Visibility"),$g=$(U.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),bs=$(U.jsx("path",{d:"m1 9 2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9m8 8 3 3 3-3c-1.65-1.66-4.34-1.66-6 0m-4-4 2 2c2.76-2.76 7.24-2.76 10 0l2-2C15.14 9.14 8.87 9.14 5 13"}),"Wifi"),rr=$(U.jsx("path",{d:"M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7zm-4 4c-1.29-1.29-2.84-2.13-4.49-2.56l3.53 3.53zM2 3.05 5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24C7.81 10.89 6.27 11.73 5 13v.01L6.99 15c1.36-1.36 3.14-2.04 4.92-2.06L18.98 20l1.27-1.26L3.29 1.79zM9 17l3 3 3-3c-1.65-1.66-4.34-1.66-6 0"}),"WifiOff"),mo=11/23/100;function RM(s){const e={r:0,g:0,b:0};if(s.length===7)e.r=parseInt(s.substring(1,3),16),e.g=parseInt(s.substring(3,5),16),e.b=parseInt(s.substring(5,7),16);else if(s.length===4){const t=s[1],i=s[2],r=s[3];e.r=parseInt(t+t,16),e.g=parseInt(i+i,16),e.b=parseInt(r+r,16)}return e}function Pg(s){return`#${Math.round(s.r).toString(16)}${Math.round(s.g).toString(16)}${Math.round(s.b).toString(16)}`}function Wg(s,e,t){const i=RM(s),r=RM(e);return i.r+=r.r*(.05+mo*(t-1)),i.g+=r.g*(.05+mo*(t-1)),i.b+=r.b*(.05+mo*(t-1)),Pg(i)}function FM(s,e){const t={};for(let i=1;i<=24;i++)t[`elevation${i}`]={backgroundColor:Wg(s,e,i)};return t}function Bg(s,e){var n,a,c,l,N,u,L,g,y,T,d;let t,i;s==="dark"?(i={MuiAppBar:{colorDefault:{backgroundColor:"#272727"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[200],"&:hover":{color:Pe[100]}}},MuiPaper:FM("#121212","#fff")},t={name:s,palette:{mode:"dark",background:{paper:"#121212",default:"#121212"},primary:{main:"#4dabf5"},secondary:{main:"#436a93"},expert:"#14bb00",text:{primary:"#ffffff",secondary:"#ffffff"}}}):s==="blue"?(i={MuiAppBar:{colorDefault:{backgroundColor:"#3399CC"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[400],"&:hover":{color:Pe[300]}}}},t={name:s,palette:{mode:"dark",background:{paper:"#151d21",default:"#151d21"},primary:{main:"#4dabf5"},secondary:{main:"#436a93"},expert:"#14bb00",text:{primary:"#ffffff",secondary:"#ffffff"}}}):s==="colored"?(i={MuiAppBar:{colorDefault:{backgroundColor:"#2a3135"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[200],"&:hover":{color:Pe[100]}}},MuiPaper:FM("#151d21","#fff")},t={name:s,palette:{mode:"light",primary:{main:"#3399CC"},secondary:{main:"#164477"},expert:"#96fc96"}}):s==="PT"?(i={MuiAppBar:{colorDefault:{backgroundColor:"#0F99DE"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[400],"&:hover":{color:Pe[300]}}}},t={name:s,palette:{mode:"light",primary:{main:"#0F99DE"},secondary:{main:"#88A536"},expert:"#BD1B24"}}):s==="DX"?(i={MuiAppBar:{colorDefault:{backgroundColor:"#a9a9a9"}},MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[400],"&:hover":{color:Pe[300]}}}},t={name:s,palette:{mode:"light",primary:{main:"#F5F5F7"},secondary:{main:"#a9a9a9"},expert:"#BD1B24",text:{primary:"#007AFE",secondary:"#007AFE",disabled:"#007AFEAA"}}}):(i={MuiLink:{root:{textTransform:"uppercase",transition:"color .3s ease",color:Pe[400],"&:hover":{color:Pe[300]}}}},t={name:s,palette:{mode:"light",primary:{main:"#3399CC",dark:"#256c97",light:"#76d0fd"},secondary:{main:"#164477"},expert:"#14bb00"}}),t.toolbar={height:48},t.saveToolbar={background:(a=(n=t.palette)==null?void 0:n.primary)==null?void 0:a.main,button:{borderRadius:3,height:32}},t.palette&&(t.palette.grey={main:vM[300],dark:vM[400]});const r=bM(t),o=r.palette;return bM(r,{...e||void 0,components:{...i,MuiButton:{variants:[{props:{variant:"contained",color:"grey"},style:{backgroundColor:(c=o.grey)==null?void 0:c[300],color:o.getContrastText&&((l=o.grey)!=null&&l[300])?o.getContrastText(o.grey[300]):void 0}},{props:{variant:"outlined",color:"grey"},style:{color:(N=o.text)==null?void 0:N.primary,borderColor:o.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)","&.Mui-disabled":{border:`1px solid ${(u=o.action)==null?void 0:u.disabledBackground}`},"&:hover":{borderColor:o.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)",backgroundColor:QM(((L=o.text)==null?void 0:L.primary)||"",((g=o.action)==null?void 0:g.hoverOpacity)||.04)}}},{props:{variant:"text",color:"grey"},style:{color:(y=o.text)==null?void 0:y.primary,"&:hover":{backgroundColor:QM(((T=o.text)==null?void 0:T.primary)||"",((d=o.action)==null?void 0:d.hoverOpacity)||.04)}}}]},...(e==null?void 0:e.components)||void 0}})}function Jg(){let s,e;const t=new Promise((i,r)=>{s=i,e=r});return t.resolve=s,t.reject=e,t}function Nn(s){return(s==null?void 0:s.rows.map(e=>e.value).filter(e=>!!e))??[]}function Tt(s){return s!=null&&s.startsWith("system.host.")||(s=`system.host.${s}`),s}function ci(s){return s!=null&&s.startsWith("system.host.")&&(s=s.substring(12)),s}function GM(s){return new Promise(e=>{setTimeout(e,s)})}function or(s){s=(s||"").toString();const e=s[0]==="*",t=s[s.length-1]==="*";return s=s.replace(/[-/\\^$+?.()|[\]{}]/g,"\\$&").replace(/\*/g,".*"),(e?"":"^")+s+(t?"":"$")}var rt;(function(s){s[s.CONNECTING=0]="CONNECTING",s[s.CONNECTED=1]="CONNECTED",s[s.OBJECTS_LOADED=2]="OBJECTS_LOADED",s[s.READY=3]="READY"})(rt||(rt={}));var Ie;(function(s){s.PERMISSION_ERROR="permissionError",s.NOT_CONNECTED="notConnectedError",s.TIMEOUT="timeout",s.NOT_ADMIN="Allowed only in admin",s.NOT_SUPPORTED="Not supported"})(Ie||(Ie={}));const t5e=Ie.PERMISSION_ERROR;Ie.NOT_CONNECTED;const Rg=["material","echarts","vis"];class ze{constructor(e){this.props=this.applyDefaultProps(e),this.connId=`${this.props.name?`${this.props.name}-`:""}${Math.round(Math.random()*1e6).toString().padStart(6,"0")}`,this.waitForSocketLib().then(()=>this.startSocket()).catch(t=>{alert(`Socket connection could not be initialized: ${t}`)})}applyDefaultProps(e){return{...e,protocol:e.protocol||window.location.protocol,host:e.host||window.location.hostname,port:e.port||(window.location.port==="3000"?8081:window.location.port),ioTimeout:Math.max(e.ioTimeout||2e4,2e4),cmdTimeout:Math.max(e.cmdTimeout||5e3,5e3),admin5only:e.admin5only||!1,autoSubscribes:e.autoSubscribes??[],autoSubscribeLog:e.autoSubscribeLog??!1,doNotLoadACL:e.doNotLoadACL??!0,doNotLoadAllObjects:e.doNotLoadAllObjects??!0}}props;connId;lastAccessToken=null;ignoreState="";connected=!1;subscribed=!1;firstConnect=!0;waitForRestart=!1;loaded=!1;simStates={};statesSubscribes={};filesSubscribes={};objectsSubscribes={};objects={};states={};acl=null;isSecure=!1;onReadyDone=!1;onConnectionHandlers=[];onLogHandlers=[];onCmdStdoutHandler;onCmdStderrHandler;onCmdExitHandler;onError(e){(this.props.onError??console.error)(e)}_socket;_waitForSocketPromise;_waitForFirstConnectionPromise=Jg();_instanceSubscriptions={};_promises={};_authTimer=null;_refreshTimer=null;_systemConfig;get systemConfig(){return this._systemConfig}systemLang="en";static isWeb(){return window.socketUrl!==void 0}waitForSocketLib(){return this._waitForSocketPromise?this._waitForSocketPromise:(this._waitForSocketPromise=new Promise(async(e,t)=>{if(typeof window.io>"u"&&typeof window.iob>"u")if(typeof window.registerSocketOnLoad=="function")window.registerSocketOnLoad(()=>e());else{for(let i=1;i<=30;i++){if(window.io||window.iob)return e();await GM(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,i=(this.props.protocol||window.location.protocol).replace(":",""),r=window.location.pathname;if(window.location.hostname==="iobroker.net"||window.location.hostname==="iobroker.pro")r="";else{if(window.socketUrl){const a=new URL(window.socketUrl);e=a.hostname,t=a.port,i=a.protocol.replace(":","")}const n=r.lastIndexOf("/");if(n!==-1&&(r=r.substring(0,n+1)),ze.isWeb()){const a=r.split("/");a.length>2&&(a.pop(),a.pop(),Rg.includes(a[a.length-1])&&a.pop(),r=a.join("/"),r.endsWith("/")||(r+="/"))}}const o=t?`${i}://${e}:${t}`:`${i}://${e}`;return this._socket=(window.io||window.iob).connect(o,{path:r.endsWith("/")?`${r}socket.io`:`${r}/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",n=>{window.addEventListener("storage",this.onAccessTokenUpdated);const a=ze.readTokens();if(a&&!a.owner){const c=Date.now();this.saveTokens({access_token:a.access_token,refresh_token:a.refresh_token,expires_in:Math.round((a.expires_in.getTime()-c)/1e3),refresh_token_expires_in:Math.round((a.refresh_token_expires_in.getTime()-c)/1e3),token_type:"Bearer"},a.stayLoggedIn)}this.onReadyDone=!1,n!==!0?(this.connected=!0,setTimeout(()=>this.getVersion().then(c=>{const[l,N,u]=c.version.split(".");parseInt(l,10)*1e4+parseInt(N,10)*100+parseInt(u,10)<40102?(this._authTimer=null,this.onPreConnect(!1,!1)):this._socket.emit("authenticate",(g,y)=>this.onPreConnect(g,y))}).catch(c=>this.onError({message:c.toString(),operation:"getVersion"})),500)):this._socket.emit("authenticate",(c,l)=>{this.onPreConnect(c,l)})}),this._socket.on("reconnect",()=>{var n,a;this.onReadyDone=!1,(a=(n=this.props).onProgress)==null||a.call(n,rt.READY),this.connected=!0,this.waitForRestart?window.location.reload():(this._subscribe(!0),this.onConnectionHandlers.forEach(c=>c(!0)))}),this._socket.on("disconnect",()=>{var n,a;this.onReadyDone=!1,this.connected=!1,this.subscribed=!1,(a=(n=this.props).onProgress)==null||a.call(n,rt.CONNECTING),this.onConnectionHandlers.forEach(c=>c(!1))}),this._socket.on("reauthenticate",()=>this.authenticate()),this._socket.on("log",n=>{var a,c;(c=(a=this.props).onLog)==null||c.call(a,n),this.onLogHandlers.forEach(l=>l(n))}),this._socket.on("error",n=>{let a;n==null?a="":typeof n.toString=="function"?a=n.toString():(a=JSON.stringify(n),console.error(`Received strange error: ${a}`)),a.includes("User not authorized")?this.authenticate():a.includes("websocket error")?(console.error(`Socket Error => reload: ${n}`),window.location.reload()):console.error(`Socket Error: ${n}`)}),this._socket.on("connect_error",n=>console.error(`Connect error: ${n}`)),this._socket.on("permissionError",n=>this.onError({message:"no permission",operation:n.operation,type:n.type,id:n.id||""})),this._socket.on("objectChange",(n,a)=>{setTimeout(()=>this.objectChange(n,a),0)}),this._socket.on("stateChange",(n,a)=>{setTimeout(()=>this.stateChange(n,a),0)}),this._socket.on("im",(n,a,c)=>{setTimeout(()=>this.instanceMessage(n,a,c),0)}),this._socket.on("fileChange",(n,a,c)=>{setTimeout(()=>this.fileChange(n,a,c),0)}),this._socket.on("cmdStdout",(n,a)=>{var c;(c=this.onCmdStdoutHandler)==null||c.call(this,n,a)}),this._socket.on("cmdStderr",(n,a)=>{var c;(c=this.onCmdStderrHandler)==null||c.call(this,n,a)}),this._socket.on("cmdExit",(n,a)=>{var c;(c=this.onCmdExitHandler)==null||c.call(this,n,a)}),Promise.resolve()}onPreConnect(e,t){var i,r;this._authTimer&&(clearTimeout(this._authTimer),this._authTimer=null),this.connected=!0,this.isSecure=t,this.waitForRestart?window.location.reload():(this.firstConnect?this.loadData().catch(o=>console.error(`Cannot load data: ${o}`)):(r=(i=this.props).onProgress)==null||r.call(i,rt.READY),this._subscribe(!0),this.onConnectionHandlers.forEach(o=>o(!0)),this.checkAccessTokenExpire()),this._waitForFirstConnectionPromise.resolve()}static readTokens(){let e=window.sessionStorage.getItem("iob_tokens");const t=!e;if(e||(e=window.localStorage.getItem("iob_tokens")),!e)return null;const[i,r,o,n,a]=e.split(";"),c=new Date(r);return c.getTime()<Date.now()?null:{refresh_token:i,refresh_token_expires_in:c,access_token:o,expires_in:new Date(n),owner:a,stayLoggedIn:t}}static saveTokensStatic(e,t,i){const r=`${e.refresh_token};${new Date(Date.now()+e.refresh_token_expires_in*1e3).toISOString()};${e.access_token};${new Date(Date.now()+e.expires_in*1e3).toISOString()}${i?`;${i}`:""}`;t?window.localStorage.setItem("iob_tokens",r):window.sessionStorage.setItem("iob_tokens",r)}saveTokens(e,t){ze.saveTokensStatic(e,t,this.connId)}static deleteTokensStatic(){window.localStorage.removeItem("iob_tokens"),window.sessionStorage.removeItem("iob_tokens")}deleteTokens(e,t){const i=ze.readTokens();i&&(t?ze.deleteTokensStatic():i.stayLoggedIn===e&&i.owner===this.connId&&(i.stayLoggedIn?window.localStorage.removeItem("iob_tokens"):window.sessionStorage.removeItem("iob_tokens")))}onAccessTokenUpdated=e=>{if(e.key==="iob_tokens"){const t=ze.readTokens();t&&(console.log(`Tab ${this.connId} received updated token: ${t.access_token}`),this.updateTokenExpiration(t.access_token))}};updateTokenExpiration(e){this.lastAccessToken!==e&&(this.lastAccessToken=e,this._socket.emit("updateTokenExpiration",e,(t,i)=>{t?(console.error(`[UPDATE/${new Date().toISOString()}] cannot say to server about new token: ${t}`),window.location.reload()):i?console.log(`[UPDATE/${new Date().toISOString()}] server accepted new token: ${e}`):(console.error(`[UPDATE/${new Date().toISOString()}] cannot say to server about new token`),window.location.reload())})),this.checkAccessTokenExpire()}refreshTokens(e,t){if(!e){console.log(`[REFRESH/${new Date().toISOString()}] No token structure found => reloading the page`),setTimeout(()=>window.location.reload(),500);return}t||!e.owner||e.owner===this.connId?(console.log(`[REFRESH/${new Date().toISOString()}] claim ownership of the token`),this.acquireTokenLock()?(console.log(`[REFRESH/${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=${e.refresh_token}&client_id=ioBroker&stayloggedin=${e.stayLoggedIn}`}).then(i=>{if(i.ok)return i.json();throw new Error("Cannot refresh access token")}).then(i=>{if(i.access_token)console.log(`[REFRESH/${new Date().toISOString()}] received new token: ${i.access_token}`),this.saveTokens(i,e.stayLoggedIn),this.releaseTokenLock(),this.updateTokenExpiration(i.access_token);else throw new Error("Cannot get access token")}).catch(i=>{console.warn(`[REFRESH/${new Date().toISOString()}] cannot refresh token: ${i}`),this.releaseTokenLock(),this.deleteTokens(e.stayLoggedIn),console.error(i),window.location.reload()})):(console.log(`[REFRESH/${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=localStorage.getItem("iob_token_semaphore");if(t)try{const r=JSON.parse(t);if(e<r.expiry)return!1}catch{}const i={connId:this.connId,expiry:e+10*1e3};return localStorage.setItem("iob_token_semaphore",JSON.stringify(i)),!0}releaseTokenLock(){const e=localStorage.getItem("iob_token_semaphore");if(e)try{JSON.parse(e).connId===this.connId&&localStorage.removeItem("iob_token_semaphore")}catch{localStorage.removeItem("iob_token_semaphore")}}checkAccessTokenExpire(){if(this._refreshTimer&&(clearTimeout(this._refreshTimer),this._refreshTimer=null),this.isSecure){const e=ze.readTokens();if(e){const t=e.expires_in.getTime();if(t<Date.now()+3e4){const i=t<Date.now()+5500;console.log(`[TOKEN/${new Date().toISOString()}] Updating refresh token ${e.access_token}`),e.refresh_token?e.owner===this.connId||i?(e.owner===this.connId?console.log(`[TOKEN/${new Date().toISOString()}] We are the owner of the token`):console.log(`[TOKEN/${new Date().toISOString()}] We are not the owner of the token, but we will take ownership`),this.props.tokenTimeoutHandler?(console.log(`[TOKEN/${new Date().toISOString()}] Asking GUI if we should prolong the token`),this.props.tokenTimeoutHandler(t).then(r=>{r?(console.log(`[TOKEN/${new Date().toISOString()}] Token will be prolonged`),this.refreshTokens(e,i)):(console.log(`[TOKEN/${new Date().toISOString()}] Token will not be prolonged. Reloading the page`),setTimeout(()=>window.location.reload(),Date.now()>t?500:t-Date.now()))})):(console.log(`[TOKEN/${new Date().toISOString()}] No tokenTimeoutHandler defined. Prolonging the token`),this.refreshTokens(e,i))):this.lastAccessToken!==e.access_token?(console.log(`[TOKEN/${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/${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/${new Date().toISOString()}] We do not have a refresh token, so we need to reauthenticate`),setTimeout(()=>window.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 window.location.hostname.includes("amazonaws.com")||window.location.hostname.includes("iobroker.in")?!0:typeof window.socketUrl>"u"?!1:window.socketUrl.includes("iobroker.in")||window.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",(i,r)=>{i?t(i):e(r||null)})}})}async loadData(){if(this.loaded)return;const e=10;for(let t=1;t<=e;t++){if(this.doLoadData().catch(i=>console.error(`Cannot load data: ${i}`)),this.loaded)return;await GM(ze.isCloud()?5e3:1e3)}}async doLoadData(){var e,t,i,r,o,n,a,c,l;if(!this.loaded){if(!this.props.doNotLoadACL)try{this.acl=await this.getUserPermissions()}catch(N){this.onError(`Cannot read user permissions: ${N}`);return}try{this.props.admin5only&&!ze.isWeb()&&(!window.vendorPrefix||window.vendorPrefix==="@@vendorPrefix@@")?this._systemConfig=await this.getCompactSystemConfig():this._systemConfig=await this.getSystemConfig()}catch(N){this.onError(`Cannot read system config: ${N}`);return}this._systemConfig&&(this.systemLang=(e=this._systemConfig.common)==null?void 0:e.language,this.systemLang||(this.systemLang=window.navigator.userLanguage||window.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)),(i=(t=this.props).onLanguage)==null||i.call(t,this.systemLang),this.loaded=!0,(o=(r=this.props).onProgress)==null||o.call(r,rt.CONNECTED),this.firstConnect=!1,this.props.doNotLoadAllObjects?this.props.admin5only?this.objects={}:this.objects={"system.config":this._systemConfig}:this.objects=await this.getObjects(),(a=(n=this.props).onProgress)==null||a.call(n,rt.READY),this.onReadyDone||(this.onReadyDone=!0,(l=(c=this.props).onReady)==null||l.call(c,this.objects))}}authenticate(){window.location.search.includes("&href=")?window.location.href=`${window.location.protocol}//${window.location.host}${window.location.pathname}${window.location.search}`:window.location.href=`${window.location.protocol}//${window.location.host}${window.location.pathname}?login&href=${encodeURIComponent(window.location.search+window.location.hash)}`}async subscribeState(...e){let t,i,r;e.length===3?[t,i,r]=e:([t,r]=e,i=!1);let o;if(Array.isArray(t)?o=t:o=[t],typeof r!="function")throw new Error("The state change handler must be a function!");const n=[];for(let a=0;a<o.length;a++){const c=o[a];this.statesSubscribes[c]?!this.statesSubscribes[c].cbs.includes(r)&&this.statesSubscribes[c].cbs.push(r):(this.statesSubscribes[c]={reg:new RegExp(or(c)),cbs:[r]},t!==this.ignoreState&&n.push(c))}if(this.connected)if(n.length&&this._socket.emit("subscribe",n),i){let a;for(let c=0;c<o.length;c++){try{a=await this.getBinaryState(o[c])}catch(l){console.error(`Cannot getBinaryState "${o[c]}": ${JSON.stringify(l)}`),a=void 0}a!=null&&r(o[c],a)}}else if(o.find(a=>a.includes("*"))){let a;for(let c=0;c<o.length;c++){try{a=await this.getForeignStates(o[c])}catch(l){console.error(`Cannot getForeignStates "${o[c]}": ${JSON.stringify(l)}`);return}if(a)for(const[l,N]of Object.entries(a)){const u=r(l,N);u instanceof Promise&&u.catch(L=>console.error(`Cannot call state change handler: ${L}`))}}}else try{const a=await(ze.isWeb()?this.getStates(o):this.getForeignStates(o));if(a)for(const[c,l]of Object.entries(a)){const N=r(c,l);N instanceof Promise&&N.catch(u=>console.error(`Cannot call state change handler: ${u}`))}}catch(a){console.error(`Cannot getState "${o.join(", ")}": ${a.message}`);return}}async subscribeStateAsync(e,t){return this.subscribeState(e,t)}unsubscribeState(e,t){var o;let i;Array.isArray(e)?i=e:i=[e];const r=[];for(let n=0;n<i.length;n++){const a=i[n];if(this.statesSubscribes[a]){const c=this.statesSubscribes[a];if(t){const l=c.cbs.indexOf(t);l!==-1&&c.cbs.splice(l,1)}else c.cbs=[];(o=c.cbs)!=null&&o.length||(delete this.statesSubscribes[a],a!==this.ignoreState&&r.push(a))}}this.connected&&r.length&&this._socket.emit("unsubscribe",i)}subscribeObject(e,t){let i;if(Array.isArray(e)?i=e:i=[e],typeof t!="function")throw new Error("The object change handler must be a function!");const r=[];for(let o=0;o<i.length;o++){const n=i[o];this.objectsSubscribes[n]?!this.objectsSubscribes[n].cbs.includes(t)&&this.objectsSubscribes[n].cbs.push(t):(this.objectsSubscribes[n]={reg:new RegExp(or(n)),cbs:[t]},r.push(n))}return this.connected&&r.length&&this._socket.emit("subscribeObjects",r),Promise.resolve()}unsubscribeObject(e,t){var o;let i;Array.isArray(e)?i=e:i=[e];const r=[];for(let n=0;n<i.length;n++){const a=i[n];if(this.objectsSubscribes[a]){const c=this.objectsSubscribes[a];if(t){const l=c.cbs.indexOf(t);l!==-1&&c.cbs.splice(l,1)}else c.cbs=[];(o=c.cbs)!=null&&o.length||(delete this.objectsSubscribes[a],r.push(a))}}return this.connected&&r.length&&this._socket.emit("unsubscribeObjects",r),Promise.resolve()}objectChange(e,t){var o,n;let i;this.objects[e]&&(i={_id:e,type:this.objects[e].type});let r=!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,r=!0)):this.objects[e]&&(delete this.objects[e],r=!0);for(const[a,c]of Object.entries(this.objectsSubscribes))(a===e||c.reg.test(e))&&c.cbs.forEach(l=>{try{const N=l(e,t,i);N instanceof Promise&&N.catch(u=>console.error(`Cannot call object change handler: ${u}`))}catch(N){console.error(`Error by callback of objectChange: ${N}`)}});if(r){const a=(n=(o=this.props).onObjectChange)==null?void 0:n.call(o,e,t);a instanceof Promise&&a.catch(c=>console.error(`Cannot call object change handler: ${c}`))}}stateChange(e,t){for(const i of Object.values(this.statesSubscribes))if(i.reg.test(e))for(const r of i.cbs)try{const o=r(e,t??null);o instanceof Promise&&o.catch(n=>console.error(`Cannot call state change handler: ${n}`))}catch(o){console.error(`Error by callback of stateChanged: ${o}`)}}instanceMessage(e,t,i){var r;(r=this._instanceSubscriptions[t])==null||r.forEach(o=>{if(o.messageType===e){const n=o.callback(i,t,e);n instanceof Promise&&n.catch(a=>console.error(`Cannot call instance message handler: ${a}`))}})}fileChange(e,t,i){for(const r of Object.values(this.filesSubscribes))if(r.regId.test(e)&&r.regFilePattern.test(t))for(const o of r.cbs)try{o(e,t,i)}catch(n){console.error(`Error by callback of fileChange: ${n}`)}}async subscribeFiles(e,t,i){if(typeof i!="function")throw new Error("The state change handler must be a function!");let r;Array.isArray(t)?r=t:r=[t];const o=[];for(let n=0;n<r.length;n++){const a=r[n],c=`${e}$%$${a}`;this.filesSubscribes[c]?!this.filesSubscribes[c].cbs.includes(i)&&this.filesSubscribes[c].cbs.push(i):(this.filesSubscribes[c]={regId:new RegExp(or(e)),regFilePattern:new RegExp(or(a)),cbs:[i]},o.push(a))}return this.connected&&o.length&&this._socket.emit("subscribeFiles",e,o),Promise.resolve()}unsubscribeFiles(e,t,i){var n;let r;Array.isArray(t)?r=t:r=[t];const o=[];for(let a=0;a<r.length;a++){const c=r[a],l=`${e}$%$${c}`;if(this.filesSubscribes[l]){const N=this.filesSubscribes[l];if(i){const u=N.cbs.indexOf(i);u!==-1&&N.cbs.splice(u,1)}else N.cbs=[];(n=N.cbs)!=null&&n.length||(delete this.filesSubscribes[l],o.push(c))}}this.connected&&o.length&&this._socket.emit("unsubscribeFiles",e,o)}async request({cacheKey:e,forceUpdate:t,commandTimeout:i,onTimeout:r,requireAdmin:o,requireFeatures:n,executor:a}){if(o&&ze.isWeb())return Promise.reject(new Error(Ie.NOT_ADMIN));if(e&&!t&&e in this._promises)return this._promises[e];if(!this.connected)return Promise.reject(new Error(Ie.NOT_CONNECTED));if(n!=null&&n.length){for(const l of n)if(!await this.checkFeatureSupported(l))throw new Error(Ie.NOT_SUPPORTED)}const c=new Promise(async(l,N)=>{const u={elapsed:!1,clearTimeout:()=>{}};let L;i!==!1&&(L=setTimeout(()=>{u.elapsed=!0,r==null||r(),e&&this._promises[e]instanceof Promise&&delete this._promises[e],N(new Error(Ie.TIMEOUT))},i??this.props.cmdTimeout),u.clearTimeout=()=>{clearTimeout(L)});try{await a(l,N,u)}catch(g){e&&this._promises[e]instanceof Promise&&delete this._promises[e],N(new Error(g.toString()))}});return e&&(this._promises[e]=c),c}resetCache(e,t){t?Object.keys(this._promises).filter(i=>i.startsWith(e)).forEach(i=>{delete this._promises[i]}):delete this._promises[e]}getStates(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getStates",e,(r,o)=>{this.states=o??{},r?i(r):t(this.states)})}})}getState(e){return this.request({commandTimeout:!1,executor:(t,i)=>{if(e&&e===this.ignoreState){t(this.simStates[e]||{val:null,ack:!0});return}this._socket.emit("getState",e,(r,o)=>{r?i(r):t(o)})}})}getBinaryState(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getBinaryState",e,(r,o)=>{r?i(r):t(o)})}})}setBinaryState(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("setBinaryState",e,t,o=>{o?r(o):i()})}})}setState(e,t,i){return typeof i=="boolean"&&(t={val:t,ack:i}),this.request({commandTimeout:!1,executor:(r,o)=>{if(e&&e===this.ignoreState){let n;if(typeof i=="boolean"||typeof t=="object"&&t.val!==void 0?n=t:n={val:t,ack:!1,ts:Date.now(),lc:Date.now(),from:"system.adapter.vis.0"},this.simStates[e]=n,this.statesSubscribes[e])for(const a of this.statesSubscribes[e].cbs)try{const c=a(e,n);c instanceof Promise&&c.catch(l=>console.error(`Cannot call state change handler: ${l}`))}catch(c){console.error(`Error by callback of stateChanged: ${c}`)}r();return}this._socket.emit("setState",e,t,n=>{n?o(n):r()})}})}getObjects(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{if(!e&&this.objects){i(this.objects);return}this._socket.emit(ze.isWeb()?"getObjects":"getAllObjects",(o,n)=>{var a,c;t||(c=(a=this.props).onProgress)==null||c.call(a,rt.OBJECTS_LOADED),o?r(o):(this.objects=n??{},i(this.objects))})}})}getObjectsById(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getObjects",e,(r,o)=>{r?i(r):t(o)})}})}_subscribe(e){var t,i;if(e&&!this.subscribed){this.subscribed=!0,(t=this.props.autoSubscribes)!=null&&t.length&&this._socket.emit("subscribeObjects",this.props.autoSubscribes);const r=Object.keys(this.objectsSubscribes);r.length&&this._socket.emit("subscribeObjects",r),Object.keys(this.objectsSubscribes).forEach(o=>this._socket.emit("subscribeObjects",o)),this.props.autoSubscribeLog&&this._socket.emit("requireLog",!0),Object.keys(this.statesSubscribes).forEach(o=>this._socket.emit("subscribe",o)),Object.keys(this.filesSubscribes).forEach(o=>{const[n,a]=o.split("$%$");this._socket.emit("subscribeFiles",n,a)})}else if(!e&&this.subscribed){this.subscribed=!1,(i=this.props.autoSubscribes)!=null&&i.length&&this._socket.emit("unsubscribeObjects",this.props.autoSubscribes);const r=Object.keys(this.objectsSubscribes);r.length&&this._socket.emit("unsubscribeObjects",r),this.props.autoSubscribeLog&&this._socket.emit("requireLog",!1),Object.keys(this.statesSubscribes).forEach(o=>this._socket.emit("unsubscribe",o)),Object.keys(this.filesSubscribes).forEach(o=>{const[n,a]=o.split("$%$");this._socket.emit("unsubscribeFiles",n,a)})}}requireLog(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("requireLog",e,r=>{r?i(r):t()})}})}delObject(e,t=!1){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("delObject",e,{maintenance:t},o=>{o?r(o):i()})}})}delObjects(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("delObjects",e,{maintenance:t},o=>{o?r(o):i()})}})}setObject(e,t){return t?(t=JSON.parse(JSON.stringify(t)),delete t.from,delete t.user,delete t.ts,this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("setObject",e,t,o=>{o?r(o):i()})}})):Promise.reject(new Error("Null object is not allowed"))}getObject(e){return this.request({commandTimeout:!1,executor:(t,i)=>{if(e&&e===this.ignoreState){t({_id:this.ignoreState,type:"state",common:{name:"ignored state",type:"mixed"}});return}this._socket.emit("getObject",e,(r,o)=>{r?i(r):t(o)})}})}sendTo(e,t,i){return this.request({commandTimeout:!1,executor:r=>{this._socket.emit("sendTo",e,t,i,o=>{r(o)})}})}extendObject(e,t){return t?(t=JSON.parse(JSON.stringify(t)),delete t.from,delete t.user,delete t.ts,this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("extendObject",e,t,o=>{o?r(o):i()})}})):Promise.reject(new Error("Null object is not allowed"))}registerLogHandler(e){this.onLogHandlers.includes(e)||this.onLogHandlers.push(e)}unregisterLogHandler(e){const t=this.onLogHandlers.indexOf(e);t!==-1&&this.onLogHandlers.splice(t,1)}registerConnectionHandler(e){this.onConnectionHandlers.includes(e)||this.onConnectionHandlers.push(e)}unregisterConnectionHandler(e){const t=this.onConnectionHandlers.indexOf(e);t!==-1&&this.onConnectionHandlers.splice(t,1)}registerCmdStdoutHandler(e){this.onCmdStdoutHandler=e}unregisterCmdStdoutHandler(){this.onCmdStdoutHandler=void 0}registerCmdStderrHandler(e){this.onCmdStderrHandler=e}unregisterCmdStderrHandler(){this.onCmdStderrHandler=void 0}registerCmdExitHandler(e){this.onCmdExitHandler=e}unregisterCmdExitHandler(){this.onCmdExitHandler=void 0}getEnums(e,t){return this.request({cacheKey:`enums_${e||"all"}`,forceUpdate:t,commandTimeout:!1,executor:(i,r)=>{this._socket.emit("getObjectView","system","enum",{startkey:`enum.${e||""}`,endkey:e?`enum.${e}.香`:"enum.香"},(o,n)=>{if(o)r(o);else{const a={};if(n)for(let c=0;c<n.rows.length;c++)e&&n.rows[c].id===`enum.${e}`||(a[n.rows[c].id]=n.rows[c].value);i(a)}})}})}getObjectView(e,t,i){return this.getObjectViewCustom("system",i,e,t)}getObjectViewSystem(e,t,i){return this.getObjectViewCustom("system",e,t,i)}getObjectViewCustom(e,t,i,r){return this.request({commandTimeout:!1,executor:(o,n)=>{i=i||"",r=r||"香",this._socket.emit("getObjectView",e,t,{startkey:i,endkey:r},(a,c)=>{if(a)n(a);else{const l={};if(c&&c.rows)for(let N=0;N<c.rows.length;N++)l[c.rows[N].id]=c.rows[N].value;o(l)}})}})}readMetaItems(){return this.request({commandTimeout:!1,executor:(e,t)=>{this._socket.emit("getObjectView","system","meta",{startkey:"",endkey:"香"},(i,r)=>{var o;i?t(i):e((o=r.rows)==null?void 0:o.map(n=>n.value).filter(n=>!!n))})}})}readDir(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("readDir",e,t,(o,n)=>{o?r(o):i(n)})}})}readFile(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{this._socket.emit(i?"readFile64":"readFile",e,t,(n,a,c)=>{n?o(n):r({file:a,mimeType:c})})}})}writeFile64(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{if(typeof i=="string")this._socket.emit("writeFile",e,t,i,n=>{n?o(n):r()});else{const n=btoa(new Uint8Array(i).reduce((a,c)=>a+String.fromCharCode(c),""));this._socket.emit("writeFile64",e,t,n,a=>{a?o(a):r()})}}})}deleteFile(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("deleteFile",e,t,o=>{o?r(o):i()})}})}deleteFolder(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("deleteFolder",e,t,o=>{o?r(o):i()})}})}rename(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{this._socket.emit("rename",e,t,i,n=>{n?o(n):r()})}})}renameFile(e,t,i){return this.request({commandTimeout:!1,executor:(r,o)=>{this._socket.emit("renameFile",e,t,i,n=>{n?o(n):r()})}})}cmdExec(e,t,i,r){return this.request({commandTimeout:r,executor:(o,n,a)=>{e=Tt(e),this._socket.emit("cmdExec",e,i,t,c=>{a.elapsed||(a.clearTimeout(),c?n(c):o())})}})}getSystemConfig(e){return this.request({cacheKey:"systemConfig",forceUpdate:e,commandTimeout:!1,executor:async t=>{let i=await this.getObject("system.config");i??={},i.common??={},i.native??={},t(i)}})}getCompactSystemConfig(e){return this.request({cacheKey:"systemConfigCommon",forceUpdate:e,commandTimeout:!1,requireAdmin:!0,executor:(t,i)=>{this._socket.emit("getCompactSystemConfig",(r,o)=>{r?i(r):(o??={},o.common??={},o.native??={},t(o))})}})}getForeignStates(e){return this.request({commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getForeignStates",e||"*",(r,o)=>{r?i(r):t(o??{})})}})}getForeignObjects(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("getForeignObjects",e||"*",t,(o,n)=>{o?r(o):i(n)})}})}setSystemConfig(e){return this.setObject("system.config",e)}getRawSocket(){return this._socket}getHistory(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("getHistory",e,t,(o,n)=>{o?r(o):i(n)})}})}getHistoryEx(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("getHistory",e,t,(o,n,a,c)=>{o?r(o):i({values:n,sessionId:c,step:a})})}})}getIpAddresses(e,t){return e=Tt(e),this.request({cacheKey:`IPs_${e}`,forceUpdate:t,commandTimeout:!1,executor:async i=>{const r=await this.getObject(e);i((r==null?void 0:r.common.address)??[])}})}getVersion(e){return this.request({cacheKey:"version",forceUpdate:e,commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getVersion",(r,o,n)=>{r&&!o&&typeof r=="string"&&r.match(/\d+\.\d+\.\d+/)?t({version:r,serverName:"socketio"}):r?i(r):t({version:o,serverName:n})})}})}getWebServerName(){return this.request({cacheKey:"webName",commandTimeout:!1,executor:(e,t)=>{this._socket.emit("getAdapterName",(i,r)=>{i?t(i):e(r)})}})}fileExists(e,t){return this.request({commandTimeout:!1,executor:(i,r)=>{this._socket.emit("fileExists",e,t,(o,n)=>{o?r(o):i(!!n)})}})}getCurrentUser(){return this.request({commandTimeout:!1,executor:e=>{this._socket.emit("authEnabled",(t,i)=>{e(i)})}})}getUuid(){return this.request({cacheKey:"uuid",commandTimeout:!1,executor:async e=>{var i;const t=await this.getObject("system.meta.uuid");e((i=t==null?void 0:t.native)==null?void 0:i.uuid)}})}checkFeatureSupported(e,t){return this.request({cacheKey:`supportedFeatures_${e}`,forceUpdate:t,commandTimeout:!1,executor:(i,r)=>{this._socket.emit("checkFeatureSupported",e,(o,n)=>{o?r(o):i(n)})}})}getAdapterInstances(e,t){return typeof e=="boolean"&&(t=e,e=""),e=e||"",this.request({cacheKey:`instances_${e}`,forceUpdate:t,commandTimeout:!1,executor:async i=>{const r=e?`system.adapter.${e}.`:"system.adapter.",o=`${r}香`,n=await this.getObjectViewSystem("instance",r,o),a=Object.values(n);i(e?a.filter(c=>c.common.name===e):a)}})}getAdapters(e,t){return typeof e=="boolean"&&(t=e,e=""),e=e||"",this.request({cacheKey:`adapter_${e}`,forceUpdate:t,commandTimeout:!1,executor:async i=>{const r=await this.getObjectViewSystem("adapter",`system.adapter.${e||""}`,`system.adapter.${e||"香"}`),o=Object.values(r);i(e?o.filter(n=>n.common.name===e):o)}})}getGroups(e){return this.request({cacheKey:"groups",forceUpdate:e,commandTimeout:!1,executor:(t,i)=>{this._socket.emit("getObjectView","system","group",{startkey:"system.group.",endkey:"system.group.香"},(r,o)=>{r?i(r):t(Nn(o))})}})}logout(){return this.request({commandTimeout:!1,executor:(e,t)=>{this._socket.emit("logout",i=>{i?t(i):e(null)})}})}subscribeOnInstance(e,t,i,r){return this.request({commandTimeout:!1,executor:(o,n)=>{this._socket.emit("clientSubscribe",e,t,i,(a,c)=>{a?n(a):c&&(c.error?n(c.error):(e.startsWith("system.adapter.")||(e=`system.adapter.${e}`),this._instanceSubscriptions[e]=this._instanceSubscriptions[e]||[],this._instanceSubscriptions[e].find(l=>l.messageType===t&&l.callback===r)||this._instanceSubscriptions[e].push({messageType:t,callback:r}),o(c)))})}})}unsubscribeFromInstance(e,t,i){var n;e.startsWith("system.adapter.")||(e=`system.adapter.${e}`);let r;const o=[];do{r=!1;const a=(n=this._instanceSubscriptions[e])==null?void 0:n.findIndex(c=>(!t||c.messageType===t)&&(!i||c.callback===i));if(a!=null&&a!==-1){r=!0;const c=this._instanceSubscriptions[e][a].messageType;this._instanceSubscriptions[e].splice(a,1),this._instanceSubscriptions[e].length||delete this._instanceSubscriptions[e],this._instanceSubscriptions[e]&&this._instanceSubscriptions[e].find(N=>N.messageType===c)||o.push(this.request({commandTimeout:!1,executor:(N,u)=>{this._socket.emit("clientUnsubscribe",e,t,(L,g)=>L?u(L):N(g))}}))}}while(r&&(!i||!t));return o.length?Promise.all(o).then(a=>!!a.find(c=>c)):Promise.resolve(!1)}log(e,t){return e?this.request({commandTimeout:!1,executor:i=>(this._socket.emit("log",e,t),i(null))}):Promise.resolve(null)}setStateToIgnore(e){this.ignoreState=e}}function Fg(s,e){if(!e)return;let t;if(e.length<700&&(e.indexOf("/")!==-1||e.indexOf("\\")!==-1))if(s.toLowerCase().includes("private"))t="private";else if(e.toLowerCase().includes("private"))t="private";else if(s.toLowerCase().includes("public"))t="public";else if(e.toLowerCase().includes("public"))t="public";else if(s.toLowerCase().includes("chain"))t="chained";else if(e.toLowerCase().includes("chain"))t="chained";else return;else t=e.substring(0,26)==="-----BEGIN RSA PRIVATE KEY"||e.substring(0,22)==="-----BEGIN PRIVATE KEY"?"private":"public",t==="public"&&e.split("-----END CERTIFICATE-----").filter(r=>r.replace(/\r\n|\r|\n/,"").trim()).length>1&&(t="chained");return{name:s,type:t}}fun