iobroker.admin 7.7.2 → 7.7.15

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.
Files changed (236) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +120 -13
  3. package/admin/README.md +3 -0
  4. package/admin/admin.png +0 -0
  5. package/admin/i18n/de.json +1 -1
  6. package/admin/i18n/es.json +1 -1
  7. package/admin/i18n/fr.json +1 -1
  8. package/admin/i18n/it.json +1 -1
  9. package/admin/i18n/nl.json +1 -1
  10. package/admin/i18n/pl.json +1 -1
  11. package/admin/i18n/pt.json +1 -1
  12. package/admin/i18n/ru.json +1 -1
  13. package/admin/i18n/uk.json +1 -1
  14. package/admin/i18n/zh-cn.json +1 -1
  15. package/admin/jsonConfig.json5 +1 -2
  16. package/adminWww/assets/AdapterUpdateDialog-CJRQB5ud.js +2 -0
  17. package/adminWww/assets/Adapters-B5LWXJ3G.js +9 -0
  18. package/adminWww/assets/Config-D3mtokJQ.js +1 -0
  19. package/adminWww/assets/CustomModal-DCjdghJB.js +1 -0
  20. package/adminWww/assets/CustomTab-CBVvppVS.js +1 -0
  21. package/adminWww/assets/DefaultPropsProvider-BZ42HOhu.js +15 -0
  22. package/adminWww/assets/DefaultPropsProvider-DoV5d6EJ.js +1 -0
  23. package/adminWww/assets/EasyMode-CR0Vw-OT.js +1 -0
  24. package/adminWww/assets/Enums-BImz5cPM.js +111 -0
  25. package/adminWww/assets/Fields-V2W2HJlv.js +1 -0
  26. package/adminWww/assets/Files-Ci2XDKh8.js +6 -0
  27. package/adminWww/assets/FilledInput-0vrRQpr_.js +2 -0
  28. package/adminWww/assets/Google-FmfjVx6X.js +27 -0
  29. package/adminWww/assets/Hosts-AXD2lYOf.js +121 -0
  30. package/adminWww/assets/Instances-j88MVgOp.js +2 -0
  31. package/adminWww/assets/Intro-DH7_8X9J.js +2 -0
  32. package/adminWww/assets/Logs-BJEYaBGh.js +1 -0
  33. package/adminWww/assets/Objects-CeqK8jeG.js +60 -0
  34. package/adminWww/assets/State-DhReNijC.js +1 -0
  35. package/adminWww/assets/TextField-fjsX40wR.js +138 -0
  36. package/adminWww/assets/Users-BJgk5zRR.js +1 -0
  37. package/adminWww/assets/___vite-browser-external_commonjs-proxy-DMh1aSo_.js +1 -0
  38. package/adminWww/assets/_commonjs-dynamic-modules-TDtrdbi3.js +1 -0
  39. package/adminWww/assets/_commonjsHelpers-CE1G-McA.js +1 -0
  40. package/adminWww/assets/ace-DgO9yth5.js +985 -0
  41. package/adminWww/assets/assertThisInitialized-CKqanoMB.js +1 -0
  42. package/adminWww/assets/blueGrey-BFcAYvAO.js +29 -0
  43. package/adminWww/assets/{bootstrap-CrpeRPv0.css → bootstrap-DSlxhDzw.css} +1 -1
  44. package/adminWww/assets/bootstrap-xC60EdKn.js +303 -0
  45. package/adminWww/assets/createSvgIcon-CC7aIjya.js +1 -0
  46. package/adminWww/assets/createTheme-O_VGsRib.js +16 -0
  47. package/adminWww/assets/defaultTheme-CF56WVgQ.js +1 -0
  48. package/adminWww/assets/emotion-cache.browser.esm-BgJfNZJN.js +1 -0
  49. package/adminWww/assets/emotion-react.browser.esm-LdYA3M0T.js +8 -0
  50. package/adminWww/assets/emotion-serialize.esm-Q4o_CgeF.js +1 -0
  51. package/adminWww/assets/emotion-styled.browser.esm-D6u524ZG.js +1 -0
  52. package/adminWww/assets/emotion-use-insertion-effect-with-fallbacks.browser.esm-q3_hvwuL.js +1 -0
  53. package/adminWww/assets/en-US-B8gg5zk_.js +1 -0
  54. package/adminWww/assets/ext-language_tools-DJmHbGA8.js +389 -0
  55. package/adminWww/assets/geosearch.module-BN92cSpK.js +1 -0
  56. package/adminWww/assets/{hostInit-fzxL8JAx.js → hostInit-OBG53iVO.js} +2 -2
  57. package/adminWww/assets/iconBase-CB0tx1VT.js +1 -0
  58. package/adminWww/assets/{index-D--ojYan.js → index-28qkNZAi.js} +1 -1
  59. package/adminWww/assets/index-8V8iNIbi.js +5 -0
  60. package/adminWww/assets/{index-CJvbfjSs.js → index-B0C4gXUO.js} +1 -1
  61. package/adminWww/assets/index-B5NvG6mn.js +2 -0
  62. package/adminWww/assets/index-BVQ-ZSLt.js +10 -0
  63. package/adminWww/assets/index-B_eoqXoQ.js +890 -0
  64. package/adminWww/assets/index-Bc8bBbjM.js +15 -0
  65. package/adminWww/assets/{index-Co3YA5NW.js → index-BgpTxVrG.js} +1 -1
  66. package/adminWww/assets/{index-DTGUg51P.js → index-C73G-H4k.js} +2 -2
  67. package/adminWww/assets/{index-rKfs-rCa.js → index-CbQYNHIO.js} +1 -1
  68. package/adminWww/assets/index-ChtI58Wj.js +1 -0
  69. package/adminWww/assets/index-CkI9667U.js +1 -0
  70. package/adminWww/assets/index-DEgEIbz9.js +1 -0
  71. package/adminWww/assets/index-DYa0xJDK.js +1 -0
  72. package/adminWww/assets/index-Dy_ekAsY.js +1 -0
  73. package/adminWww/assets/index-d-Zo1uu9.js +55 -0
  74. 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
  75. package/adminWww/assets/iobroker_admin__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-D-aUnioX.js +1 -0
  76. package/adminWww/assets/iobroker_admin__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__-DQH_iIDO.js +1 -0
  77. package/adminWww/assets/iobroker_admin__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-Dy1SQ0vs.js +1 -0
  78. package/adminWww/assets/{iobroker_admin__loadShare__leaflet__loadShare__-h9SMNPLU.js → iobroker_admin__loadShare__leaflet__loadShare__-BfU5U5_j.js} +1 -1
  79. package/adminWww/assets/iobroker_admin__loadShare__prop_mf_2_types__loadShare__-CpCTEixV.js +1 -0
  80. package/adminWww/assets/{iobroker_admin__loadShare__react__loadShare__-Bis6NHgw.js → iobroker_admin__loadShare__react__loadShare__-CMWK8WhK.js} +1 -1
  81. package/adminWww/assets/iobroker_admin__loadShare__react_mf_2_dom__loadShare__-GTRt2eft.js +1 -0
  82. package/adminWww/assets/iobroker_admin__loadShare__react_mf_2_dropzone__loadShare__-BF_gp27r.js +1 -0
  83. package/adminWww/assets/iobroker_admin__mf_v__runtimeInit__mf_v__-CHE4rLsT.js +5 -0
  84. package/adminWww/assets/leaflet-src-B98elavC.js +4 -0
  85. package/adminWww/assets/locale-ZVMVA5rz.js +1 -0
  86. package/adminWww/assets/pl-OOhGZ0tn.js +1 -0
  87. package/adminWww/assets/preload-helper-BDBacUwf.js +1 -0
  88. package/adminWww/assets/sdk-DTP6UH26.js +15 -0
  89. package/adminWww/assets/sentry-C8mPNiGL.js +1 -0
  90. package/adminWww/assets/useTheme-C-uGEZO5.js +1 -0
  91. package/adminWww/assets/useTheme-UOPilb5j.js +1 -0
  92. package/adminWww/assets/{zh-cn-vvAC9zpl.js → zh-cn-Dy5SHo8v.js} +13 -13
  93. package/adminWww/img/admin.png +0 -0
  94. package/adminWww/index.html +4 -4
  95. package/adminWww/lib/js/ace/ext-searchbox.js +1 -1
  96. package/adminWww/lib/js/socket.io.js +7 -1
  97. package/adminWww/mf-manifest.json +1 -1
  98. package/adminWww/remoteEntry.js +2 -2
  99. package/build/i18n/de.json +18 -0
  100. package/build/i18n/es.json +18 -0
  101. package/build/i18n/fr.json +18 -0
  102. package/build/i18n/it.json +18 -0
  103. package/build/i18n/nl.json +18 -0
  104. package/build/i18n/pl.json +18 -0
  105. package/build/i18n/pt.json +18 -0
  106. package/build/i18n/ru.json +18 -0
  107. package/build/i18n/uk.json +18 -0
  108. package/build/i18n/zh-cn.json +18 -0
  109. package/build/lib/checkLinuxPass.js.map +1 -0
  110. package/{build-backend → build}/lib/testPassword.js +1 -1
  111. package/build/lib/testPassword.js.map +1 -0
  112. package/{build-backend → build}/lib/translations.js +16 -1
  113. package/build/lib/translations.js.map +1 -0
  114. package/{build-backend → build}/lib/utils.js +20 -0
  115. package/build/lib/utils.js.map +1 -0
  116. package/{build-backend → build}/lib/web.js +6 -7
  117. package/build/lib/web.js.map +1 -0
  118. package/{build-backend → build}/main.js +68 -5
  119. package/build/main.js.map +1 -0
  120. package/io-package.json +27 -40
  121. package/package.json +117 -110
  122. package/adminWww/assets/AdapterUpdateDialog-DHGhgEEq.js +0 -2
  123. package/adminWww/assets/Adapters-CgSIajcF.js +0 -7
  124. package/adminWww/assets/Config-BQSl4bfA.js +0 -1
  125. package/adminWww/assets/CustomModal-DNMTLv4y.js +0 -1
  126. package/adminWww/assets/CustomTab-Bl8S8QZW.js +0 -1
  127. package/adminWww/assets/DefaultPropsProvider-u5xB1Fxz.js +0 -30
  128. package/adminWww/assets/EasyMode-xDbqrply.js +0 -1
  129. package/adminWww/assets/Enums-BSICIhWI.js +0 -111
  130. package/adminWww/assets/Fields-C3JkTmfP.js +0 -1
  131. package/adminWww/assets/Files-DK85-COY.js +0 -6
  132. package/adminWww/assets/FilledInput-CysG4ax_.js +0 -2
  133. package/adminWww/assets/Hosts-qIsB4Gub.js +0 -121
  134. package/adminWww/assets/Instances-BA_DCzs8.js +0 -2
  135. package/adminWww/assets/Intro-00oh6SLw.js +0 -2
  136. package/adminWww/assets/Logs-Cvpgh-zN.js +0 -1
  137. package/adminWww/assets/Objects-Dp71iotS.js +0 -60
  138. package/adminWww/assets/State-BqfD2ABf.js +0 -1
  139. package/adminWww/assets/Tabs-sxfWgN0b.js +0 -138
  140. package/adminWww/assets/Users-CDcWqTfZ.js +0 -1
  141. package/adminWww/assets/_commonjsHelpers-D6-XlEtG.js +0 -1
  142. package/adminWww/assets/ace-BG5WYul1.js +0 -985
  143. package/adminWww/assets/blueGrey-DYsiMDOn.js +0 -29
  144. package/adminWww/assets/bootstrap-BYQTdf9r.js +0 -2024
  145. package/adminWww/assets/createSvgIcon-Bh3KWtyp.js +0 -1
  146. package/adminWww/assets/emotion-cache.browser.esm-B8BFze5o.js +0 -1
  147. package/adminWww/assets/emotion-react.browser.esm-BCDt9NrH.js +0 -8
  148. package/adminWww/assets/emotion-serialize.esm-BUa21YfQ.js +0 -1
  149. package/adminWww/assets/emotion-styled.browser.esm-CyFqGgyG.js +0 -1
  150. package/adminWww/assets/emotion-utils.browser.esm-pglN4_eI.js +0 -1
  151. package/adminWww/assets/geosearch.module-DH4NhiPj.js +0 -1
  152. package/adminWww/assets/iconBase-C3vi24ZE.js +0 -1
  153. package/adminWww/assets/index-B1ITPhEY.js +0 -7
  154. package/adminWww/assets/index-C_-7Z7UV.js +0 -1
  155. package/adminWww/assets/index-D3IAEXXP.js +0 -10
  156. package/adminWww/assets/index-DPDg2YA0.js +0 -1
  157. package/adminWww/assets/index-Qa7Q_Dz5.js +0 -1
  158. package/adminWww/assets/index-qcIeekse.js +0 -55
  159. package/adminWww/assets/index-wN1ZlPSW.js +0 -2
  160. package/adminWww/assets/iobroker_admin__loadShare__prop_mf_2_types__loadShare__-BnsS7SOQ.js +0 -1
  161. package/adminWww/assets/iobroker_admin__mf_v__runtimeInit__mf_v__-CTkuGOOk.js +0 -5
  162. package/adminWww/assets/leaflet-src-A2ZHl6nF.js +0 -4
  163. package/adminWww/assets/locale-9HzB0nxi.js +0 -1
  164. package/adminWww/assets/preload-helper-Dp1pzeXC.js +0 -1
  165. package/adminWww/assets/sentry-H_UdJ2zx.js +0 -1
  166. package/adminWww/lib/js/crypto-js/aes.js +0 -234
  167. package/adminWww/lib/js/crypto-js/blowfish.js +0 -471
  168. package/adminWww/lib/js/crypto-js/bower.json +0 -39
  169. package/adminWww/lib/js/crypto-js/cipher-core.js +0 -895
  170. package/adminWww/lib/js/crypto-js/core.js +0 -807
  171. package/adminWww/lib/js/crypto-js/crypto-js.js +0 -6657
  172. package/adminWww/lib/js/crypto-js/docs/QuickStartGuide.wiki +0 -470
  173. package/adminWww/lib/js/crypto-js/enc-base64.js +0 -136
  174. package/adminWww/lib/js/crypto-js/enc-base64url.js +0 -148
  175. package/adminWww/lib/js/crypto-js/enc-hex.js +0 -18
  176. package/adminWww/lib/js/crypto-js/enc-latin1.js +0 -18
  177. package/adminWww/lib/js/crypto-js/enc-utf16.js +0 -149
  178. package/adminWww/lib/js/crypto-js/enc-utf8.js +0 -18
  179. package/adminWww/lib/js/crypto-js/evpkdf.js +0 -134
  180. package/adminWww/lib/js/crypto-js/format-hex.js +0 -66
  181. package/adminWww/lib/js/crypto-js/format-openssl.js +0 -18
  182. package/adminWww/lib/js/crypto-js/hmac-md5.js +0 -18
  183. package/adminWww/lib/js/crypto-js/hmac-ripemd160.js +0 -18
  184. package/adminWww/lib/js/crypto-js/hmac-sha1.js +0 -18
  185. package/adminWww/lib/js/crypto-js/hmac-sha224.js +0 -18
  186. package/adminWww/lib/js/crypto-js/hmac-sha256.js +0 -18
  187. package/adminWww/lib/js/crypto-js/hmac-sha3.js +0 -18
  188. package/adminWww/lib/js/crypto-js/hmac-sha384.js +0 -18
  189. package/adminWww/lib/js/crypto-js/hmac-sha512.js +0 -18
  190. package/adminWww/lib/js/crypto-js/hmac.js +0 -143
  191. package/adminWww/lib/js/crypto-js/index.js +0 -18
  192. package/adminWww/lib/js/crypto-js/lib-typedarrays.js +0 -76
  193. package/adminWww/lib/js/crypto-js/md5.js +0 -268
  194. package/adminWww/lib/js/crypto-js/mode-cfb.js +0 -80
  195. package/adminWww/lib/js/crypto-js/mode-ctr-gladman.js +0 -116
  196. package/adminWww/lib/js/crypto-js/mode-ctr.js +0 -58
  197. package/adminWww/lib/js/crypto-js/mode-ecb.js +0 -40
  198. package/adminWww/lib/js/crypto-js/mode-ofb.js +0 -54
  199. package/adminWww/lib/js/crypto-js/package.json +0 -42
  200. package/adminWww/lib/js/crypto-js/pad-ansix923.js +0 -49
  201. package/adminWww/lib/js/crypto-js/pad-iso10126.js +0 -44
  202. package/adminWww/lib/js/crypto-js/pad-iso97971.js +0 -40
  203. package/adminWww/lib/js/crypto-js/pad-nopadding.js +0 -30
  204. package/adminWww/lib/js/crypto-js/pad-pkcs7.js +0 -18
  205. package/adminWww/lib/js/crypto-js/pad-zeropadding.js +0 -47
  206. package/adminWww/lib/js/crypto-js/pbkdf2.js +0 -145
  207. package/adminWww/lib/js/crypto-js/rabbit-legacy.js +0 -190
  208. package/adminWww/lib/js/crypto-js/rabbit.js +0 -192
  209. package/adminWww/lib/js/crypto-js/rc4.js +0 -139
  210. package/adminWww/lib/js/crypto-js/ripemd160.js +0 -267
  211. package/adminWww/lib/js/crypto-js/sha1.js +0 -150
  212. package/adminWww/lib/js/crypto-js/sha224.js +0 -80
  213. package/adminWww/lib/js/crypto-js/sha256.js +0 -199
  214. package/adminWww/lib/js/crypto-js/sha3.js +0 -326
  215. package/adminWww/lib/js/crypto-js/sha384.js +0 -83
  216. package/adminWww/lib/js/crypto-js/sha512.js +0 -326
  217. package/adminWww/lib/js/crypto-js/tripledes.js +0 -779
  218. package/adminWww/lib/js/crypto-js/x64-core.js +0 -304
  219. package/build-backend/i18n/de.json +0 -18
  220. package/build-backend/i18n/es.json +0 -18
  221. package/build-backend/i18n/fr.json +0 -18
  222. package/build-backend/i18n/it.json +0 -18
  223. package/build-backend/i18n/nl.json +0 -18
  224. package/build-backend/i18n/pl.json +0 -18
  225. package/build-backend/i18n/pt.json +0 -18
  226. package/build-backend/i18n/ru.json +0 -18
  227. package/build-backend/i18n/uk.json +0 -18
  228. package/build-backend/i18n/zh-cn.json +0 -18
  229. package/build-backend/lib/checkLinuxPass.js.map +0 -1
  230. package/build-backend/lib/testPassword.js.map +0 -1
  231. package/build-backend/lib/translations.js.map +0 -1
  232. package/build-backend/lib/utils.js.map +0 -1
  233. package/build-backend/lib/web.js.map +0 -1
  234. package/build-backend/main.js.map +0 -1
  235. /package/{build-backend → build}/i18n/en.json +0 -0
  236. /package/{build-backend → build}/lib/checkLinuxPass.js +0 -0
@@ -1 +0,0 @@
1
- import{j as s,H as te,F as Te,J as U,E as K}from"./DefaultPropsProvider-u5xB1Fxz.js";import{i as L}from"./iobroker_admin__loadShare__react__loadShare__-Bis6NHgw.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-BYQTdf9r.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-CTkuGOOk.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};
@@ -1 +0,0 @@
1
- import{j as t}from"./DefaultPropsProvider-u5xB1Fxz.js";import{i as j}from"./iobroker_admin__loadShare__react__loadShare__-Bis6NHgw.js";import{U as w,i as e,I as l,a as s}from"./bootstrap-BYQTdf9r.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:_,fullWidth:p,help:c,maxWidth:C,progress:u,icon:r,disableApplyIfNotChanged:b,applyButton:m,onClose:g,children:I,titleButtonApply:k,titleButtonClose:S,onApply:h,textInput:x,defaultValue:i,overflowHidden:y,disableApply:B,theme:D})=>{const[a,d]=j.useState(i);j.useEffect(()=>{d(i)},[i]);let f=null;r&&(f=r);const A=w.getStyle(D,o.languageButtonActive);return t.jsxs(e.Dialog,{open:!0,maxWidth:C||"md",fullWidth:!!p,disableEscapeKeyDown:!1,onClose:g,sx:{"& .MuiPaper-root":o.modalDialog},children:[_&&t.jsxs(e.DialogTitle,{children:[r?t.jsx(f,{style:o.titleIcon}):null,_,l.getLanguage()!=="en"&&n?t.jsx(e.IconButton,{size:"large",style:{...o.languageButton,...v?A:void 0},onClick:()=>n(),title:l.t("Disable/Enable translation"),children:t.jsx(s.Language,{})}):null]}),t.jsxs(e.DialogContent,{style:{...y?o.overflowHidden:void 0,...o.content,paddingTop:8},children:[x&&t.jsx(e.TextField,{autoComplete:"off",fullWidth:!0,autoFocus:!0,variant:"standard",size:"medium",multiline:!0,value:a,onChange:W=>d(W.target.value),slotProps:{input:{endAdornment:a?t.jsx(e.InputAdornment,{position:"end",children:t.jsx(e.IconButton,{tabIndex:-1,size:"small",onClick:()=>d(""),children:t.jsx(s.Close,{})})}):null}}}),I,c?t.jsx("div",{children:c}):null]}),t.jsxs(e.DialogActions,{children:[(m===void 0||m)&&t.jsx(e.Button,{startIcon:t.jsx(s.Check,{}),disabled:B||u||b&&i===a,onClick:()=>h&&h(x?a:""),variant:"contained",color:"primary",children:l.t(k||"Ok")}),t.jsx(e.Button,{color:"grey",onClick:g,disabled:u,variant:"contained",startIcon:t.jsx(s.Close,{}),children:l.t(S||"Cancel")})]})]})};export{H as C};
@@ -1 +0,0 @@
1
- import{j as p}from"./DefaultPropsProvider-u5xB1Fxz.js";import{i as c}from"./iobroker_admin__loadShare__react__loadShare__-Bis6NHgw.js";import{f as g,J as h,R as f,i as l}from"./bootstrap-BYQTdf9r.js";import{l as u}from"./index-8HslT92O.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-CTkuGOOk.js";import"./iobroker_admin__loadShare__prop_mf_2_types__loadShare__-BnsS7SOQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./emotion-serialize.esm-BUa21YfQ.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-BOKYvG_W.js";import"./ace-BG5WYul1.js";import"./FilledInput-CysG4ax_.js";import"./preload-helper-Dp1pzeXC.js";import"./blueGrey-DYsiMDOn.js";import"./emotion-cache.browser.esm-B8BFze5o.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-h9SMNPLU.js";import"./extends-CF3RwP-h.js";const b={root:{display:"block",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 F extends c.Component{refIframe=null;registered=!1;constructor(e){super(e),this.state={href:"",adapterName:"",instanceNumber:null,schema:null,jsonData:{}}}async componentDidMount(){var m;!this.registered&&((m=this.refIframe)!=null&&m.contentWindow)&&(this.registered=!0,this.props.onRegisterIframeRef(this.refIframe)),(window.addEventListener||window.attachEvent)(window.addEventListener?"message":"onmessage",this.onMessage,!1);const e={};for(const a of this.props.hosts)e[a._id]=a;const t=await g.getHref(this.props.instancesWorker,this.props.tab,this.props.hostname,e,this.props.adminInstance,this.props.theme.palette.mode);let s=null;const r=(t==null?void 0:t.href.split("?")[0])||"";let i={};if(r.endsWith(".json")||r.endsWith(".json5"))try{let a;const d=await this.props.socket.readFile(`${t.adapterName}.admin`,r,!0);d.file!==void 0&&(a=atob(d.file.toString()),a.startsWith("{")||(a=decodeURIComponent(a)));try{s=u.parse(a)}catch(o){console.error(`Cannot parse jsonConfig of ${t.adapterName}: ${o}`),window.alert(`Cannot parse jsonConfig of ${t.adapterName}: ${o}`)}if(s&&await h.loadI18n(this.props.socket,s.i18n,t.adapterName),s!=null&&s.command){const o=await this.props.socket.getState(`system.adapter.${t.adapterName}.${t.instanceNumber||0}.alive`);if(o!=null&&o.val){const n=await this.props.socket.sendTo(`${t.adapterName}.${t.instanceNumber||0}`,s==null?void 0:s.command,null);n!=null&&n.data&&(i=n.data)}}}catch(a){console.error(`Cannot load ${t.adapterName}.admin/${t.href}: ${a}`),window.alert(`Cannot load ${t.adapterName}.admin/${t.href}: ${a}`)}this.setState({href:t.href,adapterName:t.adapterName,instanceNumber:t.instanceNumber,schema:s,jsonData:i})}componentWillUnmount(){this.registered&&(this.props.onUnregisterIframeRef(this.refIframe),this.registered=!1),(window.removeEventListener||window.detachEvent)(window.removeEventListener?"message":"onmessage",this.onMessage,!1)}componentDidUpdate(){var e;!this.registered&&((e=this.refIframe)!=null&&e.contentWindow)&&(this.registered=!0,this.props.onRegisterIframeRef(this.refIframe))}onMessage=e=>{if(e.origin===window.location.origin){if(e.data==="close"||e.message==="close")f.doNavigate("tab-instances");else if(e.data==="change"||e.message==="change")console.warn('Application sends "change" message, but it is not processed yet');else if(e.data==="nochange"||e.message==="nochange")console.warn('Application sends "nochange" message, but it is not processed yet');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(":"),[s,r,i]=t.split("/");f.doNavigate(s,r,i)}}};render(){return this.state.href?this.state.href.includes(".json")?this.state.schema?p.jsx(h,{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}):p.jsx(l.LinearProgress,{}):p.jsx("iframe",{ref:e=>this.refIframe=e,title:this.props.tab,style:b.root,src:this.state.href,onError:e=>{e.target.onerror=null,this.setState({href:this.state.href.replace("tab_m.html","tab.html")})}}):p.jsx(l.LinearProgress,{})}}export{F as default};
@@ -1,30 +0,0 @@
1
- import{i as ue}from"./iobroker_admin__loadShare__react__loadShare__-Bis6NHgw.js";import"./iobroker_admin__loadShare__prop_mf_2_types__loadShare__-BnsS7SOQ.js";import{g as Ft}from"./_commonjsHelpers-D6-XlEtG.js";import{a as jt,b as Dt}from"./iobroker_admin__mf_v__runtimeInit__mf_v__-CTkuGOOk.js";import{s as Lt}from"./emotion-serialize.esm-BUa21YfQ.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-BOKYvG_W.js";function gt(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=gt(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function po(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=gt(e))&&(n&&(n+=" "),n+=t);return n}function X(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.`}const Mt="$$material",{loadShare:Wt}=Dt,{initPromise:Nt}=jt,Kt=Nt.then(e=>Wt("@emotion/styled",{customShareInfo:{shareConfig:{singleton:!0,strictVersion:!1,requiredVersion:"*"}}})),zt=await Kt.then(e=>e());var Gt=zt;const Ht=Ft(Gt);var pt={exports:{}},be={};/**
2
- * @license React
3
- * react-jsx-runtime.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its 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 Vt=ue,Yt=Symbol.for("react.element"),Ut=Symbol.for("react.fragment"),Qt=Object.prototype.hasOwnProperty,Xt=Vt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,qt={key:!0,ref:!0,__self:!0,__source:!0};function ht(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)Qt.call(t,n)&&!qt.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:Yt,type:e,key:a,ref:s,props:o,_owner:Xt.current}}be.Fragment=Ut;be.jsx=ht;be.jsxs=ht;pt.exports=be;var Jt=pt.exports;/**
10
- * @mui/styled-engine v6.4.11
11
- *
12
- * @license MIT
13
- * This source code is licensed under the MIT license found in the
14
- * LICENSE file in the root directory of this source tree.
15
- */function Zt(e,t){return Ht(e,t)}function er(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const tt=[];function rt(e){return tt[0]=e,Lt(tt)}var yt={exports:{}},$={};/**
16
- * @license React
17
- * react-is.production.js
18
- *
19
- * Copyright (c) Meta Platforms, Inc. and affiliates.
20
- *
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
- */var ze=Symbol.for("react.transitional.element"),Ge=Symbol.for("react.portal"),Se=Symbol.for("react.fragment"),Ce=Symbol.for("react.strict_mode"),we=Symbol.for("react.profiler"),Ae=Symbol.for("react.consumer"),xe=Symbol.for("react.context"),Te=Symbol.for("react.forward_ref"),$e=Symbol.for("react.suspense"),ke=Symbol.for("react.suspense_list"),ve=Symbol.for("react.memo"),_e=Symbol.for("react.lazy"),tr=Symbol.for("react.view_transition"),rr=Symbol.for("react.client.reference");function K(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case ze:switch(e=e.type,e){case Se:case we:case Ce:case $e:case ke:case tr:return e;default:switch(e=e&&e.$$typeof,e){case xe:case Te:case _e:case ve:return e;case Ae:return e;default:return t}}case Ge:return t}}}$.ContextConsumer=Ae;$.ContextProvider=xe;$.Element=ze;$.ForwardRef=Te;$.Fragment=Se;$.Lazy=_e;$.Memo=ve;$.Portal=Ge;$.Profiler=we;$.StrictMode=Ce;$.Suspense=$e;$.SuspenseList=ke;$.isContextConsumer=function(e){return K(e)===Ae};$.isContextProvider=function(e){return K(e)===xe};$.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ze};$.isForwardRef=function(e){return K(e)===Te};$.isFragment=function(e){return K(e)===Se};$.isLazy=function(e){return K(e)===_e};$.isMemo=function(e){return K(e)===ve};$.isPortal=function(e){return K(e)===Ge};$.isProfiler=function(e){return K(e)===we};$.isStrictMode=function(e){return K(e)===Ce};$.isSuspense=function(e){return K(e)===$e};$.isSuspenseList=function(e){return K(e)===ke};$.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Se||e===we||e===Ce||e===$e||e===ke||typeof e=="object"&&e!==null&&(e.$$typeof===_e||e.$$typeof===ve||e.$$typeof===xe||e.$$typeof===Ae||e.$$typeof===Te||e.$$typeof===rr||e.getModuleId!==void 0)};$.typeOf=K;yt.exports=$;var bt=yt.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 St(e){if(ue.isValidElement(e)||bt.isValidElementType(e)||!Y(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=St(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=>{ue.isValidElement(t[o])||bt.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])?St(t[o]):t[o]:n[o]=t[o]}),n}const nr=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 or(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5,...o}=e,a=nr(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,y){const h=s.indexOf(y);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]]:y)-n/100}${r})`}function p(d){return s.indexOf(d)+1<s.length?f(d,s[s.indexOf(d)+1]):c(d)}function m(d){const y=s.indexOf(d);return y===0?c(s[1]):y===s.length-1?u(s[y]):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:m,unit:r,...o}}function ir(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 ar(e,t){return t==="@"||t.startsWith("@")&&(e.some(r=>t.startsWith(`@${r}`))||!!t.match(/^@\d/))}function sr(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 lr(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 cr={borderRadius:4};function le(e,t){return t?j(e,t,{clone:!1}):e}const Oe={xs:0,sm:600,md:900,lg:1200,xl:1536},nt={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Oe[e]}px)`},ur={containerQueries:e=>({up:t=>{let r=typeof t=="number"?t:Oe[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||nt;return t.reduce((s,c,u)=>(s[a.up(a.keys[u])]=r(t[u]),s),{})}if(typeof t=="object"){const a=n.breakpoints||nt;return Object.keys(t).reduce((s,c)=>{if(ar(a.keys,c)){const u=sr(n.containerQueries?n:ur,c);u&&(s[u]=r(t[c],c))}else if(Object.keys(a.values||Oe).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 Ct(e={}){var r;return((r=e.keys)==null?void 0:r.reduce((n,o)=>{const a=e.up(o);return n[a]={},n},{}))||{}}function wt(e,t){return e.reduce((r,n)=>{const o=r[n];return(!o||Object.keys(o).length===0)&&delete r[n],r},t)}function ho(e,...t){const r=Ct(e),n=[r,...t].reduce((o,a)=>j(o,a),{});return wt(Object.keys(r),n)}function fr(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 yo({values:e,breakpoints:t,base:r}){const n=r||fr(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 At(e){if(typeof e!="string")throw new Error(X(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Be(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 he(e,t,r,n=r){let o;return typeof e=="function"?o=e(r):Array.isArray(e)?o=e[r]||n:o=Be(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=Be(u,n)||{};return U(s,c,m=>{let d=he(f,o,m);return m===d&&typeof m=="string"&&(d=he(f,o,`${t}${m==="default"?"":At(m)}`,m)),r===!1?d:{[r]:d}})};return a.propTypes={},a.filterProps=[t],a}function dr(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const mr={m:"margin",p:"padding"},gr={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},ot={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},pr=dr(e=>{if(e.length>2)if(ot[e])e=ot[e];else return[e];const[t,r]=e.split(""),n=mr[t],o=gr[r]||"";return Array.isArray(o)?o.map(a=>n+a):[n+o]}),He=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Ve=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...He,...Ve];function fe(e,t,r,n){const o=Be(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 Ye(e){return fe(e,"spacing",8)}function de(e,t){return typeof t=="string"||t==null?t:e(t)}function hr(e,t){return r=>e.reduce((n,o)=>(n[o]=de(t,r),n),{})}function yr(e,t,r,n){if(!t.includes(r))return null;const o=pr(r),a=hr(o,n),s=e[r];return U(e,s,a)}function xt(e,t){const r=Ye(e.theme);return Object.keys(e).map(n=>yr(e,t,n,r)).reduce(le,{})}function _(e){return xt(e,He)}_.propTypes={};_.filterProps=He;function O(e){return xt(e,Ve)}O.propTypes={};O.filterProps=Ve;function Tt(e=8,t=Ye({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 Ee(...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]?le(o,t[a](n)):o,{});return r.propTypes={},r.filterProps=e.reduce((n,o)=>n.concat(o.filterProps),[]),r}function N(e){return typeof e!="number"?e:`${e}px solid`}function z(e,t){return E({prop:e,themeKey:"borders",transform:t})}const br=z("border",N),Sr=z("borderTop",N),Cr=z("borderRight",N),wr=z("borderBottom",N),Ar=z("borderLeft",N),xr=z("borderColor"),Tr=z("borderTopColor"),$r=z("borderRightColor"),kr=z("borderBottomColor"),vr=z("borderLeftColor"),_r=z("outline",N),Or=z("outlineColor"),Pe=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=fe(e.theme,"shape.borderRadius",4),r=n=>({borderRadius:de(t,n)});return U(e,e.borderRadius,r)}return null};Pe.propTypes={};Pe.filterProps=["borderRadius"];Ee(br,Sr,Cr,wr,Ar,xr,Tr,$r,kr,vr,Pe,_r,Or);const Re=e=>{if(e.gap!==void 0&&e.gap!==null){const t=fe(e.theme,"spacing",8),r=n=>({gap:de(t,n)});return U(e,e.gap,r)}return null};Re.propTypes={};Re.filterProps=["gap"];const Ie=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=fe(e.theme,"spacing",8),r=n=>({columnGap:de(t,n)});return U(e,e.columnGap,r)}return null};Ie.propTypes={};Ie.filterProps=["columnGap"];const Fe=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=fe(e.theme,"spacing",8),r=n=>({rowGap:de(t,n)});return U(e,e.rowGap,r)}return null};Fe.propTypes={};Fe.filterProps=["rowGap"];const Br=E({prop:"gridColumn"}),Er=E({prop:"gridRow"}),Pr=E({prop:"gridAutoFlow"}),Rr=E({prop:"gridAutoColumns"}),Ir=E({prop:"gridAutoRows"}),Fr=E({prop:"gridTemplateColumns"}),jr=E({prop:"gridTemplateRows"}),Dr=E({prop:"gridTemplateAreas"}),Lr=E({prop:"gridArea"});Ee(Re,Ie,Fe,Br,Er,Pr,Rr,Ir,Fr,jr,Dr,Lr);function re(e,t){return t==="grey"?t:e}const Mr=E({prop:"color",themeKey:"palette",transform:re}),Wr=E({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:re}),Nr=E({prop:"backgroundColor",themeKey:"palette",transform:re});Ee(Mr,Wr,Nr);function L(e){return e<=1&&e!==0?`${e*100}%`:e}const Kr=E({prop:"width",transform:L}),Ue=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])||Oe[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:L(r)}};return U(e,e.maxWidth,t)}return null};Ue.filterProps=["maxWidth"];const zr=E({prop:"minWidth",transform:L}),Gr=E({prop:"height",transform:L}),Hr=E({prop:"maxHeight",transform:L}),Vr=E({prop:"minHeight",transform:L});E({prop:"size",cssProperty:"width",transform:L});E({prop:"size",cssProperty:"height",transform:L});const Yr=E({prop:"boxSizing"});Ee(Kr,Ue,zr,Gr,Hr,Vr,Yr);const je={border:{themeKey:"borders",transform:N},borderTop:{themeKey:"borders",transform:N},borderRight:{themeKey:"borders",transform:N},borderBottom:{themeKey:"borders",transform:N},borderLeft:{themeKey:"borders",transform:N},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:N},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Pe},color:{themeKey:"palette",transform:re},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:re},backgroundColor:{themeKey:"palette",transform:re},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:Re},rowGap:{style:Fe},columnGap:{style:Ie},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:L},maxWidth:{style:Ue},minWidth:{transform:L},height:{transform:L},maxHeight:{transform:L},minHeight:{transform:L},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 Ur(...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 Qr(e,t){return typeof e=="function"?e(t):e}function Xr(){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:m}=c;if(n==null)return null;if(f==="typography"&&n==="inherit")return{[r]:n};const d=Be(o,f)||{};return m?m(s):U(s,n,h=>{let C=he(d,p,h);return h===C&&typeof h=="string"&&(C=he(d,p,`${r}${h==="default"?"":At(h)}`,h)),u===!1?C:{[u]:C}})}function t(r){const{sx:n,theme:o={}}=r||{};if(!n)return null;const a=o.unstable_sxConfig??je;function s(c){let u=c;if(typeof c=="function")u=c(o);else if(typeof c!="object")return c;if(!u)return null;const f=Ct(o.breakpoints),p=Object.keys(f);let m=f;return Object.keys(u).forEach(d=>{const y=Qr(u[d],o);if(y!=null)if(typeof y=="object")if(a[d])m=le(m,e(d,y,o,a));else{const h=U({theme:o},y,C=>({[d]:C}));Ur(h,y)?m[d]=t({sx:y,theme:o}):m=le(m,h)}else m=le(m,e(d,y,o,a))}),ir(o,wt(p,m))}return Array.isArray(n)?n.map(s):s(n)}return t}const ne=Xr();ne.filterProps=["sx"];function qr(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=or(r),u=Tt(o);let f=j({breakpoints:c,direction:"ltr",components:{},palette:{mode:"light",...n},spacing:u,shape:{...cr,...a}},s);return f=lr(f),f.applyStyles=qr,f=t.reduce((p,m)=>j(p,m),f),f.unstable_sxConfig={...je,...s==null?void 0:s.unstable_sxConfig},f.unstable_sx=function(m){return ne({sx:m,theme:this})},f}const it=e=>e,Jr=()=>{let e=it;return{configure(t){e=t},generate(t){return e(t)},reset(){e=it}}},Zr=Jr(),en={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 tn(e,t,r="Mui"){const n=en[t];return n?`${r}-${n}`:`${Zr.generate(e)}-${t}`}function bo(e,t,r="Mui"){const n={};return t.forEach(o=>{n[o]=tn(e,o,r)}),n}function kt(e){const{variants:t,...r}=e,n={variants:t,style:rt(r),isProcessed:!0};return n.style===r||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=rt(o.style))}),n}const rn=$t();function Le(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function nn(e){return e?(t,r)=>r[e]:null}function on(e,t,r){e.theme=ln(e.theme)?r:e.theme[t]||e.theme}function pe(e,t){const r=typeof t=="function"?t(e):t;if(Array.isArray(r))return r.flatMap(n=>pe(e,n));if(Array.isArray(r==null?void 0:r.variants)){let n;if(r.isProcessed)n=r.style;else{const{variants:o,...a}=r;n=a}return vt(e,r.variants,[n])}return r!=null&&r.isProcessed?r.style:r}function vt(e,t,r=[]){var o;let n;e:for(let a=0;a<t.length;a+=1){const s=t[a];if(typeof s.props=="function"){if(n??={...e,...e.ownerState,ownerState:e.ownerState},!s.props(n))continue}else for(const c in s.props)if(e[c]!==s.props[c]&&((o=e.ownerState)==null?void 0:o[c])!==s.props[c])continue e;typeof s.style=="function"?(n??={...e,...e.ownerState,ownerState:e.ownerState},r.push(s.style(n))):r.push(s.style)}return r}function an(e={}){const{themeId:t,defaultTheme:r=rn,rootShouldForwardProp:n=Le,slotShouldForwardProp:o=Le}=e;function a(c){on(c,t,r)}return(c,u={})=>{er(c,w=>w.filter(B=>B!==ne));const{name:f,slot:p,skipVariantsResolver:m,skipSx:d,overridesResolver:y=nn(un(p)),...h}=u,C=m!==void 0?m:p&&p!=="Root"&&p!=="root"||!1,R=d||!1;let P=Le;p==="Root"||p==="root"?P=n:p?P=o:cn(c)&&(P=void 0);const M=Zt(c,{shouldForwardProp:P,label:sn(),...h}),A=w=>{if(w.__emotion_real===w)return w;if(typeof w=="function")return function(I){return pe(I,w)};if(Y(w)){const B=kt(w);return B.variants?function(D){return pe(D,B)}:B.style}return w},b=(...w)=>{const B=[],I=w.map(A),D=[];if(B.push(a),f&&y&&D.push(function(S){var oe,Ze;const F=(Ze=(oe=S.theme.components)==null?void 0:oe[f])==null?void 0:Ze.styleOverrides;if(!F)return null;const G={};for(const et in F)G[et]=pe(S,F[et]);return y(S,G)}),f&&!C&&D.push(function(S){var G,oe;const k=S.theme,F=(oe=(G=k==null?void 0:k.components)==null?void 0:G[f])==null?void 0:oe.variants;return F?vt(S,F):null}),R||D.push(ne),Array.isArray(I[0])){const g=I.shift(),S=new Array(B.length).fill(""),k=new Array(D.length).fill("");let F;F=[...S,...g,...k],F.raw=[...S,...g.raw,...k],B.unshift(F)}const W=[...B,...I,...D],i=M(...W);return c.muiName&&(i.muiName=c.muiName),i};return M.withConfig&&(b.withConfig=M.withConfig),b}}function sn(e,t){return void 0}function ln(e){for(const t in e)return!1;return!0}function cn(e){return typeof e=="string"&&e.charCodeAt(0)>96}function un(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function Ne(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]=Ne(a[u],s[u])}}}else r[o]===void 0&&(r[o]=e[o])}return r}function fn(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}function Qe(e,t=0,r=1){return fn(e,t,r)}function dn(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 mn(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(dn(e));const t=e.indexOf("("),r=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(r))throw new Error(X(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(X(10,o))}else n=n.split(",");return n=n.map(a=>parseFloat(a)),{type:r,values:n,colorSpace:o}}const gn=e=>{const t=Q(e);return t.values.slice(0,3).map((r,n)=>t.type.includes("hsl")&&n!==0?`${r}%`:r).join(" ")},ae=(e,t)=>{try{return gn(e)}catch{return e}};function De(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 So(e){if(e.startsWith("#"))return e;const{values:t}=Q(e);return`#${t.map((r,n)=>mn(n===3?Math.round(255*r):r)).join("")}`}function _t(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])),De({type:c,values:u})}function Ke(e){e=Q(e);let t=e.type==="hsl"||e.type==="hsla"?Q(_t(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 pn(e,t){const r=Ke(e),n=Ke(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function hn(e,t){return e=Q(e),t=Qe(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,De(e)}function me(e,t,r){try{return hn(e,t)}catch{return e}}function Xe(e,t){if(e=Q(e),t=Qe(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 De(e)}function x(e,t,r){try{return Xe(e,t)}catch{return e}}function qe(e,t){if(e=Q(e),t=Qe(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 De(e)}function T(e,t,r){try{return qe(e,t)}catch{return e}}function yn(e,t=.15){return Ke(e)>.5?Xe(e,t):qe(e,t)}function ge(e,t,r){try{return yn(e,t)}catch{return e}}function Co(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 Ot=ue.createContext(void 0);function wo({value:e,children:t}){return Jt.jsx(Ot.Provider,{value:e,children:t})}function bn(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?Ne(o.defaultProps,n):!o.styleOverrides&&!o.variants?Ne(o,n):n}function Sn({props:e,name:t}){const r=ue.useContext(Ot);return bn({props:e,name:t,theme:{components:r}})}const at={theme:void 0};function Cn(e){let t,r;return function(o){let a=t;return(a===void 0||o.theme!==r)&&(at.theme=o.theme,a=kt(e(at)),t=a,r=o.theme),a}}function wn(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 st=(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])})},An=(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)},xn=(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 Me(e,t){const{prefix:r,shouldSkipGeneratingVar:n}=t||{},o={},a={},s={};return An(e,(c,u,f)=>{if((typeof u=="string"||typeof u=="number")&&(!n||!n(c,u))){const p=`--${r?`${r}-`:""}${c.join("-")}`,m=xn(c,u);Object.assign(o,{[p]:m}),st(a,c,`var(${p})`,f),st(s,c,`var(${p}, ${m})`,f)}},c=>c[0]==="vars"),{css:o,vars:a,varsWithDefaults:s}}function Tn(e,t={}){const{getSelector:r=R,disableCssColorScheme:n,colorSchemeSelector:o}=t,{colorSchemes:a={},components:s,defaultColorScheme:c="light",...u}=e,{vars:f,css:p,varsWithDefaults:m}=Me(u,t);let d=m;const y={},{[c]:h,...C}=a;if(Object.entries(C||{}).forEach(([A,b])=>{const{vars:w,css:B,varsWithDefaults:I}=Me(b,t);d=j(d,I),y[A]={css:B,vars:w}}),h){const{css:A,vars:b,varsWithDefaults:w}=Me(h,t);d=j(d,w),y[c]={css:A,vars:b}}function R(A,b){var B,I;let w=o;if(o==="class"&&(w=".%s"),o==="data"&&(w="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(w=`[${o}="%s"]`),A){if(w==="media")return e.defaultColorScheme===A?":root":{[`@media (prefers-color-scheme: ${((I=(B=a[A])==null?void 0:B.palette)==null?void 0:I.mode)||A})`]:{":root":b}};if(w)return e.defaultColorScheme===A?`:root, ${w.replace("%s",String(A))}`:w.replace("%s",String(A))}return":root"}return{vars:d,generateThemeVars:()=>{let A={...f};return Object.entries(y).forEach(([,{vars:b}])=>{A=j(A,b)}),A},generateStyleSheets:()=>{var D,W;const A=[],b=e.defaultColorScheme||"light";function w(i,g){Object.keys(g).length&&A.push(typeof i=="string"?{[i]:{...g}}:i)}w(r(void 0,{...p}),p);const{[b]:B,...I}=y;if(B){const{css:i}=B,g=(W=(D=a[b])==null?void 0:D.palette)==null?void 0:W.mode,S=!n&&g?{colorScheme:g,...i}:{...i};w(r(b,{...S}),S)}return Object.entries(I).forEach(([i,{css:g}])=>{var F,G;const S=(G=(F=a[i])==null?void 0:F.palette)==null?void 0:G.mode,k=!n&&S?{colorScheme:S,...g}:{...g};w(r(i,{...k}),k)}),A}}}function $n(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 ce={black:"#000",white:"#fff"},kn={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"},q={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"},J={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"},ie={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"},Z={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"},ee={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"},te={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 Bt(){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:ce.white,default:ce.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 vn=Bt();function Et(){return{text:{primary:ce.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:ce.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 lt=Et();function ct(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=qe(e.main,o):t==="dark"&&(e.dark=Xe(e.main,a)))}function _n(e="light"){return e==="dark"?{main:Z[200],light:Z[50],dark:Z[400]}:{main:Z[700],light:Z[400],dark:Z[800]}}function On(e="light"){return e==="dark"?{main:q[200],light:q[50],dark:q[400]}:{main:q[500],light:q[300],dark:q[700]}}function Bn(e="light"){return e==="dark"?{main:J[500],light:J[300],dark:J[700]}:{main:J[700],light:J[400],dark:J[800]}}function En(e="light"){return e==="dark"?{main:ee[400],light:ee[300],dark:ee[700]}:{main:ee[700],light:ee[500],dark:ee[900]}}function Pn(e="light"){return e==="dark"?{main:te[400],light:te[300],dark:te[700]}:{main:te[800],light:te[500],dark:te[900]}}function Rn(e="light"){return e==="dark"?{main:ie[400],light:ie[300],dark:ie[700]}:{main:"#ed6c02",light:ie[500],dark:ie[900]}}function Je(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:n=.2,...o}=e,a=e.primary||_n(t),s=e.secondary||On(t),c=e.error||Bn(t),u=e.info||En(t),f=e.success||Pn(t),p=e.warning||Rn(t);function m(C){return pn(C,lt.text.primary)>=r?lt.text.primary:vn.text.primary}const d=({color:C,name:R,mainShade:P=500,lightShade:M=300,darkShade:A=700})=>{if(C={...C},!C.main&&C[P]&&(C.main=C[P]),!C.hasOwnProperty("main"))throw new Error(X(11,R?` (${R})`:"",P));if(typeof C.main!="string")throw new Error(X(12,R?` (${R})`:"",JSON.stringify(C.main)));return ct(C,"light",M,n),ct(C,"dark",A,n),C.contrastText||(C.contrastText=m(C.main)),C};let y;return t==="light"?y=Bt():t==="dark"&&(y=Et()),j({common:{...ce},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:kn,contrastThreshold:r,getContrastText:m,augmentColor:d,tonalOffset:n,...y},o)}function In(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 Fn(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 ut={textTransform:"uppercase"},ft='"Roboto", "Helvetica", "Arial", sans-serif';function Dn(e,t){const{fontFamily:r=ft,fontSize:n=14,fontWeightLight:o=300,fontWeightRegular:a=400,fontWeightMedium:s=500,fontWeightBold:c=700,htmlFontSize:u=16,allVariants:f,pxToRem:p,...m}=typeof t=="function"?t(e):t,d=n/14,y=p||(R=>`${R/u*d}rem`),h=(R,P,M,A,b)=>({fontFamily:r,fontWeight:R,fontSize:y(P),lineHeight:M,...r===ft?{letterSpacing:`${jn(A/P)}em`}:{},...b,...f}),C={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,ut),caption:h(a,12,1.66,.4),overline:h(a,12,2.66,1,ut),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return j({htmlFontSize:u,pxToRem:y,fontFamily:r,fontSize:n,fontWeightLight:o,fontWeightRegular:a,fontWeightMedium:s,fontWeightBold:c,...C},m,{clone:!1})}const Ln=.2,Mn=.14,Wn=.12;function v(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Ln})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Mn})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Wn})`].join(",")}const Nn=["none",v(0,2,1,-1,0,1,1,0,0,1,3,0),v(0,3,1,-2,0,2,2,0,0,1,5,0),v(0,3,3,-2,0,3,4,0,0,1,8,0),v(0,2,4,-1,0,4,5,0,0,1,10,0),v(0,3,5,-1,0,5,8,0,0,1,14,0),v(0,3,5,-1,0,6,10,0,0,1,18,0),v(0,4,5,-2,0,7,10,1,0,2,16,1),v(0,5,5,-3,0,8,10,1,0,3,14,2),v(0,5,6,-3,0,9,12,1,0,3,16,2),v(0,6,6,-3,0,10,14,1,0,4,18,3),v(0,6,7,-4,0,11,15,1,0,4,20,3),v(0,7,8,-4,0,12,17,2,0,5,22,4),v(0,7,8,-4,0,13,19,2,0,5,24,4),v(0,7,9,-4,0,14,21,2,0,5,26,4),v(0,8,9,-5,0,15,22,2,0,6,28,5),v(0,8,10,-5,0,16,24,2,0,6,30,5),v(0,8,11,-5,0,17,26,2,0,6,32,5),v(0,9,11,-5,0,18,28,2,0,7,34,6),v(0,9,12,-6,0,19,29,2,0,7,36,6),v(0,10,13,-6,0,20,31,3,0,8,38,7),v(0,10,13,-6,0,21,33,3,0,8,40,7),v(0,10,14,-6,0,22,35,3,0,8,42,7),v(0,11,14,-7,0,23,36,3,0,9,44,8),v(0,11,15,-7,0,24,38,3,0,9,46,8)],Kn={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)"},zn={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function dt(e){return`${Math.round(e)}ms`}function Gn(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function Hn(e){const t={...Kn,...e.easing},r={...zn,...e.duration};return{getAutoHeightDuration:Gn,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:dt(s)} ${c} ${typeof u=="string"?u:dt(u)}`).join(",")},...e,easing:t,duration:r}}const Vn={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Yn(e){return Y(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function Pt(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];!Yn(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 ye(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(X(20));const p=Je(a),m=$t(e);let d=j(m,{mixins:Fn(m.breakpoints,n),palette:p,shadows:Nn.slice(),typography:Dn(p,c),transitions:Hn(s),zIndex:{...Vn}});return d=j(d,f),d=t.reduce((y,h)=>j(y,h),d),d.unstable_sxConfig={...je,...f==null?void 0:f.unstable_sxConfig},d.unstable_sx=function(h){return ne({sx:h,theme:this})},d.toRuntimeSource=Pt,d}function Ao(...e){return ye(...e)}function Un(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 Qn=[...Array(25)].map((e,t)=>{if(t===0)return"none";const r=Un(t);return`linear-gradient(rgba(255 255 255 / ${r}), rgba(255 255 255 / ${r}))`});function Rt(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function It(e){return e==="dark"?Qn:[]}function Xn(e){const{palette:t={mode:"light"},opacity:r,overlays:n,...o}=e,a=Je(t);return{palette:a,opacity:{...Rt(a.mode),...r},overlays:n||It(a.mode),...o}}function qn(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const Jn=e=>[...[...Array(25)].map((t,r)=>`--${e?`${e}-`:""}overlays-${r}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],Zn=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 Jn(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 eo(e,t){t.forEach(r=>{e[r]||(e[r]={})})}function l(e,t,r){!e[t]&&r&&(e[t]=r)}function se(e){return typeof e!="string"||!e.startsWith("hsl")?e:_t(e)}function V(e,t){`${t}Channel`in e||(e[`${t}Channel`]=ae(se(e[t])))}function to(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const H=e=>{try{return e()}catch{}},ro=(e="mui")=>wn(e);function We(e,t,r,n){if(!t)return;t=t===!0?{}:t;const o=n==="dark"?"dark":"light";if(!r){e[n]=Xn({...t,palette:{mode:o,...t==null?void 0:t.palette}});return}const{palette:a,...s}=ye({...r,palette:{mode:o,...t==null?void 0:t.palette}});return e[n]={...t,palette:a,opacity:{...Rt(o),...t==null?void 0:t.opacity},overlays:(t==null?void 0:t.overlays)||It(o)},s}function no(e={},...t){const{colorSchemes:r={light:!0},defaultColorScheme:n,disableCssColorScheme:o=!1,cssVarPrefix:a="mui",shouldSkipGeneratingVar:s=qn,colorSchemeSelector:c=r.light&&r.dark?"media":void 0,rootSelector:u=":root",...f}=e,p=Object.keys(r)[0],m=n||(r.light&&p!=="light"?"light":p),d=ro(a),{[m]:y,light:h,dark:C,...R}=r,P={...R};let M=y;if((m==="dark"&&!("dark"in r)||m==="light"&&!("light"in r))&&(M=!0),!M)throw new Error(X(21,m));const A=We(P,M,f,m);h&&!P.light&&We(P,h,void 0,"light"),C&&!P.dark&&We(P,C,void 0,"dark");let b={defaultColorScheme:m,...A,cssVarPrefix:a,colorSchemeSelector:c,rootSelector:u,getCssVar:d,colorSchemes:P,font:{...In(A.typography),...A.font},spacing:to(f.spacing)};Object.keys(b.colorSchemes).forEach(W=>{const i=b.colorSchemes[W].palette,g=S=>{const k=S.split("-"),F=k[1],G=k[2];return d(S,i[F][G])};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")),eo(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",g("palette-error-main")),l(i.Alert,"infoFilledBg",g("palette-info-main")),l(i.Alert,"successFilledBg",g("palette-success-main")),l(i.Alert,"warningFilledBg",g("palette-warning-main")),l(i.Alert,"errorFilledColor",H(()=>i.getContrastText(i.error.main))),l(i.Alert,"infoFilledColor",H(()=>i.getContrastText(i.info.main))),l(i.Alert,"successFilledColor",H(()=>i.getContrastText(i.success.main))),l(i.Alert,"warningFilledColor",H(()=>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",g("palette-error-main")),l(i.Alert,"infoIconColor",g("palette-info-main")),l(i.Alert,"successIconColor",g("palette-success-main")),l(i.Alert,"warningIconColor",g("palette-warning-main")),l(i.AppBar,"defaultBg",g("palette-grey-100")),l(i.Avatar,"defaultBg",g("palette-grey-400")),l(i.Button,"inheritContainedBg",g("palette-grey-300")),l(i.Button,"inheritContainedHoverBg",g("palette-grey-A100")),l(i.Chip,"defaultBorder",g("palette-grey-400")),l(i.Chip,"defaultAvatarColor",g("palette-grey-700")),l(i.Chip,"defaultIconColor",g("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(${g("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 S=ge(i.background.default,.8);l(i.SnackbarContent,"bg",S),l(i.SnackbarContent,"color",H(()=>i.getContrastText(S))),l(i.SpeedDialAction,"fabHoverBg",ge(i.background.paper,.15)),l(i.StepConnector,"border",g("palette-grey-400")),l(i.StepContent,"border",g("palette-grey-400")),l(i.Switch,"defaultColor",g("palette-common-white")),l(i.Switch,"defaultDisabledColor",g("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(me(i.divider,1),.88)),l(i.Tooltip,"bg",me(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",g("palette-error-dark")),l(i.Alert,"infoFilledBg",g("palette-info-dark")),l(i.Alert,"successFilledBg",g("palette-success-dark")),l(i.Alert,"warningFilledBg",g("palette-warning-dark")),l(i.Alert,"errorFilledColor",H(()=>i.getContrastText(i.error.dark))),l(i.Alert,"infoFilledColor",H(()=>i.getContrastText(i.info.dark))),l(i.Alert,"successFilledColor",H(()=>i.getContrastText(i.success.dark))),l(i.Alert,"warningFilledColor",H(()=>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",g("palette-error-main")),l(i.Alert,"infoIconColor",g("palette-info-main")),l(i.Alert,"successIconColor",g("palette-success-main")),l(i.Alert,"warningIconColor",g("palette-warning-main")),l(i.AppBar,"defaultBg",g("palette-grey-900")),l(i.AppBar,"darkBg",g("palette-background-paper")),l(i.AppBar,"darkColor",g("palette-text-primary")),l(i.Avatar,"defaultBg",g("palette-grey-600")),l(i.Button,"inheritContainedBg",g("palette-grey-800")),l(i.Button,"inheritContainedHoverBg",g("palette-grey-700")),l(i.Chip,"defaultBorder",g("palette-grey-700")),l(i.Chip,"defaultAvatarColor",g("palette-grey-300")),l(i.Chip,"defaultIconColor",g("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(${g("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 S=ge(i.background.default,.98);l(i.SnackbarContent,"bg",S),l(i.SnackbarContent,"color",H(()=>i.getContrastText(S))),l(i.SpeedDialAction,"fabHoverBg",ge(i.background.paper,.15)),l(i.StepConnector,"border",g("palette-grey-600")),l(i.StepContent,"border",g("palette-grey-600")),l(i.Switch,"defaultColor",g("palette-grey-300")),l(i.Switch,"defaultDisabledColor",g("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(me(i.divider,1),.68)),l(i.Tooltip,"bg",me(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(S=>{const k=i[S];S!=="tonalOffset"&&k&&typeof k=="object"&&(k.main&&l(i[S],"mainChannel",ae(se(k.main))),k.light&&l(i[S],"lightChannel",ae(se(k.light))),k.dark&&l(i[S],"darkChannel",ae(se(k.dark))),k.contrastText&&l(i[S],"contrastTextChannel",ae(se(k.contrastText))),S==="text"&&(V(i[S],"primary"),V(i[S],"secondary")),S==="action"&&(k.active&&V(i[S],"active"),k.selected&&V(i[S],"selected")))})}),b=t.reduce((W,i)=>j(W,i),b);const w={prefix:a,disableCssColorScheme:o,shouldSkipGeneratingVar:s,getSelector:Zn(b)},{vars:B,generateThemeVars:I,generateStyleSheets:D}=Tn(b,w);return b.vars=B,Object.entries(b.colorSchemes[b.defaultColorScheme]).forEach(([W,i])=>{b[W]=i}),b.generateThemeVars=I,b.generateStyleSheets=D,b.generateSpacing=function(){return Tt(f.spacing,Ye(this))},b.getColorSchemeSelector=$n(c),b.spacing=b.generateSpacing(),b.shouldSkipGeneratingVar=s,b.unstable_sxConfig={...je,...f==null?void 0:f.unstable_sxConfig},b.unstable_sx=function(i){return ne({sx:i,theme:this})},b.toRuntimeSource=Pt,b}function mt(e,t,r){e.colorSchemes&&r&&(e.colorSchemes[t]={...r!==!0&&r,palette:Je({...r===!0?{}:r.palette,mode:t})})}function oo(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 ye(e,...t);let p=r;"palette"in e||f[c]&&(f[c]!==!0?p=f[c].palette:c==="dark"&&(p={mode:"dark"}));const m=ye({...e,palette:p},...t);return m.defaultColorScheme=c,m.colorSchemes=f,m.palette.mode==="light"&&(m.colorSchemes.light={...f.light!==!0&&f.light,palette:m.palette},mt(m,"dark",f.dark)),m.palette.mode==="dark"&&(m.colorSchemes.dark={...f.dark!==!0&&f.dark,palette:m.palette},mt(m,"light",f.light)),m}return!r&&!("light"in f)&&c==="light"&&(f.light=!0),no({...s,colorSchemes:f,defaultColorScheme:c,...typeof n!="boolean"&&n},...t)}const io=oo();function ao(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const so=e=>ao(e)&&e!=="classes",xo=an({themeId:Mt,defaultTheme:io,rootShouldForwardProp:so}),To=Cn;function $o(e){return Sn(e)}export{Hn as $,so as A,Z as B,Zr as C,ce as D,te as E,kn as F,ee as G,ie as H,q as I,J,zn as K,Xe as L,qe as M,yn as N,Be as O,ao as P,fn as Q,Ne as R,dn as S,Mt as T,So as U,_t as V,Q as W,De as X,pn as Y,Ke as Z,Ao as _,bo as a,Kn as a0,Xn as a1,Un as a2,qn as a3,Dn as a4,Fn as a5,Jn as a6,io as a7,wo as a8,Y as a9,je as aa,Co as b,po as c,hn as d,At as e,Zt as f,tn as g,ne as h,an as i,Jt as j,$t as k,U as l,yo as m,Ye as n,j as o,ho as p,de as q,bt as r,xo as s,Tt as t,or as u,oo as v,X as w,no as x,$o as y,To as z};
@@ -1 +0,0 @@
1
- import{j as e}from"./DefaultPropsProvider-u5xB1Fxz.js";import{i as C}from"./iobroker_admin__loadShare__react__loadShare__-Bis6NHgw.js";import{i as s,a as S,ae as M}from"./bootstrap-BYQTdf9r.js";import{C as B}from"./Config-BQSl4bfA.js";import"./iobroker_admin__loadShare__prop_mf_2_types__loadShare__-BnsS7SOQ.js";import"./_commonjsHelpers-D6-XlEtG.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-CTkuGOOk.js";import"./emotion-serialize.esm-BUa21YfQ.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-BOKYvG_W.js";import"./ace-BG5WYul1.js";import"./FilledInput-CysG4ax_.js";import"./preload-helper-Dp1pzeXC.js";import"./blueGrey-DYsiMDOn.js";import"./emotion-cache.browser.esm-B8BFze5o.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-h9SMNPLU.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};