iobroker.admin 7.7.2 → 7.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -8
- package/admin/admin.png +0 -0
- package/admin/i18n/de.json +1 -1
- package/admin/i18n/es.json +1 -1
- package/admin/i18n/fr.json +1 -1
- package/admin/i18n/it.json +1 -1
- package/admin/i18n/nl.json +1 -1
- package/admin/i18n/pl.json +1 -1
- package/admin/i18n/pt.json +1 -1
- package/admin/i18n/ru.json +1 -1
- package/admin/i18n/uk.json +1 -1
- package/admin/i18n/zh-cn.json +1 -1
- package/admin/jsonConfig.json5 +1 -2
- package/adminWww/assets/{AdapterUpdateDialog-DHGhgEEq.js → AdapterUpdateDialog-BQUTMe7v.js} +1 -1
- package/adminWww/assets/Adapters-KuMqwfzU.js +9 -0
- package/adminWww/assets/Config-LH40Fzyp.js +1 -0
- package/adminWww/assets/CustomModal-UQ6ICKdg.js +1 -0
- package/adminWww/assets/CustomTab-CE2qvngn.js +1 -0
- package/adminWww/assets/DefaultPropsProvider-BxjOYH1h.js +30 -0
- package/adminWww/assets/EasyMode-XXQKZmWs.js +1 -0
- package/adminWww/assets/{Enums-BSICIhWI.js → Enums-Ddmi-fYo.js} +3 -3
- package/adminWww/assets/{Fields-C3JkTmfP.js → Fields-CQNdUYkd.js} +1 -1
- package/adminWww/assets/{Files-DK85-COY.js → Files-DgOiCRiN.js} +2 -2
- package/adminWww/assets/FilledInput-B9JSi0Ta.js +2 -0
- package/adminWww/assets/Hosts-BgDpLhdl.js +121 -0
- package/adminWww/assets/Instances-DikJwBl0.js +2 -0
- package/adminWww/assets/Intro-vxIHtYzr.js +2 -0
- package/adminWww/assets/Logs-DZUWTbJn.js +1 -0
- package/adminWww/assets/Objects-Dm1_4aGR.js +60 -0
- package/adminWww/assets/{State-BqfD2ABf.js → State-CrcWiBdx.js} +1 -1
- package/adminWww/assets/TextField-j-uewRwI.js +138 -0
- package/adminWww/assets/ThemeProvider-DHntAcOp.js +29 -0
- package/adminWww/assets/Users-GcWjwa7A.js +1 -0
- package/adminWww/assets/ace-1DqSbvTN.js +985 -0
- package/adminWww/assets/{bootstrap-BYQTdf9r.js → bootstrap-B3ZI_-0g.js} +112 -112
- package/adminWww/assets/{createSvgIcon-Bh3KWtyp.js → createSvgIcon-Ds12z7B3.js} +1 -1
- package/adminWww/assets/emotion-cache.browser.esm-BgJfNZJN.js +1 -0
- package/adminWww/assets/emotion-react.browser.esm-CBtpmfsG.js +8 -0
- package/adminWww/assets/emotion-serialize.esm-Q4o_CgeF.js +1 -0
- package/adminWww/assets/emotion-styled.browser.esm-BeD8nBzN.js +1 -0
- package/adminWww/assets/emotion-use-insertion-effect-with-fallbacks.browser.esm-BIy6Leuu.js +1 -0
- package/adminWww/assets/geosearch.module-B6h9BuIR.js +1 -0
- package/adminWww/assets/hostInit-fzxL8JAx.js +1 -1
- package/adminWww/assets/iconBase-BAOnvyiQ.js +1 -0
- package/adminWww/assets/{index-Qa7Q_Dz5.js → index-BOnh7es7.js} +1 -1
- package/adminWww/assets/{index-B1ITPhEY.js → index-BSfwmoAE.js} +3 -3
- package/adminWww/assets/{index-rKfs-rCa.js → index-BVgYaw7t.js} +1 -1
- package/adminWww/assets/{index-D--ojYan.js → index-C9i3HTsG.js} +1 -1
- package/adminWww/assets/{index-wN1ZlPSW.js → index-CELb-gCK.js} +2 -2
- package/adminWww/assets/{index-DPDg2YA0.js → index-CU6eZCem.js} +1 -1
- package/adminWww/assets/{index-DTGUg51P.js → index-DZ0MncEz.js} +2 -2
- package/adminWww/assets/index-Dg-s3k0-.js +10 -0
- package/adminWww/assets/index-tS5iCAF7.js +55 -0
- package/adminWww/assets/{iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-BOKYvG_W.js → iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-CXogaIXO.js} +1 -1
- package/adminWww/assets/{iobroker_admin__loadShare__leaflet__loadShare__-h9SMNPLU.js → iobroker_admin__loadShare__leaflet__loadShare__-DIpcqFbm.js} +1 -1
- package/adminWww/assets/{iobroker_admin__loadShare__prop_mf_2_types__loadShare__-BnsS7SOQ.js → iobroker_admin__loadShare__prop_mf_2_types__loadShare__-pDONiJUe.js} +1 -1
- package/adminWww/assets/{iobroker_admin__loadShare__react__loadShare__-Bis6NHgw.js → iobroker_admin__loadShare__react__loadShare__-CuzHmAOj.js} +1 -1
- package/adminWww/assets/iobroker_admin__mf_v__runtimeInit__mf_v__-CHE4rLsT.js +5 -0
- package/adminWww/assets/leaflet-src-BRBM-1HK.js +4 -0
- package/adminWww/assets/{sentry-H_UdJ2zx.js → sentry-B6yHtsbd.js} +1 -1
- package/adminWww/assets/{zh-cn-vvAC9zpl.js → zh-cn-heTcsLnU.js} +13 -13
- package/adminWww/img/admin.png +0 -0
- package/adminWww/index.html +2 -2
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/remoteEntry.js +2 -2
- package/build/i18n/de.json +18 -0
- package/build/i18n/es.json +18 -0
- package/build/i18n/fr.json +18 -0
- package/build/i18n/it.json +18 -0
- package/build/i18n/nl.json +18 -0
- package/build/i18n/pl.json +18 -0
- package/build/i18n/pt.json +18 -0
- package/build/i18n/ru.json +18 -0
- package/build/i18n/uk.json +18 -0
- package/build/i18n/zh-cn.json +18 -0
- package/build/lib/DockerManager.js +1315 -0
- package/build/lib/DockerManager.js.map +1 -0
- package/build/lib/dockerManager.types.js +3 -0
- package/build/lib/dockerManager.types.js.map +1 -0
- package/{build-backend → build}/lib/testPassword.js +1 -1
- package/{build-backend → build}/lib/testPassword.js.map +1 -1
- package/{build-backend → build}/lib/translations.js +16 -1
- package/build/lib/translations.js.map +1 -0
- package/{build-backend → build}/main.js +58 -5
- package/build/main.js.map +1 -0
- package/io-package.json +14 -14
- package/package.json +7 -7
- package/adminWww/assets/Adapters-CgSIajcF.js +0 -7
- package/adminWww/assets/Config-BQSl4bfA.js +0 -1
- package/adminWww/assets/CustomModal-DNMTLv4y.js +0 -1
- package/adminWww/assets/CustomTab-Bl8S8QZW.js +0 -1
- package/adminWww/assets/DefaultPropsProvider-u5xB1Fxz.js +0 -30
- package/adminWww/assets/EasyMode-xDbqrply.js +0 -1
- package/adminWww/assets/FilledInput-CysG4ax_.js +0 -2
- package/adminWww/assets/Hosts-qIsB4Gub.js +0 -121
- package/adminWww/assets/Instances-BA_DCzs8.js +0 -2
- package/adminWww/assets/Intro-00oh6SLw.js +0 -2
- package/adminWww/assets/Logs-Cvpgh-zN.js +0 -1
- package/adminWww/assets/Objects-Dp71iotS.js +0 -60
- package/adminWww/assets/Tabs-sxfWgN0b.js +0 -138
- package/adminWww/assets/Users-CDcWqTfZ.js +0 -1
- package/adminWww/assets/ace-BG5WYul1.js +0 -985
- package/adminWww/assets/blueGrey-DYsiMDOn.js +0 -29
- package/adminWww/assets/emotion-cache.browser.esm-B8BFze5o.js +0 -1
- package/adminWww/assets/emotion-react.browser.esm-BCDt9NrH.js +0 -8
- package/adminWww/assets/emotion-serialize.esm-BUa21YfQ.js +0 -1
- package/adminWww/assets/emotion-styled.browser.esm-CyFqGgyG.js +0 -1
- package/adminWww/assets/emotion-utils.browser.esm-pglN4_eI.js +0 -1
- package/adminWww/assets/geosearch.module-DH4NhiPj.js +0 -1
- package/adminWww/assets/iconBase-C3vi24ZE.js +0 -1
- package/adminWww/assets/index-D3IAEXXP.js +0 -10
- package/adminWww/assets/index-qcIeekse.js +0 -55
- package/adminWww/assets/iobroker_admin__mf_v__runtimeInit__mf_v__-CTkuGOOk.js +0 -5
- package/adminWww/assets/leaflet-src-A2ZHl6nF.js +0 -4
- package/build-backend/i18n/de.json +0 -18
- package/build-backend/i18n/es.json +0 -18
- package/build-backend/i18n/fr.json +0 -18
- package/build-backend/i18n/it.json +0 -18
- package/build-backend/i18n/nl.json +0 -18
- package/build-backend/i18n/pl.json +0 -18
- package/build-backend/i18n/pt.json +0 -18
- package/build-backend/i18n/ru.json +0 -18
- package/build-backend/i18n/uk.json +0 -18
- package/build-backend/i18n/zh-cn.json +0 -18
- package/build-backend/lib/translations.js.map +0 -1
- package/build-backend/main.js.map +0 -1
- /package/{build-backend → build}/i18n/en.json +0 -0
- /package/{build-backend → build}/lib/checkLinuxPass.js +0 -0
- /package/{build-backend → build}/lib/checkLinuxPass.js.map +0 -0
- /package/{build-backend → build}/lib/utils.js +0 -0
- /package/{build-backend → build}/lib/utils.js.map +0 -0
- /package/{build-backend → build}/lib/web.js +0 -0
- /package/{build-backend → build}/lib/web.js.map +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s,u as te,q as Te,w as U,p as K}from"./DefaultPropsProvider-BxjOYH1h.js";import{i as L}from"./iobroker_admin__loadShare__react__loadShare__-CuzHmAOj.js";import{i as a,I as v,b as $,a as c,J as ye,U as H,af as Q,f as Ie,ag as Ce,D as $e}from"./bootstrap-B3ZI_-0g.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-CHE4rLsT.js";var I={},A={},E={},M={};Object.defineProperty(M,"__esModule",{value:!0});M.ErrorCodes=void 0;var se;(function(n){n[n.E_INSTANCE_ACTION_NOT_INITIALIZED=101]="E_INSTANCE_ACTION_NOT_INITIALIZED",n[n.E_INSTANCE_ACTION_UNKNOWN=102]="E_INSTANCE_ACTION_UNKNOWN",n[n.E_INSTANCE_ACTION_NO_HANDLER=103]="E_INSTANCE_ACTION_NO_HANDLER",n[n.E_DEVICE_ACTION_NOT_INITIALIZED=201]="E_DEVICE_ACTION_NOT_INITIALIZED",n[n.E_DEVICE_ACTION_DEVICE_UNKNOWN=202]="E_DEVICE_ACTION_DEVICE_UNKNOWN",n[n.E_DEVICE_ACTION_UNKNOWN=203]="E_DEVICE_ACTION_UNKNOWN",n[n.E_DEVICE_ACTION_NO_HANDLER=204]="E_DEVICE_ACTION_NO_HANDLER",n[n.E_DEVICE_CONTROL_NOT_INITIALIZED=301]="E_DEVICE_CONTROL_NOT_INITIALIZED",n[n.E_DEVICE_CONTROL_DEVICE_UNKNOWN=302]="E_DEVICE_CONTROL_DEVICE_UNKNOWN",n[n.E_DEVICE_CONTROL_UNKNOWN=303]="E_DEVICE_CONTROL_UNKNOWN",n[n.E_DEVICE_CONTROL_NO_HANDLER=304]="E_DEVICE_CONTROL_NO_HANDLER",n[n.E_DEVICE_GET_STATE_NOT_INITIALIZED=401]="E_DEVICE_GET_STATE_NOT_INITIALIZED",n[n.E_DEVICE_GET_STATE_DEVICE_UNKNOWN=402]="E_DEVICE_GET_STATE_DEVICE_UNKNOWN",n[n.E_DEVICE_GET_STATE_UNKNOWN=403]="E_DEVICE_GET_STATE_UNKNOWN",n[n.E_DEVICE_GET_STATE_NO_HANDLER=404]="E_DEVICE_GET_STATE_NO_HANDLER"})(se||(M.ErrorCodes=se={}));var R={};Object.defineProperty(R,"__esModule",{value:!0});R.ACTIONS=void 0;R.ACTIONS={STATUS:"status",ENABLE_DISABLE:"enable/disable"};(function(n){var e=E&&E.__createBinding||(Object.create?(function(r,i,l,d){d===void 0&&(d=l);var h=Object.getOwnPropertyDescriptor(i,l);(!h||("get"in h?!i.__esModule:h.writable||h.configurable))&&(h={enumerable:!0,get:function(){return i[l]}}),Object.defineProperty(r,d,h)}):(function(r,i,l,d){d===void 0&&(d=l),r[d]=i[l]})),t=E&&E.__exportStar||function(r,i){for(var l in r)l!=="default"&&!Object.prototype.hasOwnProperty.call(i,l)&&e(i,r,l)};Object.defineProperty(n,"__esModule",{value:!0}),n.ACTIONS=void 0,t(M,n);var o=R;Object.defineProperty(n,"ACTIONS",{enumerable:!0,get:function(){return o.ACTIONS}})})(E);Object.defineProperty(A,"__esModule",{value:!0});A.MessageContext=A.DeviceManagement=void 0;const g=E;class we{constructor(e){this.adapter=e,this.contexts=new Map,e.on("message",this.onMessage.bind(this))}get log(){return this.adapter.log}getInstanceInfo(){return{apiVersion:"v1"}}getDeviceDetails(e){return{id:e,schema:{}}}handleInstanceAction(e,t,o){var r;if(!this.instanceInfo)return this.log.warn(`Instance action ${e} was called before getInstanceInfo()`),{error:{code:g.ErrorCodes.E_INSTANCE_ACTION_NOT_INITIALIZED,message:`Instance action ${e} was called before getInstanceInfo()`}};const i=(r=this.instanceInfo.actions)===null||r===void 0?void 0:r.find(l=>l.id===e);return i?i.handler?i.handler(t,o):(this.log.warn(`Instance action ${e} is disabled because it has no handler`),{error:{code:g.ErrorCodes.E_INSTANCE_ACTION_NO_HANDLER,message:`Instance action ${e} is disabled because it has no handler`}}):(this.log.warn(`Instance action ${e} is unknown`),{error:{code:g.ErrorCodes.E_INSTANCE_ACTION_UNKNOWN,message:`Instance action ${e} is unknown`}})}handleDeviceAction(e,t,o,r){var i;if(!this.devices)return this.log.warn(`Device action ${t} was called before listDevices()`),{error:{code:g.ErrorCodes.E_DEVICE_ACTION_NOT_INITIALIZED,message:`Device action ${t} was called before listDevices()`}};const l=this.devices.get(e);if(!l)return this.log.warn(`Device action ${t} was called on unknown device: ${e}`),{error:{code:g.ErrorCodes.E_DEVICE_ACTION_DEVICE_UNKNOWN,message:`Device action ${t} was called on unknown device: ${e}`}};const d=(i=l.actions)===null||i===void 0?void 0:i.find(h=>h.id===t);return d?d.handler?d.handler(e,o,r):(this.log.warn(`Device action ${t} on ${e} is disabled because it has no handler`),{error:{code:g.ErrorCodes.E_DEVICE_ACTION_NO_HANDLER,message:`Device action ${t} on ${e} is disabled because it has no handler`}}):(this.log.warn(`Device action ${t} doesn't exist on device ${e}`),{error:{code:g.ErrorCodes.E_DEVICE_ACTION_UNKNOWN,message:`Device action ${t} doesn't exist on device ${e}`}})}handleDeviceControl(e,t,o,r){var i;if(!this.devices)return this.log.warn(`Device control ${t} was called before listDevices()`),{error:{code:g.ErrorCodes.E_DEVICE_CONTROL_NOT_INITIALIZED,message:`Device control ${t} was called before listDevices()`}};const l=this.devices.get(e);if(!l)return this.log.warn(`Device control ${t} was called on unknown device: ${e}`),{error:{code:g.ErrorCodes.E_DEVICE_CONTROL_DEVICE_UNKNOWN,message:`Device control ${t} was called on unknown device: ${e}`}};const d=(i=l.controls)===null||i===void 0?void 0:i.find(h=>h.id===t);return d?d.handler?d.handler(e,t,o,r):(this.log.warn(`Device control ${t} on ${e} is disabled because it has no handler`),{error:{code:g.ErrorCodes.E_DEVICE_CONTROL_NO_HANDLER,message:`Device control ${t} on ${e} is disabled because it has no handler`}}):(this.log.warn(`Device control ${t} doesn't exist on device ${e}`),{error:{code:g.ErrorCodes.E_DEVICE_CONTROL_UNKNOWN,message:`Device control ${t} doesn't exist on device ${e}`}})}handleDeviceControlState(e,t,o){var r;if(!this.devices)return this.log.warn(`Device get state ${t} was called before listDevices()`),{error:{code:g.ErrorCodes.E_DEVICE_GET_STATE_NOT_INITIALIZED,message:`Device control ${t} was called before listDevices()`}};const i=this.devices.get(e);if(!i)return this.log.warn(`Device get state ${t} was called on unknown device: ${e}`),{error:{code:g.ErrorCodes.E_DEVICE_GET_STATE_DEVICE_UNKNOWN,message:`Device control ${t} was called on unknown device: ${e}`}};const l=(r=i.controls)===null||r===void 0?void 0:r.find(d=>d.id===t);return l?l.getStateHandler?l.getStateHandler(e,t,o):(this.log.warn(`Device get state ${t} on ${e} is disabled because it has no handler`),{error:{code:g.ErrorCodes.E_DEVICE_GET_STATE_NO_HANDLER,message:`Device get state ${t} on ${e} is disabled because it has no handler`}}):(this.log.warn(`Device get state ${t} doesn't exist on device ${e}`),{error:{code:g.ErrorCodes.E_DEVICE_GET_STATE_UNKNOWN,message:`Device control ${t} doesn't exist on device ${e}`}})}onMessage(e){e.command.startsWith("dm:")&&this.handleMessage(e).catch(this.log.error)}async handleMessage(e){switch(this.log.debug(`DeviceManagement received: ${JSON.stringify(e)}`),e.command){case"dm:instanceInfo":{this.instanceInfo=await this.getInstanceInfo(),this.sendReply(Object.assign(Object.assign({},this.instanceInfo),{actions:this.convertActions(this.instanceInfo.actions)}),e);return}case"dm:listDevices":{const t=await this.listDevices();this.devices=t.reduce((r,i)=>{if(r.has(i.id))throw new Error(`Device ID ${i.id} is not unique`);return r.set(i.id,i),r},new Map);const o=t.map(r=>Object.assign(Object.assign({},r),{actions:this.convertActions(r.actions),controls:this.convertControls(r.controls)}));this.sendReply(o,e),this.adapter.sendTo(e.from,e.command,this.devices,e.callback);return}case"dm:deviceDetails":{const t=await this.getDeviceDetails(e.message);this.adapter.sendTo(e.from,e.command,t,e.callback);return}case"dm:instanceAction":{const t=e.message,o=new P(e,this.adapter);this.contexts.set(e._id,o);const r=await this.handleInstanceAction(t.actionId,o,{value:t.value});this.contexts.delete(e._id),o.sendFinalResult(r);return}case"dm:deviceAction":{const t=e.message,o=new P(e,this.adapter);this.contexts.set(e._id,o);const r=await this.handleDeviceAction(t.deviceId,t.actionId,o,{value:t.value});this.contexts.delete(e._id),o.sendFinalResult(r);return}case"dm:deviceControl":{const t=e.message,o=new P(e,this.adapter);this.contexts.set(e._id,o);const r=await this.handleDeviceControl(t.deviceId,t.controlId,t.state,o);this.contexts.delete(e._id),o.sendControlResult(t.deviceId,t.controlId,r);return}case"dm:deviceControlState":{const t=e.message,o=new P(e,this.adapter);this.contexts.set(e._id,o);const r=await this.handleDeviceControlState(t.deviceId,t.controlId,o);this.contexts.delete(e._id),o.sendControlResult(t.deviceId,t.controlId,r);return}case"dm:actionProgress":{const{origin:t}=e.message,o=this.contexts.get(t);if(!o){this.log.warn(`Unknown message origin: ${t}`),this.sendReply({error:"Unknown action origin"},e);return}o.handleProgress(e);return}}}convertActions(e){if(!e)return;const t=new Set;return e.forEach(o=>{if(t.has(o.id))throw new Error(`Action ID ${o.id} is used twice, this would lead to unexpected behavior`);t.add(o.id)}),e.map(o=>Object.assign(Object.assign({},o),{handler:void 0,disabled:!o.handler}))}convertControls(e){if(!e)return;const t=new Set;return e.forEach(o=>{if(t.has(o.id))throw new Error(`Control ID ${o.id} is used twice, this would lead to unexpected behavior`);t.add(o.id)}),e.map(o=>Object.assign(Object.assign({},o),{handler:void 0,getStateHandler:void 0}))}sendReply(e,t){this.adapter.sendTo(t.from,t.command,e,t.callback)}}A.DeviceManagement=we;class P{constructor(e,t){this.adapter=t,this.hasOpenProgressDialog=!1,this.lastMessage=e}showMessage(e){this.checkPreconditions();const t=new Promise(o=>{this.progressHandler=()=>o()});return this.send("message",{message:e}),t}showConfirmation(e){this.checkPreconditions();const t=new Promise(o=>{this.progressHandler=r=>o(!!r.confirm)});return this.send("confirm",{confirm:e}),t}showForm(e,t){this.checkPreconditions();const o=new Promise(r=>{this.progressHandler=i=>r(i.data)});return this.send("form",{form:Object.assign({schema:e},t)}),o}openProgress(e,t){this.checkPreconditions(),this.hasOpenProgressDialog=!0;const o={update:i=>{const l=new Promise(d=>{this.progressHandler=()=>d()});return this.send("progress",{progress:Object.assign(Object.assign(Object.assign({title:e},t),i),{open:!0})},!0),l},close:()=>{const i=new Promise(l=>{this.progressHandler=()=>{this.hasOpenProgressDialog=!1,l()}});return this.send("progress",{progress:{open:!1}}),i}},r=new Promise(i=>{this.progressHandler=()=>i(o)});return this.send("progress",{progress:Object.assign(Object.assign({title:e},t),{open:!0})},!0),r}sendFinalResult(e){this.send("result",{result:e})}sendControlResult(e,t,o){typeof o=="object"&&"error"in o?this.send("result",{result:{error:o.error,deviceId:e,controlId:t}}):this.send("result",{result:{state:o,deviceId:e,controlId:t}})}handleProgress(e){const t=this.progressHandler;t&&typeof e.message!="string"&&(this.lastMessage=e,this.progressHandler=void 0,t(e.message))}checkPreconditions(){if(this.hasOpenProgressDialog)throw new Error("Can't show another dialog while a progress dialog is open. Please call 'close()' on the dialog before opening another dialog.")}send(e,t,o){if(!this.lastMessage)throw new Error("No outstanding message, can't send a new one");this.adapter.sendTo(this.lastMessage.from,this.lastMessage.command,Object.assign(Object.assign({},t),{type:e,origin:this.lastMessage.message.origin||this.lastMessage._id}),this.lastMessage.callback),o||(this.lastMessage=void 0)}}A.MessageContext=P;(function(n){var e=I&&I.__createBinding||(Object.create?(function(o,r,i,l){l===void 0&&(l=i);var d=Object.getOwnPropertyDescriptor(r,i);(!d||("get"in d?!r.__esModule:d.writable||d.configurable))&&(d={enumerable:!0,get:function(){return r[i]}}),Object.defineProperty(o,l,d)}):(function(o,r,i,l){l===void 0&&(l=i),o[l]=r[i]})),t=I&&I.__exportStar||function(o,r){for(var i in o)i!=="default"&&!Object.prototype.hasOwnProperty.call(r,i)&&e(r,o,i)};Object.defineProperty(n,"__esModule",{value:!0}),t(A,n),t(E,n)})(I);function pe(n){const{tooltip:e,label:t,disabled:o,Icon:r,onClick:i}=n,l=!!t&&s.jsx(a.Typography,{variant:"button",style:{marginLeft:4},children:t});return e?s.jsx(a.Tooltip,{title:e,slotProps:{popper:{sx:{pointerEvents:"none"}}},children:s.jsx("span",{children:s.jsxs(a.IconButton,{onClick:i,disabled:o,size:"small",children:[r,l]})})}):s.jsxs(a.IconButton,{onClick:i,disabled:o,size:"small",children:[r,l]})}function he(n,e){const t=n.split(" ").map(o=>o.trim()).filter(o=>o!=="fa-solid");return t.includes("fa-trash-can")||t.includes("fa-trash")?s.jsx(c.Delete,{style:{color:e}}):t.includes("fa-pen")?s.jsx(c.Edit,{style:{color:e}}):t.includes("fa-redo-alt")?s.jsx(c.Refresh,{style:{color:e}}):t.includes("fa-plus")?s.jsx(c.Add,{style:{color:e}}):t.includes("fa-qrcode")||t.includes("qrcode")?s.jsx(c.QrCode,{style:{color:e}}):t.includes("fa-wifi")?s.jsx(c.Wifi,{style:{color:e}}):t.includes("fa-wifi-slash")?s.jsx(c.WifiOff,{style:{color:e}}):t.includes("fa-bluetooth")?s.jsx(c.Bluetooth,{style:{color:e}}):t.includes("fa-bluetooth-slash")?s.jsx(c.BluetoothDisabled,{style:{color:e}}):t.includes("fa-eye")?s.jsx(c.Visibility,{style:{color:e}}):t.includes("fa-search")?s.jsx(c.Search,{style:{color:e}}):t.includes("fa-unlink")?s.jsx(c.LinkOff,{style:{color:e}}):t.includes("fa-link")?s.jsx(c.Link,{style:{color:e}}):t.includes("fa-search-location")?s.jsx(c.NotListedLocation,{style:{color:e}}):t.includes("fa-play")?s.jsx(c.PlayArrow,{style:{color:e}}):t.includes("fa-stop")?s.jsx(c.Stop,{style:{color:e}}):t.includes("fa-pause")?s.jsx(c.Pause,{style:{color:e}}):s.jsx(c.QuestionMark,{style:{color:e}})}function ue(n,e,t){return n==="edit"||n==="rename"||e==="edit"||e==="rename"?s.jsx(c.Edit,{style:{color:t}}):n==="delete"||e==="delete"?s.jsx(c.Delete,{style:{color:t}}):n==="refresh"||e==="refresh"?s.jsx(c.Refresh,{style:{color:t}}):n==="newDevice"||n==="new"||n==="add"||e==="newDevice"||e==="new"||e==="add"?s.jsx(c.Add,{style:{color:t}}):n==="discover"||n==="search"||e==="discover"||e==="search"?s.jsx(c.Search,{style:{color:t}}):n==="unpairDevice"||n==="unpair"||e==="unpairDevice"||e==="unpair"?s.jsx(c.LinkOff,{style:{color:t}}):n==="pairDevice"||n==="pair"||e==="pairDevice"||e==="pair"?s.jsx(c.Link,{style:{color:t}}):n==="identify"||e==="identify"?s.jsx(c.NotListedLocation,{style:{color:t}}):n==="play"||e==="play"?s.jsx(c.PlayArrow,{style:{color:t}}):n==="stop"||e==="stop"?s.jsx(c.Stop,{style:{color:t}}):n==="pause"||e==="pause"?s.jsx(c.Pause,{style:{color:t}}):n==="forward"||n==="next"||e==="forward"||e==="next"?s.jsx(c.FastForward,{style:{color:t}}):n==="rewind"||n==="previous"||e==="rewind"||e==="previous"?s.jsx(c.FastRewind,{style:{color:t}}):n==="lamp"||n==="light"||e==="lamp"||e==="light"?s.jsx(c.Lightbulb,{style:{color:t}}):n==="backlight"||e==="backlight"?s.jsx(c.Fluorescent,{style:{color:t}}):n==="dimmer"||e==="dimmer"?s.jsx(c.WbIncandescent,{style:{color:t}}):n==="socket"||e==="socket"?s.jsx(c.Power,{style:{color:t}}):n==="settings"||e==="settings"?s.jsx(c.Settings,{style:{color:t}}):n==="users"||n==="group"||e==="users"||e==="group"?s.jsx(c.Group,{style:{color:t}}):n==="user"||e==="user"?s.jsx(c.Person,{style:{color:t}}):n==="qrcode"||e==="qrcode"?s.jsx(c.QrCode,{style:{color:t}}):n==="info"||e==="info"?s.jsx(c.Info,{style:{color:t}}):n==="lines"||e==="lines"?s.jsx(c.Article,{style:{color:t}}):s.jsx(c.QuestionMark,{style:{color:t}})}function oe(n,e,t){var r,i,l,d;if(!n)return null;let o=t&&n.colorOn||n.color||(n.state?"primary":"inherit");return e&&(o==="primary"?o=e.primary:o==="secondary"&&(o=e.secondary)),(r=n.icon)!=null&&r.startsWith("fa-")||(i=n.icon)!=null&&i.startsWith("fas")?he(n.icon,o):t&&((l=n.iconOn)!=null&&l.startsWith("data:image"))?s.jsx($,{src:n.iconOn,style:{color:o}}):(d=n.icon)!=null&&d.startsWith("data:image")?s.jsx($,{src:n.icon,style:{color:o}}):ue(n.id,n.icon,o)}function fe(n){var e,t,o;return n?(e=n.icon)!=null&&e.startsWith("fa-")||(t=n.icon)!=null&&t.startsWith("fas")?he(n.icon,n.color):(o=n.icon)!=null&&o.startsWith("data:image")?s.jsx($,{src:n.icon,style:{color:n.color}}):ue(n.id,n.icon,n.color):null}let G;function p(n,e){return G=G||v.getLanguage(),typeof n=="object"?n[G]||n.en:e?n:v.t(n)}function je(n){const{deviceId:e,action:t,refresh:o,deviceHandler:r,disabled:i}=n,l=fe(t),d=p(t.description??"")||(l?null:t.id);return s.jsx(pe,{tooltip:d||void 0,disabled:i||t.disabled,Icon:l,onClick:r(e,t,o)})}class ne extends L.Component{constructor(e){var t,o;super(e),this.state={value:(t=e.control.state)==null?void 0:t.val,ts:(o=e.control.state)==null?void 0:o.ts,unit:e.control.unit||""}}async componentDidMount(){var e;if(this.props.control.stateId){const t=this.props.socket.subscribeState(this.props.control.stateId,this.stateHandler);if(t instanceof Promise&&await t,this.props.control.type==="slider"||this.props.control.type==="number")if(this.props.control.min===void 0&&this.props.control.max===void 0)this.props.socket.getObject(this.props.control.stateId).then(o=>{if(o!=null&&o.common){let r=this.props.control.min;r===void 0&&(r=o.common.min),r===void 0&&(r=0);let i=this.props.control.max;i===void 0&&(r=o.common.max),r===void 0&&(i=100);let l=this.props.control.step;l===void 0&&(l=o.common.step),l===void 0&&(l=(i-r)/100);let d=this.props.control.unit;d===void 0&&(d=o.common.unit),this.setState({min:r,max:i,step:l,unit:d})}});else{const o=this.props.control.min===void 0?0:this.props.control.min,r=this.props.control.max===void 0?100:this.props.control.max;this.setState({min:o,max:r,step:this.props.control.step===void 0?(r-o)/100:this.props.control.step,unit:this.props.control.unit||""})}else this.props.control.type==="select"?(e=this.props.control.options)!=null&&e.length?this.setState({options:this.props.control.options.map(o=>({label:p(o.label),value:o.value,icon:o.icon,color:o.color}))}):this.props.socket.getObject(this.props.control.stateId).then(o=>{var r;if((r=o==null?void 0:o.common)!=null&&r.states){let i;typeof o.common.states=="string"?i=o.common.states.split(";").map(d=>{const h=d.split(":");return{value:h[0],label:h[1]}}):Array.isArray(o.common.states)?i=o.common.states.map(l=>({label:l,value:l})):i=Object.keys(o.common.states).map(l=>({label:l,value:o.common.states[l]})),this.setState({options:i})}}):this.props.control.type==="info"&&(this.props.control.unit||this.props.socket.getObject(this.props.control.stateId).then(o=>{var r;(r=o==null?void 0:o.common)!=null&&r.unit&&this.setState({unit:o.common.unit})}))}}stateHandler=async(e,t)=>{if(e===this.props.control.stateId&&t){const o=await this.props.controlStateHandler(this.props.deviceId,this.props.control)();o!=null&&o.ts&&(!this.state.ts||o.ts>this.state.ts)&&this.setState({value:o.val,ts:o.ts})}};componentWillUnmount(){this.props.control.stateId&&this.props.socket.unsubscribeState(this.props.control.stateId,this.stateHandler)}static getDerivedStateFromProps(e,t){var o,r;return(o=e.control.state)!=null&&o.ts&&(!t.ts||((r=e.control.state)==null?void 0:r.ts)>t.ts)?{value:e.control.state.val,ts:e.control.state.ts}:null}async sendControl(e,t,o){const r=await this.props.controlHandler(e,t,o)();r!=null&&r.ts&&(!this.state.ts||(r==null?void 0:r.ts)>this.state.ts)&&this.setState({value:r.val,ts:r.ts})}renderButton(){const e=p(this.props.control.description??""),t=oe(this.props.control,this.props.colors,this.state.value);return this.props.control.label?s.jsx(a.Button,{disabled:this.props.disabled,title:e,onClick:()=>this.sendControl(this.props.deviceId,this.props.control,!0),startIcon:t,children:p(this.props.control.label)}):s.jsx(a.Fab,{size:"small",disabled:this.props.disabled,title:e,onClick:()=>this.sendControl(this.props.deviceId,this.props.control,!0),children:t})}renderSwitch(){const e=p(this.props.control.description??"");return s.jsx(a.Switch,{disabled:this.props.disabled,title:e,checked:!!this.state.value,onChange:t=>this.sendControl(this.props.deviceId,this.props.control,t.target.checked)})}getColor(){let e;return this.state.value?e=this.props.control.colorOn||"primary":this.props.control.type==="switch"&&(e=this.props.control.color),e==="primary"?this.props.colors.primary:e==="secondary"?this.props.colors.secondary:e}renderSelect(){var t,o;const e=(t=this.state.options)==null?void 0:t.some(r=>!!r.icon);return s.jsxs(a.FormControl,{fullWidth:!0,variant:"standard",children:[this.props.control.label?s.jsx(a.InputLabel,{children:p(this.props.control.label)}):null,s.jsx(a.Select,{variant:"standard",value:this.state.value,onChange:r=>this.sendControl(this.props.deviceId,this.props.control,r.target.value),children:(o=this.state.options)==null?void 0:o.map((r,i)=>s.jsxs(a.MenuItem,{value:typeof r.value=="boolean"?r.value.toString():r.value,style:{color:r.color},children:[e?s.jsx($,{src:r.icon,style:{width:24,height:24}}):null,r.label]},i.toString()))})]})}renderSlider(){return this.state.min===void 0||this.state.max===void 0?s.jsx("div",{style:{width:"100%"},children:"..."}):s.jsxs(a.Stack,{spacing:2,direction:"row",sx:{alignItems:"center",mb:1,width:"100%"},children:[this.props.control.label?s.jsx(a.InputLabel,{style:{color:this.props.control.color},children:p(this.props.control.label)}):null,this.props.control.icon?s.jsx($,{style:{color:this.props.control.color},src:this.props.control.icon}):null,s.jsx(a.Slider,{value:parseFloat(this.state.value||"0"),min:this.state.min,max:this.state.max,step:this.state.step,valueLabelDisplay:"auto",onChange:(e,t)=>this.sendControl(this.props.deviceId,this.props.control,t)}),this.props.control.iconOn?s.jsx($,{style:{color:this.props.control.colorOn},src:this.props.control.iconOn}):null,this.props.control.labelOn?s.jsx(a.InputLabel,{style:{color:this.props.control.colorOn},children:p(this.props.control.labelOn)}):null]})}renderColor(){return s.jsx(a.TextField,{fullWidth:!0,label:this.props.control.label?p(this.props.control.label):void 0,type:"color",value:this.state.value,onChange:e=>this.sendControl(this.props.deviceId,this.props.control,e.target.value),variant:"standard"})}renderText(){return s.jsx(a.TextField,{fullWidth:!0,label:this.props.control.label?p(this.props.control.label):void 0,value:this.state.value,onChange:e=>this.sendControl(this.props.deviceId,this.props.control,e.target.value),variant:"standard"})}renderNumber(){return s.jsx(a.TextField,{fullWidth:!0,type:"number",label:this.props.control.label?p(this.props.control.label):void 0,value:this.state.value,onChange:e=>isNaN(parseFloat(e.target.value))?Promise.resolve():this.sendControl(this.props.deviceId,this.props.control,parseFloat(e.target.value)),slotProps:{htmlInput:{min:this.state.min,max:this.state.max,step:this.state.step},input:{endAdornment:this.state.unit?s.jsx(a.InputAdornment,{position:"end",children:this.state.unit}):void 0}},variant:"standard"})}renderIcon(){const e=p(this.props.control.description??""),t=oe(this.props.control,this.props.colors,this.state.value),o=this.getColor(),r=o===this.props.colors.primary||o===this.props.colors.secondary?{}:{color:o},i=o===this.props.colors.primary?"primary":o===this.props.colors.secondary?"secondary":void 0;return this.props.control.label?s.jsx(a.Button,{disabled:this.props.disabled,title:e,color:i,style:r,onClick:()=>this.sendControl(this.props.deviceId,this.props.control,!this.state.value),startIcon:t,children:p(this.props.control.label)}):(r.width=34,r.height=34,r.minHeight=34,s.jsx(a.Fab,{disabled:this.props.disabled,size:"small",title:e,color:i,style:r,onClick:()=>this.sendControl(this.props.deviceId,this.props.control,!this.state.value),children:t}))}renderInfo(){return s.jsxs("div",{children:[this.props.control.label?s.jsx(a.InputLabel,{children:p(this.props.control.label)}):null,s.jsxs("span",{children:[this.state.value,s.jsx("span",{style:{fontSize:"smaller",opacity:.7,marginLeft:this.state.unit?4:0},children:this.state.unit})]})]})}render(){return this.props.control.type==="button"?this.renderButton():this.props.control.type==="icon"?this.renderIcon():this.props.control.type==="switch"?this.renderSwitch():this.props.control.type==="select"?this.renderSelect():this.props.control.type==="slider"?this.renderSlider():this.props.control.type==="color"?this.renderColor():this.props.control.type==="text"?this.renderText():this.props.control.type==="number"?this.renderNumber():this.props.control.type==="info"?this.renderInfo():s.jsx("div",{style:{color:"red"},children:this.props.control.type})}}const ie=34,N=20,re=30,V=15;class Se extends L.Component{render(){const e=s.jsxs("div",{style:{width:this.props.size==="small"?re:ie,height:N,display:"flex",alignItems:"center",cursor:"pointer",position:"relative",opacity:this.props.disabled?.7:1},onClick:t=>{this.props.disabled||(t.stopPropagation(),t.preventDefault(),this.props.onChange(!this.props.checked))},children:[s.jsx("div",{style:{borderRadius:15,width:"100%",height:(this.props.size==="small"?V:N)*.7,opacity:.6,backgroundColor:this.props.checked?this.props.theme.palette.primary.main:this.props.theme.palette.text.disabled}}),s.jsx("div",{style:{position:"absolute",top:this.props.size==="small"?(N-V)/2:0,left:this.props.checked?this.props.size==="small"?re-V:ie-N:0,transition:"left 0.2s",borderRadius:50,width:this.props.size==="small"?V:N,height:this.props.size==="small"?V:N,backgroundColor:this.props.checked?this.props.theme.palette.primary.main:"#EEE",boxShadow:"rgba(0, 0, 0, 0.2) 0px 2px 1px -1px, rgba(0, 0, 0, 0.14) 0px 1px 1px 0px, rgba(0, 0, 0, 0.12) 0px 1px 3px 0px"}})]});return this.props.labelOn||this.props.labelOff?s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[this.props.labelOff,e,this.props.labelOn]}):e}}const B={tooltip:{pointerEvents:"none"}};function Z(n){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",onClick:e=>n.onClick&&n.onClick(e),viewBox:"0 0 165 165",width:n.width||(n.fontSize==="small"?16:20),height:n.height||n.width||(n.fontSize==="small"?16:20),className:n.className,style:n.style,children:[s.jsx("path",{fill:"currentColor",d:"M82.498,0C37.008,0,0,37.008,0,82.496c0,45.181,36.51,81.977,81.573,82.476V82.569l-27.002-0.002 c-8.023,0-14.554,6.53-14.554,14.561c0,8.023,6.531,14.551,14.554,14.551v17.98c-17.939,0-32.534-14.595-32.534-32.531 c0-17.944,14.595-32.543,32.534-32.543l27.002,0.004v-9.096c0-14.932,12.146-27.08,27.075-27.08 c14.932,0,27.082,12.148,27.082,27.08c0,14.931-12.15,27.08-27.082,27.08l-9.097-0.001v80.641 C136.889,155.333,165,122.14,165,82.496C165,37.008,127.99,0,82.498,0z"}),s.jsx("path",{fill:"currentColor",d:"M117.748,55.493c0-5.016-4.082-9.098-9.1-9.098c-5.015,0-9.097,4.082-9.097,9.098v9.097l9.097,0.001 C113.666,64.591,117.748,60.51,117.748,55.493z"})]})}function J(n){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",onClick:e=>n.onClick&&n.onClick(e),viewBox:"0 0 1073 1068",width:n.width||(n.fontSize==="small"?16:20),height:n.height||n.width||(n.fontSize==="small"?16:20),className:n.className,style:n.style,children:s.jsx("path",{fill:"currentColor",d:"M716 1.1C632.9 5.3 549.8 23.7 472 55c-66.4 26.7-132.6 65.5-188.5 110.4-43.8 35.1-85.2 76.7-120.1 120.6C72.4 400.4 16.7 539.8 3.5 686 1.8 705.1-.1 754.7.7 758c.5 2 1 2 49.7 1.8l49.1-.3.7-20c2.4-64.6 13.4-126 33.2-186 80.8-243.9 297-419.9 552.1-449.4 20.2-2.4 44.2-4.1 56.6-4.1h8.9V50 0l-9.7.1c-5.4.1-16.8.6-25.3 1zm-.8 208c-78.5 4.7-158 27.4-226.5 64.5-68.7 37.3-126.4 86.3-175.2 148.9-11 14-33.2 47.3-42.3 63.5-44 77.8-68.6 164.9-70.9 251.2l-.6 22.8h49.5 49.4l1.2-19c6.3-98.7 40-185.8 102.2-263.3 12.7-15.9 41.2-45.2 57-58.7 66.1-56.3 142.1-91.8 226-105.5 18.9-3 44.1-5.5 56.7-5.5h9.3v-50-50l-11.2.1c-6.2.1-17.3.6-24.6 1zm17.8 251c-104.5 9.2-195.2 69.7-243.6 162.4-43.9 84-45.5 184.2-4.5 270 60.3 125.9 198.1 194.2 334.9 166 46.6-9.7 89.5-29.7 127.2-59.6 13.5-10.7 37.3-34.5 48-47.9 34.2-43.1 55.2-92 63.7-148.6 2.2-15.1 2.5-62.7.5-77.4-3.6-25.2-10.1-51.4-17.8-71.2-10.1-26.2-29.4-59.7-47-81.8-9.7-12.1-35-37.2-47.4-47-47.8-37.9-104.5-60.1-165.4-65-14.7-1.1-34.7-1.1-48.6.1zm174.7 138.6c-.3.5-30.9 49.2-68.1 108.3L772 814.5l67.9.5 68 .5-30.1 48.8-30 48.7h-131c-104.4 0-130.9-.3-130.5-1.3.2-.6 32.7-51.1 72.1-112.1L730 687.9c0-.5-29.5-1-66.5-1.1l-66.6-.3 27.7-44.3 27.6-44.2h128l127.5.7z"})})}function q(n){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",onClick:e=>n.onClick&&n.onClick(e),viewBox:"0 0 48 48",width:n.width||(n.fontSize==="small"?16:20),height:n.height||n.width||(n.fontSize==="small"?16:20),className:n.className,style:n.style,children:[s.jsx("path",{fill:"currentColor",d:"M32.042,9.792c4.595,1.238,4.88,3.165,5.524,5.048C34.841,17.664,17.35,35.7,17.35,35.7 s10.901,1.177,23.487-1.003c-0.001,0.029-0.002,0.048-0.003,0.076C42.829,31.661,44,27.97,44,24c0-11.046-8.954-20-20-20 c-5.634,0-10.715,2.338-14.35,6.087C15.489,9.124,26.89,8.403,32.042,9.792z"}),s.jsx("path",{fill:"currentColor",d:"M14.724,37.285c-1.982-0.347-4.212-2.131-4.707-5.302c1.437-1.239,19.994-20.507,19.994-20.507 c-7.008-0.424-14.569-0.465-22.237,0.864C5.408,15.625,4,19.644,4,24c0,11.046,8.954,20,20,20c6.173,0,11.689-2.8,15.358-7.195 C35.486,37.33,23.257,38.769,14.724,37.285z"})]})}function De(n,e){return n<-80?e==="dark"?"#ff5c5c":"#aa0000":n<-60?e==="dark"?"#fa8547":"#ae5c00":n<-50?e==="dark"?"#cdff4f":"#7b9500":e==="dark"?"#5cff5c":"#008500"}const x={fill:"#00ac00",color:"#00ac00"},S={fill:"#ff0000",color:"#ff0000"},Y={fill:"#da8200",color:"#da8200"},O={fill:"#8a8a8a",color:"#8a8a8a"},ae={fill:"#ffcc00",color:"#ffcc00"};function be(n){return n>95?s.jsx(c.BatteryFull,{style:x}):n>85&&n<=95?s.jsx(c.Battery90,{style:x}):n>70&&n<=85?s.jsx(c.Battery80,{style:x}):n>55&&n<=70?s.jsx(c.Battery60,{style:x}):n>40&&n<=55?s.jsx(c.Battery50,{style:ae}):n>25&&n<=40?s.jsx(c.Battery30,{style:ae}):n>10&&n<=25?s.jsx(c.Battery20,{style:Y}):s.jsx(c.BatteryAlert,{style:S})}function le(n){if(!n.status)return null;let e;typeof n.status=="string"?e={connection:n.status}:e=n.status;let t=null;typeof e.battery=="number"&&(t=be(e.battery));const o=typeof n.enabled=="boolean"?s.jsxs(s.Fragment,{children:[s.jsx("div",{style:{flexGrow:1}}),s.jsx(a.Tooltip,{title:n.enabled?p("disableIconTooltip"):p("enableIconTooltip"),slotProps:{popper:{sx:B.tooltip}},children:s.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:s.jsx(Se,{size:"small",checked:n.enabled,disabled:!n.disableEnableAction,onChange:()=>n.disableEnableAction&&n.deviceHandler(n.deviceId,n.disableEnableAction,n.refresh)(),theme:n.theme})})})]}):null;let r;n.connectionType==="wifi"?r=e.connection==="connected"?s.jsx(c.Wifi,{style:x}):e.connection==="disconnected"?s.jsx(c.WifiOff,{style:S}):s.jsx(c.Wifi,{style:O}):n.connectionType==="bluetooth"?r=e.connection==="connected"?s.jsx(c.Bluetooth,{style:x}):e.connection==="disconnected"?s.jsx(c.BluetoothDisabled,{style:S}):s.jsx(c.Bluetooth,{style:O}):n.connectionType==="lan"?r=e.connection==="connected"?s.jsx(c.Cable,{style:x}):e.connection==="disconnected"?s.jsx(c.Cable,{style:S}):s.jsx(c.Cable,{style:O}):n.connectionType==="thread"?r=e.connection==="connected"?s.jsx(Z,{style:x}):e.connection==="disconnected"?s.jsx(Z,{style:S}):s.jsx(Z,{style:O}):n.connectionType==="z-wave"?r=e.connection==="connected"?s.jsx(J,{style:x}):e.connection==="disconnected"?s.jsx(J,{style:S}):s.jsx(J,{style:O}):n.connectionType==="zigbee"?r=e.connection==="connected"?s.jsx(q,{style:x}):e.connection==="disconnected"?s.jsx(q,{style:S}):s.jsx(q,{style:O}):r=e.connection==="connected"?s.jsx(c.Link,{style:x}):e.connection==="disconnected"?s.jsx(c.LinkOff,{style:S}):null;const i=e.connection==="connected"||e.connection==="disconnected"?s.jsx(a.Tooltip,{title:(e.connection==="connected"?p("connectedIconTooltip"):p("disconnectedIconTooltip"))+(n.statusAction?`. ${p(n.statusAction.description||"moreInformation")}`:""),slotProps:{popper:{sx:B.tooltip}},children:n.statusAction?s.jsxs(a.IconButton,{onClick:l=>{n.statusAction&&(l.stopPropagation(),n.deviceHandler(n.deviceId,n.statusAction,n.refresh)())},children:[r,s.jsx("div",{style:{position:"absolute",top:0,left:0,color:"grey"},children:"*"})]}):s.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:r})}):r;return s.jsxs("div",{style:{display:"flex",alignItems:"baseline",cursor:n.statusAction?"pointer":void 0,width:n.disableEnableAction?"100%":void 0,gap:8},children:[i,e.rssi&&s.jsx(a.Tooltip,{title:"RSSI",slotProps:{popper:{sx:B.tooltip}},children:s.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[s.jsx(c.NetworkCheck,{style:{color:De(e.rssi,n.theme.palette.mode)}}),s.jsx("p",{style:{fontSize:"small",margin:0},children:e.rssi})]})}),typeof e.battery=="number"&&s.jsx(a.Tooltip,{title:p("batteryTooltip"),slotProps:{popper:{sx:B.tooltip}},children:s.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[t,s.jsxs("p",{style:{fontSize:"small",margin:0},children:[e.battery,"%"]})]})}),typeof e.battery=="string"&&s.jsx(a.Tooltip,{title:p("batteryTooltip"),slotProps:{popper:{sx:B.tooltip}},children:s.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:[e.battery==="charging"?s.jsx(c.BatteryCharging50,{}):s.jsx(c.BatteryFull,{}),e.battery!=="charging"?e.battery.includes("V")||e.battery.includes("mV")?s.jsx("p",{style:{fontSize:"small",margin:0},children:e.battery}):s.jsxs("p",{style:{fontSize:"small",margin:0},children:[s.jsx("span",{style:{marginRight:4},children:e.battery}),"mV"]}):null]})}),typeof e.battery=="boolean"&&s.jsx(a.Tooltip,{title:p("batteryTooltip"),slotProps:{popper:{sx:B.tooltip}},children:s.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:e.battery?s.jsx(c.BatteryFull,{style:x}):s.jsx(c.BatteryAlert,{style:S})})}),e.warning?typeof e.warning=="string"||typeof e.warning=="object"?s.jsx(a.Tooltip,{title:p(e.warning),slotProps:{popper:{sx:B.tooltip}},children:s.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:s.jsx(c.Warning,{style:Y})})}):s.jsx("div",{style:{display:"flex",flexDirection:"column",alignItems:"center"},children:s.jsx(c.Warning,{style:Y})}):null,o]})}function me(n){var m,T;const{instanceId:e,socket:t,schema:o,data:r,onChange:i}=n,[l,d]=L.useState(!1);if(o===void 0)return null;const[h,u]=e.split(".",2);return s.jsxs(s.Fragment,{children:[l&&s.jsx("div",{children:l}),s.jsx(ye,{expertMode:n.expertMode,socket:t,adapterName:h,instance:parseInt(u,10),schema:o,data:r,onError:d,onChange:y=>i(y),embedded:!0,themeName:n.themeName,themeType:n.themeType,theme:n.theme,isFloatComma:n.isFloatComma===void 0?!!((m=n.socket.systemConfig)!=null&&m.common.isFloatComma):n.isFloatComma,dateFormat:n.dateFormat===void 0?(T=n.socket.systemConfig)==null?void 0:T.common.dateFormat:n.dateFormat})]})}function ce(n){const{socket:e,manufacturer:t,model:o,deviceId:r,onImageSelect:i,uploadImagesToInstance:l}=n,d=m=>{const y=m.target.files;if(!y||y.length===0)return;const D=y[0];if(D){const w=new FileReader;w.onload=k=>{if(!k.target||!k.target.result)return;const F=new Image;F.src=k.target.result,F.onload=async()=>{let b=F.width,_=F.height;b>_?b>100&&(_*=100/b,b=100):_>100&&(b*=100/_,_=100);const z=document.createElement("canvas"),X=z.getContext("2d");if(X){z.width=b,z.height=_,X.drawImage(F,0,0,b,_);const ee=z.toDataURL("image/webp"),ge=`${t?`${t}_`:""}${o||r}.webp`,xe=ee.replace(/^data:image\/webp;base64,/,""),ve=await e.writeFile64(l,ge,xe);console.log(`saveImage response: ${JSON.stringify(ve)}`),i&&i(ee)}}},w.readAsDataURL(D)}},h={opacity:0,position:"absolute",width:45,height:45,zIndex:3},u={position:"relative",top:-22};return s.jsx("div",{style:u,children:s.jsx("input",{style:h,type:"file",accept:"image/*",onChange:d})})}const C={cardStyle:{width:300,minHeight:280,margin:10,overflow:"hidden",display:"inline-block"},headerStyle:{display:"flex",alignItems:"center",gap:8,paddingLeft:8,paddingRight:8,position:"relative",minHeight:60,color:"#000"},imgAreaStyle:{height:45,width:45,justifyContent:"center",display:"flex",alignItems:"center"},imgStyle:{zIndex:2,maxWidth:"100%",maxHeight:"100%",color:"#FFF"},titleStyle:{fontSize:16,fontWeight:"bold",overflow:"hidden",textOverflow:"ellipsis"},detailsButtonStyle:{right:20,bottom:-20,position:"absolute"},bodyStyle:{height:"calc(100% - 116px)"},deviceInfoStyle:{padding:"20px 16px 0 16px",height:133},statusStyle:{padding:"15px 25px 0 15px",height:41}};function de(n){return s.jsx("svg",{viewBox:"0 0 24 24",width:"24",height:"24",style:n.style,className:n.className,children:s.jsx("path",{fill:"currentColor",d:"M21.9,21.9l-8.49-8.49l0,0L3.59,3.59l0,0L2.1,2.1L0.69,3.51L3,5.83V19c0,1.1,0.9,2,2,2h13.17l2.31,2.31L21.9,21.9z M5,18 l3.5-4.5l2.5,3.01L12.17,15l3,3H5z M21,18.17L5.83,3H19c1.1,0,2,0.9,2,2V18.17z"})})}function j(n){return typeof n=="object"?n[v.getLanguage()]||n.en:n}class _e extends L.Component{constructor(e){super(e),this.state={open:!1,details:null,data:{},icon:e.device.icon,showControlDialog:!1}}async fetchIcon(){if(!this.props.device.icon){const e=v.getLanguage(),t=this.props.device.manufacturer&&typeof this.props.device.manufacturer=="object"?this.props.device.manufacturer[e]||this.props.device.manufacturer.en:this.props.device.manufacturer,o=this.props.device.model&&typeof this.props.device.model=="object"?this.props.device.model[e]||this.props.device.model.en:this.props.device.model,r=`${t?`${t}_`:""}${o||this.props.device.id}`;try{const i=await this.props.socket.readFile(this.props.instanceId.replace("system.adapter.",""),`${r}.webp`,!0);i?this.setState({icon:`data:${i.mimeType};base64,${i.file}`}):this.setState({icon:""})}catch{this.state.icon&&this.setState({icon:""})}}}componentDidMount(){this.fetchIcon().catch(e=>console.error(e))}async loadDetails(){console.log(`Loading device details for ${this.props.device.id}... from ${this.props.instanceId}`);const e=await this.props.socket.sendTo(this.props.instanceId,"dm:deviceDetails",this.props.device.id);console.log(`Got device details for ${this.props.device.id}:`,e),this.setState({details:e,data:(e==null?void 0:e.data)||{}})}refresh=()=>{this.setState({details:null}),this.loadDetails().catch(console.error)};copyToClipboard=()=>{const e=this.props.device.id;H.copyToClipboard(e),alert(`${p("copied")} ${e} ${p("toClipboard")}!`)};renderDialog(){return!this.state.open||!this.state.details?null:s.jsxs(a.Dialog,{open:!0,maxWidth:"md",onClose:()=>this.setState({open:!1}),children:[s.jsx(a.DialogContent,{children:s.jsx(me,{instanceId:this.props.instanceId,socket:this.props.socket,schema:this.state.details.schema,data:this.state.data,onChange:e=>this.setState({data:e}),themeName:this.props.themeName,themeType:this.props.themeType,theme:this.props.theme,isFloatComma:this.props.isFloatComma,dateFormat:this.props.dateFormat})}),s.jsx(a.DialogActions,{children:s.jsx(a.Button,{disabled:!this.props.alive,variant:"contained",color:"primary",onClick:()=>this.setState({open:!1}),autoFocus:!0,children:p("closeButtonText")})})]})}renderControlDialog(){var t;if(!this.state.showControlDialog||!this.props.alive)return null;const e={primary:"#111",secondary:"#888"};return s.jsxs(a.Dialog,{open:!0,onClose:()=>this.setState({showControlDialog:!1}),children:[s.jsxs(a.DialogTitle,{children:[this.props.title,s.jsx(a.IconButton,{style:{position:"absolute",top:5,right:5,zIndex:10},onClick:()=>this.setState({showControlDialog:!1}),children:s.jsx(c.Close,{})})]}),s.jsx(a.DialogContent,{style:{display:"flex",flexDirection:"column"},children:(t=this.props.device.controls)==null?void 0:t.map(o=>s.jsx(ne,{disabled:!1,control:o,socket:this.props.socket,colors:e,deviceId:this.props.device.id,controlHandler:this.props.controlHandler,controlStateHandler:this.props.controlStateHandler},o.id))})]})}renderControls(){var o,r,i;const e={primary:"#111",secondary:"#888"},t=(o=this.props.device.controls)==null?void 0:o[0];return((r=this.props.device.controls)==null?void 0:r.length)===1&&t&&(t.type==="icon"||t.type==="switch")&&!t.label?s.jsx(ne,{disabled:!this.props.alive,control:t,colors:e,socket:this.props.socket,deviceId:this.props.device.id,controlHandler:this.props.controlHandler,controlStateHandler:this.props.controlStateHandler}):(i=this.props.device.controls)!=null&&i.length?s.jsx(a.Fab,{size:"small",disabled:!this.props.alive,onClick:()=>this.setState({showControlDialog:!0}),children:s.jsx(c.VideogameAsset,{})}):null}renderActions(){var t;const e=(t=this.props.device.actions)==null?void 0:t.filter(o=>o.id!==I.ACTIONS.STATUS&&o.id!==I.ACTIONS.ENABLE_DISABLE);return e!=null&&e.length?e.map(o=>s.jsx(je,{disabled:!this.props.alive,deviceId:this.props.device.id,action:o,deviceHandler:this.props.deviceHandler,refresh:this.refresh},o.id)):null}renderSmall(){const e=this.props.device.hasDetails,t=this.props.device.status?Array.isArray(this.props.device.status)?this.props.device.status:[this.props.device.status]:[],o=this.state.icon?s.jsx(Q,{src:this.state.icon}):s.jsx(de,{}),r=this.getCardHeaderStyle(this.props.theme,345);return s.jsxs(a.Card,{sx:{maxWidth:345,minWidth:200},children:[s.jsx(a.CardHeader,{style:r,avatar:s.jsxs("div",{children:[this.props.uploadImagesToInstance?s.jsx(ce,{uploadImagesToInstance:this.props.uploadImagesToInstance,deviceId:this.props.device.id,manufacturer:j(this.props.device.manufacturer),model:j(this.props.device.model),onImageSelect:i=>{i&&this.setState({icon:i})},socket:this.props.socket}):null,o]}),action:e?s.jsx(a.IconButton,{"aria-label":"settings",onClick:()=>{this.state.open||(this.loadDetails().catch(console.error),this.setState({open:!0}))},children:s.jsx(c.MoreVert,{})}):null,title:this.props.title,subheader:this.props.device.manufacturer?s.jsxs("span",{children:[s.jsxs("b",{style:{marginRight:4},children:[p("manufacturer"),":"]}),j(this.props.device.manufacturer)]}):null}),s.jsxs(a.CardContent,{style:{position:"relative"},children:[t!=null&&t.length?s.jsx("div",{style:{display:"flex",position:"absolute",top:-11,background:"#88888880",padding:"0 8px",borderRadius:5,width:"calc(100% - 46px)"},children:t.map((i,l)=>{var d,h;return s.jsx(le,{status:i,connectionType:this.props.device.connectionType,enabled:this.props.device.enabled,deviceId:this.props.device.id,statusAction:(d=this.props.device.actions)==null?void 0:d.find(u=>u.id===I.ACTIONS.STATUS),disableEnableAction:(h=this.props.device.actions)==null?void 0:h.find(u=>u.id===I.ACTIONS.ENABLE_DISABLE),deviceHandler:this.props.deviceHandler,refresh:this.refresh,theme:this.props.theme},l)})}):null,s.jsx("div",{children:s.jsxs(a.Typography,{variant:"body1",children:[s.jsxs("div",{onClick:this.copyToClipboard,style:{textOverflow:"ellipsis",overflow:"hidden"},children:[s.jsx("b",{children:"ID:"}),s.jsx("span",{style:{marginLeft:4},children:this.props.device.id.replace(/.*\.\d\./,"")})]}),this.props.device.manufacturer?s.jsxs("div",{children:[s.jsxs("b",{style:{marginRight:4},children:[p("manufacturer"),":"]}),j(this.props.device.manufacturer)]}):null,this.props.device.model?s.jsxs("div",{children:[s.jsxs("b",{style:{marginRight:4},children:[p("model"),":"]}),j(this.props.device.model)]}):null]})})]}),s.jsxs(a.CardActions,{disableSpacing:!0,children:[this.renderActions(),s.jsx("div",{style:{flexGrow:1}}),this.renderControls()]}),this.renderDialog(),this.renderControlDialog()]})}getCardHeaderStyle(e,t){const o=this.props.device;if(!o)return{};const r=o.backgroundColor==="primary"?e.palette.primary.main:o.backgroundColor==="secondary"?e.palette.secondary.main:o.backgroundColor||e.palette.secondary.main;let i;return o.color&&o.color!=="primary"&&o.color!=="secondary"?i=o.color:o.color==="primary"?i=e.palette.primary.main:o.color==="secondary"?i=e.palette.secondary.main:o.backgroundColor==="primary"?i=e.palette.primary.contrastText:o.backgroundColor==="secondary"||!o.backgroundColor?i=e.palette.secondary.contrastText:i=H.invertColor(r,!0),{backgroundColor:r,color:i,maxWidth:t}}renderBig(){var i,l,d,h,u;const e=this.props.device.status?Array.isArray(this.props.device.status)?this.props.device.status:[this.props.device.status]:[],t=this.state.icon?s.jsx(Q,{src:this.state.icon,style:C.imgStyle}):s.jsx(de,{style:C.imgStyle}),o=this.getCardHeaderStyle(this.props.theme),r=((l=(i=this.state.details)==null?void 0:i.data)==null?void 0:l.name)||this.props.title||"";return s.jsxs(a.Paper,{style:C.cardStyle,children:[s.jsxs(a.Box,{sx:o,style:C.headerStyle,children:[s.jsxs("div",{style:C.imgAreaStyle,children:[this.props.uploadImagesToInstance?s.jsx(ce,{uploadImagesToInstance:this.props.uploadImagesToInstance,deviceId:this.props.device.id,manufacturer:j(this.props.device.manufacturer),model:j(this.props.device.model),onImageSelect:m=>{m&&this.setState({icon:m})},socket:this.props.socket}):null,t]}),s.jsx(a.Box,{style:C.titleStyle,title:r.length>20?r:void 0,sx:m=>({color:o.color||m.palette.secondary.contrastText}),children:((h=(d=this.state.details)==null?void 0:d.data)==null?void 0:h.name)||this.props.title}),this.props.device.hasDetails?s.jsx(a.Fab,{disabled:!this.props.alive,size:"small",style:C.detailsButtonStyle,onClick:()=>{this.state.open||(this.loadDetails().catch(console.error),this.setState({open:!0}))},color:"primary",children:s.jsx(c.MoreVert,{})}):null]}),s.jsx("div",{style:C.statusStyle,children:e.map((m,T)=>{var y,D;return s.jsx(le,{deviceId:this.props.device.id,connectionType:this.props.device.connectionType,status:m,enabled:this.props.device.enabled,statusAction:(y=this.props.device.actions)==null?void 0:y.find(w=>w.id===I.ACTIONS.STATUS),disableEnableAction:(D=this.props.device.actions)==null?void 0:D.find(w=>w.id===I.ACTIONS.ENABLE_DISABLE),deviceHandler:this.props.deviceHandler,refresh:this.refresh,theme:this.props.theme},T)})}),s.jsxs("div",{style:C.bodyStyle,children:[s.jsxs(a.Typography,{variant:"body1",style:C.deviceInfoStyle,children:[s.jsxs("div",{onClick:this.copyToClipboard,children:[s.jsx("b",{style:{marginRight:4},children:"ID:"}),this.props.device.id.replace(/.*\.\d\./,"")]}),this.props.device.manufacturer?s.jsxs("div",{children:[s.jsxs("b",{style:{marginRight:4},children:[p("manufacturer"),":"]}),j(this.props.device.manufacturer)]}):null,this.props.device.model?s.jsxs("div",{children:[s.jsxs("b",{style:{marginRight:4},children:[p("model"),":"]}),j(this.props.device.model)]}):null]}),!!((u=this.props.device.actions)!=null&&u.length)&&s.jsxs("div",{style:{flex:1,position:"relative",display:"flex",gap:8,paddingBottom:5,height:34,paddingLeft:10,paddingRight:10},children:[this.renderActions(),s.jsx("div",{style:{flexGrow:1}}),this.renderControls()]})]}),this.renderDialog(),this.renderControlDialog()]},this.props.id)}render(){return this.props.smallCards?this.renderSmall():this.renderBig()}}class Be extends L.Component{responseTimeout=null;instanceHandler;deviceHandler;controlHandler;controlStateHandler;constructor(e){super(e),this.state={showSpinner:!1,showToast:null,message:null,confirm:null,form:null,progress:null,showConfirmation:null,showInput:null,inputValue:null},this.instanceHandler=t=>()=>{if(t.confirmation){this.setState({showConfirmation:t});return}if(t.inputBefore){this.setState({showInput:t});return}this.sendActionToInstance("dm:instanceAction",{actionId:t.id,timeout:t.timeout})},this.deviceHandler=(t,o,r)=>()=>{if(o.confirmation){this.setState({showConfirmation:{...o,deviceId:t,refresh:r}});return}if(o.inputBefore){this.setState({showInput:{...o,deviceId:t,refresh:r},inputValue:o.inputBefore.defaultValue||""});return}this.sendActionToInstance("dm:deviceAction",{deviceId:t,actionId:o.id,timeout:o.timeout},r)},this.controlHandler=(t,o,r)=>()=>this.sendControlToInstance("dm:deviceControl",{deviceId:t,controlId:o.id,state:r}),this.controlStateHandler=(t,o)=>()=>this.sendControlToInstance("dm:deviceControlState",{deviceId:t,controlId:o.id}),this.props.registerHandler&&this.props.registerHandler(()=>this.loadData())}componentWillUnmount(){this.responseTimeout&&(clearTimeout(this.responseTimeout),this.responseTimeout=null)}loadData(){console.error("loadData not implemented")}sendActionToInstance=(e,t,o)=>{(async()=>{this.setState({showSpinner:!0}),this.responseTimeout=setTimeout(()=>{this.setState({showSpinner:!1}),window.alert(v.t("ra_No response from the backend"))},t.timeout||5e3);const i=await this.props.socket.sendTo(this.props.selectedInstance,e,t);this.responseTimeout&&(clearTimeout(this.responseTimeout),this.responseTimeout=null);const l=i.type;switch(console.log(`Response: ${i.type}`),l){case"message":console.log(`Message received: ${i.message}`),i.message&&this.setState({message:{message:i.message,handleClose:()=>this.setState({message:null},()=>this.sendActionToInstance("dm:actionProgress",{origin:i.origin},o))},showSpinner:!1});break;case"confirm":console.log(`Confirm received: ${i.confirm}`),i.confirm&&this.setState({confirm:{message:i.confirm,handleClose:d=>this.setState({confirm:null},()=>this.sendActionToInstance("dm:actionProgress",{origin:i.origin,confirm:d},o))},showSpinner:!1});break;case"form":if(console.log("Form received"),i.form){const d=i.form.data,h={};d&&Object.keys(d).forEach(u=>{d[u]!==void 0&&(h[u]=d[u])}),i.form.data=JSON.parse(JSON.stringify(h)),this.setState({form:{...i.form,changed:!1,originalData:JSON.stringify(h),handleClose:u=>this.setState({form:null},()=>{console.log(`Form ${JSON.stringify(u)}`),this.sendActionToInstance("dm:actionProgress",{origin:i.origin,data:u},o)})},showSpinner:!1})}break;case"progress":if(i.progress)if(this.state.progress){const d={...this.state.progress,...i.progress};this.setState({progress:d,showSpinner:!1})}else this.setState({progress:i.progress,showSpinner:!1});this.sendActionToInstance("dm:actionProgress",{origin:i.origin},o);break;case"result":console.log("Response content",i.result),i.result.refresh&&(i.result.refresh===!0?(console.log("Refreshing all"),this.loadData()):i.result.refresh==="instance"?console.log(`Refreshing instance infos: ${this.props.selectedInstance}`):i.result.refresh==="device"?o?(console.log(`Refreshing device infos: ${this.props.selectedInstance}`),o()):console.log('No refresh function provided to refresh "device"'):console.log("Not refreshing anything")),i.result.error?(console.error(`Error: ${i.result.error.message}`),this.setState({showToast:i.result.error.message,showSpinner:!1})):this.setState({showSpinner:!1});break;default:console.log(`Unknown response type: ${l}`),this.setState({showSpinner:!1});break}})().catch(console.error)};sendControlToInstance=async(e,t)=>{const o=await this.props.socket.sendTo(this.props.selectedInstance,e,t),r=o.type;if(console.log(`Response: ${o.type}`),o.type==="result"){if(console.log("Response content",o.result),o.result.error)console.error(`Error: ${o.result.error.message}`),this.setState({showToast:o.result.error.message});else if(o.result.state!==void 0)return o.result.state}else console.warn("Unexpected response type",r);return null};loadDevices(){return this.props.socket.sendTo(this.props.selectedInstance,"dm:listDevices")}loadInstanceInfos(){return this.props.socket.sendTo(this.props.selectedInstance,"dm:instanceInfo")}renderMessageDialog(){var e;return this.state.message?s.jsxs(a.Dialog,{open:!0,onClose:()=>{var t;return(t=this.state.message)==null?void 0:t.handleClose()},hideBackdrop:!0,"aria-describedby":"message-dialog-description",children:[s.jsx(a.DialogContent,{children:s.jsx(a.DialogContentText,{id:"message-dialog-description",children:(e=this.state.message)==null?void 0:e.message})}),s.jsx(a.DialogActions,{children:s.jsx(a.Button,{color:"primary",onClick:()=>{var t;return(t=this.state.message)==null?void 0:t.handleClose()},variant:"contained",autoFocus:!0,children:p("okButtonText")})})]}):null}renderConfirmDialog(){var e;return this.state.confirm?s.jsxs(a.Dialog,{open:!0,onClose:()=>{var t;return(t=this.state.confirm)==null?void 0:t.handleClose()},hideBackdrop:!0,"aria-describedby":"confirm-dialog-description",children:[s.jsx(a.DialogContent,{children:s.jsx(a.DialogContentText,{id:"confirm-dialog-description",children:p((e=this.state.confirm)==null?void 0:e.message)})}),s.jsxs(a.DialogActions,{children:[s.jsx(a.Button,{variant:"contained",color:"primary",onClick:()=>{var t;return(t=this.state.confirm)==null?void 0:t.handleClose(!0)},autoFocus:!0,children:p("yesButtonText")}),s.jsx(a.Button,{variant:"contained",color:"grey",onClick:()=>{var t;return(t=this.state.confirm)==null?void 0:t.handleClose(!1)},autoFocus:!0,children:p("noButtonText")})]})]}):null}renderSnackbar(){return s.jsx(a.Snackbar,{open:!!this.state.showToast,autoHideDuration:6e3,onClose:()=>this.setState({showToast:null}),message:this.state.showToast})}getOkButton(e){var t;return typeof e=="string"&&(e=void 0),s.jsx(a.Button,{disabled:!((t=this.state.form)!=null&&t.changed),variant:(e==null?void 0:e.variant)||"contained",color:(e==null?void 0:e.color)==="primary"?"primary":(e==null?void 0:e.color)==="secondary"?"secondary":"primary",style:{backgroundColor:e!=null&&e.color&&(e==null?void 0:e.color)!=="primary"&&(e==null?void 0:e.color)!=="secondary"?e==null?void 0:e.color:void 0,...(e==null?void 0:e.style)||void 0},onClick:()=>{var o,r;return((o=this.state.form)==null?void 0:o.handleClose)&&this.state.form.handleClose((r=this.state.form)==null?void 0:r.data)},startIcon:e!=null&&e.icon?s.jsx($,{src:e==null?void 0:e.icon}):void 0,children:p((e==null?void 0:e.label)||"okButtonText",e==null?void 0:e.noTranslation)},"apply")}getCancelButton(e){let t=!1;return typeof e=="string"&&(t=e==="close",e=void 0),s.jsx(a.Button,{variant:(e==null?void 0:e.variant)||"contained",color:(e==null?void 0:e.color)==="primary"?"primary":(e==null?void 0:e.color)==="secondary"?"secondary":"grey",style:{backgroundColor:e!=null&&e.color&&(e==null?void 0:e.color)!=="primary"&&(e==null?void 0:e.color)!=="secondary"?e==null?void 0:e.color:void 0,...(e==null?void 0:e.style)||void 0},onClick:()=>{var o;return((o=this.state.form)==null?void 0:o.handleClose)&&this.state.form.handleClose()},startIcon:t?s.jsx(c.Close,{}):e!=null&&e.icon?s.jsx($,{src:e==null?void 0:e.icon}):void 0,children:p((e==null?void 0:e.label)||"cancelButtonText",e==null?void 0:e.noTranslation)},"cancel")}renderFormDialog(){var t,o,r;if(!this.state.form||!this.state.form.schema)return null;let e;return this.state.form.buttons?(e=[],this.state.form.buttons.forEach(i=>{typeof i=="object"&&i.type==="copyToClipboard"?e.push(s.jsx(a.Button,{variant:i.variant||"outlined",color:i.color==="primary"?"primary":i.color==="secondary"?"secondary":void 0,style:{backgroundColor:i.color&&i.color!=="primary"&&i.color!=="secondary"?i.color:void 0,...i.style||void 0},onClick:()=>{var l;if(i.copyToClipboardAttr&&this.state.form.data){const d=this.state.form.data[i.copyToClipboardAttr];typeof d=="string"?H.copyToClipboard(d):H.copyToClipboard(JSON.stringify(d,null,2)),window.alert(v.t("copied"))}else(l=this.state.form)!=null&&l.data?(H.copyToClipboard(JSON.stringify(this.state.form.data,null,2)),window.alert(v.t("copied"))):window.alert(v.t("nothingToCopy"))},startIcon:i!=null&&i.icon?s.jsx($,{src:i==null?void 0:i.icon}):s.jsx(c.ContentCopy,{}),children:p((i==null?void 0:i.label)||"ctcButtonText",i==null?void 0:i.noTranslation)},"copyToClipboard")):i==="apply"||i.type==="apply"?e.push(this.getOkButton(i)):e.push(this.getCancelButton(i))})):e=[this.getOkButton(),this.getCancelButton()],s.jsxs(a.Dialog,{open:!0,onClose:()=>this.state.form.handleClose&&this.state.form.handleClose(),hideBackdrop:!0,fullWidth:!0,sx:{"& .MuiDialog-paper":{minWidth:this.state.form.minWidth||void 0}},maxWidth:this.state.form.maxWidth||"md",children:[(t=this.state.form)!=null&&t.title?s.jsx(a.DialogTitle,{children:p(((o=this.state.form)==null?void 0:o.label)||((r=this.state.form)==null?void 0:r.title),this.state.form.noTranslation)}):null,s.jsx(a.DialogContent,{children:s.jsx(me,{instanceId:this.props.selectedInstance,schema:this.state.form.schema,data:this.state.form.data||{},socket:this.props.socket,onChange:i=>{console.log("handleFormChange",{data:i});const l={...this.state.form};l&&(l.data=i,l.changed=JSON.stringify(i)!==l.originalData,this.setState({form:l}))},themeName:this.props.themeName,themeType:this.props.themeType,theme:this.props.theme,isFloatComma:this.props.isFloatComma,dateFormat:this.props.dateFormat})}),s.jsx(a.DialogActions,{children:e})]})}renderProgressDialog(){var e,t;return(e=this.state.progress)!=null&&e.open?s.jsx(a.Dialog,{open:!0,onClose:()=>{},hideBackdrop:!0,children:s.jsx(a.LinearProgress,{variant:"determinate",value:((t=this.state.progress)==null?void 0:t.progress)||0})}):null}renderContent(){return null}renderSpinner(){return this.state.showSpinner?s.jsx(a.Backdrop,{style:{zIndex:1e3},open:!0,children:s.jsx(a.CircularProgress,{})}):null}renderConfirmationDialog(){return this.state.showConfirmation?s.jsxs(a.Dialog,{open:!0,onClose:()=>this.setState({showConfirmation:null}),children:[s.jsx(a.DialogTitle,{children:p(this.state.showConfirmation.confirmation===!0?p("areYouSureText"):p(this.state.showConfirmation.confirmation))}),s.jsxs(a.DialogActions,{children:[s.jsx(a.Button,{variant:"contained",color:"primary",onClick:()=>{if(!this.state.showConfirmation)return;const e=this.state.showConfirmation;this.setState({showConfirmation:null},()=>{e.deviceId?this.sendActionToInstance("dm:deviceAction",{actionId:e.id,deviceId:e.deviceId,timeout:e.timeout},e.refresh):this.sendActionToInstance("dm:instanceAction",{actionId:e.id,timeout:e.timeout})})},autoFocus:!0,startIcon:s.jsx(c.Check,{}),children:p("yesButtonText")}),s.jsx(a.Button,{variant:"contained",color:"grey",onClick:()=>this.setState({showConfirmation:null}),startIcon:s.jsx(c.Close,{}),children:p("cancelButtonText")})]})]}):null}onShowInputOk(){if(!this.state.showInput)return;const e=this.state.showInput;this.setState({showInput:null},()=>{var t,o,r,i;e.deviceId?this.sendActionToInstance("dm:deviceAction",{actionId:e.id,deviceId:e.deviceId,timeout:e.timeout,value:((t=e.inputBefore)==null?void 0:t.type)==="checkbox"?!!this.state.inputValue:((o=e.inputBefore)==null?void 0:o.type)==="number"?parseFloat(this.state.inputValue)||0:this.state.inputValue},e.refresh):this.sendActionToInstance("dm:instanceAction",{actionId:e.id,timeout:e.timeout,value:((r=e.inputBefore)==null?void 0:r.type)==="checkbox"?!!this.state.inputValue:((i=e.inputBefore)==null?void 0:i.type)==="number"?parseFloat(this.state.inputValue)||0:this.state.inputValue})})}renderInputDialog(){var t;if(!this.state.showInput||!this.state.showInput.inputBefore)return null;let e=!1;return!this.state.showInput.inputBefore.allowEmptyValue&&this.state.showInput.inputBefore.type!=="checkbox"&&(this.state.showInput.inputBefore.type==="number"||this.state.showInput.inputBefore.type==="slider"?e=this.state.inputValue===""||this.state.inputValue===null||!window.isFinite(this.state.inputValue):e=!this.state.inputValue),s.jsxs(a.Dialog,{open:!0,onClose:()=>this.setState({showInput:null}),children:[s.jsx(a.DialogTitle,{children:p("pleaseEnterValueText")}),s.jsxs(a.DialogContent,{children:[this.state.showInput.inputBefore.type==="text"||this.state.showInput.inputBefore.type==="number"||!this.state.showInput.inputBefore.type?s.jsx(a.TextField,{autoFocus:!0,margin:"dense",label:p(this.state.showInput.inputBefore.label),slotProps:{htmlInput:this.state.showInput.inputBefore.type==="number"?{min:this.state.showInput.inputBefore.min,max:this.state.showInput.inputBefore.max,step:this.state.showInput.inputBefore.step}:void 0,input:{endAdornment:this.state.inputValue?s.jsx(a.InputAdornment,{position:"end",children:s.jsx(a.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setState({inputValue:""}),children:s.jsx(c.Close,{})})}):null}},type:this.state.showInput.inputBefore.type==="number"?"number":"text",fullWidth:!0,value:this.state.inputValue,onChange:o=>this.setState({inputValue:o.target.value}),onKeyUp:o=>{o.key==="Enter"&&this.onShowInputOk()}}):null,this.state.showInput.inputBefore.type==="checkbox"?s.jsx(a.FormControlLabel,{control:s.jsx(a.Checkbox,{checked:!!this.state.inputValue,autoFocus:!0,onChange:o=>this.setState({inputValue:o.target.checked})}),label:p(this.state.showInput.inputBefore.label)}):null,this.state.showInput.inputBefore.type==="select"?s.jsxs(a.FormControl,{fullWidth:!0,children:[s.jsx(a.InputLabel,{children:p(this.state.showInput.inputBefore.label)}),s.jsx(a.Select,{variant:"standard",value:this.state.inputValue,onChange:o=>this.setState({inputValue:o.target.value}),children:(t=this.state.showInput.inputBefore.options)==null?void 0:t.map(o=>s.jsx(a.MenuItem,{value:o.value,children:p(o.label)},o.value))})]}):null,this.state.showInput.inputBefore.type==="slider"?s.jsxs(a.Box,{sx:{width:"100%"},children:[s.jsx(a.Typography,{gutterBottom:!0,children:p(this.state.showInput.inputBefore.label)}),s.jsxs(a.Grid2,{container:!0,spacing:2,alignItems:"center",children:[s.jsx(a.Grid2,{children:s.jsx(a.Slider,{value:typeof this.state.inputValue=="number"?this.state.inputValue:0,onChange:(o,r)=>this.setState({inputValue:r})})}),s.jsx(a.Grid2,{children:s.jsx(a.Input,{value:this.state.inputValue,size:"small",onChange:o=>this.setState({inputValue:o.target.value===""?0:Number(o.target.value)}),onBlur:()=>{var i,l;if(!this.state.showInput)return;const o=((i=this.state.showInput.inputBefore)==null?void 0:i.min)===void 0?0:this.state.showInput.inputBefore.min,r=((l=this.state.showInput.inputBefore)==null?void 0:l.max)===void 0?100:this.state.showInput.inputBefore.max;this.state.inputValue<o?this.setState({inputValue:o}):this.state.inputValue>r&&this.setState({inputValue:r})},inputProps:{step:this.state.showInput.inputBefore.step,min:this.state.showInput.inputBefore.min===void 0?0:this.state.showInput.inputBefore.min,max:this.state.showInput.inputBefore.max===void 0?100:this.state.showInput.inputBefore.max,type:"number"}})})]})]}):null]}),s.jsxs(a.DialogActions,{children:[s.jsx(a.Button,{variant:"contained",disabled:e,color:"primary",onClick:()=>this.onShowInputOk(),startIcon:s.jsx(c.Check,{}),children:p("yesButtonText")}),s.jsx(a.Button,{variant:"contained",color:"grey",onClick:()=>this.setState({showInput:null}),startIcon:s.jsx(c.Close,{}),children:p("cancelButtonText")})]})]})}render(){return s.jsxs(s.Fragment,{children:[this.renderSnackbar(),this.renderContent(),this.renderConfirmDialog(),this.renderMessageDialog(),this.renderFormDialog(),this.renderProgressDialog(),this.renderConfirmationDialog(),this.renderInputDialog(),this.renderSpinner()]})}}function Ee(n){const{action:e,instanceHandler:t}=n,o=p(e!=null&&e.description?e.description:""),r=p(e!=null&&e.title?e.title:""),i=fe(e);return s.jsx(pe,{tooltip:o,label:r,disabled:e.disabled,Icon:i,onClick:t(e)})}const ke="Alle Geräte herausgefiltert",Ne="Batterie",Oe="Abbrechen",Ae="Schließen",Le="Verbunden",Fe="Kopiert",Ve="In die Zwischenablage kopieren",Pe="Gerät deaktivieren",He="Getrennt",ze="Gerät aktivieren",We="Nach Name filtern",Me="Instanz",Re="Instanz ist nicht aktiv",Ue="Hersteller",Ke="Modell",Ge="Klicken, um weitere Informationen zu erhalten",Ze="Nein",Je="Keine Geräte gefunden",qe="Bitte Instanz auswählen",Qe="nichts zu kopieren",Ye="OK",Xe="Bitte eingeben",et="Instanzliste aktualisieren",tt="Aktualisieren",st="in die Zwischenablage kopiert",ot="Ja",nt={allDevicesFilteredOut:ke,batteryTooltip:Ne,cancelButtonText:Oe,closeButtonText:Ae,connectedIconTooltip:Le,copied:Fe,ctcButtonText:Ve,disableIconTooltip:Pe,disconnectedIconTooltip:He,enableIconTooltip:ze,filterLabelText:We,instanceLabelText:Me,instanceNotAlive:Re,manufacturer:Ue,model:Ke,moreInformation:Ge,noButtonText:Ze,noDevicesFoundText:Je,noInstanceSelectedText:qe,nothingToCopy:Qe,okButtonText:Ye,pleaseEnterValueText:Xe,refreshInstanceList:et,refreshTooltip:tt,toClipboard:st,yesButtonText:ot},it="All devices filtered out",rt="Battery",at="Cancel",lt="Close",ct="Connected",dt="Copied",pt="Copy to clipboard",ht="Disable device",ut="Disconnected",ft="Enable device",mt="Filter by name",gt="Instance",xt="Instance is not alive",vt="Manufacturer",Tt="Model",yt="Click to get more information",It="No",Ct="No devices found",$t="Please select instance",wt="nothingToCopy",jt="OK",St="Please enter",Dt="Refresh instance list",bt="Refresh",_t="to clipboard",Bt="Yes",Et={allDevicesFilteredOut:it,batteryTooltip:rt,cancelButtonText:at,closeButtonText:lt,connectedIconTooltip:ct,copied:dt,ctcButtonText:pt,disableIconTooltip:ht,disconnectedIconTooltip:ut,enableIconTooltip:ft,filterLabelText:mt,instanceLabelText:gt,instanceNotAlive:xt,manufacturer:vt,model:Tt,moreInformation:yt,noButtonText:It,noDevicesFoundText:Ct,noInstanceSelectedText:$t,nothingToCopy:wt,okButtonText:jt,pleaseEnterValueText:St,refreshInstanceList:Dt,refreshTooltip:bt,toClipboard:_t,yesButtonText:Bt},kt="Все устройства отфильтрованы",Nt="Батарея",Ot="Отмена",At="Закрыть",Lt="Подключено",Ft="Скопировано",Vt="Копировать в буфер обмена",Pt="Деактивировать устройство",Ht="Отключено",zt="Активировать устройство",Wt="Фильтровать по имени",Mt="Екземпляр",Rt="Экземпляр не жив",Ut="Производитель",Kt="Модель",Gt="Нажмите, чтобы получить больше информации",Zt="Нет",Jt="Устройства не найдены",qt="Пожалуйста, выберите экземпляр",Qt="ничегоКопировать",Yt="ХОРОШО",Xt="Пожалуйста входите",es="Обновить список экземпляров",ts="Обновить",ss="в буфер обмена",os="Да",ns={allDevicesFilteredOut:kt,batteryTooltip:Nt,cancelButtonText:Ot,closeButtonText:At,connectedIconTooltip:Lt,copied:Ft,ctcButtonText:Vt,disableIconTooltip:Pt,disconnectedIconTooltip:Ht,enableIconTooltip:zt,filterLabelText:Wt,instanceLabelText:Mt,instanceNotAlive:Rt,manufacturer:Ut,model:Kt,moreInformation:Gt,noButtonText:Zt,noDevicesFoundText:Jt,noInstanceSelectedText:qt,nothingToCopy:Qt,okButtonText:Yt,pleaseEnterValueText:Xt,refreshInstanceList:es,refreshTooltip:ts,toClipboard:ss,yesButtonText:os},is="Todos os dispositivos foram filtrados",rs="Bateria",as="Cancelar",ls="Fechar",cs="Conectado",ds="Copiado",ps="Copiar para área de transferência",hs="Desativar dispositivo",us="Desconectado",fs="Habilitar dispositivo",ms="Filtrar por nome",gs="Instância",xs="A instância não está ativa",vs="Fabricante",Ts="Modelo",ys="Clique para obter mais informações",Is="Não",Cs="Nenhum dispositivo encontrado",$s="Selecione a instância",ws="nadaParaCopiar",js="OK",Ss="Por favor, insira",Ds="Atualizar lista de instâncias",bs="Atualizar",_s="para a área de transferência",Bs="Sim",Es={allDevicesFilteredOut:is,batteryTooltip:rs,cancelButtonText:as,closeButtonText:ls,connectedIconTooltip:cs,copied:ds,ctcButtonText:ps,disableIconTooltip:hs,disconnectedIconTooltip:us,enableIconTooltip:fs,filterLabelText:ms,instanceLabelText:gs,instanceNotAlive:xs,manufacturer:vs,model:Ts,moreInformation:ys,noButtonText:Is,noDevicesFoundText:Cs,noInstanceSelectedText:$s,nothingToCopy:ws,okButtonText:js,pleaseEnterValueText:Ss,refreshInstanceList:Ds,refreshTooltip:bs,toClipboard:_s,yesButtonText:Bs},ks="Alle apparaten zijn eruit gefilterd",Ns="Batterij",Os="Annuleren",As="Dichtbij",Ls="Verbonden",Fs="Gekopieerd",Vs="Kopiëren naar klembord",Ps="Apparaat uitschakelen",Hs="Losgekoppeld",zs="Apparaat inschakelen",Ws="Filter op naam",Ms="Voorbeeld",Rs="Instantie leeft niet",Us="Fabrikant",Ks="Model",Gs="Klik voor meer informatie",Zs="Nee",Js="Geen apparaten gevonden",qs="Selecteer een exemplaar",Qs="nietsOmTeKopiëren",Ys="OK",Xs="Kom binnen alstublieft",eo="Ververs de exemplaarlijst",to="Vernieuwen",so="naar klembord",oo="Ja",no={allDevicesFilteredOut:ks,batteryTooltip:Ns,cancelButtonText:Os,closeButtonText:As,connectedIconTooltip:Ls,copied:Fs,ctcButtonText:Vs,disableIconTooltip:Ps,disconnectedIconTooltip:Hs,enableIconTooltip:zs,filterLabelText:Ws,instanceLabelText:Ms,instanceNotAlive:Rs,manufacturer:Us,model:Ks,moreInformation:Gs,noButtonText:Zs,noDevicesFoundText:Js,noInstanceSelectedText:qs,nothingToCopy:Qs,okButtonText:Ys,pleaseEnterValueText:Xs,refreshInstanceList:eo,refreshTooltip:to,toClipboard:so,yesButtonText:oo},io="Tous les appareils filtrés",ro="Batterie",ao="Annuler",lo="Fermer",co="Connecté",po="Copié",ho="Copier dans le presse-papier",uo="Désactiver l'appareil",fo="Débranché",mo="Activer l'appareil",go="Filtrer par nom",xo="Exemple",vo="L'instance n'est pas vivante",To="Fabricant",yo="Modèle",Io="Cliquez pour obtenir plus d'informations",Co="Non",$o="Aucun périphérique trouvé",wo="Veuillez sélectionner une instance",jo="rien à copier",So="D'ACCORD",Do="Entrez s'il vous plait",bo="Actualiser la liste des instances",_o="Rafraîchir",Bo="au presse-papiers",Eo="Oui",ko={allDevicesFilteredOut:io,batteryTooltip:ro,cancelButtonText:ao,closeButtonText:lo,connectedIconTooltip:co,copied:po,ctcButtonText:ho,disableIconTooltip:uo,disconnectedIconTooltip:fo,enableIconTooltip:mo,filterLabelText:go,instanceLabelText:xo,instanceNotAlive:vo,manufacturer:To,model:yo,moreInformation:Io,noButtonText:Co,noDevicesFoundText:$o,noInstanceSelectedText:wo,nothingToCopy:jo,okButtonText:So,pleaseEnterValueText:Do,refreshInstanceList:bo,refreshTooltip:_o,toClipboard:Bo,yesButtonText:Eo},No="Tutti i dispositivi sono stati filtrati",Oo="Batteria",Ao="Annulla",Lo="Vicino",Fo="Connesso",Vo="Copiato",Po="Copia negli appunti",Ho="Disabilita dispositivo",zo="Disconnesso",Wo="Abilita dispositivo",Mo="Filtra per nome",Ro="Esempio",Uo="L'istanza non è viva",Ko="Produttore",Go="Modello",Zo="Clicca per avere maggiori informazioni",Jo="NO",qo="Nessun dispositivo trovato",Qo="Seleziona l'istanza",Yo="Niente da copiare",Xo="OK",en="Prego entra",tn="Aggiorna l'elenco delle istanze",sn="ricaricare",on="negli appunti",nn="SÌ",rn={allDevicesFilteredOut:No,batteryTooltip:Oo,cancelButtonText:Ao,closeButtonText:Lo,connectedIconTooltip:Fo,copied:Vo,ctcButtonText:Po,disableIconTooltip:Ho,disconnectedIconTooltip:zo,enableIconTooltip:Wo,filterLabelText:Mo,instanceLabelText:Ro,instanceNotAlive:Uo,manufacturer:Ko,model:Go,moreInformation:Zo,noButtonText:Jo,noDevicesFoundText:qo,noInstanceSelectedText:Qo,nothingToCopy:Yo,okButtonText:Xo,pleaseEnterValueText:en,refreshInstanceList:tn,refreshTooltip:sn,toClipboard:on,yesButtonText:nn},an="Todos los dispositivos filtrados",ln="Batería",cn="Cancelar",dn="Cerca",pn="Conectado",hn="copiado",un="Copiar al portapapeles",fn="Deshabilitar dispositivo",mn="Desconectado",gn="Habilitar dispositivo",xn="Filtrar por nombre",vn="Instancia",Tn="La instancia no está viva.",yn="Fabricante",In="Modelo",Cn="Haga clic para obtener más información",$n="No",wn="No se encontraron dispositivos",jn="Por favor seleccione instancia",Sn="nada que copiar",Dn="DE ACUERDO",bn="Por favor escribe",_n="Actualizar lista de instancias",Bn="Actualizar",En="al portapapeles",kn="Sí",Nn={allDevicesFilteredOut:an,batteryTooltip:ln,cancelButtonText:cn,closeButtonText:dn,connectedIconTooltip:pn,copied:hn,ctcButtonText:un,disableIconTooltip:fn,disconnectedIconTooltip:mn,enableIconTooltip:gn,filterLabelText:xn,instanceLabelText:vn,instanceNotAlive:Tn,manufacturer:yn,model:In,moreInformation:Cn,noButtonText:$n,noDevicesFoundText:wn,noInstanceSelectedText:jn,nothingToCopy:Sn,okButtonText:Dn,pleaseEnterValueText:bn,refreshInstanceList:_n,refreshTooltip:Bn,toClipboard:En,yesButtonText:kn},On="Wszystkie urządzenia zostały odfiltrowane",An="Bateria",Ln="Anulować",Fn="Zamknąć",Vn="Połączono",Pn="Skopiowano",Hn="Kopiuj do schowka",zn="Wyłącz urządzenie",Wn="Bezładny",Mn="Włącz urządzenie",Rn="Filtruj według nazwy",Un="Instancja",Kn="Instancja nie żyje",Gn="Producent",Zn="Model",Jn="Kliknij, aby uzyskać więcej informacji",qn="NIE",Qn="Nie znaleziono urządzeń",Yn="Wybierz instancję",Xn="nicDoSkopiowania",ei="OK",ti="Podaj",si="Odśwież listę instancji",oi="Odświeżać",ni="do schowka",ii="Tak",ri={allDevicesFilteredOut:On,batteryTooltip:An,cancelButtonText:Ln,closeButtonText:Fn,connectedIconTooltip:Vn,copied:Pn,ctcButtonText:Hn,disableIconTooltip:zn,disconnectedIconTooltip:Wn,enableIconTooltip:Mn,filterLabelText:Rn,instanceLabelText:Un,instanceNotAlive:Kn,manufacturer:Gn,model:Zn,moreInformation:Jn,noButtonText:qn,noDevicesFoundText:Qn,noInstanceSelectedText:Yn,nothingToCopy:Xn,okButtonText:ei,pleaseEnterValueText:ti,refreshInstanceList:si,refreshTooltip:oi,toClipboard:ni,yesButtonText:ii},ai="Усі пристрої відфільтровано",li="Батарея",ci="Скасувати",di="Закрити",pi="Підключено",hi="Скопійовано",ui="Копіювати в буфер обміну",fi="Вимкнути пристрій",mi="Відключено",gi="Увімкнути пристрій",xi="Фільтрувати за назвою",vi="Екземпляр",Ti="Примірник не живий",yi="Виробник",Ii="Модель",Ci="Натисніть, щоб отримати більше інформації",$i="Немає",wi="Пристроїв не знайдено",ji="Виберіть екземпляр",Si="нічого для копіювання",Di="в порядку",bi="Будь ласка введіть",_i="Оновити список екземплярів",Bi="Оновити",Ei="в буфер обміну",ki="Так",Ni={allDevicesFilteredOut:ai,batteryTooltip:li,cancelButtonText:ci,closeButtonText:di,connectedIconTooltip:pi,copied:hi,ctcButtonText:ui,disableIconTooltip:fi,disconnectedIconTooltip:mi,enableIconTooltip:gi,filterLabelText:xi,instanceLabelText:vi,instanceNotAlive:Ti,manufacturer:yi,model:Ii,moreInformation:Ci,noButtonText:$i,noDevicesFoundText:wi,noInstanceSelectedText:ji,nothingToCopy:Si,okButtonText:Di,pleaseEnterValueText:bi,refreshInstanceList:_i,refreshTooltip:Bi,toClipboard:Ei,yesButtonText:ki},Oi="所有设备均被过滤掉",Ai="电池",Li="取消",Fi="关闭",Vi="已连接",Pi="已复制",Hi="复制到剪贴板",zi="禁用设备",Wi="已断开连接",Mi="启用设备",Ri="按名称过滤",Ui="实例",Ki="实例不存在",Gi="制造商",Zi="型号",Ji="点击获取更多信息",qi="不",Qi="未找到设备",Yi="请选择实例",Xi="无可复制",er="好的",tr="请输入",sr="刷新实例列表",or="刷新",nr="到剪贴板",ir="是的",rr={allDevicesFilteredOut:Oi,batteryTooltip:Ai,cancelButtonText:Li,closeButtonText:Fi,connectedIconTooltip:Vi,copied:Pi,ctcButtonText:Hi,disableIconTooltip:zi,disconnectedIconTooltip:Wi,enableIconTooltip:Mi,filterLabelText:Ri,instanceLabelText:Ui,instanceNotAlive:Ki,manufacturer:Gi,model:Zi,moreInformation:Ji,noButtonText:qi,noDevicesFoundText:Qi,noInstanceSelectedText:Yi,nothingToCopy:Xi,okButtonText:er,pleaseEnterValueText:tr,refreshInstanceList:sr,refreshTooltip:or,toClipboard:nr,yesButtonText:ir};class W extends Be{static i18nInitialized=!1;lastPropsFilter;lastInstance;lastTriggerLoad=0;filterTimeout;language;constructor(e){super(e),W.i18nInitialized||(W.i18nInitialized=!0,v.extendTranslations({en:Et,de:nt,ru:ns,pt:Es,nl:no,fr:ko,it:rn,es:Nn,pl:ri,uk:Ni,"zh-cn":rr})),Object.assign(this.state,{devices:[],filteredDevices:[],filter:"",instanceInfo:null,loading:null,alive:null,groupKey:""}),this.lastPropsFilter=this.props.filter,this.lastInstance=this.props.selectedInstance,this.lastTriggerLoad=this.props.triggerLoad||0,this.filterTimeout=null,this.language=v.getLanguage()}async componentDidMount(){let e=!1;if(this.state.alive===null){try{const t=await this.props.socket.getState(`system.adapter.${this.props.selectedInstance}.alive`);t!=null&&t.val&&(e=!0)}catch(t){console.error(t)}if(this.setState({alive:e},()=>this.props.socket.subscribeState(`system.adapter.${this.props.selectedInstance}.alive`,this.aliveHandler)),!e)return}else e=this.state.alive;if(!this.props.embedded&&e)try{const t=await this.loadInstanceInfos();this.setState({instanceInfo:t})}catch(t){console.error(t)}e&&this.loadData()}componentWillUnmount(){this.props.socket.unsubscribeState(`system.adapter.${this.props.selectedInstance}.alive`,this.aliveHandler)}aliveHandler=(e,t)=>{if(e===`system.adapter.${this.props.selectedInstance}.alive`){const o=!!(t!=null&&t.val);o!==this.state.alive&&this.setState({alive:o},()=>{o&&this.componentDidMount().catch(console.error)})}};loadData(){this.setState({loading:!0},async()=>{console.log(`Loading devices for ${this.props.selectedInstance}...`);let e=[];try{e=await this.loadDevices(),(!e||!Array.isArray(e))&&(console.error(`Message returned from sendTo() doesn't look like one from DeviceManagement, did you accidentally handle the message in your adapter? ${JSON.stringify(e)}`),e=[])}catch(t){console.error(t),e=[]}this.setState({devices:e,loading:!1},()=>this.applyFilter())})}getText(e){return typeof e=="object"?e[this.language]||e.en:e}applyFilter(){const e=this.props.embedded?this.props.filter:this.state.filter;if(e){const t=this.state.devices.filter(o=>this.getText(o.name).toLowerCase().includes(e.toLowerCase()));this.setState({filteredDevices:t})}else this.setState({filteredDevices:this.state.devices})}handleFilterChange(e){this.setState({filter:e},()=>{this.filterTimeout&&clearTimeout(this.filterTimeout),this.filterTimeout=setTimeout(()=>{this.filterTimeout=null,this.applyFilter()},250)})}renderGroups(e){return e!=null&&e.length?s.jsx(a.Select,{style:{minWidth:120,marginRight:8,marginTop:12.5},variant:"standard",value:this.state.groupKey||"_",renderValue:t=>{t==="_"&&(t="");const o=e.find(r=>r.value===t);return s.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(o==null?void 0:o.icon)||s.jsx("div",{style:{width:24}}),(o==null?void 0:o.name)||t]})},onChange:t=>this.setState({groupKey:t.target.value==="_"?"":t.target.value}),children:e.map(t=>s.jsxs(a.MenuItem,{value:t.value||"_",style:{display:"flex",alignItems:"center",gap:8},children:[t.icon||s.jsx("div",{style:{width:24}}),t.name]},t.value||"_"))}):null}renderContent(){var r,i;const e={padding:25};(this.props.triggerLoad||0)!==this.lastTriggerLoad&&(this.lastTriggerLoad=this.props.triggerLoad||0,setTimeout(()=>this.loadData(),50)),this.props.embedded&&this.lastPropsFilter!==this.props.filter&&(this.lastPropsFilter=this.props.filter,setTimeout(()=>this.applyFilter(),50)),this.props.embedded&&this.lastInstance!==this.props.selectedInstance&&(this.lastInstance=this.props.selectedInstance,setTimeout(()=>this.loadData(),50));const t=[];let o;if(!this.props.embedded&&!this.state.alive)o=[s.jsx("div",{style:e,children:s.jsx("span",{children:p("instanceNotAlive")})},"notAlive")];else if(!this.state.devices.length&&this.props.selectedInstance)o=[s.jsx("div",{style:e,children:s.jsx("span",{children:p("noDevicesFoundText")})},"notFound")];else if(this.state.devices.length&&!this.state.filteredDevices.length)o=[s.jsx("div",{style:e,children:s.jsx("span",{children:p("allDevicesFilteredOut")})},"filtered")];else{let l=this.state.filteredDevices;if(!this.props.embedded&&l.find(d=>d.group)){t.push({name:v.t("All"),value:"",count:l.length,icon:s.jsx(c.FilterAltOff,{})}),l.forEach(h=>{if(h.group){const u=t.find(m=>{var T;return m.value===((T=h.group)==null?void 0:T.key)});if(u)u.count++;else{const m=h.group.icon?s.jsx(Q,{src:h.group.icon}):null;t.push({name:this.getText(h.group.name||h.group.key),value:h.group.key,count:1,icon:m})}}});const d=l.filter(h=>!h.group);d.length&&t.push({name:v.t("Unknown"),value:"?",count:d.length,icon:s.jsx(c.QuestionMark,{})}),this.state.groupKey&&(this.state.groupKey==="?"?l=l.filter(h=>{var u;return!((u=h.group)!=null&&u.key)}):l=l.filter(h=>{var u;return((u=h.group)==null?void 0:u.key)===this.state.groupKey}),l.length||(o=[s.jsx("div",{style:e,children:s.jsx("span",{children:p("allDevicesFilteredOut")})},"filtered")]))}l.length&&(o=l.map(d=>s.jsx(_e,{alive:!!this.state.alive,id:d.id,title:this.getText(d.name),device:d,instanceId:this.props.selectedInstance,uploadImagesToInstance:this.props.uploadImagesToInstance,deviceHandler:this.deviceHandler,controlHandler:this.controlHandler,controlStateHandler:this.controlStateHandler,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,theme:this.props.theme,isFloatComma:this.props.isFloatComma,dateFormat:this.props.dateFormat},d.id)))}return this.props.embedded?s.jsxs(s.Fragment,{children:[this.state.loading?s.jsx(a.LinearProgress,{style:{width:"100%"}}):null,o]}):s.jsxs("div",{style:{width:"100%",height:"100%",overflow:"hidden"},children:[s.jsxs(a.Toolbar,{variant:"dense",style:{backgroundColor:"#777",display:"flex"},children:[this.props.title,this.props.selectedInstance?s.jsx(a.Tooltip,{title:p("refreshTooltip"),slotProps:{popper:{sx:{pointerEvents:"none"}}},children:s.jsx("span",{children:s.jsx(a.IconButton,{onClick:()=>this.loadData(),disabled:!this.state.alive,size:"small",children:s.jsx(c.Refresh,{})})})}):null,this.state.alive&&((i=(r=this.state.instanceInfo)==null?void 0:r.actions)!=null&&i.length)?s.jsx("div",{style:{marginLeft:20},children:this.state.instanceInfo.actions.map(l=>s.jsx(Ee,{action:l,instanceHandler:this.instanceHandler},l.id))}):null,s.jsx("div",{style:{flexGrow:1}}),this.renderGroups(t),this.state.alive?s.jsx(a.TextField,{variant:"standard",style:{width:200},size:"small",label:p("filterLabelText"),onChange:l=>this.handleFilterChange(l.target.value),value:this.state.filter,autoComplete:"off",slotProps:{input:{autoComplete:"new-password",endAdornment:this.state.filter?s.jsx(a.InputAdornment,{position:"end",children:s.jsx(a.IconButton,{tabIndex:-1,onClick:()=>this.handleFilterChange(""),edge:"end",children:s.jsx(c.Clear,{})})}):null},htmlInput:{autoComplete:"off"}}}):null]}),s.jsxs("div",{style:{width:"100%",height:"calc(100% - 56px)",marginTop:8,overflow:"auto",...this.props.style},children:[this.state.loading?s.jsx(a.LinearProgress,{style:{width:"100%"}}):null,o]})]})}}const ar=["silly","debug","info","warn","error"],f={root:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},scroll:{height:"100%",overflowY:"auto"},instanceIcon:{width:42,height:42,marginRight:16,verticalAlign:"middle"},button:{width:36,height:36},version:{fontSize:12,opacity:.8,marginLeft:20,marginRight:10},versionAliveConnected:n=>({color:n.palette.mode==="dark"?"#23a623":"#60ff60"}),versionAliveNotConnected:{color:"#a67223"},buttonControl:{padding:"5px",transition:"opacity 0.2s",height:34},enabled:{color:K[400],"&:hover":{backgroundColor:K[200]}},disabled:{color:U[400],"&:hover":{backgroundColor:U[200]}},hide:{visibility:"hidden"},formControl:{width:"100%",marginBottom:5},logLevel:{fontSize:12,marginLeft:10},green:{color:K[700]},red:{color:U[700]},grey:{color:Te[700]},blue:{color:"#0055a9"},orange:{color:te[400]},orangeDevice:{color:te[300]},tooltip:{pointerEvents:"none"}};class fr extends L.Component{refIframe;registered;constructor(e){super(e),this.state={checkedExist:!1,showStopAdminDialog:!1,running:!1,canStart:!1,alive:!1,connected:!1,connectedToHost:!1,logOnTheFlyValue:!1,logLevel:"info",logLevelValue:"info",tempLogLevel:"info",showLogLevelDialog:!1,showMore:null},this.refIframe=null,this.registered=!1}componentDidUpdate(){var e;!this.registered&&((e=this.refIframe)!=null&&e.contentWindow)&&(this.registered=!0,this.props.onRegisterIframeRef(this.refIframe))}componentDidMount(){var e;if(this.props.tab)this.props.socket.fileExists(`${this.props.adapter}.admin`,"tab.html").then(t=>{if(t)this.setState({checkedExist:"tab.html"});else return this.props.socket.fileExists(`${this.props.adapter}.admin`,"tab_m.html").then(o=>o?this.setState({checkedExist:"tab_m.html"}):window.alert("Cannot find tab(_m).html"))});else{const t=`system.adapter.${this.props.adapter}.${this.props.instance}`;this.props.socket.subscribeObject(t,this.onObjectChange),this.props.socket.getObject(t).then(async o=>{var u,m,T,y,D,w,k;const r=await this.props.socket.getState(`${t}.logLevel`);await this.props.socket.subscribeState(`${t}.logLevel`,this.onStateChange);const i=await this.props.socket.getState(`${t}.alive`);await this.props.socket.subscribeState(`${t}.alive`,this.onStateChange);const l=await this.props.socket.getState(`${t}.connected`);await this.props.socket.subscribeState(`${t}.connected`,this.onStateChange);let d;try{d=await this.props.socket.getState(`${this.props.adapter}.${this.props.instance}.info.connection`),this.props.socket.subscribeState(`${this.props.adapter}.${this.props.instance}.info.connection`,this.onStateChange)}catch{d=null}let h;try{h=await this.props.socket.getState(`${this.props.adapter}.${this.props.instance}.info.extension`),this.props.socket.subscribeState(`${this.props.adapter}.${this.props.instance}.info.extension`,this.onStateChange)}catch{h=null}this.setState({checkedExist:!0,running:((u=o==null?void 0:o.common)==null?void 0:u.onlyWWW)||((m=o==null?void 0:o.common)==null?void 0:m.enabled),canStart:!((T=o==null?void 0:o.common)!=null&&T.onlyWWW),alive:!!(i!=null&&i.val),extension:h?!!(h!=null&&h.val):null,connectedToHost:!!(l!=null&&l.val),connected:d?!!d.val:null,logLevel:((y=o==null?void 0:o.common)==null?void 0:y.loglevel)||"info",logLevelValue:((D=o==null?void 0:o.common)==null?void 0:D.loglevel)||"info",tempLogLevel:(r==null?void 0:r.val)||((w=o==null?void 0:o.common)==null?void 0:w.loglevel)||"info",common:(o==null?void 0:o.common)||{},native:(o==null?void 0:o.native)||{},adapterDocLangs:(k=o==null?void 0:o.common)!=null&&k.docs?Object.keys(o.common.docs):["en"]})}).catch(o=>{console.error(o),this.setState({checkedExist:!0,running:!1})})}!this.registered&&((e=this.refIframe)!=null&&e.contentWindow)&&(this.registered=!0,this.props.onRegisterIframeRef(this.refIframe)),(window.addEventListener||window.attachEvent)(window.addEventListener?"message":"onmessage",this.closeConfig,!1)}onObjectChange=(e,t)=>{var o,r,i,l;e===`system.adapter.${this.props.adapter}.${this.props.instance}`&&this.setState({running:((o=t==null?void 0:t.common)==null?void 0:o.onlyWWW)||((r=t==null?void 0:t.common)==null?void 0:r.enabled),canStart:!((i=t==null?void 0:t.common)!=null&&i.onlyWWW),logLevel:((l=t==null?void 0:t.common)==null?void 0:l.loglevel)||"info"})};getInstanceStatus(){var o,r,i,l;const e=((o=this.state.common)==null?void 0:o.mode)||"";let t=e==="daemon"?"green":"blue";if((r=this.state.common)!=null&&r.enabled&&(!this.state.common.webExtension||!((i=this.state.native)!=null&&i.webInstance)||e==="daemon")){if(this.state.common.webExtension&&((l=this.state.native)!=null&&l.webInstance)&&this.state.extension!==null)return this.state.extension?"green":"red";(!this.state.connectedToHost||!this.state.alive)&&(t=e==="daemon"?"red":"orangeDevice"),this.state.connected!==null&&!this.state.connected&&t!=="red"&&(t="orange")}else t=e==="daemon"?"grey":"blue";return t}onStateChange=(e,t)=>{const o=`system.adapter.${this.props.adapter}.${this.props.instance}`;e===`${o}.alive`?this.setState({alive:!!(t!=null&&t.val)}):e===`${o}.connected`?this.setState({connectedToHost:!!(t!=null&&t.val)}):e===`${this.props.adapter}.${this.props.instance}.info.connection`?this.setState({connected:t?!!t.val:null}):e===`${this.props.adapter}.${this.props.instance}.info.extension`?this.setState({extension:t?!!t.val:null}):e===`${o}.logLevel`&&this.setState({tempLogLevel:t?t.val:null})};componentWillUnmount(){this.props.socket.unsubscribeObject(`system.adapter.${this.props.adapter}.${this.props.instance}`,this.onObjectChange),(window.removeEventListener||window.detachEvent)(window.removeEventListener?"message":"onmessage",this.closeConfig,!1),this.registered&&this.refIframe&&this.props.onUnregisterIframeRef(this.refIframe),this.refIframe=null}closeConfig=e=>{if(e.origin===window.location.origin){if(e.data==="close"||e.message==="close")this.props.easyMode?this.props.handleNavigation("easy"):this.props.handleNavigation("tab-instances");else if(e.data==="change"||e.message==="change")this.props.configStored(!1);else if(e.data==="nochange"||e.message==="nochange")this.props.configStored(!0);else if(typeof e.data=="string"&&e.data.startsWith("goto:")||typeof e.message=="string"&&e.message.startsWith("goto:")){const[,t]=(e.data||e.message).split(":"),[o,r,i]=t.split("/");this.props.handleNavigation(o,r,i)}}};renderHelpButton(){return this.props.jsonConfig?s.jsx(a.Tooltip,{title:this.props.t("Show help for this adapter"),slotProps:{popper:{sx:f.tooltip}},children:s.jsx(a.Fab,{sx:{"&.MuiFab-root":f.button},onClick:()=>{var t;const e=(t=this.state.adapterDocLangs)!=null&&t.includes(this.props.lang)?this.props.lang:"en";window.open(Ie.getDocsLinkForAdapter({lang:e,adapterName:this.props.adapter}),"help")},children:s.jsx(c.Help,{})})}):null}getConfigurator(){if(this.props.jsonConfig)return s.jsx(Ce,{expertMode:this.props.expertMode,theme:this.props.theme,width:this.props.width,adapterName:this.props.adapter,instance:this.props.instance,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,dateFormat:this.props.dateFormat,isFloatComma:this.props.isFloatComma,configStored:this.props.configStored,t:this.props.t,DeviceManager:W});const e=`adapter/${this.props.adapter}/${this.props.tab?this.state.checkedExist:this.props.materialize?"index_m.html":"index.html"}?${this.props.instance||0}&newReact=true&${this.props.instance||0}&react=${this.props.themeName}`;return this.state.checkedExist?s.jsx("iframe",{ref:t=>this&&(this.refIframe=t),title:"config",style:this.props.style,src:e}):null}returnStopAdminDialog(){return this.state.showStopAdminDialog?s.jsx($e,{title:this.props.t("Please confirm"),text:this.props.t("stop_admin",this.props.instance),ok:this.props.t("Stop admin"),onClose:e=>{e&&this.props.socket.extendObject(`system.adapter.${this.props.adapter}.${this.props.instance}`,{common:{enabled:!1}}).catch(t=>window.alert(t)),this.setState({showStopAdminDialog:!1})}}):null}renderLogLevelDialog(){return this.state.showLogLevelDialog?s.jsxs(a.Dialog,{open:!0,onClose:()=>this.setState({showLogLevelDialog:!1}),children:[s.jsx(a.DialogTitle,{children:this.props.t("Edit log level rule for %s",`${this.props.adapter}.${this.props.instance}`)}),s.jsxs(a.DialogContent,{children:[s.jsxs(a.FormControl,{style:{...f.formControl,marginTop:10},variant:"outlined",children:[s.jsx(a.InputLabel,{children:this.props.t("log level")}),s.jsx(a.Select,{variant:"standard",value:this.state.logLevelValue,fullWidth:!0,onChange:e=>this.setState({logLevelValue:e.target.value}),children:ar.map(e=>s.jsx(a.MenuItem,{value:e,children:this.props.t(e)},e))})]}),s.jsxs(a.FormControl,{style:f.formControl,variant:"outlined",children:[s.jsx(a.FormControlLabel,{control:s.jsx(a.Checkbox,{checked:this.state.logOnTheFlyValue,onChange:e=>this.setState({logOnTheFlyValue:e.target.checked})}),label:this.props.t("Without restart")}),s.jsx(a.FormHelperText,{children:this.state.logOnTheFlyValue?this.props.t("Will be reset to the saved log level after restart of adapter"):this.props.t("Log level will be saved permanently")})]})]}),s.jsxs(a.DialogActions,{children:[s.jsx(a.Button,{color:"primary",variant:"contained",onClick:()=>{this.state.logOnTheFlyValue?this.props.socket.setState(`system.adapter.${this.props.adapter}.${this.props.instance}.logLevel`,this.state.logLevelValue):this.props.socket.extendObject(`system.adapter.${this.props.adapter}.${this.props.instance}`,{common:{loglevel:this.state.logLevelValue}}).catch(e=>window.alert(`Cannot set log level: ${e}`)),this.setState({showLogLevelDialog:!1})},children:this.props.t("Ok")}),s.jsx(a.Button,{color:"grey",variant:"contained",onClick:()=>this.setState({showLogLevelDialog:!1}),children:this.props.t("Cancel")})]})]}):null}render(){const e=[this.props.version?s.jsxs("span",{style:{...f.version,...f[this.getInstanceStatus()]},children:["v",this.props.version]},"version"):null,s.jsx(a.Tooltip,{title:this.props.t("Start/stop"),slotProps:{popper:{sx:f.tooltip}},children:s.jsx("span",{children:s.jsx(a.IconButton,{size:"small",onClick:t=>{t.stopPropagation(),t.preventDefault(),this.state.running&&`${this.props.adapter}.${this.props.instance}`===this.props.adminInstance?this.setState({showStopAdminDialog:!0,showMore:null}):(this.setState({showMore:null}),this.props.socket.extendObject(`system.adapter.${this.props.adapter}.${this.props.instance}`,{common:{enabled:!this.state.running}}).catch(o=>window.alert(`Cannot set log level: ${o}`)))},onFocus:t=>t.stopPropagation(),sx:{...f.buttonControl,...this.state.canStart?this.state.running?f.enabled:f.disabled:f.hide},children:this.state.running?s.jsx(c.Pause,{}):s.jsx(c.PlayArrow,{})})})},"start"),s.jsx(a.Tooltip,{title:this.props.t("Restart"),slotProps:{popper:{sx:f.tooltip}},children:s.jsx("span",{children:s.jsx(a.IconButton,{size:"small",onClick:t=>{this.setState({showMore:null}),t.stopPropagation(),this.props.socket.extendObject(`system.adapter.${this.props.adapter}.${this.props.instance}`,{}).catch(o=>window.alert(`Cannot set log level: ${o}`))},onFocus:t=>t.stopPropagation(),style:{...f.buttonControl,...this.state.canStart?void 0:f.hide},disabled:!this.state.running,children:s.jsx(c.Refresh,{})})})},"restart"),this.state.tempLogLevel!==this.state.logLevel?s.jsx(a.Tooltip,{title:this.props.t("temporary log level"),slotProps:{popper:{sx:f.tooltip}},children:s.jsx("span",{style:f.logLevel,children:this.state.tempLogLevel})},"log"):null,s.jsx(a.Tooltip,{title:this.props.t("log level"),slotProps:{popper:{sx:f.tooltip}},children:s.jsx("span",{style:f.logLevel,children:this.state.tempLogLevel!==this.state.logLevel?`/ ${this.state.logLevel}`:this.state.logLevel})},"logLevel"),s.jsx(a.Tooltip,{title:this.props.t("Edit log level rule for %s",`${this.props.adapter}.${this.props.instance}`),children:s.jsx(a.IconButton,{size:"small",onClick:t=>{t.stopPropagation(),this.setState({showLogLevelDialog:!0,showMore:null})},onFocus:t=>t.stopPropagation(),style:{...f.buttonControl,...this.state.canStart?void 0:f.hide,width:34,height:34},children:s.jsx(c.Edit,{style:{width:20,height:20}})})},"editLog")];return s.jsxs(a.Paper,{style:f.root,children:[s.jsx(a.AppBar,{color:"default",position:"static",children:s.jsxs(a.Toolbar,{variant:"dense",style:{marginLeft:8,paddingRight:6},children:[s.jsxs(a.Typography,{variant:"h6",color:"inherit",style:{display:"flex",alignItems:"center"},children:[s.jsx(a.IconButton,{size:"small",onClick:()=>{this.props.easyMode?this.props.handleNavigation("easy"):this.props.handleNavigation("tab-instances")},onFocus:t=>t.stopPropagation(),style:{marginRight:10},children:s.jsx(c.ArrowBack,{})}),this.props.jsonConfig?s.jsx($,{src:this.props.icon,style:f.instanceIcon}):null,s.jsx(a.Box,{component:"span",sx:t=>({[t.breakpoints.down("md")]:{display:"none"},marginRight:"8px"}),children:`${this.props.t("Instance settings")}:`}),`${this.props.adapter}.${this.props.instance}`,s.jsx(a.Box,{component:"div",sx:t=>({[t.breakpoints.down("sm")]:{display:"none"}}),children:e}),s.jsxs(a.Box,{component:"span",sx:t=>({[t.breakpoints.up("sm")]:{display:"none"}}),children:[s.jsx(a.IconButton,{style:{marginLeft:8},onClick:t=>this.setState({showMore:t.currentTarget}),children:s.jsx(c.MoreVert,{})}),this.state.showMore?s.jsx(a.Menu,{open:!0,anchorEl:this.state.showMore,onClose:()=>this.setState({showMore:null}),children:e}):null]})]}),s.jsx("div",{style:{flexGrow:1}}),this.renderHelpButton()]})}),this.getConfigurator(),this.returnStopAdminDialog(),this.renderLogLevelDialog()]})}}export{fr as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./DefaultPropsProvider-BxjOYH1h.js";import{i as p}from"./iobroker_admin__loadShare__react__loadShare__-CuzHmAOj.js";import{i as t,U as E,I as l,a as s}from"./bootstrap-B3ZI_-0g.js";const o={modalDialog:{minWidth:400,maxWidth:800},overflowHidden:{display:"flex",overflow:"hidden"},titleIcon:{marginRight:5},content:{fontSize:16},languageButton:{position:"absolute",right:8,top:8},languageButtonActive:n=>({color:n.palette.primary.main})},H=({toggleTranslation:n,noTranslation:v,title:u,fullWidth:C,help:m,maxWidth:S,progress:_,icon:r,disableApplyIfNotChanged:b,applyButton:g,onClose:h,children:k,titleButtonApply:I,titleButtonClose:y,onApply:x,textInput:f,defaultValue:i,overflowHidden:B,disableApply:D,theme:w})=>{const[a,d]=p.useState(i);p.useEffect(()=>{d(i)},[i]);const A=t.useTheme(),c=t.useMediaQuery(A.breakpoints.down("md"));let j=null;r&&(j=r);const W=E.getStyle(w,o.languageButtonActive);return e.jsxs(t.Dialog,{open:!0,maxWidth:c?!1:S||"md",fullWidth:!!C,fullScreen:c,disableEscapeKeyDown:!1,onClose:h,sx:{"& .MuiPaper-root":c?{}:o.modalDialog},children:[u&&e.jsxs(t.DialogTitle,{children:[r?e.jsx(j,{style:o.titleIcon}):null,u,l.getLanguage()!=="en"&&n?e.jsx(t.IconButton,{size:"large",style:{...o.languageButton,...v?W:void 0},onClick:()=>n(),title:l.t("Disable/Enable translation"),children:e.jsx(s.Language,{})}):null]}),e.jsxs(t.DialogContent,{style:{...B?o.overflowHidden:void 0,...o.content,paddingTop:8},children:[f&&e.jsx(t.TextField,{autoComplete:"off",fullWidth:!0,autoFocus:!0,variant:"standard",size:"medium",multiline:!0,value:a,onChange:z=>d(z.target.value),slotProps:{input:{endAdornment:a?e.jsx(t.InputAdornment,{position:"end",children:e.jsx(t.IconButton,{tabIndex:-1,size:"small",onClick:()=>d(""),children:e.jsx(s.Close,{})})}):null}}}),k,m?e.jsx("div",{children:m}):null]}),e.jsxs(t.DialogActions,{children:[(g===void 0||g)&&e.jsx(t.Button,{startIcon:e.jsx(s.Check,{}),disabled:D||_||b&&i===a,onClick:()=>x&&x(f?a:""),variant:"contained",color:"primary",children:l.t(I||"Ok")}),e.jsx(t.Button,{color:"grey",onClick:h,disabled:_,variant:"contained",startIcon:e.jsx(s.Close,{}),children:l.t(y||"Cancel")})]})]})};export{H as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./DefaultPropsProvider-BxjOYH1h.js";import{i as g}from"./iobroker_admin__loadShare__react__loadShare__-CuzHmAOj.js";import{f as u,J as m,R as c,i as l,I as f}from"./bootstrap-B3ZI_-0g.js";import{l as b}from"./index-8HslT92O.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-CHE4rLsT.js";import"./iobroker_admin__loadShare__prop_mf_2_types__loadShare__-pDONiJUe.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./emotion-serialize.esm-Q4o_CgeF.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-CXogaIXO.js";import"./ace-1DqSbvTN.js";import"./FilledInput-B9JSi0Ta.js";import"./preload-helper-Dp1pzeXC.js";import"./ThemeProvider-DHntAcOp.js";import"./emotion-cache.browser.esm-BgJfNZJN.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-DIpcqFbm.js";import"./extends-CF3RwP-h.js";const x={root:{display:"block",position:"relative",left:0,top:0,width:"100%",height:"100%",color:"black",borderRadius:4,boxShadow:"0px 2px 1px -1px rgb(0 0 0 / 20%), 0px 1px 1px 0px rgb(0 0 0 / 14%), 0px 1px 3px 0px rgb(0 0 0 / 12%)",border:"0px solid #888"}};class D extends g.Component{refIframe=null;registered=!1;loadingTimer=null;constructor(t){super(t),this.state={href:"",adapterName:"",instanceNumber:null,schema:null,jsonData:{},loadingKey:0,loading:!0}}async componentDidMount(){var p;!this.registered&&((p=this.refIframe)!=null&&p.contentWindow)&&(this.registered=!0,this.props.onRegisterIframeRef(this.refIframe)),(window.addEventListener||window.attachEvent)(window.addEventListener?"message":"onmessage",this.onMessage,!1);const t={};for(const a of this.props.hosts)t[a._id]=a;const e=await u.getHref(this.props.instancesWorker,this.props.tab,this.props.hostname,t,this.props.adminInstance,this.props.theme.palette.mode);let s=null;const r=(e==null?void 0:e.href.split("?")[0])||"";let n={};if(r.endsWith(".json")||r.endsWith(".json5"))try{let a;const h=await this.props.socket.readFile(`${e.adapterName}.admin`,r,!0);h.file!==void 0&&(a=atob(h.file.toString()),a.startsWith("{")||(a=decodeURIComponent(a)));try{s=b.parse(a)}catch(o){console.error(`Cannot parse jsonConfig of ${e.adapterName}: ${o}`),window.alert(`Cannot parse jsonConfig of ${e.adapterName}: ${o}`)}if(s&&await m.loadI18n(this.props.socket,s.i18n,e.adapterName),s!=null&&s.command){const o=await this.props.socket.getState(`system.adapter.${e.adapterName}.${e.instanceNumber||0}.alive`);if(o!=null&&o.val){const d=await this.props.socket.sendTo(`${e.adapterName}.${e.instanceNumber||0}`,s==null?void 0:s.command,null);d!=null&&d.data&&(n=d.data)}}}catch(a){console.error(`Cannot load ${e.adapterName}.admin/${e.href}: ${a}`),window.alert(`Cannot load ${e.adapterName}.admin/${e.href}: ${a}`)}this.setState({href:e.href,adapterName:e.adapterName,instanceNumber:e.instanceNumber,schema:s,jsonData:n})}componentWillUnmount(){this.loadingTimer&&(clearInterval(this.loadingTimer),this.loadingTimer=null),this.registered&&(this.props.onUnregisterIframeRef(this.refIframe),this.registered=!1),(window.removeEventListener||window.detachEvent)(window.removeEventListener?"message":"onmessage",this.onMessage,!1)}componentDidUpdate(){var t;!this.registered&&((t=this.refIframe)!=null&&t.contentWindow)&&(this.registered=!0,this.props.onRegisterIframeRef(this.refIframe))}onMessage=t=>{if(this.props.supportsLoadingMessage&&t.data==="iobLoaded"||t.message==="iobLoaded"){this.setState({loading:!1}),this.loadingTimer&&(clearInterval(this.loadingTimer),this.loadingTimer=null);return}if(t.origin===window.location.origin){if(t.data==="close"||t.message==="close")c.doNavigate("tab-instances");else if(t.data==="change"||t.message==="change")console.warn('Application sends "change" message, but it is not processed yet');else if(t.data==="nochange"||t.message==="nochange")console.warn('Application sends "nochange" message, but it is not processed yet');else if(typeof t.data=="string"&&t.data.startsWith("goto:")||typeof t.message=="string"&&t.message.startsWith("goto:")){const[,e]=(t.data||t.message).split(":"),[s,r,n]=e.split("/");c.doNavigate(s,r,n)}}};render(){return this.state.href?this.state.href.includes(".json")?this.state.schema?i.jsx(m,{socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.theme.palette.mode,adapterName:this.state.adapterName,instance:this.state.instanceNumber||0,isFloatComma:this.props.isFloatComma,dateFormat:this.props.dateFormat,schema:this.state.schema,data:this.state.jsonData,onError:()=>{},theme:this.props.theme,withoutSaveButtons:!0,expertMode:this.props.expertMode}):i.jsx(l.LinearProgress,{}):this.state.href.startsWith("http://")&&window.location.protocol==="https:"&&window.location.hostname!=="localhost"?i.jsxs("div",{style:{padding:10,display:"flex",justifyContent:"center",alignItems:"center",height:"100%",flexDirection:"column",fontSize:18,gap:20},children:[i.jsx("div",{children:f.t("This content cannot be loaded because it uses insecure HTTP protocol.")}),i.jsx("div",{children:f.t("But you can open this link in new tab:")}),i.jsx("a",{href:this.state.href,target:"_blank",rel:"noopener noreferrer",children:this.state.href})]}):i.jsxs("div",{style:x.root,children:[this.state.loading?i.jsx(l.LinearProgress,{style:{position:"absolute",zIndex:2,width:"100%"}}):null,this.state.loading&&this.props.icon?i.jsx("div",{style:{position:"absolute",zIndex:2,width:"100%",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",fontSize:48},children:typeof this.props.icon=="string"?i.jsx("img",{src:this.props.icon,alt:"icon",style:{maxWidth:200,width:"100%",opacity:.7}}):this.props.icon}):null,i.jsx("iframe",{ref:t=>this.refIframe=t,title:this.props.tab,style:{display:"block",position:"relative",left:0,top:0,width:"100%",height:"100%",color:"black",zIndex:1,borderRadius:0,boxShadow:"none",border:"0px solid #888"},src:this.state.href,onLoad:()=>{this.props.supportsLoadingMessage||(this.setState({loading:!1}),this.loadingTimer&&(clearInterval(this.loadingTimer),this.loadingTimer=null))},onError:t=>{t.target.onerror=null,this.state.href.includes("tab_m.html")?this.setState(e=>({href:e.href.replace("tab_m.html","tab.html")})):this.loadingTimer||=setInterval(()=>this.setState({loadingKey:this.state.loadingKey+1}),3e3)}})]}):i.jsx(l.LinearProgress,{})}}export{D as default};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import{i as me}from"./iobroker_admin__loadShare__react__loadShare__-CuzHmAOj.js";import"./iobroker_admin__loadShare__prop_mf_2_types__loadShare__-pDONiJUe.js";import{g as Dt}from"./_commonjsHelpers-D6-XlEtG.js";import{a as Mt,b as Wt}from"./iobroker_admin__mf_v__runtimeInit__mf_v__-CHE4rLsT.js";import{s as Kt}from"./emotion-serialize.esm-Q4o_CgeF.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-CXogaIXO.js";var bt={exports:{}},$={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-is.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Ye=Symbol.for("react.transitional.element"),Ue=Symbol.for("react.portal"),we=Symbol.for("react.fragment"),Ae=Symbol.for("react.strict_mode"),xe=Symbol.for("react.profiler"),Te=Symbol.for("react.consumer"),$e=Symbol.for("react.context"),ke=Symbol.for("react.forward_ref"),ve=Symbol.for("react.suspense"),_e=Symbol.for("react.suspense_list"),Oe=Symbol.for("react.memo"),Be=Symbol.for("react.lazy"),Gt=Symbol.for("react.view_transition"),zt=Symbol.for("react.client.reference");function z(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Ye:switch(e=e.type,e){case we:case xe:case Ae:case ve:case _e:case Gt:return e;default:switch(e=e&&e.$$typeof,e){case $e:case ke:case Be:case Oe:return e;case Te:return e;default:return t}}case Ue:return t}}}$.ContextConsumer=Te;$.ContextProvider=$e;$.Element=Ye;$.ForwardRef=ke;$.Fragment=we;$.Lazy=Be;$.Memo=Oe;$.Portal=Ue;$.Profiler=xe;$.StrictMode=Ae;$.Suspense=ve;$.SuspenseList=_e;$.isContextConsumer=function(e){return z(e)===Te};$.isContextProvider=function(e){return z(e)===$e};$.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Ye};$.isForwardRef=function(e){return z(e)===ke};$.isFragment=function(e){return z(e)===we};$.isLazy=function(e){return z(e)===Be};$.isMemo=function(e){return z(e)===Oe};$.isPortal=function(e){return z(e)===Ue};$.isProfiler=function(e){return z(e)===xe};$.isStrictMode=function(e){return z(e)===Ae};$.isSuspense=function(e){return z(e)===ve};$.isSuspenseList=function(e){return z(e)===_e};$.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===we||e===xe||e===Ae||e===ve||e===_e||typeof e=="object"&&e!==null&&(e.$$typeof===Be||e.$$typeof===Oe||e.$$typeof===$e||e.$$typeof===Te||e.$$typeof===ke||e.$$typeof===zt||e.getModuleId!==void 0)};$.typeOf=z;bt.exports=$;var St=bt.exports;function Y(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Ct(e){if(me.isValidElement(e)||St.isValidElementType(e)||!Y(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=Ct(e[r])}),t}function j(e,t,r={clone:!0}){const n=r.clone?{...e}:e;return Y(e)&&Y(t)&&Object.keys(t).forEach(o=>{me.isValidElement(t[o])||St.isValidElementType(t[o])?n[o]=t[o]:Y(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&Y(e[o])?n[o]=j(e[o],t[o],r):r.clone?n[o]=Y(t[o])?Ct(t[o]):t[o]:n[o]=t[o]}),n}function J(e,...t){const r=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(n=>r.searchParams.append("args[]",n)),`Minified MUI error #${e}; visit ${r} for the full message.`}function wt(e){if(typeof e!="string")throw new Error(J(7));return e.charAt(0).toUpperCase()+e.slice(1)}function He(e,t){const r={...t};for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=n;if(o==="components"||o==="slots")r[o]={...e[o],...r[o]};else if(o==="componentsProps"||o==="slotProps"){const a=e[o],s=t[o];if(!s)r[o]=a||{};else if(!a)r[o]=s;else{r[o]={...s};for(const c in a)if(Object.prototype.hasOwnProperty.call(a,c)){const u=c;r[o][u]=He(a[u],s[u])}}}else r[o]===void 0&&(r[o]=e[o])}return r}function yo(e,t,r=void 0){const n={};for(const o in e){const a=e[o];let s="",c=!0;for(let u=0;u<a.length;u+=1){const f=a[u];f&&(s+=(c===!0?"":" ")+t(f),c=!1,r&&r[f]&&(s+=" "+r[f]))}n[o]=s}return n}const it=e=>e,Ht=()=>{let e=it;return{configure(t){e=t},generate(t){return e(t)},reset(){e=it}}},Nt=Ht(),Vt={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Yt(e,t,r="Mui"){const n=Vt[t];return n?`${r}-${n}`:`${Nt.generate(e)}-${t}`}function bo(e,t,r="Mui"){const n={};return t.forEach(o=>{n[o]=Yt(e,o,r)}),n}function Ut(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}function At(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=At(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function So(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=At(e))&&(n&&(n+=" "),n+=t);return n}function fe(e,t){return t?j(e,t,{clone:!1}):e}function at(e,t){if(!e.containerQueries)return t;const r=Object.keys(t).filter(n=>n.startsWith("@container")).sort((n,o)=>{var s,c;const a=/min-width:\s*([0-9.]+)/;return+(((s=n.match(a))==null?void 0:s[1])||0)-+(((c=o.match(a))==null?void 0:c[1])||0)});return r.length?r.reduce((n,o)=>{const a=t[o];return delete n[o],n[o]=a,n},{...t}):t}function Qt(e,t){return t==="@"||t.startsWith("@")&&(e.some(r=>t.startsWith(`@${r}`))||!!t.match(/^@\d/))}function Xt(e,t){const r=t.match(/^@([^/]+)?\/?(.+)?$/);if(!r)return null;const[,n,o]=r,a=Number.isNaN(+n)?n||0:+n;return e.containerQueries(o).up(a)}function qt(e){const t=(a,s)=>a.replace("@media",s?`@container ${s}`:"@container");function r(a,s){a.up=(...c)=>t(e.breakpoints.up(...c),s),a.down=(...c)=>t(e.breakpoints.down(...c),s),a.between=(...c)=>t(e.breakpoints.between(...c),s),a.only=(...c)=>t(e.breakpoints.only(...c),s),a.not=(...c)=>{const u=t(e.breakpoints.not(...c),s);return u.includes("not all and")?u.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):u}}const n={},o=a=>(r(n,a),n);return r(o),{...e,containerQueries:o}}const Ee={xs:0,sm:600,md:900,lg:1200,xl:1536},st={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Ee[e]}px)`},Jt={containerQueries:e=>({up:t=>{let r=typeof t=="number"?t:Ee[t]||t;return typeof r=="number"&&(r=`${r}px`),e?`@container ${e} (min-width:${r})`:`@container (min-width:${r})`}})};function U(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const a=n.breakpoints||st;return t.reduce((s,c,u)=>(s[a.up(a.keys[u])]=r(t[u]),s),{})}if(typeof t=="object"){const a=n.breakpoints||st;return Object.keys(t).reduce((s,c)=>{if(Qt(a.keys,c)){const u=Xt(n.containerQueries?n:Jt,c);u&&(s[u]=r(t[c],c))}else if(Object.keys(a.values||Ee).includes(c)){const u=a.up(c);s[u]=r(t[c],c)}else{const u=c;s[u]=t[u]}return s},{})}return r(t)}function xt(e={}){var r;return((r=e.keys)==null?void 0:r.reduce((n,o)=>{const a=e.up(o);return n[a]={},n},{}))||{}}function Ne(e,t){return e.reduce((r,n)=>{const o=r[n];return(!o||Object.keys(o).length===0)&&delete r[n],r},t)}function Co(e,...t){const r=xt(e),n=[r,...t].reduce((o,a)=>j(o,a),{});return Ne(Object.keys(r),n)}function Zt(e,t){if(typeof e!="object")return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach((o,a)=>{a<e.length&&(r[o]=!0)}):n.forEach(o=>{e[o]!=null&&(r[o]=!0)}),r}function wo({values:e,breakpoints:t,base:r}){const n=r||Zt(e,t),o=Object.keys(n);if(o.length===0)return e;let a;return o.reduce((s,c,u)=>(Array.isArray(e)?(s[c]=e[u]!=null?e[u]:e[a],a=u):typeof e=="object"?(s[c]=e[c]!=null?e[c]:e[a],a=c):s[c]=e,s),{})}function Pe(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const n=`vars.${t}`.split(".").reduce((o,a)=>o&&o[a]?o[a]:null,e);if(n!=null)return n}return t.split(".").reduce((n,o)=>n&&n[o]!=null?n[o]:null,e)}function Se(e,t,r,n=r){let o;return typeof e=="function"?o=e(r):Array.isArray(e)?o=e[r]||n:o=Pe(e,r)||n,t&&(o=t(o,n,e)),o}function E(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:o}=e,a=s=>{if(s[t]==null)return null;const c=s[t],u=s.theme,f=Pe(u,n)||{};return U(s,c,g=>{let d=Se(f,o,g);return g===d&&typeof g=="string"&&(d=Se(f,o,`${t}${g==="default"?"":wt(g)}`,g)),r===!1?d:{[r]:d}})};return a.propTypes={},a.filterProps=[t],a}function er(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const tr={m:"margin",p:"padding"},rr={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},lt={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},nr=er(e=>{if(e.length>2)if(lt[e])e=lt[e];else return[e];const[t,r]=e.split(""),n=tr[t],o=rr[r]||"";return Array.isArray(o)?o.map(a=>n+a):[n+o]}),Qe=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Xe=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Qe,...Xe];function ge(e,t,r,n){const o=Pe(e,t,!0)??r;return typeof o=="number"||typeof o=="string"?a=>typeof a=="string"?a:typeof o=="string"?`calc(${a} * ${o})`:o*a:Array.isArray(o)?a=>{if(typeof a=="string")return a;const s=Math.abs(a),c=o[s];return a>=0?c:typeof c=="number"?-c:`-${c}`}:typeof o=="function"?o:()=>{}}function qe(e){return ge(e,"spacing",8)}function pe(e,t){return typeof t=="string"||t==null?t:e(t)}function or(e,t){return r=>e.reduce((n,o)=>(n[o]=pe(t,r),n),{})}function ir(e,t,r,n){if(!t.includes(r))return null;const o=nr(r),a=or(o,n),s=e[r];return U(e,s,a)}function Tt(e,t){const r=qe(e.theme);return Object.keys(e).map(n=>ir(e,t,n,r)).reduce(fe,{})}function _(e){return Tt(e,Qe)}_.propTypes={};_.filterProps=Qe;function O(e){return Tt(e,Xe)}O.propTypes={};O.filterProps=Xe;function Re(...e){const t=e.reduce((n,o)=>(o.filterProps.forEach(a=>{n[a]=o}),n),{}),r=n=>Object.keys(n).reduce((o,a)=>t[a]?fe(o,t[a](n)):o,{});return r.propTypes={},r.filterProps=e.reduce((n,o)=>n.concat(o.filterProps),[]),r}function G(e){return typeof e!="number"?e:`${e}px solid`}function H(e,t){return E({prop:e,themeKey:"borders",transform:t})}const ar=H("border",G),sr=H("borderTop",G),lr=H("borderRight",G),cr=H("borderBottom",G),ur=H("borderLeft",G),fr=H("borderColor"),dr=H("borderTopColor"),mr=H("borderRightColor"),gr=H("borderBottomColor"),pr=H("borderLeftColor"),hr=H("outline",G),yr=H("outlineColor"),Ie=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=ge(e.theme,"shape.borderRadius",4),r=n=>({borderRadius:pe(t,n)});return U(e,e.borderRadius,r)}return null};Ie.propTypes={};Ie.filterProps=["borderRadius"];Re(ar,sr,lr,cr,ur,fr,dr,mr,gr,pr,Ie,hr,yr);const Fe=e=>{if(e.gap!==void 0&&e.gap!==null){const t=ge(e.theme,"spacing",8),r=n=>({gap:pe(t,n)});return U(e,e.gap,r)}return null};Fe.propTypes={};Fe.filterProps=["gap"];const Le=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=ge(e.theme,"spacing",8),r=n=>({columnGap:pe(t,n)});return U(e,e.columnGap,r)}return null};Le.propTypes={};Le.filterProps=["columnGap"];const je=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=ge(e.theme,"spacing",8),r=n=>({rowGap:pe(t,n)});return U(e,e.rowGap,r)}return null};je.propTypes={};je.filterProps=["rowGap"];const br=E({prop:"gridColumn"}),Sr=E({prop:"gridRow"}),Cr=E({prop:"gridAutoFlow"}),wr=E({prop:"gridAutoColumns"}),Ar=E({prop:"gridAutoRows"}),xr=E({prop:"gridTemplateColumns"}),Tr=E({prop:"gridTemplateRows"}),$r=E({prop:"gridTemplateAreas"}),kr=E({prop:"gridArea"});Re(Fe,Le,je,br,Sr,Cr,wr,Ar,xr,Tr,$r,kr);function oe(e,t){return t==="grey"?t:e}const vr=E({prop:"color",themeKey:"palette",transform:oe}),_r=E({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:oe}),Or=E({prop:"backgroundColor",themeKey:"palette",transform:oe});Re(vr,_r,Or);function W(e){return e<=1&&e!==0?`${e*100}%`:e}const Br=E({prop:"width",transform:W}),Je=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{var o,a,s,c,u;const n=((s=(a=(o=e.theme)==null?void 0:o.breakpoints)==null?void 0:a.values)==null?void 0:s[r])||Ee[r];return n?((u=(c=e.theme)==null?void 0:c.breakpoints)==null?void 0:u.unit)!=="px"?{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:n}:{maxWidth:W(r)}};return U(e,e.maxWidth,t)}return null};Je.filterProps=["maxWidth"];const Er=E({prop:"minWidth",transform:W}),Pr=E({prop:"height",transform:W}),Rr=E({prop:"maxHeight",transform:W}),Ir=E({prop:"minHeight",transform:W});E({prop:"size",cssProperty:"width",transform:W});E({prop:"size",cssProperty:"height",transform:W});const Fr=E({prop:"boxSizing"});Re(Br,Je,Er,Pr,Rr,Ir,Fr);const De={border:{themeKey:"borders",transform:G},borderTop:{themeKey:"borders",transform:G},borderRight:{themeKey:"borders",transform:G},borderBottom:{themeKey:"borders",transform:G},borderLeft:{themeKey:"borders",transform:G},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:G},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ie},color:{themeKey:"palette",transform:oe},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:oe},backgroundColor:{themeKey:"palette",transform:oe},p:{style:O},pt:{style:O},pr:{style:O},pb:{style:O},pl:{style:O},px:{style:O},py:{style:O},padding:{style:O},paddingTop:{style:O},paddingRight:{style:O},paddingBottom:{style:O},paddingLeft:{style:O},paddingX:{style:O},paddingY:{style:O},paddingInline:{style:O},paddingInlineStart:{style:O},paddingInlineEnd:{style:O},paddingBlock:{style:O},paddingBlockStart:{style:O},paddingBlockEnd:{style:O},m:{style:_},mt:{style:_},mr:{style:_},mb:{style:_},ml:{style:_},mx:{style:_},my:{style:_},margin:{style:_},marginTop:{style:_},marginRight:{style:_},marginBottom:{style:_},marginLeft:{style:_},marginX:{style:_},marginY:{style:_},marginInline:{style:_},marginInlineStart:{style:_},marginInlineEnd:{style:_},marginBlock:{style:_},marginBlockStart:{style:_},marginBlockEnd:{style:_},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Fe},rowGap:{style:je},columnGap:{style:Le},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:W},maxWidth:{style:Je},minWidth:{transform:W},height:{transform:W},maxHeight:{transform:W},minHeight:{transform:W},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function Lr(...e){const t=e.reduce((n,o)=>n.concat(Object.keys(o)),[]),r=new Set(t);return e.every(n=>r.size===Object.keys(n).length)}function jr(e,t){return typeof e=="function"?e(t):e}function Dr(){function e(r,n,o,a){const s={[r]:n,theme:o},c=a[r];if(!c)return{[r]:n};const{cssProperty:u=r,themeKey:f,transform:p,style:g}=c;if(n==null)return null;if(f==="typography"&&n==="inherit")return{[r]:n};const d=Pe(o,f)||{};return g?g(s):U(s,n,h=>{let S=Se(d,p,h);return h===S&&typeof h=="string"&&(S=Se(d,p,`${r}${h==="default"?"":wt(h)}`,h)),u===!1?S:{[u]:S}})}function t(r){const{sx:n,theme:o={},nested:a}=r||{};if(!n)return null;const s=o.unstable_sxConfig??De;function c(u){let f=u;if(typeof u=="function")f=u(o);else if(typeof u!="object")return u;if(!f)return null;const p=xt(o.breakpoints),g=Object.keys(p);let d=p;return Object.keys(f).forEach(b=>{const h=jr(f[b],o);if(h!=null)if(typeof h=="object")if(s[b])d=fe(d,e(b,h,o,s));else{const S=U({theme:o},h,I=>({[b]:I}));Lr(S,h)?d[b]=t({sx:h,theme:o,nested:!0}):d=fe(d,S)}else d=fe(d,e(b,h,o,s))}),!a&&o.modularCssLayers?{"@layer sx":at(o,Ne(g,d))}:at(o,Ne(g,d))}return Array.isArray(n)?n.map(c):c(n)}return t}const ie=Dr();ie.filterProps=["sx"];const{loadShare:Mr}=Wt,{initPromise:Wr}=Mt,Kr=Wr.then(e=>Mr("@emotion/styled",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"*"}}})),Gr=await Kr.then(e=>e());var zr=Gr;const Hr=Dt(zr);var $t={exports:{}},Me={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.production.min.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Nr=me,Vr=Symbol.for("react.element"),Yr=Symbol.for("react.fragment"),Ur=Object.prototype.hasOwnProperty,Qr=Nr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Xr={key:!0,ref:!0,__self:!0,__source:!0};function kt(e,t,r){var n,o={},a=null,s=null;r!==void 0&&(a=""+r),t.key!==void 0&&(a=""+t.key),t.ref!==void 0&&(s=t.ref);for(n in t)Ur.call(t,n)&&!Xr.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)o[n]===void 0&&(o[n]=t[n]);return{$$typeof:Vr,type:e,key:a,ref:s,props:o,_owner:Qr.current}}Me.Fragment=Yr;Me.jsx=kt;Me.jsxs=kt;$t.exports=Me;var qr=$t.exports;/**
|
|
18
|
+
* @mui/styled-engine v6.5.0
|
|
19
|
+
*
|
|
20
|
+
* @license MIT
|
|
21
|
+
* This source code is licensed under the MIT license found in the
|
|
22
|
+
* LICENSE file in the root directory of this source tree.
|
|
23
|
+
*/function Jr(e,t){return Hr(e,t)}function Zr(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const ct=[];function q(e){return ct[0]=e,Kt(ct)}const en=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,n)=>r.val-n.val),t.reduce((r,n)=>({...r,[n.key]:n.val}),{})};function tn(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5,...o}=e,a=en(t),s=Object.keys(a);function c(d){return`@media (min-width:${typeof t[d]=="number"?t[d]:d}${r})`}function u(d){return`@media (max-width:${(typeof t[d]=="number"?t[d]:d)-n/100}${r})`}function f(d,b){const h=s.indexOf(b);return`@media (min-width:${typeof t[d]=="number"?t[d]:d}${r}) and (max-width:${(h!==-1&&typeof t[s[h]]=="number"?t[s[h]]:b)-n/100}${r})`}function p(d){return s.indexOf(d)+1<s.length?f(d,s[s.indexOf(d)+1]):c(d)}function g(d){const b=s.indexOf(d);return b===0?c(s[1]):b===s.length-1?u(s[b]):f(d,s[s.indexOf(d)+1]).replace("@media","@media not all and")}return{keys:s,values:a,up:c,down:u,between:f,only:p,not:g,unit:r,...o}}const rn={borderRadius:4};function vt(e=8,t=qe({spacing:e})){if(e.mui)return e;const r=(...n)=>(n.length===0?[1]:n).map(a=>{const s=t(a);return typeof s=="number"?`${s}px`:s}).join(" ");return r.mui=!0,r}function nn(e,t){var n;const r=this;if(r.vars){if(!((n=r.colorSchemes)!=null&&n[e])||typeof r.getColorSchemeSelector!="function")return{};let o=r.getColorSchemeSelector(e);return o==="&"?t:((o.includes("data-")||o.includes("."))&&(o=`*:where(${o.replace(/\s*&$/,"")}) &`),{[o]:t})}return r.palette.mode===e?t:{}}function _t(e={},...t){const{breakpoints:r={},palette:n={},spacing:o,shape:a={},...s}=e,c=tn(r),u=vt(o);let f=j({breakpoints:c,direction:"ltr",components:{},palette:{mode:"light",...n},spacing:u,shape:{...rn,...a}},s);return f=qt(f),f.applyStyles=nn,f=t.reduce((p,g)=>j(p,g),f),f.unstable_sxConfig={...De,...s==null?void 0:s.unstable_sxConfig},f.unstable_sx=function(g){return ie({sx:g,theme:this})},f}function Ot(e){const{variants:t,...r}=e,n={variants:t,style:q(r),isProcessed:!0};return n.style===r||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=q(o.style))}),n}const on=_t();function Ke(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function X(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function an(e){return e?(t,r)=>r[e]:null}function sn(e,t,r){e.theme=un(e.theme)?r:e.theme[t]||e.theme}function be(e,t,r){const n=typeof t=="function"?t(e):t;if(Array.isArray(n))return n.flatMap(o=>be(e,o,r));if(Array.isArray(n==null?void 0:n.variants)){let o;if(n.isProcessed)o=r?X(n.style,r):n.style;else{const{variants:a,...s}=n;o=r?X(q(s),r):s}return Bt(e,n.variants,[o],r)}return n!=null&&n.isProcessed?r?X(q(n.style),r):n.style:r?X(q(n),r):n}function Bt(e,t,r=[],n=void 0){var a;let o;e:for(let s=0;s<t.length;s+=1){const c=t[s];if(typeof c.props=="function"){if(o??={...e,...e.ownerState,ownerState:e.ownerState},!c.props(o))continue}else for(const u in c.props)if(e[u]!==c.props[u]&&((a=e.ownerState)==null?void 0:a[u])!==c.props[u])continue e;typeof c.style=="function"?(o??={...e,...e.ownerState,ownerState:e.ownerState},r.push(n?X(q(c.style(o)),n):c.style(o))):r.push(n?X(q(c.style),n):c.style)}return r}function ln(e={}){const{themeId:t,defaultTheme:r=on,rootShouldForwardProp:n=Ke,slotShouldForwardProp:o=Ke}=e;function a(c){sn(c,t,r)}return(c,u={})=>{Zr(c,v=>v.filter(B=>B!==ie));const{name:f,slot:p,skipVariantsResolver:g,skipSx:d,overridesResolver:b=an(dn(p)),...h}=u,S=f&&f.startsWith("Mui")||p?"components":"custom",I=g!==void 0?g:p&&p!=="Root"&&p!=="root"||!1,F=d||!1;let D=Ke;p==="Root"||p==="root"?D=n:p?D=o:fn(c)&&(D=void 0);const w=Jr(c,{shouldForwardProp:D,label:cn(),...h}),y=v=>{if(v.__emotion_real===v)return v;if(typeof v=="function")return function(M){return be(M,v,M.theme.modularCssLayers?S:void 0)};if(Y(v)){const B=Ot(v);return function(R){return B.variants?be(R,B,R.theme.modularCssLayers?S:void 0):R.theme.modularCssLayers?X(B.style,S):B.style}}return v},P=(...v)=>{const B=[],M=v.map(y),R=[];if(B.push(a),f&&b&&R.push(function(A){var se,nt;const L=(nt=(se=A.theme.components)==null?void 0:se[f])==null?void 0:nt.styleOverrides;if(!L)return null;const ae={};for(const ot in L)ae[ot]=be(A,L[ot],A.theme.modularCssLayers?"theme":void 0);return b(A,ae)}),f&&!I&&R.push(function(A){var ae,se;const K=A.theme,L=(se=(ae=K==null?void 0:K.components)==null?void 0:ae[f])==null?void 0:se.variants;return L?Bt(A,L,[],A.theme.modularCssLayers?"theme":void 0):null}),F||R.push(ie),Array.isArray(M[0])){const C=M.shift(),A=new Array(B.length).fill(""),K=new Array(R.length).fill("");let L;L=[...A,...C,...K],L.raw=[...A,...C.raw,...K],B.unshift(L)}const i=[...B,...M,...R],m=w(...i);return c.muiName&&(m.muiName=c.muiName),m};return w.withConfig&&(P.withConfig=w.withConfig),P}}function cn(e,t){return void 0}function un(e){for(const t in e)return!1;return!0}function fn(e){return typeof e=="string"&&e.charCodeAt(0)>96}function dn(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function Ze(e,t=0,r=1){return Ut(e,t,r)}function mn(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(n=>n+n)),r?`rgb${r.length===4?"a":""}(${r.map((n,o)=>o<3?parseInt(n,16):Math.round(parseInt(n,16)/255*1e3)/1e3).join(", ")})`:""}function gn(e){const t=e.toString(16);return t.length===1?`0${t}`:t}function Q(e){if(e.type)return e;if(e.charAt(0)==="#")return Q(mn(e));const t=e.indexOf("("),r=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(r))throw new Error(J(9,e));let n=e.substring(t+1,e.length-1),o;if(r==="color"){if(n=n.split(" "),o=n.shift(),n.length===4&&n[3].charAt(0)==="/"&&(n[3]=n[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error(J(10,o))}else n=n.split(",");return n=n.map(a=>parseFloat(a)),{type:r,values:n,colorSpace:o}}const pn=e=>{const t=Q(e);return t.values.slice(0,3).map((r,n)=>t.type.includes("hsl")&&n!==0?`${r}%`:r).join(" ")},ce=(e,t)=>{try{return pn(e)}catch{return e}};function We(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.includes("rgb")?n=n.map((o,a)=>a<3?parseInt(o,10):o):t.includes("hsl")&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),t.includes("color")?n=`${r} ${n.join(" ")}`:n=`${n.join(", ")}`,`${t}(${n})`}function Ao(e){if(e.startsWith("#"))return e;const{values:t}=Q(e);return`#${t.map((r,n)=>gn(n===3?Math.round(255*r):r)).join("")}`}function Et(e){e=Q(e);const{values:t}=e,r=t[0],n=t[1]/100,o=t[2]/100,a=n*Math.min(o,1-o),s=(f,p=(f+r/30)%12)=>o-a*Math.max(Math.min(p-3,9-p,1),-1);let c="rgb";const u=[Math.round(s(0)*255),Math.round(s(8)*255),Math.round(s(4)*255)];return e.type==="hsla"&&(c+="a",u.push(t[3])),We({type:c,values:u})}function Ve(e){e=Q(e);let t=e.type==="hsl"||e.type==="hsla"?Q(Et(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function hn(e,t){const r=Ve(e),n=Ve(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function yn(e,t){return e=Q(e),t=Ze(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,We(e)}function he(e,t,r){try{return yn(e,t)}catch{return e}}function et(e,t){if(e=Q(e),t=Ze(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]*=1-t;return We(e)}function x(e,t,r){try{return et(e,t)}catch{return e}}function tt(e,t){if(e=Q(e),t=Ze(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return We(e)}function T(e,t,r){try{return tt(e,t)}catch{return e}}function bn(e,t=.15){return Ve(e)>.5?et(e,t):tt(e,t)}function ye(e,t,r){try{return bn(e,t)}catch{return e}}const Pt=me.createContext(void 0);function xo({value:e,children:t}){return qr.jsx(Pt.Provider,{value:e,children:t})}function Sn(e){const{theme:t,name:r,props:n}=e;if(!t||!t.components||!t.components[r])return n;const o=t.components[r];return o.defaultProps?He(o.defaultProps,n):!o.styleOverrides&&!o.variants?He(o,n):n}function Cn({props:e,name:t}){const r=me.useContext(Pt);return Sn({props:e,name:t,theme:{components:r}})}const ut={theme:void 0};function wn(e){let t,r;return function(o){let a=t;return(a===void 0||o.theme!==r)&&(ut.theme=o.theme,a=Ot(e(ut)),t=a,r=o.theme),a}}function An(e=""){function t(...n){if(!n.length)return"";const o=n[0];return typeof o=="string"&&!o.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${o}${t(...n.slice(1))})`:`, ${o}`}return(n,...o)=>`var(--${e?`${e}-`:""}${n}${t(...o)})`}const ft=(e,t,r,n=[])=>{let o=e;t.forEach((a,s)=>{s===t.length-1?Array.isArray(o)?o[Number(a)]=r:o&&typeof o=="object"&&(o[a]=r):o&&typeof o=="object"&&(o[a]||(o[a]=n.includes(a)?[]:{}),o=o[a])})},xn=(e,t,r)=>{function n(o,a=[],s=[]){Object.entries(o).forEach(([c,u])=>{(!r||r&&!r([...a,c]))&&u!=null&&(typeof u=="object"&&Object.keys(u).length>0?n(u,[...a,c],Array.isArray(u)?[...s,c]:s):t([...a,c],u,s))})}n(e)},Tn=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(n=>e.includes(n))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function Ge(e,t){const{prefix:r,shouldSkipGeneratingVar:n}=t||{},o={},a={},s={};return xn(e,(c,u,f)=>{if((typeof u=="string"||typeof u=="number")&&(!n||!n(c,u))){const p=`--${r?`${r}-`:""}${c.join("-")}`,g=Tn(c,u);Object.assign(o,{[p]:g}),ft(a,c,`var(${p})`,f),ft(s,c,`var(${p}, ${g})`,f)}},c=>c[0]==="vars"),{css:o,vars:a,varsWithDefaults:s}}function $n(e,t={}){const{getSelector:r=I,disableCssColorScheme:n,colorSchemeSelector:o}=t,{colorSchemes:a={},components:s,defaultColorScheme:c="light",...u}=e,{vars:f,css:p,varsWithDefaults:g}=Ge(u,t);let d=g;const b={},{[c]:h,...S}=a;if(Object.entries(S||{}).forEach(([w,y])=>{const{vars:P,css:v,varsWithDefaults:B}=Ge(y,t);d=j(d,B),b[w]={css:v,vars:P}}),h){const{css:w,vars:y,varsWithDefaults:P}=Ge(h,t);d=j(d,P),b[c]={css:w,vars:y}}function I(w,y){var v,B;let P=o;if(o==="class"&&(P=".%s"),o==="data"&&(P="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(P=`[${o}="%s"]`),w){if(P==="media")return e.defaultColorScheme===w?":root":{[`@media (prefers-color-scheme: ${((B=(v=a[w])==null?void 0:v.palette)==null?void 0:B.mode)||w})`]:{":root":y}};if(P)return e.defaultColorScheme===w?`:root, ${P.replace("%s",String(w))}`:P.replace("%s",String(w))}return":root"}return{vars:d,generateThemeVars:()=>{let w={...f};return Object.entries(b).forEach(([,{vars:y}])=>{w=j(w,y)}),w},generateStyleSheets:()=>{var M,R;const w=[],y=e.defaultColorScheme||"light";function P(i,m){Object.keys(m).length&&w.push(typeof i=="string"?{[i]:{...m}}:i)}P(r(void 0,{...p}),p);const{[y]:v,...B}=b;if(v){const{css:i}=v,m=(R=(M=a[y])==null?void 0:M.palette)==null?void 0:R.mode,C=!n&&m?{colorScheme:m,...i}:{...i};P(r(y,{...C}),C)}return Object.entries(B).forEach(([i,{css:m}])=>{var K,L;const C=(L=(K=a[i])==null?void 0:K.palette)==null?void 0:L.mode,A=!n&&C?{colorScheme:C,...m}:{...m};P(r(i,{...A}),A)}),w}}}function kn(e){return function(r){return e==="media"?`@media (prefers-color-scheme: ${r})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${r}"] &`:e==="class"?`.${r} &`:e==="data"?`[data-${r}] &`:`${e.replace("%s",r)} &`:"&"}}const de={black:"#000",white:"#fff"},vn={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Z={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},ee={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},le={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},te={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},re={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},ne={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};function Rt(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:de.white,default:de.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const _n=Rt();function It(){return{text:{primary:de.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:de.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const dt=It();function mt(e,t,r,n){const o=n.light||n,a=n.dark||n*1.5;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:t==="light"?e.light=tt(e.main,o):t==="dark"&&(e.dark=et(e.main,a)))}function On(e="light"){return e==="dark"?{main:te[200],light:te[50],dark:te[400]}:{main:te[700],light:te[400],dark:te[800]}}function Bn(e="light"){return e==="dark"?{main:Z[200],light:Z[50],dark:Z[400]}:{main:Z[500],light:Z[300],dark:Z[700]}}function En(e="light"){return e==="dark"?{main:ee[500],light:ee[300],dark:ee[700]}:{main:ee[700],light:ee[400],dark:ee[800]}}function Pn(e="light"){return e==="dark"?{main:re[400],light:re[300],dark:re[700]}:{main:re[700],light:re[500],dark:re[900]}}function Rn(e="light"){return e==="dark"?{main:ne[400],light:ne[300],dark:ne[700]}:{main:ne[800],light:ne[500],dark:ne[900]}}function In(e="light"){return e==="dark"?{main:le[400],light:le[300],dark:le[700]}:{main:"#ed6c02",light:le[500],dark:le[900]}}function rt(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:n=.2,...o}=e,a=e.primary||On(t),s=e.secondary||Bn(t),c=e.error||En(t),u=e.info||Pn(t),f=e.success||Rn(t),p=e.warning||In(t);function g(S){return hn(S,dt.text.primary)>=r?dt.text.primary:_n.text.primary}const d=({color:S,name:I,mainShade:F=500,lightShade:D=300,darkShade:w=700})=>{if(S={...S},!S.main&&S[F]&&(S.main=S[F]),!S.hasOwnProperty("main"))throw new Error(J(11,I?` (${I})`:"",F));if(typeof S.main!="string")throw new Error(J(12,I?` (${I})`:"",JSON.stringify(S.main)));return mt(S,"light",D,n),mt(S,"dark",w,n),S.contrastText||(S.contrastText=g(S.main)),S};let b;return t==="light"?b=Rt():t==="dark"&&(b=It()),j({common:{...de},mode:t,primary:d({color:a,name:"primary"}),secondary:d({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:d({color:c,name:"error"}),warning:d({color:p,name:"warning"}),info:d({color:u,name:"info"}),success:d({color:f,name:"success"}),grey:vn,contrastThreshold:r,getContrastText:g,augmentColor:d,tonalOffset:n,...b},o)}function Fn(e){const t={};return Object.entries(e).forEach(n=>{const[o,a]=n;typeof a=="object"&&(t[o]=`${a.fontStyle?`${a.fontStyle} `:""}${a.fontVariant?`${a.fontVariant} `:""}${a.fontWeight?`${a.fontWeight} `:""}${a.fontStretch?`${a.fontStretch} `:""}${a.fontSize||""}${a.lineHeight?`/${a.lineHeight} `:""}${a.fontFamily||""}`)}),t}function Ln(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function jn(e){return Math.round(e*1e5)/1e5}const gt={textTransform:"uppercase"},pt='"Roboto", "Helvetica", "Arial", sans-serif';function Dn(e,t){const{fontFamily:r=pt,fontSize:n=14,fontWeightLight:o=300,fontWeightRegular:a=400,fontWeightMedium:s=500,fontWeightBold:c=700,htmlFontSize:u=16,allVariants:f,pxToRem:p,...g}=typeof t=="function"?t(e):t,d=n/14,b=p||(I=>`${I/u*d}rem`),h=(I,F,D,w,y)=>({fontFamily:r,fontWeight:I,fontSize:b(F),lineHeight:D,...r===pt?{letterSpacing:`${jn(w/F)}em`}:{},...y,...f}),S={h1:h(o,96,1.167,-1.5),h2:h(o,60,1.2,-.5),h3:h(a,48,1.167,0),h4:h(a,34,1.235,.25),h5:h(a,24,1.334,0),h6:h(s,20,1.6,.15),subtitle1:h(a,16,1.75,.15),subtitle2:h(s,14,1.57,.1),body1:h(a,16,1.5,.15),body2:h(a,14,1.43,.15),button:h(s,14,1.75,.4,gt),caption:h(a,12,1.66,.4),overline:h(a,12,2.66,1,gt),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return j({htmlFontSize:u,pxToRem:b,fontFamily:r,fontSize:n,fontWeightLight:o,fontWeightRegular:a,fontWeightMedium:s,fontWeightBold:c,...S},g,{clone:!1})}const Mn=.2,Wn=.14,Kn=.12;function k(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Mn})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Wn})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Kn})`].join(",")}const Gn=["none",k(0,2,1,-1,0,1,1,0,0,1,3,0),k(0,3,1,-2,0,2,2,0,0,1,5,0),k(0,3,3,-2,0,3,4,0,0,1,8,0),k(0,2,4,-1,0,4,5,0,0,1,10,0),k(0,3,5,-1,0,5,8,0,0,1,14,0),k(0,3,5,-1,0,6,10,0,0,1,18,0),k(0,4,5,-2,0,7,10,1,0,2,16,1),k(0,5,5,-3,0,8,10,1,0,3,14,2),k(0,5,6,-3,0,9,12,1,0,3,16,2),k(0,6,6,-3,0,10,14,1,0,4,18,3),k(0,6,7,-4,0,11,15,1,0,4,20,3),k(0,7,8,-4,0,12,17,2,0,5,22,4),k(0,7,8,-4,0,13,19,2,0,5,24,4),k(0,7,9,-4,0,14,21,2,0,5,26,4),k(0,8,9,-5,0,15,22,2,0,6,28,5),k(0,8,10,-5,0,16,24,2,0,6,30,5),k(0,8,11,-5,0,17,26,2,0,6,32,5),k(0,9,11,-5,0,18,28,2,0,7,34,6),k(0,9,12,-6,0,19,29,2,0,7,36,6),k(0,10,13,-6,0,20,31,3,0,8,38,7),k(0,10,13,-6,0,21,33,3,0,8,40,7),k(0,10,14,-6,0,22,35,3,0,8,42,7),k(0,11,14,-7,0,23,36,3,0,9,44,8),k(0,11,15,-7,0,24,38,3,0,9,46,8)],zn={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},Hn={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function ht(e){return`${Math.round(e)}ms`}function Nn(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function Vn(e){const t={...zn,...e.easing},r={...Hn,...e.duration};return{getAutoHeightDuration:Nn,create:(o=["all"],a={})=>{const{duration:s=r.standard,easing:c=t.easeInOut,delay:u=0,...f}=a;return(Array.isArray(o)?o:[o]).map(p=>`${p} ${typeof s=="string"?s:ht(s)} ${c} ${typeof u=="string"?u:ht(u)}`).join(",")},...e,easing:t,duration:r}}const Yn={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Un(e){return Y(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function Ft(e={}){const t={...e};function r(n){const o=Object.entries(n);for(let a=0;a<o.length;a++){const[s,c]=o[a];!Un(c)||s.startsWith("unstable_")?delete n[s]:Y(c)&&(n[s]={...c},r(n[s]))}}return r(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
24
|
+
|
|
25
|
+
const theme = ${JSON.stringify(t,null,2)};
|
|
26
|
+
|
|
27
|
+
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
28
|
+
theme.transitions = createTransitions(theme.transitions || {});
|
|
29
|
+
|
|
30
|
+
export default theme;`}function Ce(e={},...t){const{breakpoints:r,mixins:n={},spacing:o,palette:a={},transitions:s={},typography:c={},shape:u,...f}=e;if(e.vars&&e.generateThemeVars===void 0)throw new Error(J(20));const p=rt(a),g=_t(e);let d=j(g,{mixins:Ln(g.breakpoints,n),palette:p,shadows:Gn.slice(),typography:Dn(p,c),transitions:Vn(s),zIndex:{...Yn}});return d=j(d,f),d=t.reduce((b,h)=>j(b,h),d),d.unstable_sxConfig={...De,...f==null?void 0:f.unstable_sxConfig},d.unstable_sx=function(h){return ie({sx:h,theme:this})},d.toRuntimeSource=Ft,d}function To(...e){return Ce(...e)}function Qn(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const Xn=[...Array(25)].map((e,t)=>{if(t===0)return"none";const r=Qn(t);return`linear-gradient(rgba(255 255 255 / ${r}), rgba(255 255 255 / ${r}))`});function Lt(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function jt(e){return e==="dark"?Xn:[]}function qn(e){const{palette:t={mode:"light"},opacity:r,overlays:n,...o}=e,a=rt(t);return{palette:a,opacity:{...Lt(a.mode),...r},overlays:n||jt(a.mode),...o}}function Jn(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const Zn=e=>[...[...Array(25)].map((t,r)=>`--${e?`${e}-`:""}overlays-${r}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],eo=e=>(t,r)=>{const n=e.rootSelector||":root",o=e.colorSchemeSelector;let a=o;if(o==="class"&&(a=".%s"),o==="data"&&(a="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(a=`[${o}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const s={};return Zn(e.cssVarPrefix).forEach(c=>{s[c]=r[c],delete r[c]}),a==="media"?{[n]:r,"@media (prefers-color-scheme: dark)":{[n]:s}}:a?{[a.replace("%s",t)]:s,[`${n}, ${a.replace("%s",t)}`]:r}:{[n]:{...r,...s}}}if(a&&a!=="media")return`${n}, ${a.replace("%s",String(t))}`}else if(t){if(a==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[n]:r}};if(a)return a.replace("%s",String(t))}return n};function to(e,t){t.forEach(r=>{e[r]||(e[r]={})})}function l(e,t,r){!e[t]&&r&&(e[t]=r)}function ue(e){return typeof e!="string"||!e.startsWith("hsl")?e:Et(e)}function V(e,t){`${t}Channel`in e||(e[`${t}Channel`]=ce(ue(e[t])))}function ro(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const N=e=>{try{return e()}catch{}},no=(e="mui")=>An(e);function ze(e,t,r,n){if(!t)return;t=t===!0?{}:t;const o=n==="dark"?"dark":"light";if(!r){e[n]=qn({...t,palette:{mode:o,...t==null?void 0:t.palette}});return}const{palette:a,...s}=Ce({...r,palette:{mode:o,...t==null?void 0:t.palette}});return e[n]={...t,palette:a,opacity:{...Lt(o),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||jt(o)},s}function oo(e={},...t){const{colorSchemes:r={light:!0},defaultColorScheme:n,disableCssColorScheme:o=!1,cssVarPrefix:a="mui",shouldSkipGeneratingVar:s=Jn,colorSchemeSelector:c=r.light&&r.dark?"media":void 0,rootSelector:u=":root",...f}=e,p=Object.keys(r)[0],g=n||(r.light&&p!=="light"?"light":p),d=no(a),{[g]:b,light:h,dark:S,...I}=r,F={...I};let D=b;if((g==="dark"&&!("dark"in r)||g==="light"&&!("light"in r))&&(D=!0),!D)throw new Error(J(21,g));const w=ze(F,D,f,g);h&&!F.light&&ze(F,h,void 0,"light"),S&&!F.dark&&ze(F,S,void 0,"dark");let y={defaultColorScheme:g,...w,cssVarPrefix:a,colorSchemeSelector:c,rootSelector:u,getCssVar:d,colorSchemes:F,font:{...Fn(w.typography),...w.font},spacing:ro(f.spacing)};Object.keys(y.colorSchemes).forEach(R=>{const i=y.colorSchemes[R].palette,m=C=>{const A=C.split("-"),K=A[1],L=A[2];return d(C,i[K][L])};if(i.mode==="light"&&(l(i.common,"background","#fff"),l(i.common,"onBackground","#000")),i.mode==="dark"&&(l(i.common,"background","#000"),l(i.common,"onBackground","#fff")),to(i,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),i.mode==="light"){l(i.Alert,"errorColor",x(i.error.light,.6)),l(i.Alert,"infoColor",x(i.info.light,.6)),l(i.Alert,"successColor",x(i.success.light,.6)),l(i.Alert,"warningColor",x(i.warning.light,.6)),l(i.Alert,"errorFilledBg",m("palette-error-main")),l(i.Alert,"infoFilledBg",m("palette-info-main")),l(i.Alert,"successFilledBg",m("palette-success-main")),l(i.Alert,"warningFilledBg",m("palette-warning-main")),l(i.Alert,"errorFilledColor",N(()=>i.getContrastText(i.error.main))),l(i.Alert,"infoFilledColor",N(()=>i.getContrastText(i.info.main))),l(i.Alert,"successFilledColor",N(()=>i.getContrastText(i.success.main))),l(i.Alert,"warningFilledColor",N(()=>i.getContrastText(i.warning.main))),l(i.Alert,"errorStandardBg",T(i.error.light,.9)),l(i.Alert,"infoStandardBg",T(i.info.light,.9)),l(i.Alert,"successStandardBg",T(i.success.light,.9)),l(i.Alert,"warningStandardBg",T(i.warning.light,.9)),l(i.Alert,"errorIconColor",m("palette-error-main")),l(i.Alert,"infoIconColor",m("palette-info-main")),l(i.Alert,"successIconColor",m("palette-success-main")),l(i.Alert,"warningIconColor",m("palette-warning-main")),l(i.AppBar,"defaultBg",m("palette-grey-100")),l(i.Avatar,"defaultBg",m("palette-grey-400")),l(i.Button,"inheritContainedBg",m("palette-grey-300")),l(i.Button,"inheritContainedHoverBg",m("palette-grey-A100")),l(i.Chip,"defaultBorder",m("palette-grey-400")),l(i.Chip,"defaultAvatarColor",m("palette-grey-700")),l(i.Chip,"defaultIconColor",m("palette-grey-700")),l(i.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),l(i.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),l(i.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),l(i.LinearProgress,"primaryBg",T(i.primary.main,.62)),l(i.LinearProgress,"secondaryBg",T(i.secondary.main,.62)),l(i.LinearProgress,"errorBg",T(i.error.main,.62)),l(i.LinearProgress,"infoBg",T(i.info.main,.62)),l(i.LinearProgress,"successBg",T(i.success.main,.62)),l(i.LinearProgress,"warningBg",T(i.warning.main,.62)),l(i.Skeleton,"bg",`rgba(${m("palette-text-primaryChannel")} / 0.11)`),l(i.Slider,"primaryTrack",T(i.primary.main,.62)),l(i.Slider,"secondaryTrack",T(i.secondary.main,.62)),l(i.Slider,"errorTrack",T(i.error.main,.62)),l(i.Slider,"infoTrack",T(i.info.main,.62)),l(i.Slider,"successTrack",T(i.success.main,.62)),l(i.Slider,"warningTrack",T(i.warning.main,.62));const C=ye(i.background.default,.8);l(i.SnackbarContent,"bg",C),l(i.SnackbarContent,"color",N(()=>i.getContrastText(C))),l(i.SpeedDialAction,"fabHoverBg",ye(i.background.paper,.15)),l(i.StepConnector,"border",m("palette-grey-400")),l(i.StepContent,"border",m("palette-grey-400")),l(i.Switch,"defaultColor",m("palette-common-white")),l(i.Switch,"defaultDisabledColor",m("palette-grey-100")),l(i.Switch,"primaryDisabledColor",T(i.primary.main,.62)),l(i.Switch,"secondaryDisabledColor",T(i.secondary.main,.62)),l(i.Switch,"errorDisabledColor",T(i.error.main,.62)),l(i.Switch,"infoDisabledColor",T(i.info.main,.62)),l(i.Switch,"successDisabledColor",T(i.success.main,.62)),l(i.Switch,"warningDisabledColor",T(i.warning.main,.62)),l(i.TableCell,"border",T(he(i.divider,1),.88)),l(i.Tooltip,"bg",he(i.grey[700],.92))}if(i.mode==="dark"){l(i.Alert,"errorColor",T(i.error.light,.6)),l(i.Alert,"infoColor",T(i.info.light,.6)),l(i.Alert,"successColor",T(i.success.light,.6)),l(i.Alert,"warningColor",T(i.warning.light,.6)),l(i.Alert,"errorFilledBg",m("palette-error-dark")),l(i.Alert,"infoFilledBg",m("palette-info-dark")),l(i.Alert,"successFilledBg",m("palette-success-dark")),l(i.Alert,"warningFilledBg",m("palette-warning-dark")),l(i.Alert,"errorFilledColor",N(()=>i.getContrastText(i.error.dark))),l(i.Alert,"infoFilledColor",N(()=>i.getContrastText(i.info.dark))),l(i.Alert,"successFilledColor",N(()=>i.getContrastText(i.success.dark))),l(i.Alert,"warningFilledColor",N(()=>i.getContrastText(i.warning.dark))),l(i.Alert,"errorStandardBg",x(i.error.light,.9)),l(i.Alert,"infoStandardBg",x(i.info.light,.9)),l(i.Alert,"successStandardBg",x(i.success.light,.9)),l(i.Alert,"warningStandardBg",x(i.warning.light,.9)),l(i.Alert,"errorIconColor",m("palette-error-main")),l(i.Alert,"infoIconColor",m("palette-info-main")),l(i.Alert,"successIconColor",m("palette-success-main")),l(i.Alert,"warningIconColor",m("palette-warning-main")),l(i.AppBar,"defaultBg",m("palette-grey-900")),l(i.AppBar,"darkBg",m("palette-background-paper")),l(i.AppBar,"darkColor",m("palette-text-primary")),l(i.Avatar,"defaultBg",m("palette-grey-600")),l(i.Button,"inheritContainedBg",m("palette-grey-800")),l(i.Button,"inheritContainedHoverBg",m("palette-grey-700")),l(i.Chip,"defaultBorder",m("palette-grey-700")),l(i.Chip,"defaultAvatarColor",m("palette-grey-300")),l(i.Chip,"defaultIconColor",m("palette-grey-300")),l(i.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),l(i.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),l(i.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),l(i.LinearProgress,"primaryBg",x(i.primary.main,.5)),l(i.LinearProgress,"secondaryBg",x(i.secondary.main,.5)),l(i.LinearProgress,"errorBg",x(i.error.main,.5)),l(i.LinearProgress,"infoBg",x(i.info.main,.5)),l(i.LinearProgress,"successBg",x(i.success.main,.5)),l(i.LinearProgress,"warningBg",x(i.warning.main,.5)),l(i.Skeleton,"bg",`rgba(${m("palette-text-primaryChannel")} / 0.13)`),l(i.Slider,"primaryTrack",x(i.primary.main,.5)),l(i.Slider,"secondaryTrack",x(i.secondary.main,.5)),l(i.Slider,"errorTrack",x(i.error.main,.5)),l(i.Slider,"infoTrack",x(i.info.main,.5)),l(i.Slider,"successTrack",x(i.success.main,.5)),l(i.Slider,"warningTrack",x(i.warning.main,.5));const C=ye(i.background.default,.98);l(i.SnackbarContent,"bg",C),l(i.SnackbarContent,"color",N(()=>i.getContrastText(C))),l(i.SpeedDialAction,"fabHoverBg",ye(i.background.paper,.15)),l(i.StepConnector,"border",m("palette-grey-600")),l(i.StepContent,"border",m("palette-grey-600")),l(i.Switch,"defaultColor",m("palette-grey-300")),l(i.Switch,"defaultDisabledColor",m("palette-grey-600")),l(i.Switch,"primaryDisabledColor",x(i.primary.main,.55)),l(i.Switch,"secondaryDisabledColor",x(i.secondary.main,.55)),l(i.Switch,"errorDisabledColor",x(i.error.main,.55)),l(i.Switch,"infoDisabledColor",x(i.info.main,.55)),l(i.Switch,"successDisabledColor",x(i.success.main,.55)),l(i.Switch,"warningDisabledColor",x(i.warning.main,.55)),l(i.TableCell,"border",x(he(i.divider,1),.68)),l(i.Tooltip,"bg",he(i.grey[700],.92))}V(i.background,"default"),V(i.background,"paper"),V(i.common,"background"),V(i.common,"onBackground"),V(i,"divider"),Object.keys(i).forEach(C=>{const A=i[C];C!=="tonalOffset"&&A&&typeof A=="object"&&(A.main&&l(i[C],"mainChannel",ce(ue(A.main))),A.light&&l(i[C],"lightChannel",ce(ue(A.light))),A.dark&&l(i[C],"darkChannel",ce(ue(A.dark))),A.contrastText&&l(i[C],"contrastTextChannel",ce(ue(A.contrastText))),C==="text"&&(V(i[C],"primary"),V(i[C],"secondary")),C==="action"&&(A.active&&V(i[C],"active"),A.selected&&V(i[C],"selected")))})}),y=t.reduce((R,i)=>j(R,i),y);const P={prefix:a,disableCssColorScheme:o,shouldSkipGeneratingVar:s,getSelector:eo(y)},{vars:v,generateThemeVars:B,generateStyleSheets:M}=$n(y,P);return y.vars=v,Object.entries(y.colorSchemes[y.defaultColorScheme]).forEach(([R,i])=>{y[R]=i}),y.generateThemeVars=B,y.generateStyleSheets=M,y.generateSpacing=function(){return vt(f.spacing,qe(this))},y.getColorSchemeSelector=kn(c),y.spacing=y.generateSpacing(),y.shouldSkipGeneratingVar=s,y.unstable_sxConfig={...De,...f==null?void 0:f.unstable_sxConfig},y.unstable_sx=function(i){return ie({sx:i,theme:this})},y.toRuntimeSource=Ft,y}function yt(e,t,r){e.colorSchemes&&r&&(e.colorSchemes[t]={...r!==!0&&r,palette:rt({...r===!0?{}:r.palette,mode:t})})}function io(e={},...t){const{palette:r,cssVariables:n=!1,colorSchemes:o=r?void 0:{light:!0},defaultColorScheme:a=r==null?void 0:r.mode,...s}=e,c=a||"light",u=o==null?void 0:o[c],f={...o,...r?{[c]:{...typeof u!="boolean"&&u,palette:r}}:void 0};if(n===!1){if(!("colorSchemes"in e))return Ce(e,...t);let p=r;"palette"in e||f[c]&&(f[c]!==!0?p=f[c].palette:c==="dark"&&(p={mode:"dark"}));const g=Ce({...e,palette:p},...t);return g.defaultColorScheme=c,g.colorSchemes=f,g.palette.mode==="light"&&(g.colorSchemes.light={...f.light!==!0&&f.light,palette:g.palette},yt(g,"dark",f.dark)),g.palette.mode==="dark"&&(g.colorSchemes.dark={...f.dark!==!0&&f.dark,palette:g.palette},yt(g,"light",f.light)),g}return!r&&!("light"in f)&&c==="light"&&(f.light=!0),oo({...s,colorSchemes:f,defaultColorScheme:c,...typeof n!="boolean"&&n},...t)}const ao=io(),so="$$material";function lo(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const co=e=>lo(e)&&e!=="classes",$o=ln({themeId:so,defaultTheme:ao,rootShouldForwardProp:co}),ko=wn;function vo(e){return Cn(e)}export{zn as $,J as A,oo as B,Nt as C,bo as D,vo as E,Hn as F,$o as G,ko as H,et as I,tt as J,yn as K,bn as L,co as M,Pe as N,lo as O,Ut as P,He as Q,mn as R,Ao as S,so as T,Et as U,Q as V,We as W,hn as X,Ve as Y,To as Z,Vn as _,ie as a,qn as a0,Qn as a1,Jn as a2,Dn as a3,Ln as a4,Zn as a5,St as a6,ao as a7,xo as a8,Y as a9,De as aa,q as ab,ln as b,So as c,wt as d,yo as e,_t as f,Yt as g,U as h,qe as i,qr as j,j as k,pe as l,Co as m,te as n,de as o,ne as p,vn as q,wo as r,Jr as s,re as t,le as u,Z as v,ee as w,vt as x,tn as y,io as z};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./DefaultPropsProvider-BxjOYH1h.js";import{i as C}from"./iobroker_admin__loadShare__react__loadShare__-CuzHmAOj.js";import{i as s,a as S,ae as M}from"./bootstrap-B3ZI_-0g.js";import{C as B}from"./Config-LH40Fzyp.js";import"./iobroker_admin__loadShare__prop_mf_2_types__loadShare__-pDONiJUe.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-CHE4rLsT.js";import"./emotion-serialize.esm-Q4o_CgeF.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-CXogaIXO.js";import"./ace-1DqSbvTN.js";import"./FilledInput-B9JSi0Ta.js";import"./preload-helper-Dp1pzeXC.js";import"./ThemeProvider-DHntAcOp.js";import"./emotion-cache.browser.esm-BgJfNZJN.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-DIpcqFbm.js";import"./extends-CF3RwP-h.js";const T="0 2px 2px 0 rgba(0, 0, 0, .14),0 3px 1px -2px rgba(0, 0, 0, .12),0 1px 5px 0 rgba(0, 0, 0, .2)",R="0 8px 17px 0 rgba(0, 0, 0, .2),0 6px 20px 0 rgba(0, 0, 0, .19)",n={root:o=>({position:"relative",m:"10px",width:300,minHeight:200,background:o.palette.background.default,boxShadow:T,display:"flex",transition:"box-shadow 0.5s",cursor:"pointer","&:hover":{boxShadow:R}}),imageBlock:{background:"silver",minHeight:60,display:"flex",padding:"0 10px 0 10px",position:"relative",justifyContent:"space-between",transition:"background 0.5s"},img:{width:60,height:60,marginTop:20,position:"relative","&:after":{content:'""',position:"absolute",zIndex:2,top:0,left:0,width:"100%",height:"100%",background:'url("img/no-image.svg") 100% 100% no-repeat',backgroundSize:"cover",backgroundColor:"#fff"}},adapter:{width:"100%",fontWeight:"bold",fontSize:15,verticalAlign:"middle",marginTop:"auto",borderTop:"1px solid silver",padding:"20px 4px",textAlign:"center",textTransform:"uppercase",textOverflow:"ellipsis",overflow:"hidden",color:"#ffab40"},instanceStateNotAlive1:{backgroundColor:"rgba(192, 192, 192, 0.4)"},wrapperDesc:{display:"flex",flexDirection:"column",width:"100%",overflow:"hidden"},desc:{padding:20,fontSize:15}};function z(o,r){return o&&typeof o=="object"?o[r]||o.en||"":o||""}const A=({icon:o,id:r,desc:d,lang:l,navigate:p})=>e.jsxs(s.Card,{onClick:p,sx:n.root,children:[e.jsx("div",{style:{...n.imageBlock,...n.instanceStateNotAlive1},children:e.jsx(s.CardMedia,{sx:n.img,component:"img",image:`adapter/${r.split(".")[0]}/${o}`})}),e.jsxs("div",{style:n.wrapperDesc,children:[e.jsx("div",{style:n.desc,children:z(d,l)}),e.jsx("div",{style:n.adapter,children:r})]})]}),t={appBar:o=>({transition:o.transitions.create(["margin","width"],{easing:o.transitions.easing.sharp,duration:o.transitions.duration.leavingScreen})}),wrapperEasyMode:{height:"100%",borderRadius:0},wrapperCard:{padding:"80px 20px 20px",height:"100%",overflowY:"auto"},controlHeight:{display:"flex",flexFlow:"wrap",justifyContent:"center"},img:{width:60,height:60,position:"relative",borderRadius:60},logoWhite:{background:"white"},wrapperHeader:{display:"flex",alignItems:"center"},headerName:{fontSize:24,marginLeft:10},toolBar:{justifyContent:"space-between",margin:"5px 0"},paper:{height:"100%",paddingTop:80},iframe:{height:"100%",width:"100%",background:"#FFF",color:"#000",borderRadius:5,border:"1px solid #888"},IconButtons:{display:"flex"},logoPointer:{cursor:"pointer"}};class K extends C.Component{constructor(r){super(r),this.state={configs:this.props.configs,strictMode:!this.props.configs}}componentDidMount(){this.props.configs||this.props.socket.getEasyMode().then(r=>this.setState({configs:r.configs}))}render(){const{t:r,themeName:d,toggleTheme:l,navigate:p,location:f,socket:x,themeType:b,theme:_,width:u,isFloatComma:y,dateFormat:v,configStored:w,getLocation:g,adminInstance:j}=this.props,{configs:m,strictMode:h}=this.state;if(!m)return e.jsx(s.CircularProgress,{});const k=f.id,i=m.find(({id:a})=>a===k);return e.jsxs(s.Paper,{style:t.wrapperEasyMode,children:[e.jsx(s.AppBar,{color:"default",position:"fixed",sx:t.appBar,children:e.jsxs(s.Toolbar,{style:t.toolBar,children:[e.jsxs("div",{style:t.wrapperHeader,children:[e.jsx(s.CardMedia,{onClick:h&&!g().dialog||i!=null&&i.tab?()=>p(i!=null&&i.tab?"easy":"tab-intro"):null,style:{...t.img,...d==="colored"?t.logoWhite:void 0,...h&&!g().dialog||i!=null&&i.tab?t.logoPointer:void 0},component:"img",image:"img/no-image.svg"}),e.jsx("div",{style:t.headerName,children:r("Easy Admin")})]}),e.jsxs("div",{style:t.IconButtons,children:[(h&&!g().dialog||(i==null?void 0:i.tab))&&e.jsx(s.IconButton,{size:"large",onClick:()=>p(i!=null&&i.tab?"easy":"tab-intro"),children:e.jsx(S.ArrowBack,{})}),e.jsx(M,{t:r,toggleTheme:l,themeName:d,size:"large"})]})]})}),i?e.jsx(s.Paper,{style:t.paper,children:e.jsx(B,{expertMode:!0,style:t.iframe,adapter:i.id.split(".")[0],instance:parseInt(i.id.split(".")[1],10),jsonConfig:i.jsonConfig,materialize:i.materialize,tab:i==null?void 0:i.tab,socket:x,easyMode:!0,themeName:d,themeType:b,theme:_,width:u,t:r,lang:this.props.lang,icon:i.icon,adminInstance:j,configStored:w,dateFormat:v,isFloatComma:y,onRegisterIframeRef:a=>this.props.onRegisterIframeRef(a),onUnregisterIframeRef:a=>this.props.onUnregisterIframeRef(a),handleNavigation:this.props.handleNavigation})}):e.jsx("div",{style:t.wrapperCard,children:e.jsx("div",{style:t.controlHeight,children:m.sort((a,c)=>a.id<c.id?-1:a.id>c.id?1:0).map(a=>e.jsx(A,{lang:this.props.lang,navigate:()=>p(null,"config",a.id),...a},a.id))})})]})}}export{K as default};
|