UNPKG

iobroker.backitup

Version:

ioBroker.backitup allows you to backup and restore your ioBroker installation and other systems, such as databases, Zigbee, scripts and many more.

9 lines (8 loc) 85.4 kB
import{j as s}from"./jsx-runtime-e5CEFVx3.js";import{C as f,a as l}from"./ConfigCustomBackItUpSet__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-BhpZGuLJ.js";import{C as a}from"./ConfigCustomBackItUpSet__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-C1Lfb1yU.js";import{C as N,a as W}from"./ConfigCustomBackItUpSet__mf_v__runtimeInit__mf_v__-DPTpQ1gj.js";import{R as D,C as A}from"./ConfigCustomBackItUpSet__loadShare__react__loadShare__-BfsrHRhR.js";import{c as T}from"./_commonjsHelpers-CE1G-McA.js";import{G as C,S as M,a as q,b as P,c as H,d as Q,e as J,F as z,f as U,g as G}from"./index-B_AduhZ1.js";const{loadShare:X}=W,{initPromise:V}=N,K=V.then(h=>X("@iobroker/json-config",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"*"}}})),Y=await K.then(h=>h());var y=Y;class w extends y.ConfigGeneric{constructor(e){super(e),this.state.message=!1}isConfigFilled(e){return e==="ccu"?!!this.props.data.ccuHost&&!!this.props.data.ccuEnabled:e==="mySql"?!!this.props.data.mySqlUser&&!!this.props.data.mySqlEnabled:e==="sqlite"?!!this.props.data.sqlitePath&&!!this.props.data.sqliteEnabled:e==="pgSql"?!!this.props.data.pgSqlUser&&!!this.props.data.pgSqlEnabled:e==="influxDB"?!!this.props.data.influxDBName&&!!this.props.data.influxDBEnabled:e==="history"?!!this.props.data.historyPath&&!!this.props.data.historyEnabled:(this.showMessage(a.I18n.t("BackItUp Warning!"),a.I18n.t("Unknown config type %s",e)),!1)}fetchConfig=async(e,t)=>e==="ccu"?this.fetchCcuConfig(t):e==="mySql"?this.fetchMySqlConfig(t):e==="sqlite"?this.fetchSqliteConfig(t):e==="pgSql"?this.fetchPgSqlConfig(t):e==="influxDB"?this.fetchInfluxDBConfig(t):e==="history"?this.fetchHistoryConfig(t):(this.showMessage(a.I18n.t("BackItUp Warning!"),a.I18n.t("Unknown config type %s",e)),{changed:!1,found:!1});async fetchCcuConfig(e){const t=Object.values(await this.props.oContext.socket.getObjectViewCustom("system","instance","system.adapter.hm-rpc.","system.adapter.hm-rpc.香"));let n=!1,c=!1;if(t&&t.length){for(let o=0;o<t.length;o++){const r=t[o].common,i=t[o].native;if(r.enabled&&i){(e.ccuHost!==i.homematicAddress||e.ccuUsehttps!==i.useHttps)&&(e.ccuHost=i.homematicAddress,e.ccuUsehttps=i.useHttps,c=!0),n=t[o]._id;break}}if(!n)for(let o=0;o<t.length;o++){const r=t[o].native;r&&(e.ccuHost!==r.homematicAddress||e.ccuUsehttps!==r.useHttps)&&(e.ccuHost=r.homematicAddress,e.ccuUsehttps=r.useHttps,c=!0),n=t[o]._id}}return{changed:c,found:n}}async fetchMySqlConfig(e){const t=Object.values(await this.props.oContext.socket.getObjectViewCustom("system","instance","system.adapter.sql.","system.adapter.sql.香"));let n=!1,c=!1;if(t&&t.length){for(let o=0;o<t.length;o++){const r=t[o].common,i=t[o].native;if(r.enabled&&(i==null?void 0:i.dbtype)==="mysql"){const p=i.port==="0"?3306:i.port||3306;(e.mySqlUser!==i.user||e.mySqlPassword!==i.password||e.mySqlHost!==i.host||e.mySqlPort!==p||e.mySqlName!==i.dbname)&&(e.mySqlUser=i.user,e.mySqlPassword=i.password,e.mySqlHost=i.host,e.mySqlPort=p,e.mySqlName=i.dbname,c=!0),n=t[o]._id;break}}if(!n)for(let o=0;o<t.length;o++){const r=t[o].native;if((r==null?void 0:r.dbtype)==="mysql"){const i=r.port==="0"?3306:r.port||3306;(e.mySqlUser!==r.user||e.mySqlPassword!==r.password||e.mySqlHost!==r.host||e.mySqlPort!==i||e.mySqlName!==r.dbname)&&(e.mySqlUser=r.user,e.mySqlPassword=r.password,e.mySqlHost=r.host,e.mySqlPort=i,e.mySqlName=r.dbname,c=!0),n=t[o]._id;break}}}return{changed:c,found:n}}async fetchSqliteConfig(e){const t=Object.values(await this.props.oContext.socket.getObjectViewCustom("system","instance","system.adapter.sql.","system.adapter.sql.香"));let n=!1,c=!1;if(t&&t.length){for(let o=0;o<t.length;o++){const r=t[o].common,i=t[o].native;if(r.enabled&&i&&i.dbtype==="sqlite"&&i.fileName){const d=i.fileName.split("/")>1?i.fileName:`/opt/iobroker/iobroker-data/sqlite/${i.fileName}`;e.sqlitePath!==d&&(e.sqlitePath=d,c=!0),n=t[o]._id;break}}if(!n)for(let o=0;o<t.length;o++){const r=t[o].native;if((r==null?void 0:r.dbtype)==="sqlite"&&r.fileName){const p=r.fileName.split("/")>1?r.fileName:`/opt/iobroker/iobroker-data/sqlite/${r.fileName}`;e.sqlitePath!==p&&(e.sqlitePath=p,c=!0),n=t[o]._id;break}}}return{changed:c,found:n}}async fetchPgSqlConfig(e){const t=Object.values(await this.props.oContext.socket.getObjectViewCustom("system","instance","system.adapter.sql.","system.adapter.sql.香"));let n=!1,c=!1;if(t&&t.length){for(let o=0;o<t.length;o++){const r=t[o].common,i=t[o].native;if(r.enabled&&(i==null?void 0:i.dbtype)==="postgresql"){const p=i.port==="0"?5432:i.port||5432;(e.pgSqlUser!==i.user||e.pgSqlPassword!==i.password||e.pgSqlHost!==i.host||e.pgSqlPort!==p||e.pgSqlName!==i.dbname)&&(e.pgSqlUser=i.user,e.pgSqlPassword=i.password,e.pgSqlHost=i.host,e.pgSqlPort=p,e.pgSqlName=i.dbname,c=!0),n=t[o]._id;break}}if(!n)for(let o=0;o<t.length;o++){const r=t[o].native;if((r==null?void 0:r.dbtype)==="postgresql"){const i=r.port==="0"?5432:r.port||5432;(e.pgSqlUser!==r.user||e.pgSqlPassword!==r.password||e.pgSqlHost!==r.host||e.pgSqlPort!==i||e.pgSqlName!==r.dbname)&&(e.pgSqlUser=r.user,e.pgSqlPassword=r.password,e.pgSqlHost=r.host,e.pgSqlPort=i,e.pgSqlName=r.dbname,c=!0),n=t[o]._id;break}}}return{changed:c,found:n}}async fetchInfluxDBConfig(e){const t=Object.values(await this.props.oContext.socket.getObjectViewCustom("system","instance","system.adapter.influxdb.","system.adapter.influxdb.香"));let n=!1,c=!1;if(t&&t.length){for(let o=0;o<t.length;o++){const r=t[o].common,i=t[o].native;if(r.enabled){(e.influxDBHost!==i.host||e.influxDBVersion!==i.dbversion||e.influxDBProtocol!==i.protocol||e.influxDBName!==i.dbname||i.dbversion==="2.x"&&e.influxDBPort!==i.port)&&(e.influxDBHost=i.host,e.influxDBVersion=i.dbversion,e.influxDBProtocol=i.protocol,e.influxDBName=i.dbname,i.port&&i.dbversion==="2.x"&&(e.influxDBPort=i.port),c=!0),n=t[o]._id;break}}if(!n&&t.length&&t[0].native){const o=t[0].native;o&&(e.influxDBHost!==o.host||e.influxDBVersion!==o.dbversion||e.influxDBProtocol!==o.protocol||e.influxDBName!==o.dbname||o.dbversion==="2.x"&&e.influxDBPort!==o.port)&&(e.influxDBHost=o.host,e.influxDBVersion=o.dbversion,e.influxDBProtocol=o.protocol,e.influxDBName=o.dbname,o.port&&o.dbversion==="2.x"&&(e.influxDBPort=o.port),c=!0),n=t[0]._id}}return{changed:c,found:n}}async fetchHistoryConfig(e){const t=Object.values(await this.props.oContext.socket.getObjectViewCustom("system","instance","system.adapter.history.","system.adapter.history.香"));let n="",c=!1,o=!1;if(t!=null&&t.length){for(let i=0;i<t.length;i++){const p=t[i].common,d=t[i].native;if(p.enabled&&d){const u=d.storeDir&&!d.storeDir.startsWith("/opt/iobroker/backups")?d.storeDir:"/opt/iobroker/iobroker-data/history";e.historyPath!==u&&(e.historyPath=u,o=!0),n=d.storeDir,c=t[i]._id;break}}if(!c&&t[0]){const i=t[0].native;if(i){const p=i.storeDir&&!i.storeDir.startsWith("/opt/iobroker/backups")?i.storeDir:"/opt/iobroker/iobroker-data/history";e.historyPath!==p&&(e.historyPath=p,o=!0),n=i.storeDir,c=t[0]._id}}}let r;return c&&(n?n!=null&&n.startsWith("/opt/iobroker/backups")&&(r=a.I18n.t(`The storage path of %s must not be identical to the path for backups. The default path of the history adapter has been set. Please change the path in the history adapter!`,c.substring(15))):r=a.I18n.t(`No storage path of %s is configured. The default path of the history adapter has been set.`,c.substring(15))),{changed:o,found:c,message:r}}checkAdapterInstall=async(e,t)=>{const n=this.props.common.host;let c=e;(e==="pgsql"||e==="mysql"||e==="sqlite")&&(c="sql");const o=["zigbee","esphome","zigbee2mqtt","node-red","yahka","jarvis","history"];{const r=Object.values(await this.props.oContext.socket.getObjectViewCustom("system","instance",`system.adapter.${c}.`,`system.adapter.${c}.香`));if(r!=null&&r.length){let i=!1;for(let p=0;p<r.length;p++)if(r[p].common.host===n||t){i=!0;break}!i&&o.includes(c)&&this.showMessage(a.I18n.t("BackItUp Warning!"),a.I18n.t(`No %s Instance found on this host. Please check your System`,c),"warning")}else o.includes(c)&&this.showMessage(a.I18n.t("BackItUp Warning!"),a.I18n.t(`No %s Instance found on this host. Please check your System`,c),"warning")}};showMessage=(e,t,n)=>{this.setState({message:{title:e,text:t,level:n||"info"}})};renderMessage(){if(!this.state.message)return null;const e=this.state.message.text.split(` `).map(t=>s.jsx("div",{style:{minHeight:24},children:t},t));return this.state.message?s.jsx(a.DialogMessage,{title:this.state.message.title,text:e,icon:this.state.message.level==="info"?s.jsx(f.Info,{}):this.state.message.level==="warning"?s.jsx(f.Warning,{style:{color:"orange"}}):this.state.message.level==="error"?s.jsx(l.Alert,{style:{color:"red"}}):void 0,onClose:()=>this.setState({message:!1})}):null}}class Z extends w{renderItem(){return s.jsxs(s.Fragment,{children:[s.jsx(l.FormControlLabel,{control:s.jsx(l.Checkbox,{checked:(this.props.schema.custom.adapter==="hm-rpc"||this.props.schema.custom.adapter==="javascript"||this.props.schema.custom.adapter==="backitup")&&this.props.data.hostType==="Slave"?!1:this.props.data[this.props.attr]?this.props.data[this.props.attr]:!1,disabled:(this.props.schema.custom.adapter==="influxdb"||this.props.schema.custom.adapter==="sql")&&this.props.data._nonSupportDockerDB||(this.props.schema.custom.adapter==="hm-rpc"||this.props.schema.custom.adapter==="javascript"||this.props.schema.custom.adapter==="backitup")&&this.props.data.hostType==="Slave",onChange:e=>{e.target.checked&&(this.props.schema.custom.adapter?this.checkAdapterInstall(this.props.schema.custom.adapter,!!this.props.schema.custom.allHosts).catch(t=>console.error(t)):this.props.schema.custom.alert&&this.setState({message:{text:a.I18n.t(this.props.schema.custom.alert),title:a.I18n.t(this.props.schema.title)}})),this.props.onChange({...this.props.data,[this.props.attr]:e.target.checked})}}),label:a.I18n.t(this.props.schema.label||this.props.schema.custom.adapter)}),this.renderMessage()]})}}const _={paper:{height:"calc(100% - 64px)"},textTime:{display:"inline-block",width:95},responseTextTime:{display:"inline-block",width:70},textLevel:{display:"inline-block",width:50},"textLevel-ERROR":{color:"red"},"textLevel-WARN":{color:"orange"},"textLevel-INFO":{color:"#00b204"},textSource:{display:"inline-block",width:100,textAlign:"left"},text:{display:"inline-block"},responseText:{display:"inline-block",wordWrap:"break-word"},textLine:{whiteSpace:"nowrap"},responseTextLine:{whiteSpace:"normal"},dialogContent:{position:"relative",padding:16},logContainer:{fontSize:12,fontFamily:"monospace",padding:8,border:"1px solid grey",borderRadius:5,overflow:"auto",boxSizing:"border-box",height:"calc(100% - 16px - 4px)",width:"calc(100% - 16px)"},responseLogContainer:{position:"relative",display:"flex",flexDirection:"column",gap:15},dialogActions:{display:"flex",flexDirection:"column",alignItems:"stretch"}};class I extends y.ConfigGeneric{lastExecutionLine;textRef;closeTimeout;constructor(e){super(e),this.state={...this.state,executing:!1,executionDialog:!1,executionLog:[],closeOnReady:!1,styles:_,isFullScreen:!1},this.lastExecutionLine="",this.textRef=D.createRef()}static getTime(){const e=new Date;return`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}:${e.getSeconds().toString().padStart(2,"0")}.${e.getMilliseconds().toString().padStart(3,"0")}`}onOutput=(e,t)=>{if(t&&t.val&&t.val!==this.lastExecutionLine){this.lastExecutionLine=t.val;const n=[...this.state.executionLog],c=(t.val||"").toString().replace(/\n$/,"").split(` `),o=I.getTime();if(c.forEach(r=>{r=r.trim();const i=r.match(/^\[(\w+)] \[(\w+)] - (.*)/);if(i)n.push({level:i[1],source:i[2],ts:o,text:i[3]});else if(t.val.startsWith("[EXIT]")){const p=t.val.match(/^\[EXIT] ([-\d]+)/);n.push({level:p[1]==="0"?"INFO":"WARN",source:"gui",ts:o,text:p[1]==="0"?a.I18n.t("The backup was successfully created!"):a.I18n.t("The backup could not be created completely!")})}else n.push({text:r})}),this.textRef.current&&this.textRef.current.scrollTop+this.textRef.current.clientHeight>=this.textRef.current.scrollHeight&&setTimeout(()=>this.textRef.current.scrollTop=this.textRef.current.scrollHeight,100),this.setState({executionLog:n}),t.val.startsWith("[EXIT]")){this.setState({executing:!1});const r=t.val.match(/^\[EXIT] ([-\d]+)/);this.state.closeOnReady&&(!r||r[1]==="0")&&(this.closeTimeout=this.closeTimeout||setTimeout(()=>{this.closeTimeout=null,this.setState({executionDialog:!1})},1500))}}};async componentDidMount(){super.componentDidMount(),await this.props.oContext.socket.subscribeState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.oneClick.${this.props.schema.custom.backUpType}`,this.onEnabled),await this.props.oContext.socket.subscribeState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.output.line`,this.onOutput),this.updateFullScreenMode(),window.addEventListener("resize",this.updateFullScreenMode)}onEnabled=(e,t)=>{e===`${this.props.oContext.adapterName}.${this.props.oContext.instance}.oneClick.${this.props.schema.custom.backUpType}`&&!!(t!=null&&t.val)!==this.state.executing&&this.setState({executing:!!(t!=null&&t.val)})};componentWillUnmount(){super.componentWillUnmount(),this.props.oContext.socket.unsubscribeState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.oneClick.${this.props.schema.custom.backUpType}`,this.onEnabled),this.props.oContext.socket.unsubscribeState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.output.line`,this.onOutput),this.closeTimeout&&clearTimeout(this.closeTimeout),this.closeTimeout=null,window.removeEventListener("resize",this.updateFullScreenMode)}updateFullScreenMode=()=>{const e=window.matchMedia("(max-width: 600px)").matches;this.setState({isFullScreen:e})};renderLine(e,t){return s.jsxs("div",{style:{...this.state.isFullScreen?this.state.styles.responseTextLine:this.state.styles.textLine},children:[s.jsx("div",{style:{...this.state.styles.textTime,...e.level?this.state.styles[`textLevel-${e.level}`]:void 0},children:e.ts}),s.jsx("div",{style:{...this.state.styles.textLevel,...e.level?this.state.styles[`textLevel-${e.level}`]:void 0},children:e.level}),s.jsx("div",{style:{...this.state.styles.textSource,...e.level?this.state.styles[`textLevel-${e.level}`]:void 0},children:e.source}),s.jsx("div",{style:{...this.state.isFullScreen?this.state.styles.responseText:this.state.styles.text,...e.level?this.state.styles[`textLevel-${e.level}`]:void 0},children:e.text})]},t)}renderExecutionDialog(){return this.state.executionDialog?s.jsxs(l.Dialog,{open:!0,onClose:()=>this.setState({executionDialog:!1}),maxWidth:"lg",fullWidth:!0,fullScreen:this.state.isFullScreen,sx:{"& .MuiDialog-paper":this.state.styles.paper},children:[s.jsxs(l.DialogTitle,{children:[s.jsx(f.CloudUploadOutlined,{style:{width:24,height:24,margin:"0 10px -4px 0"}}),a.I18n.t("BackItUp execution:")]}),s.jsxs(l.DialogContent,{style:this.state.styles.dialogContent,children:[this.state.executing?s.jsx(l.LinearProgress,{style:{position:"absolute",top:0,left:24,width:"calc(100% - 64px)"}}):s.jsx("div",{style:{height:4,width:"calc(100% - 64px)"}}),s.jsx("div",{style:{...this.state.styles.logContainer,...this.state.isFullScreen?this.state.styles.responseLogContainer:void 0,backgroundColor:this.props.oContext.themeType==="dark"?"#111":"#EEE"},ref:this.textRef,children:this.state.executionLog.map((e,t)=>this.renderLine(e,t))})]}),s.jsxs(l.DialogActions,{style:{...this.state.isFullScreen?this.state.styles.dialogActions:void 0},children:[s.jsx(l.FormControlLabel,{control:s.jsx(l.Checkbox,{disabled:!this.state.executing,checked:this.state.closeOnReady,onChange:e=>this.setState({closeOnReady:e.target.checked})}),label:a.I18n.t("Close on ready")}),s.jsx(l.Button,{variant:"contained",color:this.props.color,onClick:()=>this.setState({executionDialog:!1}),children:a.I18n.t("Close")})]})]}):null}renderItem(){return s.jsxs(s.Fragment,{children:[s.jsx(l.Button,{disabled:!this.props.alive||this.state.executing,onClick:()=>this.setState({executionDialog:!0,executionLog:[{ts:I.getTime(),level:"INFO",text:a.I18n.t("starting Backup..."),source:"gui"}],executing:!0},async()=>{this.lastExecutionLine="",await this.props.oContext.socket.setState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.oneClick.${this.props.schema.custom.backUpType}`,!0)}),className:this.props.className,color:this.props.color,variant:"contained",style:this.props.style,endIcon:s.jsx(f.CloudUploadOutlined,{}),children:this.props.schema.label?a.I18n.t(this.props.schema.label):a.I18n.t("Backup now")}),this.renderExecutionDialog()]})}}class $ extends w{renderItem(){return s.jsxs(s.Fragment,{children:[s.jsx(l.Button,{variant:"contained",endIcon:s.jsx(f.Search,{}),onClick:async()=>{const e={...this.props.data},t=await this.fetchConfig(this.props.schema.custom.adapter,e);t.found?t.changed?(this.showMessage(a.I18n.t("BackItUp Information!"),t.message||a.I18n.t("Config taken from %s",t.found.substring(15))),this.props.onChange(e)):this.showMessage(a.I18n.t("BackItUp Information!"),t.message||a.I18n.t("Config found in %s, but nothing changed",t.found.substring(15))):this.showMessage(a.I18n.t("BackItUp Warning!"),a.I18n.t("No config found"),"warning")},children:a.I18n.t("Detect config")}),this.renderMessage()]})}}class ee extends w{async componentDidMount(){if(super.componentDidMount(),!this.isConfigFilled(this.props.schema.adapter)){const e={...this.props.data};(await this.fetchConfig(this.props.schema.adapter,e)).changed&&this.props.onChange(e)}}renderItem(){return this.renderMessage()}}class te extends y.ConfigGeneric{googleAuthWindow;componentDidMount(){super.componentDidMount(),window.addEventListener?window.addEventListener("message",this.onMessage,!1):window.attachEvent("onmessage",this.onMessage,!1)}componentWillUnmount(){super.componentWillUnmount(),window.removeEventListener?window.removeEventListener("message",this.onMessage,!1):window.detachEvent("onmessage",this.onMessage,!1)}onMessage=e=>{var t;if(e.origin==="https://googleauth.iobroker.in"&&(typeof e.data=="string"&&e.data.startsWith("google-authentication:")||typeof e.message=="string"&&e.message.startsWith("google-authentication:"))){const n=(e.data||e.message).split(":");n[1]==="success"?(this.setState({googleDriveUrl:"",googledriveAccessTokens:n[2],success:!0},()=>this.props.onChange({...this.props.data,googledriveAccessTokens:this.state.googledriveAccessTokens})),(t=this.googleAuthWindow)==null||t.postMessage("close",e.origin),this.googleAuthWindow=null):this.props.onError&&this.props.onError(n[2])}};onOpenUrl(){this.googleAuthWindow=window.open(this.state.googleDriveUrl,"ioBrokerGoogleAuth"),(!this.googleAuthWindow||this.googleAuthWindow.closed||typeof this.googleAuthWindow.closed>"u")&&this.setState({blocked:!0})}renderItem(){var e,t;return s.jsxs("div",{style:{width:"100%",margin:"0 0 1rem 0"},children:[s.jsx(l.Button,{disabled:!!this.state.googleDriveUrl||!this.props.alive||this.state.running,endIcon:s.jsx(f.CloudUpload,{}),variant:"contained",onClick:()=>this.setState({running:!0},async()=>{const n=await this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,"authGoogleDrive",{url:`${window.location.protocol}//${window.location.host}${window.location.pathname}`});this.setState({googleDriveUrl:n.url,running:!1},()=>this.onOpenUrl())}),children:a.I18n.t(this.props.data.googledriveAccessTokens?"Renew Google Drive Access":"Get Google Drive Access")}),this.state.blocked?s.jsx("div",{style:{color:"red",fontSize:16,marginTop:20},children:a.I18n.t("Please allow popups in your browser for this page!")}):null,this.state.success&&((e=this.props.originalData)==null?void 0:e.googledriveAccessTokens)!==this.state.googledriveAccessTokens?s.jsx("div",{style:{color:"green",fontSize:16,marginTop:20},children:a.I18n.t("Successfully authorized. Now please be sure, the configuration is saved.")}):null,this.state.success&&((t=this.props.originalData)==null?void 0:t.googledriveAccessTokens)===this.state.googledriveAccessTokens?s.jsx("div",{style:{color:"green",fontWeight:"bold",fontSize:16,marginTop:20},children:a.I18n.t("Successfully authorized!")}):null,!this.state.success&&this.props.data.googledriveAccessTokens?s.jsx("div",{style:{color:"green",fontWeight:"bold",fontSize:16,marginTop:20},children:a.I18n.t("Authorization token exists")}):null,this.state.googleDriveUrl?s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{width:"100%",margin:"1rem 0 1rem 0"},children:[s.jsx("span",{style:{marginRight:4},children:`${a.I18n.t("Authorize this app by visiting this url:")}`}),s.jsx("br",{}),s.jsx("a",{target:"_blank",href:this.state.googleDriveUrl,rel:"noreferrer",children:this.state.googleDriveUrl})]}),s.jsx(l.TextField,{value:this.state.googledriveAccessTokens,label:a.I18n.t("Enter the code from that page here"),variant:"standard",onChange:n=>{this.setState({googledriveAccessTokens:n.target.value},()=>this.props.onChange({...this.props.data,googledriveAccessTokens:this.state.googledriveAccessTokens}))},fullWidth:!0})]}):null]})}}class se extends y.ConfigGeneric{renderItem(){return s.jsxs("div",{style:{width:"100%",margin:"0 0 1rem 0"},children:[s.jsx("div",{style:{width:"100%",margin:"0 0 1rem 0"},children:s.jsxs("span",{hidden:!!this.state.onedriveUrl,children:[s.jsx("span",{style:{marginRight:4},children:`${a.I18n.t("OneDrive refresh token:")}`}),a.I18n.t(this.state.onedriveState==="Present"||this.props.data.onedriveAccessJson?"Present":"Not present")]})}),s.jsx(l.Button,{disabled:!!this.state.onedriveUrl||!this.props.alive||this.state.running,endIcon:s.jsx(f.CloudUpload,{}),variant:"contained",onClick:()=>this.setState({running:!0},async()=>{const e=await this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,"authOnedrive",null);this.setState({onedriveUrl:e.url,running:!1})}),children:a.I18n.t(this.props.data.onedriveAccessJson?"Renew OneDrive Access":"Get OneDrive Access")}),this.state.onedriveUrl?s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{width:"100%",margin:"1rem 0 1rem 0"},children:[s.jsx("span",{style:{marginRight:4},children:`${a.I18n.t("Authorize this app by visiting this url:")}`}),s.jsx("br",{}),s.jsx("a",{target:"_blank",href:this.state.onedriveUrl,rel:"noreferrer",children:this.state.onedriveUrl})]}),s.jsx(l.TextField,{label:a.I18n.t("Enter the code from that page here"),variant:"standard",onChange:e=>this.setState({code:e.target.value}),fullWidth:!0}),s.jsx(l.Button,{style:{margin:"1rem 0 1rem 0"},disabled:!this.state.onedriveUrl||!this.props.alive||this.state.running,endIcon:s.jsx(f.CloudUpload,{}),variant:"contained",onClick:()=>this.setState({running:!0},async()=>{const e=await this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,"authOnedrive",{code:this.state.code});this.props.onChange({...this.props.data,onedriveAccessJson:e.json}),this.setState({onedriveState:e.done?"Present":"Not present",running:!1,onedriveUrl:null})}),children:a.I18n.t("Submit")})]}):null]})}}class oe extends y.ConfigGeneric{authWindow;async componentDidMount(){super.componentDidMount(),window.addEventListener?window.addEventListener("message",this.onMessage,!1):window.attachEvent("onmessage",this.onMessage,!1),await this.props.oContext.socket.subscribeState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.info.dropboxTokens`,this.onTokensUpdated);const e=await this.props.oContext.socket.getState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.info.dropboxTokens`);if(e){const t=JSON.parse(e.val);new Date(t.access_token_expires_on).getTime()>Date.now()&&this.setState({accessTokens:e.val})}}onTokensUpdated=(e,t)=>{if(t!=null&&t.val){const n=JSON.parse(t.val);if(new Date(n.access_token_expires_on).getTime()>Date.now()){this.state.accessTokens!==t.val&&this.setState({accessTokens:t.val});return}}this.setState({accessTokens:""})};componentWillUnmount(){super.componentWillUnmount(),window.removeEventListener?window.removeEventListener("message",this.onMessage,!1):window.detachEvent("onmessage",this.onMessage,!1),this.props.oContext.socket.unsubscribeState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.info.dropboxTokens`,this.onTokensUpdated)}saveToken(e){try{e&&!e.startsWith("{")&&(e=atob(e));const t=JSON.parse(e);t.access_token&&t.refresh_token&&t.expires_in&&(t.access_token_expires_on||=new Date(Date.now()+t.expires_in*1e3).toISOString(),this.props.oContext.socket.setState(`${this.props.oContext.adapterName}.${this.props.oContext.instance}.info.dropboxTokens`,JSON.stringify(t),!0).catch(n=>console.log(`Error occurred: ${n}`)))}catch(t){console.log(t)}}onMessage=e=>{var t;if(e.origin==="https://oauth2.iobroker.in"&&(typeof e.data=="string"&&e.data.startsWith("dropbox-authentication:")||typeof e.message=="string"&&e.message.startsWith("dropbox-authentication:"))){const n=(e.data||e.message).split(":");n[1]==="success"?(this.setState({url:"",accessTokens:n[2],success:!0},()=>this.saveToken(this.state.accessTokens)),(t=this.authWindow)==null||t.postMessage("close",e.origin),this.authWindow=null):this.props.onError&&this.props.onError(n[2])}};onOpenUrl(){this.authWindow=window.open(this.state.url,"ioBrokerDropBoxAuth"),(!this.authWindow||this.authWindow.closed||typeof this.authWindow.closed>"u")&&this.setState({blocked:!0})}renderItem(){let e="";if(this.state.accessTokens)try{const t=JSON.parse(this.state.accessTokens);e=new Date(t.access_token_expires_on).toLocaleString()}catch{}return s.jsxs("div",{style:{width:"100%",margin:"0 0 1rem 0"},children:[s.jsx(l.Button,{disabled:!!this.state.url||!this.props.alive||this.state.running,endIcon:s.jsx(f.CloudUpload,{}),variant:"contained",onClick:()=>this.setState({running:!0},async()=>{const t=await this.props.oContext.socket.sendTo(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,"authDropbox");this.setState({url:t.url,running:!1},()=>this.onOpenUrl())}),children:a.I18n.t(this.state.accessTokens?"Renew DropBox Access":"Get DropBox Access")}),this.state.blocked?s.jsx("div",{style:{color:"red",fontSize:16,marginTop:20},children:a.I18n.t("Please allow popups in your browser for this page!")}):null,this.state.accessTokens?s.jsx("div",{style:{color:"green",fontSize:16,marginTop:20},children:this.props.alive?a.I18n.t("Successfully authorized. Token valid till %s and will be automatically renewed.",e):a.I18n.t("Successfully authorized. Token valid till %s but it can expire as the instance is not running.",e)}):null,this.state.url?s.jsxs(s.Fragment,{children:[s.jsxs("div",{style:{width:"100%",margin:"1rem 0 1rem 0"},children:[s.jsx("span",{style:{marginRight:4},children:`${a.I18n.t("Authorize this app by visiting this url:")}`}),s.jsx("br",{}),s.jsx("a",{target:"_blank",href:this.state.url,rel:"noreferrer",children:this.state.url})]}),s.jsx(l.TextField,{value:this.state.accessTokens,label:a.I18n.t("Enter the code from that page here"),variant:"standard",onChange:t=>{let n=t.target.value;n&&!n.startsWith("{")&&(n=atob(n));try{const c=JSON.parse(n);c.access_token&&(c.access_token_expires_on=new Date(Date.now()+(c.expires_in-10)*1e3).toISOString(),this.setState({accessTokens:JSON.stringify(c)},()=>this.saveToken(this.state.accessTokens)))}catch{}},fullWidth:!0})]}):null]})}}class ie extends w{instanceRead;async componentDidMount(){super.componentDidMount();const e=y.ConfigGeneric.getValue(this.props.data,this.props.attr),t=y.ConfigGeneric.getValue(this.props.data,this.props.schema.custom.adapter==="telegram"?"telegramUser":"discordTarget"),c=Object.values(await this.props.oContext.socket.getObjectViewCustom("system","instance",`system.adapter.${this.props.schema.custom.adapter}.`,`system.adapter.${this.props.schema.custom.adapter}.香`)).map(o=>({value:o._id.substring(15),label:o._id.substring(15)}));c.unshift({value:"_",label:"none"}),this.setState({instances:c,instance:e,target:t},()=>{this.readTargets()})}async fillTelegramUser(){var e;if((e=this.state.instance)!=null&&e.startsWith("telegram.")){if(this.instanceRead!==this.state.instance){let t=!1;const n=await this.props.oContext.socket.getObject(`system.adapter.${this.state.instance}`);n&&n.native&&(t=n.native.useUsername);const c=await this.props.oContext.socket.getState(`${this.state.instance}.communicate.users`),o=c==null?void 0:c.val,r=[{value:"allTelegramUsers",label:"All Receiver"}];if(o){this.instanceRead=this.state.target;const i=JSON.parse(o);for(const p in i)t?r.push({value:i[p].userName,label:i[p].userName}):r.push({value:i[p].firstName,label:i[p].firstName})}this.setState({targets:r})}}else this.props.data.telegramUser!=="allTelegramUsers"&&setTimeout(()=>this.props.onChange({...this.props.data,telegramUser:"allTelegramUsers"}),50)}async fillDiscordTarget(){var e;if((e=this.state.instance)!=null&&e.startsWith("discord.")){if(this.instanceRead!==this.state.instance){const t=await this.props.oContext.socket.getState(`system.adapter.${this.state.instance}.alive`);if(t!=null&&t.val){const n=await this.props.oContext.socket.sendTo(this.state.instance,"getNotificationTargets",{});if(Array.isArray(n)){this.instanceRead=this.state.instance;const c=[{value:"_",label:"none"}];for(let o=0;o<n.length;o++)c.push({value:n[o].value,label:n[o].label});this.setState({targets:c})}}}}else{const t=[{value:"_",label:"none"}];this.setState({targets:t}),this.props.data.discordTarget&&setTimeout(()=>this.props.onChange({...this.props.data,discordTarget:""}),50)}}async readTargets(){this.props.schema.custom.adapter==="telegram"?await this.fillTelegramUser():this.props.schema.custom.adapter==="discord"&&await this.fillDiscordTarget()}renderItem(){var n,c;const e=(n=this.state.instances)==null?void 0:n.find(o=>o.value===(this.state.instance||"")),t=(c=this.state.targets)==null?void 0:c.find(o=>o.value===(this.state.target||""));return s.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fit, minmax(300px, 1fr))",gap:12,justifyContent:"space-evenly",alignContent:"center",justifyItems:"stretch",gridAutoRows:"1fr"},children:[this.state.instances?s.jsxs(l.FormControl,{style:{width:"100%",marginRight:10},variant:"standard",children:[s.jsx(l.InputLabel,{children:a.I18n.t(this.props.schema.label)}),s.jsx(l.Select,{variant:"standard",value:this.state.instance||"_",renderValue:()=>e?this.getText(e.label,e.label!=="none"):this.state.instance||"",onChange:o=>this.setState({instance:o.target.value==="_"?"":o.target.value},async()=>{await this.readTargets(),await this.onChange(this.props.attr,this.state.instance)}),children:this.state.instances.map((o,r)=>s.jsx(l.MenuItem,{value:o.value,children:this.getText(o.label,(o==null?void 0:o.label)!=="none")},r))}),this.props.schema.help?s.jsx(l.FormHelperText,{children:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}):null]}):null,this.state.targets&&(this.props.schema.custom.adapter==="telegram"||this.props.schema.custom.adapter==="discord")?s.jsxs(l.FormControl,{variant:"standard",children:[s.jsx(l.InputLabel,{children:a.I18n.t(this.props.schema.custom.adapter==="telegram"?"Telegram receiver":"Discord receiver")}),s.jsx(l.Select,{disabled:!this.state.instance,variant:"standard",value:this.state.target||"_",renderValue:()=>t?this.getText(t.label,(t==null?void 0:t.label)!=="none"):this.state.target||"",onChange:o=>this.setState({target:o.target.value==="_"?"":o.target.value},()=>this.onChange(this.props.schema.custom.adapter==="telegram"?"telegramUser":"discordTarget",this.state.target)),children:this.state.targets.map((o,r)=>s.jsx(l.MenuItem,{value:o.value,children:this.getText(o.label,(o==null?void 0:o.label)!=="none")},r))}),this.props.schema.help?s.jsx(l.FormHelperText,{children:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}):null]}):this.props.schema.custom.adapter==="telegram"||this.props.schema.custom.adapter==="discord"?s.jsx(l.TextField,{variant:"standard",disabled:!this.state.instance,label:a.I18n.t(this.props.schema.custom.adapter==="telegram"?"Telegram receiver":"Discord receiver"),value:this.state.target,onChange:o=>this.setState({target:o.target.value},()=>this.onChange(this.props.schema.custom.adapter==="telegram"?"telegramUser":"discordTarget",this.state.target))}):null]})}}var E={exports:{}},ne=E.exports;(function(h,e){(function(t,n){n()})(ne,function(){function t(d,u){return typeof u>"u"?u={autoBom:!1}:typeof u!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),u={autoBom:!u}),u.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(d.type)?new Blob(["\uFEFF",d],{type:d.type}):d}function n(d,u,x){var m=new XMLHttpRequest;m.open("GET",d),m.responseType="blob",m.onload=function(){p(m.response,u,x)},m.onerror=function(){console.error("could not download file")},m.send()}function c(d){var u=new XMLHttpRequest;u.open("HEAD",d,!1);try{u.send()}catch{}return 200<=u.status&&299>=u.status}function o(d){try{d.dispatchEvent(new MouseEvent("click"))}catch{var u=document.createEvent("MouseEvents");u.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),d.dispatchEvent(u)}}var r=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof T=="object"&&T.global===T?T:void 0,i=r.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),p=r.saveAs||(typeof window!="object"||window!==r?function(){}:"download"in HTMLAnchorElement.prototype&&!i?function(d,u,x){var m=r.URL||r.webkitURL,v=document.createElement("a");u=u||d.name||"download",v.download=u,v.rel="noopener",typeof d=="string"?(v.href=d,v.origin===location.origin?o(v):c(v.href)?n(d,u,x):o(v,v.target="_blank")):(v.href=m.createObjectURL(d),setTimeout(function(){m.revokeObjectURL(v.href)},4e4),setTimeout(function(){o(v)},0))}:"msSaveOrOpenBlob"in navigator?function(d,u,x){if(u=u||d.name||"download",typeof d!="string")navigator.msSaveOrOpenBlob(t(d,x),u);else if(c(d))n(d,u,x);else{var m=document.createElement("a");m.href=d,m.target="_blank",setTimeout(function(){o(m)})}}:function(d,u,x,m){if(m=m||open("","_blank"),m&&(m.document.title=m.document.body.innerText="downloading..."),typeof d=="string")return n(d,u,x);var v=d.type==="application/octet-stream",F=/constructor/i.test(r.HTMLElement)||r.safari,B=/CriOS\/[\d]+/.test(navigator.userAgent);if((B||v&&F||i)&&typeof FileReader<"u"){var j=new FileReader;j.onloadend=function(){var b=j.result;b=B?b:b.replace(/^data:[^;]*;/,"data:attachment/file;"),m?m.location.href=b:location=b,m=null},j.readAsDataURL(d)}else{var L=r.URL||r.webkitURL,R=L.createObjectURL(d);m?m.location=R:location.href=R,m=null,setTimeout(function(){L.revokeObjectURL(R)},4e4)}});r.saveAs=p.saveAs=p,h.exports=p})})(E);var re=E.exports;function ae(h){return C({attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M5.082 5.593c-0.564 0.564-0.423 1.213 0.564 2.679 0.508 0.761 1.1 1.946 1.326 2.623 0.226 0.705 0.677 1.664 0.987 2.143 0.564 0.79 0.564 0.959 0.197 2.397-0.226 0.902-0.31 2.031-0.197 2.736 0.169 1.185 1.128 2.905 1.72 3.102 0.508 0.169 1.241-0.733 1.269-1.551 0-0.705 0.028-0.733 0.338-0.226 0.536 0.874 2.228 2.735 2.369 2.594 0.056-0.056-0.31-0.79-0.846-1.607-0.508-0.846-1.1-1.946-1.325-2.454-0.31-0.846-0.423-0.902-0.79-0.508-0.226 0.226-0.508 0.874-0.592 1.466-0.226 1.354-0.733 1.523-1.128 0.367s-0.395-3.131 0-4.484c0.282-0.931 0.254-1.184-0.226-1.89-0.31-0.423-0.79-1.438-1.044-2.256-0.254-0.79-0.846-1.974-1.325-2.595-1.1-1.551-1.1-2.115 0.056-1.89 0.479 0.085 1.213 0.423 1.664 0.733 0.423 0.31 1.156 0.564 1.607 0.564 1.354 0 3.723 1.326 5.443 3.046 1.326 1.325 2.002 2.397 3.441 5.302 1.692 3.44 1.833 3.638 2.877 3.976 1.241 0.423 3.835 2.002 3.835 2.341 0 0.113-0.649 0.282-1.438 0.338-2.115 0.226-2.313 0.62-0.931 1.861 0.649 0.564 1.862 1.438 2.736 1.918l1.579 0.902-0.733-0.931c-0.423-0.508-1.297-1.297-1.974-1.72s-1.213-0.874-1.213-0.987c0-0.113 0.479-0.31 1.072-0.395 1.579-0.282 2.030-0.423 2.030-0.705 0-0.423-2.848-2.566-4.202-3.159-1.156-0.536-1.297-0.762-2.792-3.835-1.326-2.82-1.861-3.61-3.553-5.302-2.171-2.171-3.666-3.102-5.584-3.384-0.649-0.113-1.551-0.451-1.946-0.733-0.931-0.705-2.82-0.959-3.272-0.479z"},child:[]}]})(h)}function le(h){return C({attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M11.953 23.012c-1.393-0.348-2.169-1.455-2.172-3.099-0.001-0.525 0.037-0.777 0.168-1.115 0.321-0.828 1.173-1.453 2.292-1.683 0.557-0.114 0.729-0.237 0.729-0.522 0-0.089 0.066-0.355 0.147-0.591 0.368-1.070 1.050-1.963 1.779-2.328 0.763-0.382 1.147-0.468 2.070-0.463 1.31 0.007 1.964 0.291 2.878 1.251l0.503 0.528 0.45-0.156c2.18-0.754 4.353 0.53 4.528 2.676l0.048 0.587 0.429 0.154c1.226 0.439 1.802 1.361 1.698 2.717-0.068 0.887-0.483 1.595-1.14 1.946l-0.309 0.165-6.861 0.013c-5.272 0.010-6.948-0.009-7.238-0.081v0zM6.809 22.065c-0.813-0.193-1.675-0.912-2.079-1.733-0.229-0.466-0.241-0.535-0.241-1.359 0-0.784 0.020-0.91 0.202-1.299 0.385-0.821 1.122-1.414 2.047-1.647 0.195-0.049 0.379-0.128 0.408-0.174s0.061-0.301 0.072-0.566c0.064-1.642 1.142-3.089 2.646-3.554 0.813-0.251 1.834-0.189 2.718 0.164 0.28 0.112 0.249 0.136 0.842-0.641 0.351-0.46 1.059-1.032 1.639-1.323 0.626-0.314 1.277-0.459 2.055-0.457 2.176 0.005 4.051 1.366 4.744 3.443 0.222 0.664 0.21 0.849-0.051 0.855-0.114 0.002-0.441 0.065-0.726 0.139l-0.519 0.135-0.473-0.473c-1.335-1.335-3.513-1.623-5.364-0.71-0.74 0.365-1.334 0.888-1.783 1.57-0.32 0.486-0.728 1.394-0.728 1.619 0 0.16-0.129 0.24-0.682 0.421-1.711 0.561-2.709 1.857-2.709 3.515 0 0.604 0.156 1.342 0.371 1.765 0.081 0.16 0.127 0.311 0.101 0.337-0.066 0.066-2.194 0.044-2.489-0.026v0z"},child:[]}]})(h)}function ce(h){return C({attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M26.741 18.661c-0.24-0.278-0.65-0.202-0.967-0.139-0.762 0.136-1.591 0.294-2.329-0.023 1.318-2.080 2.355-4.351 2.935-6.748 0.211-0.911 0.374-1.843 0.343-2.781-0.023-0.525-0.096-1.084-0.417-1.519-0.794-1.047-1.945-1.81-3.214-2.151-1.585-0.43-3.285-0.302-4.844 0.18-0.129 0.026-0.256-0.032-0.382-0.048-1.415-0.287-2.975-0.174-4.202 0.645-1.473-0.53-3.056-0.85-4.624-0.686-1.166 0.121-2.337 0.663-3.006 1.656-0.846 1.239-0.961 2.821-0.826 4.273 0.272 1.928 0.742 3.826 1.34 5.677 0.394 1.154 0.828 2.317 1.529 3.325 0.356 0.495 0.829 0.994 1.466 1.072 0.566 0.069 1.078-0.282 1.425-0.698 0.6-0.718 1.217-1.423 1.857-2.105 0.418 0.205 0.872 0.323 1.336 0.358-0.251 0.298-0.458 0.687-0.858 0.804-0.539 0.208-1.17 0.18-1.645 0.539-0.274 0.196-0.287 0.623-0.041 0.848 0.445 0.432 1.101 0.525 1.693 0.575 0.839 0.064 1.687-0.218 2.324-0.768-0.004 1.334 0.002 2.672 0.152 3.999 0.075 0.777 0.41 1.551 1.001 2.074 0.557 0.486 1.351 0.587 2.058 0.464 0.694-0.132 1.407-0.34 1.949-0.814 0.576-0.508 0.822-1.275 0.936-2.011 0.207-1.319 0.364-2.644 0.514-3.969 1.483 0.25 3.161-0.034 4.269-1.117 0.237-0.223 0.462-0.609 0.228-0.912zM23.45 6.117c0.89 0.338 1.681 0.925 2.275 1.668 0.283 0.355 0.319 0.832 0.337 1.268 0.013 1.040-0.197 2.067-0.464 3.067-0.511 1.851-1.287 3.625-2.262 5.277-0.096 0.163-0.201 0.32-0.317 0.469-0.009-0.045-0.027-0.137-0.036-0.183 0.121-0.318 0.298-0.618 0.367-0.956 0.244-0.953 0.038-1.934-0.050-2.893-0.092-0.905 0.217-1.786 0.209-2.689 0.035-0.442-0.14-0.86-0.31-1.257-0.615-1.375-1.593-2.598-2.848-3.438-0.306-0.21-0.648-0.357-0.953-0.568 1.334-0.286 2.765-0.25 4.051 0.234zM22.637 13.836c0.078 1.071 0.389 2.221-0.116 3.237-0.677-1.347-1.552-2.633-1.857-4.133-0.086-0.477-0.108-1.081 0.316-1.413 0.538-0.382 1.241-0.296 1.863-0.258-0.027 0.859-0.291 1.702-0.205 2.567zM10.534 20.181c-0.243 0.286-0.571 0.627-0.985 0.542-0.484-0.14-0.792-0.582-1.062-0.979-0.729-1.166-1.168-2.483-1.571-3.79-0.451-1.547-0.831-3.119-1.050-4.717-0.109-1.216-0.041-2.52 0.581-3.603 0.466-0.82 1.335-1.343 2.248-1.514 1.462-0.281 2.961 0.017 4.364 0.445-0.619 0.68-1.101 1.481-1.382 2.358-0.383 1.171-0.558 2.417-0.466 3.648 0.053 0.867 0.030 1.738-0.091 2.598-0.152 1.123 0.299 2.278 1.133 3.036-0.568 0.664-1.17 1.297-1.72 1.977zM11.814 16.158c-0.143-0.636 0.044-1.276 0.065-1.913 0.049-0.721-0.002-1.443-0.016-2.164 0.674-0.436 1.462-0.777 2.279-0.73 0.423 0.018 0.813 0.317 0.915 0.734 0.371 1.477 0.486 3.121-0.225 4.52-0.248 0.54-0.449 1.099-0.622 1.666-1.182 0.012-2.187-0.987-2.396-2.112zM15.492 20.112c-0.742 1.005-2.227 1.197-3.3 0.65 0.529-0.245 1.148-0.226 1.659-0.528 0.494-0.266 0.69-0.851 1.152-1.152 0.503-0.071 0.87 0.676 0.49 1.029zM21.856 18.938c-0.282 0.454-0.183 1.008-0.252 1.512-0.162 1.413-0.321 2.828-0.551 4.232-0.109 0.673-0.395 1.388-1.030 1.723-0.651 0.331-1.407 0.539-2.139 0.426-0.695-0.122-1.133-0.77-1.33-1.401-0.144-0.529-0.159-1.082-0.2-1.627-0.070-1.315-0.071-2.633-0.037-3.949 0.029-0.514-0.235-1.049-0.694-1.299-0.222-0.125-0.482-0.142-0.73-0.162 0.195-0.967 0.784-1.802 0.986-2.768 0.262-1.195 0.117-2.439-0.151-3.619-0.131-0.589-0.579-1.11-1.175-1.253-0.918-0.231-1.844 0.128-2.665 0.512 0.104-1.334 0.461-2.7 1.278-3.783 0.601-0.806 1.533-1.344 2.528-1.473 1.642-0.209 3.366 0.243 4.671 1.27 1.078 0.852 1.93 2.006 2.389 3.304-0.763-0.027-1.628-0.058-2.245 0.472-0.56 0.472-0.632 1.277-0.506 1.953 0.292 1.608 1.241 2.975 1.941 4.421 0.186 0.339 0.436 0.635 0.674 0.939-0.283 0.143-0.599 0.28-0.76 0.571zM23.82 20.075c-0.504 0.060-1.028 0.078-1.514-0.089 0.002-0.275-0.013-0.601 0.208-0.806 0.175-0.129 0.424-0.248 0.626-0.107 0.86 0.453 1.86 0.232 2.775 0.121-0.559 0.544-1.333 0.798-2.095 0.881zM21.178 11.728c-0.179 0.147 0.014 0.367 0.168 0.436 0.373 0.219 0.884-0.087 0.896-0.513-0.337-0.157-0.76-0.141-1.065 0.077zM14.576 12.408c0.159-0.090 0.327-0.337 0.143-0.486-0.262-0.213-0.643-0.254-0.962-0.168-0.103 0.036-0.211 0.106-0.19 0.232 0.074 0.428 0.647 0.688 1.008 0.422z"},child:[]}]})(h)}function he(h){return C({attr:{version:"1.1",viewBox:"0 0 32 32"},child:[{tag:"path",attr:{d:"M14.824 7.518c0 0.007 0.103 0.202 0.232 0.441 0.126 0.235 0.219 0.437 0.205 0.447s-0.371 0.146-0.792 0.295c-0.424 0.152-0.765 0.282-0.759 0.288s0.487 0.056 1.067 0.109c0.699 0.066 1.067 0.113 1.093 0.139 0.023 0.023 0.182 0.282 0.358 0.57l0.315 0.53 0.056-0.133c0.030-0.070 0.126-0.302 0.215-0.51l0.156-0.381 0.841-0.089c0.46-0.050 0.871-0.089 0.914-0.089 0.040-0.003 0.073-0.013 0.073-0.030 0-0.013-0.311-0.142-0.696-0.285-0.381-0.142-0.696-0.265-0.696-0.268s0.083-0.205 0.182-0.447 0.175-0.447 0.169-0.454c-0.007-0.010-0.331 0.089-0.715 0.215l-0.702 0.229-0.745-0.295c-0.732-0.288-0.772-0.301-0.772-0.282zM19.452 10.038c-0.891 0.354-1.623 0.649-1.63 0.656s0.656 0.275 1.474 0.6l1.484 0.586 0.159-0.063c1.653-0.643 3.157-1.242 3.15-1.249-0.023-0.027-2.948-1.172-2.981-1.172-0.023 0.003-0.768 0.291-1.656 0.643zM10.899 9.694c-0.855 0.089-1.573 0.338-1.878 0.653-0.209 0.215-0.242 0.398-0.113 0.619 0.192 0.331 0.822 0.61 1.693 0.752 0.391 0.066 1.54 0.056 1.938-0.013 0.931-0.162 1.534-0.46 1.676-0.835 0.053-0.139 0.053-0.159 0-0.295-0.139-0.364-0.732-0.666-1.61-0.818-0.444-0.076-1.272-0.106-1.706-0.063zM26.819 10.724c-0.043 0.056-0.202 0.182-0.354 0.285-0.451 0.291-1.034 0.556-4.651 2.113-2.544 1.093-3.193 1.381-4.074 1.805-0.977 0.467-1.381 0.596-1.872 0.596-0.441 0-0.702-0.076-1.524-0.441-0.328-0.146-1.67-0.709-2.981-1.255-5.734-2.385-5.84-2.435-6.148-2.766l-0.129-0.142v2.256l0.146 0.139c0.139 0.136 0.613 0.421 0.782 0.47 0.046 0.013 0.358 0.142 0.696 0.288s1.984 0.835 3.66 1.534c2.773 1.156 3.405 1.421 4.349 1.835 0.5 0.222 0.778 0.278 1.249 0.262 0.345-0.013 0.447-0.033 0.749-0.136 0.195-0.066 0.533-0.209 0.752-0.318 0.719-0.361 1.59-0.745 5.058-2.239 3.263-1.408 3.687-1.603 4.041-1.848 0.364-0.258 0.348-0.195 0.348-1.451 0-0.6-0.003-1.090-0.010-1.090s-0.043 0.046-0.086 0.103zM15.397 12.195c-1.335 0.205-2.441 0.381-2.461 0.388-0.030 0.010 3.326 1.421 3.468 1.457 0.033 0.010 1.534-2.15 1.534-2.206 0-0.030 0.003-0.033-2.541 0.361zM26.838 14.428c-0.030 0.050-0.169 0.172-0.305 0.268-0.434 0.298-1.086 0.596-5.052 2.302-2.282 0.984-2.998 1.299-3.677 1.63-1.1 0.533-1.365 0.619-1.954 0.616-0.457-0.003-0.739-0.076-1.345-0.351-0.583-0.268-1.236-0.543-3.856-1.63-4.558-1.891-5.085-2.127-5.406-2.438l-0.159-0.149v2.219l0.179 0.169c0.292 0.272 0.262 0.258 5.154 2.296 1.795 0.745 3.488 1.457 3.76 1.58 0.722 0.325 0.931 0.401 1.216 0.46 0.666 0.136 1.159 0.026 2.239-0.5 0.702-0.341 1.56-0.722 3.637-1.616 3.948-1.703 4.922-2.14 5.21-2.332 0.103-0.073 0.242-0.189 0.311-0.265l0.123-0.136v-1.11c0-0.61-0.003-1.11-0.010-1.11-0.003 0-0.033 0.043-0.066 0.096zM26.802 18.061c-0.262 0.328-0.785 0.58-4.856 2.332-2.657 1.146-3.465 1.504-4.339 1.921-0.918 0.437-1.219 0.53-1.749 0.53-0.361 0-0.729-0.086-1.136-0.265-0.951-0.417-1.577-0.682-4.353-1.838-3.157-1.315-4.167-1.742-4.505-1.911-0.315-0.159-0.636-0.384-0.709-0.5l-0.070-0.106v1.13c0 1.295-0.023 1.199 0.325 1.434 0.384 0.258 0.954 0.51 4.744 2.083 2.65 1.1 3.604 1.501 4.074 1.713 0.961 0.431 1.216 0.5 1.752 0.47 0.49-0.023 0.812-0.129 1.66-0.533 0.884-0.424 1.537-0.715 4.422-1.958 4.008-1.726 4.442-1.934 4.747-2.286l0.106-0.119v-1.106c0-0.61-0.003-1.11-0.007-1.11-0.007 0-0.053 0.053-0.106 0.119z"},child:[]}]})(h)}function pe(h){return C({attr:{version:"1.1",viewBox:"0 0 34 32"},child:[{tag:"path",attr:{d:"M21.576 3.59c-1.115-0.994-2.465-0.595-3.798 0.588-0.198 0.176-0.395 0.371-0.591 0.579-2.279 2.418-4.395 6.897-5.053 10.318 0.256 0.519 0.456 1.182 0.588 1.688 0.034 0.13 0.064 0.252 0.089 0.355 0.058 0.245 0.089 0.405 0.089 0.405s-0.020-0.077-0.104-0.321c-0.016-0.047-0.034-0.098-0.055-0.158-0.009-0.025-0.021-0.055-0.035-0.087-0.149-0.346-0.56-1.075-0.741-1.393-0.155 0.457-0.292 0.884-0.406 1.271 0.523 0.956 0.841 2.595 0.841 2.595s-0.028-0.106-0.159-0.477c-0.117-0.328-0.697-1.345-0.835-1.583-0.235 0.869-0.329 1.455-0.244 1.598 0.164 0.277 0.32 0.754 0.457 1.282 0.309 1.189 0.524 2.637 0.524 2.637s0.007 0.096 0.019 0.244c-0.043 0.999-0.017 2.034 0.060 2.97 0.103 1.239 0.295 2.303 0.541 2.873l0.167-0.091c-0.361-1.122-0.508-2.593-0.444-4.289 0.097-2.593 0.694-5.719 1.796-8.978 1.863-4.919 4.447-8.866 6.811-10.751-2.155 1.947-5.073 8.248-5.946 10.581-0.978 2.613-1.671 5.065-2.088 7.414 0.721-2.202 3.050-3.149 3.050-3.149s1.143-1.409 2.478-3.422c-0.8 0.182-2.113 0.495-2.553 0.68-0.649 0.272-0.824 0.365-0.824 0.365s2.102-1.28 3.905-1.86c2.48-3.906 5.182-9.456 2.461-11.884z"},child:[]}]})(h)}const de=""+new URL("ccu-DJclZqBW.png",import.meta.url).href,ue="data:image/png;base64,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",ge=""+new URL("history-DK5tzdjc.png",import.meta.url).href,me=""+new URL("zigbee2mqtt-tDEKhm15.png",import.meta.url).href,fe="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJEAAACRCAYAAADD2FojAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAACXBIWXMAAAsSAAALEgHS3X78AAAAB3RJTUUH4ggGBQAKZF0vwQAAABh0RVh0U29mdHdhcmUAcGFpbnQubmV0IDQuMC41ZYUyZQAADvlJREFUeF7tnf1