iobroker.javascript 10.2.4 → 10.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -7
- package/admin/assets/{AiChatPanel-AZko1BsN.js → AiChatPanel-oBeXbUFv.js} +8 -8
- package/admin/assets/{AiChatService-Bsp_rhVx.js → AiChatService-BOL3J2Jd.js} +1 -1
- package/admin/assets/AiDiffView-C-KKjnJD.js +1 -0
- package/admin/assets/{AiInlineProvider-BxOW88xU.js → AiInlineProvider-BIlcrTkS.js} +1 -1
- package/admin/assets/Debugger-DwHHsh9O.js +15 -0
- package/admin/assets/Documentation-Bc0RmoEF.js +4339 -0
- package/admin/assets/Error-DZ4vCykD.js +1 -0
- package/admin/assets/Import-Cu02ceLW.js +1 -0
- package/admin/assets/RulesEditor-QCbi1lV_.js +1 -0
- package/admin/assets/{ScriptEditor-BCGahS47.js → ScriptEditor-CEHpEFp7.js} +2 -2
- package/admin/assets/ScriptEditorVanillaMonaco-ChQmnk0p.js +3 -0
- package/admin/assets/_virtual_mf-localSharedImportMap___mfe_internal__iobroker_javascript__mf_owner__1-CM95r358.js +1 -0
- package/admin/assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__180366418666083__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-BEpNZh4U.js +1217 -0
- package/admin/assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__180366418666083__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-FeM77flT.js +9 -0
- package/admin/assets/aiPromptBuilder-DKler0UK.js +1 -0
- package/admin/assets/{blocks_action-DS28sNfo.js → blocks_action-DywZVfRY.js} +1 -1
- package/admin/assets/{blocks_convert-CLb0DLyc.js → blocks_convert-BP2RjhQH.js} +1 -1
- package/admin/assets/{blocks_logic-Dpp2fwlu.js → blocks_logic-CdTl5YZw.js} +1 -1
- package/admin/assets/{blocks_number-N4IfHvYD.js → blocks_number-DXFd9Rva.js} +1 -1
- package/admin/assets/{blocks_object-uK7FHVhS.js → blocks_object-by1uBDHi.js} +1 -1
- package/admin/assets/{blocks_procedures-C_KD0Bm6.js → blocks_procedures-BcJ7N70D.js} +1 -1
- package/admin/assets/{blocks_sendto-BxCMg9X4.js → blocks_sendto-qIKzOAcV.js} +1 -1
- package/admin/assets/{blocks_switch-C8Rls5pK.js → blocks_switch-dLF6hSJl.js} +1 -1
- package/admin/assets/{blocks_system-CEQnj5fY.js → blocks_system-DmX-SBy8.js} +1 -1
- package/admin/assets/{blocks_text-BDEWxu0P.js → blocks_text-BI4zNU3o.js} +1 -1
- package/admin/assets/{blocks_time-aHQQK1Uz.js → blocks_time-BgYA4Y_4.js} +1 -1
- package/admin/assets/{blocks_timeout-C2L93TLJ.js → blocks_timeout-DUzgMyAu.js} +1 -1
- package/admin/assets/{blocks_trigger-XivsIDE5.js → blocks_trigger-CnmXLCUE.js} +1 -1
- package/admin/assets/{cronHoverProvider-BZMOFHO_.js → cronHoverProvider-CcIFAhVy.js} +1 -1
- package/admin/assets/{field_cron-CxKi__cX.js → field_cron-Ba46q8Qc.js} +1 -1
- package/admin/assets/{field_oid-CJIYiGxY.js → field_oid-lWCjOzuq.js} +1 -1
- package/admin/assets/{field_script-CehplM7L.js → field_script-BCWZHhnW.js} +1 -1
- package/admin/assets/{helpers-DiwtLpXM.js → helpers-CnEjYAup.js} +1 -1
- package/admin/assets/{hostInit-Bs-bStPF.js → hostInit-CVybS7BB.js} +1 -1
- package/admin/assets/iconLibraryData-B5fiyl1C.js +1 -0
- package/admin/assets/index-B3s0zmWC.js +871 -0
- package/admin/assets/{inlineChatWidget-NIvdRGmU.js → inlineChatWidget-N8xIkvxX.js} +2 -2
- package/admin/assets/{inlineDiffController-Qh402KhK.js → inlineDiffController-BuqYsKKq.js} +2 -2
- package/admin/assets/{mf-entry-bootstrap-0-019228a5.js → mf-entry-bootstrap-0-a5a39621.js} +3 -3
- package/admin/assets/{pendingShares-B3t6ewri.js → pendingShares-DOAkyFMS.js} +1 -1
- package/admin/assets/stateHoverProvider-BYAbe1Ay.js +11 -0
- package/admin/custom/assets/Components-FkGDIlId.js +1 -0
- package/admin/custom/assets/_virtual_mf-localSharedImportMap___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1-Cs88NUCd.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__37453319418803__loadShare___mf_0_emotion_mf_1_react__loadShare__.js-P-8ffWXw.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__37453319418803__loadShare___mf_0_emotion_mf_1_styled__loadShare__.js-ZVuRAEo5.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__37453319418803__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-DVb0ZZ1Q.js +1217 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__37453319418803__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.js-Dna3WF04.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__37453319418803__loadShare___mf_0_mui_mf_1_x_mf_2_date_mf_2_pickers__loadShare__.js-DcjdCGAx.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__37453319418803__loadShare__date_mf_2_fns__loadShare__.js-CnhNjamd.js +1 -0
- package/admin/custom/assets/{_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__136440932828998__loadShare__leaflet__loadShare__.js-im3edKNs.js → _virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__37453319418803__loadShare__leaflet__loadShare__.js-Dz7BFJqH.js} +1 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__37453319418803__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-B0olko2J.js +1 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__37453319418803__prebuild___mf_0_iobroker_mf_1_json_mf_2_config__prebuild__-CzN4reh_.js +122 -0
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__37453319418803__prebuild__leaflet__prebuild__-xPcBaiTQ.js +1 -0
- package/admin/custom/assets/{_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__136440932828998__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-Byvr2uOb.js → _virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__37453319418803__prebuild__react_mf_1_jsx_mf_2_runtime__prebuild__-CXpyx8Vy.js} +1 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__37453319418803__prebuild__react_mf_2_dom_mf_1_client__prebuild__-DuFBE5fh.js +9 -0
- package/admin/custom/assets/{hostInit-IJMNq3h7.js → hostInit-6oh4UY2k.js} +1 -1
- package/admin/custom/assets/iconLibraryData-B5fiyl1C.js +1 -0
- package/admin/custom/assets/index-BrlyEy6J.js +1 -0
- package/admin/custom/assets/lib-BmDlTzq2.js +3 -0
- package/admin/custom/assets/{mf-entry-bootstrap-0-f149bc46.js → mf-entry-bootstrap-0-ad1cd7d0.js} +3 -3
- package/admin/custom/assets/pendingShares-kV2kwejX.js +1 -0
- package/admin/custom/assets/rolldown-runtime-Dqfqb5bO.js +1 -0
- package/admin/custom/customComponents.js +3 -2
- package/admin/custom/i18n/en.json +39 -39
- package/admin/custom/i18n/es.json +1 -1
- package/admin/custom/i18n/fr.json +2 -2
- package/admin/custom/i18n/it.json +1 -1
- package/admin/custom/i18n/nl.json +2 -2
- package/admin/custom/i18n/pt.json +2 -2
- package/admin/custom/i18n/ru.json +2 -2
- package/admin/custom/i18n/uk.json +1 -1
- package/admin/custom/i18n/zh-cn.json +1 -1
- package/admin/i18n/de.json +1 -1
- package/admin/i18n/en.json +115 -115
- package/admin/i18n/fr.json +115 -115
- package/admin/i18n/it.json +115 -115
- package/admin/i18n/nl.json +115 -115
- package/admin/i18n/pl.json +1 -1
- package/admin/i18n/pt.json +115 -115
- package/admin/i18n/ru.json +115 -115
- package/admin/i18n/uk.json +115 -115
- package/admin/i18n/zh-cn.json +115 -115
- package/admin/mf-manifest.json +1 -1
- package/admin/mf-stats.json +1 -1
- package/admin/remoteEntry.js +2 -2
- package/admin/tab.html +4 -4
- package/build/lib/javascript.d.ts +16 -16
- package/docs/de/README.md +1 -1
- package/docs/de/javascript.md +2167 -0
- package/docs/en/javascript.md +28 -30
- package/io-package.json +14 -14
- package/package.json +8 -8
- package/admin/assets/AiDiffView-Cri2QFh1.js +0 -1
- package/admin/assets/Debugger-CVDh3kgz.js +0 -15
- package/admin/assets/Error-Ch2nx5uC.js +0 -1
- package/admin/assets/Import-XKVP-nRT.js +0 -1
- package/admin/assets/RulesEditor-DsO4cKIk.js +0 -1
- package/admin/assets/ScriptEditorVanillaMonaco-BDAw2Bw6.js +0 -3
- package/admin/assets/_virtual_mf-localSharedImportMap___mfe_internal__iobroker_javascript__mf_owner__1-BMAFQFoH.js +0 -1
- package/admin/assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-D-gi6Mty.js +0 -1217
- package/admin/assets/_virtual_mf___mfe_internal__iobroker_javascript__mf_owner__113183188387379__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-CDctpiPx.js +0 -9
- package/admin/assets/aiPromptBuilder-aJfHa-eU.js +0 -1
- package/admin/assets/index-B0FfAYMN.js +0 -871
- package/admin/assets/stateHoverProvider-BkW15VMN.js +0 -9
- package/admin/assets/virtualExposes-DgGB-18P.js +0 -1
- package/admin/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__iobroker_javascript__remoteEntry_js-CiidVc0O.js +0 -1
- package/admin/assets/virtual_mf-exposes___mfe_internal__iobroker_javascript__remoteEntry_js-ChiJXsfH.js +0 -1
- package/admin/custom/assets/Components-SGnA-3W_.js +0 -1
- package/admin/custom/assets/_virtual_mf-localSharedImportMap___mfe_internal__ConfigCustomJavascriptSet__mf_owner__1-Bx3X6TLB.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__136440932828998__loadShare___mf_0_emotion_mf_1_react__loadShare__.js-Cc7MmJgr.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__136440932828998__loadShare___mf_0_emotion_mf_1_styled__loadShare__.js-CdvEvX5z.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__136440932828998__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-D5NaoeJi.js +0 -1217
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__136440932828998__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__.js-Cbgw_a3f.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__136440932828998__loadShare___mf_0_mui_mf_1_x_mf_2_date_mf_2_pickers__loadShare__.js-CMr75K5w.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__136440932828998__loadShare__date_mf_2_fns__loadShare__.js-DKIvPDPX.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__136440932828998__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-D50aYKgD.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__136440932828998__prebuild___mf_0_iobroker_mf_1_json_mf_2_config__prebuild__-CEzQFX7o.js +0 -122
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__136440932828998__prebuild__leaflet__prebuild__-BUDmnAcx.js +0 -1
- package/admin/custom/assets/_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__136440932828998__prebuild__react_mf_2_dom_mf_1_client__prebuild__-D_1oh1WH.js +0 -9
- package/admin/custom/assets/index-7r4VklMp.js +0 -1
- package/admin/custom/assets/lib-DDU2Oe48.js +0 -3
- package/admin/custom/assets/pendingShares-DarGQhyO.js +0 -1
- package/admin/custom/assets/rolldown-runtime-BcKkbAw3.js +0 -1
- package/admin/custom/assets/virtualExposes-C0IqMANQ.js +0 -1
- package/admin/custom/assets/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__ConfigCustomJavascriptSet__customComponents_js-CqKvh5Xu.js +0 -1
- package/admin/custom/assets/virtual_mf-exposes___mfe_internal__ConfigCustomJavascriptSet__customComponents_js-DrBN_S5o.js +0 -2
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./lib-DDU2Oe48.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as e,r as t,s as n,t as r}from"./rolldown-runtime-BcKkbAw3.js";import{t as i}from"./vite-preload-helper-CaC3yEL3.js";import{n as a,r as o,t as s}from"./dist-D4uJqRBO.js";import{C as c,E as l,M as u,R as d,V as f,v as p}from"./_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__136440932828998__loadShare___mf_0_emotion_mf_1_react__loadShare__.js-Cc7MmJgr.js";import{$ as m,$t as h,A as g,An as _,At as v,B as y,Bt as ee,C as b,Cn as x,Ct as te,D as ne,Dn as re,Dt as S,E as C,En as w,Et as T,F as E,Fn as D,Ft as ie,G as ae,Gt as O,H as oe,Ht as se,I as ce,In as le,It as k,J as ue,Jt as A,K as de,Kt as fe,L as pe,Lt as me,M as j,Mn as he,N as ge,Nn as _e,Nr as ve,O as M,On as N,Ot as ye,P as be,Pn as P,Pt as xe,Q as Se,Qt as F,R as Ce,Rt as I,S as we,Sn as Te,St as Ee,T as De,Tn as Oe,Tt as ke,U as Ae,Ut as L,V as je,Vt as Me,W as Ne,Wt as Pe,X as Fe,Xt as Ie,Y as Le,Yt as Re,Z as ze,Zt as R,_ as z,_n as Be,_t as Ve,a as He,an as Ue,at as We,bn as B,bt as Ge,c as Ke,cn as qe,ct as Je,d as Ye,dn as Xe,dt as Ze,en as Qe,et as $e,f as et,fn as tt,ft as nt,g as rt,gn as V,gt as it,h as at,hn as ot,ht as st,i as ct,in as lt,it as ut,j as dt,jn as ft,jt as pt,k as mt,kn as H,kt as ht,l as gt,ln as _t,lt as vt,m as yt,mn as U,mt as bt,n as xt,nn as St,nt as Ct,o as wt,on as Tt,ot as Et,p as Dt,pn as Ot,pt as kt,q as At,qt as jt,r as Mt,rn as Nt,rt as Pt,s as Ft,sn as It,st as Lt,t as Rt,tn as zt,tt as Bt,u as W,un as Vt,ut as Ht,v as Ut,vn as Wt,vt as Gt,w as Kt,wn as qt,wr as G,wt as Jt,x as Yt,xn as Xt,xt as Zt,yn as Qt,yt as $t,z as en,zt as K}from"./_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__136440932828998__loadShare___mf_0_iobroker_mf_1_gui_mf_2_components__loadShare__.js-D5NaoeJi.js";import{n as tn,r as nn}from"./_virtual_mf___mfe_internal__ConfigCustomJavascriptSet__mf_owner__136440932828998__loadShare___mf_0_mui_mf_1_x_mf_2_date_mf_2_pickers__loadShare__.js-CMr75K5w.js";var rn=r(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):n.JSON5=r()})(e,(function(){function e(e,t){return t={exports:{}},e(t,t.exports),t.exports}var t=e(function(e){var t=e.exports=typeof window<`u`&&window.Math==Math?window:typeof self<`u`&&self.Math==Math?self:Function(`return this`)();typeof __g==`number`&&(__g=t)}),n=e(function(e){var t=e.exports={version:`2.6.5`};typeof __e==`number`&&(__e=t)});n.version;var r=function(e){return typeof e==`object`?e!==null:typeof e==`function`},i=function(e){if(!r(e))throw TypeError(e+` is not an object!`);return e},a=function(e){try{return!!e()}catch{return!0}},o=!a(function(){return Object.defineProperty({},"a",{get:function(){return 7}}).a!=7}),s=t.document,c=r(s)&&r(s.createElement),l=function(e){return c?s.createElement(e):{}},u=!o&&!a(function(){return Object.defineProperty(l(`div`),"a",{get:function(){return 7}}).a!=7}),d=function(e,t){if(!r(e))return e;var n,i;if(t&&typeof(n=e.toString)==`function`&&!r(i=n.call(e))||typeof(n=e.valueOf)==`function`&&!r(i=n.call(e))||!t&&typeof(n=e.toString)==`function`&&!r(i=n.call(e)))return i;throw TypeError(`Can't convert object to primitive value`)},f=Object.defineProperty,p={f:o?Object.defineProperty:function(e,t,n){if(i(e),t=d(t,!0),i(n),u)try{return f(e,t,n)}catch{}if(`get`in n||`set`in n)throw TypeError(`Accessors not supported!`);return`value`in n&&(e[t]=n.value),e}},m=function(e,t){return{enumerable:!(e&1),configurable:!(e&2),writable:!(e&4),value:t}},h=o?function(e,t,n){return p.f(e,t,m(1,n))}:function(e,t,n){return e[t]=n,e},g={}.hasOwnProperty,_=function(e,t){return g.call(e,t)},v=0,y=Math.random(),ee=function(e){return`Symbol(${e===void 0?``:e})_${(++v+y).toString(36)}`},b=e(function(e){var r=`__core-js_shared__`,i=t[r]||(t[r]={});(e.exports=function(e,t){return i[e]||(i[e]=t===void 0?{}:t)})(`versions`,[]).push({version:n.version,mode:`global`,copyright:`© 2019 Denis Pushkarev (zloirock.ru)`})})(`native-function-to-string`,Function.toString),x=e(function(e){var r=ee(`src`),i=`toString`,a=(``+b).split(i);n.inspectSource=function(e){return b.call(e)},(e.exports=function(e,n,i,o){var s=typeof i==`function`;s&&(_(i,`name`)||h(i,`name`,n)),e[n]!==i&&(s&&(_(i,r)||h(i,r,e[n]?``+e[n]:a.join(String(n)))),e===t?e[n]=i:o?e[n]?e[n]=i:h(e,n,i):(delete e[n],h(e,n,i)))})(Function.prototype,i,function(){return typeof this==`function`&&this[r]||b.call(this)})}),te=function(e){if(typeof e!=`function`)throw TypeError(e+` is not a function!`);return e},ne=function(e,t,n){if(te(e),t===void 0)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},re=`prototype`,S=function(e,r,i){var a=e&S.F,o=e&S.G,s=e&S.S,c=e&S.P,l=e&S.B,u=o?t:s?t[r]||(t[r]={}):(t[r]||{})[re],d=o?n:n[r]||(n[r]={}),f=d[re]||(d[re]={}),p,m,g,_;for(p in o&&(i=r),i)m=!a&&u&&u[p]!==void 0,g=(m?u:i)[p],_=l&&m?ne(g,t):c&&typeof g==`function`?ne(Function.call,g):g,u&&x(u,p,g,e&S.U),d[p]!=g&&h(d,p,_),c&&f[p]!=g&&(f[p]=g)};t.core=n,S.F=1,S.G=2,S.S=4,S.P=8,S.B=16,S.W=32,S.U=64,S.R=128;var C=S,w=Math.ceil,T=Math.floor,E=function(e){return isNaN(e=+e)?0:(e>0?T:w)(e)},D=function(e){if(e==null)throw TypeError(`Can't call method on `+e);return e},ie=function(e){return function(t,n){var r=String(D(t)),i=E(n),a=r.length,o,s;return i<0||i>=a?e?``:void 0:(o=r.charCodeAt(i),o<55296||o>56319||i+1===a||(s=r.charCodeAt(i+1))<56320||s>57343?e?r.charAt(i):o:e?r.slice(i,i+2):(o-55296<<10)+(s-56320)+65536)}}(!1);C(C.P,`String`,{codePointAt:function(e){return ie(this,e)}}),n.String.codePointAt;var ae=Math.max,O=Math.min,oe=function(e,t){return e=E(e),e<0?ae(e+t,0):O(e,t)},se=String.fromCharCode,ce=String.fromCodePoint;C(C.S+C.F*(!!ce&&ce.length!=1),`String`,{fromCodePoint:function(e){for(var t=arguments,n=[],r=arguments.length,i=0,a;r>i;){if(a=+t[i++],oe(a,1114111)!==a)throw RangeError(a+` is not a valid code point`);n.push(a<65536?se(a):se(((a-=65536)>>10)+55296,a%1024+56320))}return n.join(``)}}),n.String.fromCodePoint;var le={Space_Separator:/[\u1680\u2000-\u200A\u202F\u205F\u3000]/,ID_Start:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/,ID_Continue:/[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D00-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF2D-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD836[\uDE00-\uDE36\uDE3B-\uDE6C\uDE75\uDE84\uDE9B-\uDE9F\uDEA1-\uDEAF]|\uD838[\uDC00-\uDC06\uDC08-\uDC18\uDC1B-\uDC21\uDC23\uDC24\uDC26-\uDC2A]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6\uDD00-\uDD4A\uDD50-\uDD59]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/},k={isSpaceSeparator:function(e){return typeof e==`string`&&le.Space_Separator.test(e)},isIdStartChar:function(e){return typeof e==`string`&&(e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e===`$`||e===`_`||le.ID_Start.test(e))},isIdContinueChar:function(e){return typeof e==`string`&&(e>=`a`&&e<=`z`||e>=`A`&&e<=`Z`||e>=`0`&&e<=`9`||e===`$`||e===`_`||e===``||e===``||le.ID_Continue.test(e))},isDigit:function(e){return typeof e==`string`&&/[0-9]/.test(e)},isHexDigit:function(e){return typeof e==`string`&&/[0-9A-Fa-f]/.test(e)}},ue,A,de,fe,pe,me,j,he,ge,_e=function(e,t){ue=String(e),A=`start`,de=[],fe=0,pe=1,me=0,j=void 0,he=void 0,ge=void 0;do j=xe(),Oe[A]();while(j.type!==`eof`);return typeof t==`function`?ve({"":ge},``,t):ge};function ve(e,t,n){var r=e[t];if(typeof r==`object`&&r){if(Array.isArray(r))for(var i=0;i<r.length;i++){var a=String(i),o=ve(r,a,n);o===void 0?delete r[a]:Object.defineProperty(r,a,{value:o,writable:!0,enumerable:!0,configurable:!0})}else for(var s in r){var c=ve(r,s,n);c===void 0?delete r[s]:Object.defineProperty(r,s,{value:c,writable:!0,enumerable:!0,configurable:!0})}}return n.call(e,t,r)}var M,N,ye,be,P;function xe(){for(M=`default`,N=``,ye=!1,be=1;;){P=Se();var e=Ce[M]();if(e)return e}}function Se(){if(ue[fe])return String.fromCodePoint(ue.codePointAt(fe))}function F(){var e=Se();return e===`
|
|
3
|
-
`?(pe++,me=0):e?me+=e.length:me++,e&&(fe+=e.length),e}var Ce={default:function(){switch(P){case` `:case`\v`:case`\f`:case` `:case`\xA0`:case``:case`
|
|
4
|
-
`:case`\r`:case`\u2028`:case`\u2029`:F();return;case`/`:F(),M=`comment`;return;case void 0:return F(),I(`eof`)}if(k.isSpaceSeparator(P)){F();return}return Ce[A]()},comment:function(){switch(P){case`*`:F(),M=`multiLineComment`;return;case`/`:F(),M=`singleLineComment`;return}throw L(F())},multiLineComment:function(){switch(P){case`*`:F(),M=`multiLineCommentAsterisk`;return;case void 0:throw L(F())}F()},multiLineCommentAsterisk:function(){switch(P){case`*`:F();return;case`/`:F(),M=`default`;return;case void 0:throw L(F())}F(),M=`multiLineComment`},singleLineComment:function(){switch(P){case`
|
|
5
|
-
`:case`\r`:case`\u2028`:case`\u2029`:F(),M=`default`;return;case void 0:return F(),I(`eof`)}F()},value:function(){switch(P){case`{`:case`[`:return I(`punctuator`,F());case`n`:return F(),we(`ull`),I(`null`,null);case`t`:return F(),we(`rue`),I(`boolean`,!0);case`f`:return F(),we(`alse`),I(`boolean`,!1);case`-`:case`+`:F()===`-`&&(be=-1),M=`sign`;return;case`.`:N=F(),M=`decimalPointLeading`;return;case`0`:N=F(),M=`zero`;return;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:N=F(),M=`decimalInteger`;return;case`I`:return F(),we(`nfinity`),I(`numeric`,1/0);case`N`:return F(),we(`aN`),I(`numeric`,NaN);case`"`:case`'`:ye=F()===`"`,N=``,M=`string`;return}throw L(F())},identifierNameStartEscape:function(){if(P!==`u`)throw L(F());F();var e=De();switch(e){case`$`:case`_`:break;default:if(!k.isIdStartChar(e))throw Me()}N+=e,M=`identifierName`},identifierName:function(){switch(P){case`$`:case`_`:case``:case``:N+=F();return;case`\\`:F(),M=`identifierNameEscape`;return}if(k.isIdContinueChar(P)){N+=F();return}return I(`identifier`,N)},identifierNameEscape:function(){if(P!==`u`)throw L(F());F();var e=De();switch(e){case`$`:case`_`:case``:case``:break;default:if(!k.isIdContinueChar(e))throw Me()}N+=e,M=`identifierName`},sign:function(){switch(P){case`.`:N=F(),M=`decimalPointLeading`;return;case`0`:N=F(),M=`zero`;return;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:N=F(),M=`decimalInteger`;return;case`I`:return F(),we(`nfinity`),I(`numeric`,be*(1/0));case`N`:return F(),we(`aN`),I(`numeric`,NaN)}throw L(F())},zero:function(){switch(P){case`.`:N+=F(),M=`decimalPoint`;return;case`e`:case`E`:N+=F(),M=`decimalExponent`;return;case`x`:case`X`:N+=F(),M=`hexadecimal`;return}return I(`numeric`,be*0)},decimalInteger:function(){switch(P){case`.`:N+=F(),M=`decimalPoint`;return;case`e`:case`E`:N+=F(),M=`decimalExponent`;return}if(k.isDigit(P)){N+=F();return}return I(`numeric`,be*Number(N))},decimalPointLeading:function(){if(k.isDigit(P)){N+=F(),M=`decimalFraction`;return}throw L(F())},decimalPoint:function(){switch(P){case`e`:case`E`:N+=F(),M=`decimalExponent`;return}if(k.isDigit(P)){N+=F(),M=`decimalFraction`;return}return I(`numeric`,be*Number(N))},decimalFraction:function(){switch(P){case`e`:case`E`:N+=F(),M=`decimalExponent`;return}if(k.isDigit(P)){N+=F();return}return I(`numeric`,be*Number(N))},decimalExponent:function(){switch(P){case`+`:case`-`:N+=F(),M=`decimalExponentSign`;return}if(k.isDigit(P)){N+=F(),M=`decimalExponentInteger`;return}throw L(F())},decimalExponentSign:function(){if(k.isDigit(P)){N+=F(),M=`decimalExponentInteger`;return}throw L(F())},decimalExponentInteger:function(){if(k.isDigit(P)){N+=F();return}return I(`numeric`,be*Number(N))},hexadecimal:function(){if(k.isHexDigit(P)){N+=F(),M=`hexadecimalInteger`;return}throw L(F())},hexadecimalInteger:function(){if(k.isHexDigit(P)){N+=F();return}return I(`numeric`,be*Number(N))},string:function(){switch(P){case`\\`:F(),N+=Te();return;case`"`:if(ye)return F(),I(`string`,N);N+=F();return;case`'`:if(!ye)return F(),I(`string`,N);N+=F();return;case`
|
|
6
|
-
`:case`\r`:throw L(F());case`\u2028`:case`\u2029`:Ne(P);break;case void 0:throw L(F())}N+=F()},start:function(){switch(P){case`{`:case`[`:return I(`punctuator`,F())}M=`value`},beforePropertyName:function(){switch(P){case`$`:case`_`:N=F(),M=`identifierName`;return;case`\\`:F(),M=`identifierNameStartEscape`;return;case`}`:return I(`punctuator`,F());case`"`:case`'`:ye=F()===`"`,M=`string`;return}if(k.isIdStartChar(P)){N+=F(),M=`identifierName`;return}throw L(F())},afterPropertyName:function(){if(P===`:`)return I(`punctuator`,F());throw L(F())},beforePropertyValue:function(){M=`value`},afterPropertyValue:function(){switch(P){case`,`:case`}`:return I(`punctuator`,F())}throw L(F())},beforeArrayValue:function(){if(P===`]`)return I(`punctuator`,F());M=`value`},afterArrayValue:function(){switch(P){case`,`:case`]`:return I(`punctuator`,F())}throw L(F())},end:function(){throw L(F())}};function I(e,t){return{type:e,value:t,line:pe,column:me}}function we(e){for(var t=0,n=e;t<n.length;t+=1){var r=n[t];if(Se()!==r)throw L(F());F()}}function Te(){switch(Se()){case`b`:return F(),`\b`;case`f`:return F(),`\f`;case`n`:return F(),`
|
|
7
|
-
`;case`r`:return F(),`\r`;case`t`:return F(),` `;case`v`:return F(),`\v`;case`0`:if(F(),k.isDigit(Se()))throw L(F());return`\0`;case`x`:return F(),Ee();case`u`:return F(),De();case`
|
|
8
|
-
`:case`\u2028`:case`\u2029`:return F(),``;case`\r`:return F(),Se()===`
|
|
9
|
-
`&&F(),``;case`1`:case`2`:case`3`:case`4`:case`5`:case`6`:case`7`:case`8`:case`9`:throw L(F());case void 0:throw L(F())}return F()}function Ee(){var e=``,t=Se();if(!k.isHexDigit(t)||(e+=F(),t=Se(),!k.isHexDigit(t)))throw L(F());return e+=F(),String.fromCodePoint(parseInt(e,16))}function De(){for(var e=``,t=4;t-->0;){var n=Se();if(!k.isHexDigit(n))throw L(F());e+=F()}return String.fromCodePoint(parseInt(e,16))}var Oe={start:function(){if(j.type===`eof`)throw je();ke()},beforePropertyName:function(){switch(j.type){case`identifier`:case`string`:he=j.value,A=`afterPropertyName`;return;case`punctuator`:Ae();return;case`eof`:throw je()}},afterPropertyName:function(){if(j.type===`eof`)throw je();A=`beforePropertyValue`},beforePropertyValue:function(){if(j.type===`eof`)throw je();ke()},beforeArrayValue:function(){if(j.type===`eof`)throw je();if(j.type===`punctuator`&&j.value===`]`){Ae();return}ke()},afterPropertyValue:function(){if(j.type===`eof`)throw je();switch(j.value){case`,`:A=`beforePropertyName`;return;case`}`:Ae()}},afterArrayValue:function(){if(j.type===`eof`)throw je();switch(j.value){case`,`:A=`beforeArrayValue`;return;case`]`:Ae()}},end:function(){}};function ke(){var e;switch(j.type){case`punctuator`:switch(j.value){case`{`:e={};break;case`[`:e=[]}break;case`null`:case`boolean`:case`numeric`:case`string`:e=j.value}if(ge===void 0)ge=e;else{var t=de[de.length-1];Array.isArray(t)?t.push(e):Object.defineProperty(t,he,{value:e,writable:!0,enumerable:!0,configurable:!0})}if(typeof e==`object`&&e)de.push(e),A=Array.isArray(e)?`beforeArrayValue`:`beforePropertyName`;else{var n=de[de.length-1];A=n==null?`end`:Array.isArray(n)?`afterArrayValue`:`afterPropertyValue`}}function Ae(){de.pop();var e=de[de.length-1];A=e==null?`end`:Array.isArray(e)?`afterArrayValue`:`afterPropertyValue`}function L(e){return Fe(e===void 0?`JSON5: invalid end of input at `+pe+`:`+me:`JSON5: invalid character '`+Pe(e)+`' at `+pe+`:`+me)}function je(){return Fe(`JSON5: invalid end of input at `+pe+`:`+me)}function Me(){return me-=5,Fe(`JSON5: invalid identifier character at `+pe+`:`+me)}function Ne(e){console.warn(`JSON5: '`+Pe(e)+`' in strings is not valid ECMAScript; consider escaping`)}function Pe(e){var t={"'":`\\'`,'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`,"\v":`\\v`,"\0":`\\0`,"\u2028":`\\u2028`,"\u2029":`\\u2029`};if(t[e])return t[e];if(e<` `){var n=e.charCodeAt(0).toString(16);return`\\x`+(`00`+n).substring(n.length)}return e}function Fe(e){var t=SyntaxError(e);return t.lineNumber=pe,t.columnNumber=me,t}return{parse:_e,stringify:function(e,t,n){var r=[],i=``,a,o,s=``,c;if(typeof t==`object`&&t&&!Array.isArray(t)&&(n=t.space,c=t.quote,t=t.replacer),typeof t==`function`)o=t;else if(Array.isArray(t)){a=[];for(var l=0,u=t;l<u.length;l+=1){var d=u[l],f=void 0;typeof d==`string`?f=d:(typeof d==`number`||d instanceof String||d instanceof Number)&&(f=String(d)),f!==void 0&&a.indexOf(f)<0&&a.push(f)}}return n instanceof Number?n=Number(n):n instanceof String&&(n=String(n)),typeof n==`number`?n>0&&(n=Math.min(10,Math.floor(n)),s=` `.substr(0,n)):typeof n==`string`&&(s=n.substr(0,10)),p(``,{"":e});function p(e,t){var n=t[e];switch(n!=null&&(typeof n.toJSON5==`function`?n=n.toJSON5(e):typeof n.toJSON==`function`&&(n=n.toJSON(e))),o&&(n=o.call(t,e,n)),n instanceof Number?n=Number(n):n instanceof String?n=String(n):n instanceof Boolean&&(n=n.valueOf()),n){case null:return`null`;case!0:return`true`;case!1:return`false`}if(typeof n==`string`)return m(n,!1);if(typeof n==`number`)return String(n);if(typeof n==`object`)return Array.isArray(n)?_(n):h(n)}function m(e){for(var t={"'":.1,'"':.2},n={"'":`\\'`,'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`,"\v":`\\v`,"\0":`\\0`,"\u2028":`\\u2028`,"\u2029":`\\u2029`},r=``,i=0;i<e.length;i++){var a=e[i];switch(a){case`'`:case`"`:t[a]++,r+=a;continue;case`\0`:if(k.isDigit(e[i+1])){r+=`\\x00`;continue}}if(n[a]){r+=n[a];continue}if(a<` `){var o=a.charCodeAt(0).toString(16);r+=`\\x`+(`00`+o).substring(o.length);continue}r+=a}var s=c||Object.keys(t).reduce(function(e,n){return t[e]<t[n]?e:n});return r=r.replace(new RegExp(s,`g`),n[s]),s+r+s}function h(e){if(r.indexOf(e)>=0)throw TypeError(`Converting circular structure to JSON5`);r.push(e);var t=i;i+=s;for(var n=a||Object.keys(e),o=[],c=0,l=n;c<l.length;c+=1){var u=l[c],d=p(u,e);if(d!==void 0){var f=g(u)+`:`;s!==``&&(f+=` `),f+=d,o.push(f)}}var m;if(o.length===0)m=`{}`;else{var h;if(s===``)h=o.join(`,`),m=`{`+h+`}`;else{var _=`,
|
|
10
|
-
`+i;h=o.join(_),m=`{
|
|
11
|
-
`+i+h+`,
|
|
12
|
-
`+t+`}`}}return r.pop(),i=t,m}function g(e){if(e.length===0)return m(e,!0);var t=String.fromCodePoint(e.codePointAt(0));if(!k.isIdStartChar(t))return m(e,!0);for(var n=t.length;n<e.length;n++)if(!k.isIdContinueChar(String.fromCodePoint(e.codePointAt(n))))return m(e,!0);return e}function _(e){if(r.indexOf(e)>=0)throw TypeError(`Converting circular structure to JSON5`);r.push(e);var t=i;i+=s;for(var n=[],a=0;a<e.length;a++){var o=p(String(a),e);n.push(o===void 0?`null`:o)}var c;if(n.length===0)c=`[]`;else if(s===``)c=`[`+n.join(`,`)+`]`;else{var l=`,
|
|
13
|
-
`+i,u=n.join(l);c=`[
|
|
14
|
-
`+i+u+`,
|
|
15
|
-
`+t+`]`}return r.pop(),i=t,c}}}}))})),an=r(((e,t)=>{t.exports={}})),on=r(((t,n)=>{(function(e,r){typeof t==`object`?n.exports=t=r():typeof define==`function`&&define.amd?define([],r):e.CryptoJS=r()})(t,function(){var t=t||function(t,n){var r;if(typeof window<`u`&&window.crypto&&(r=window.crypto),typeof self<`u`&&self.crypto&&(r=self.crypto),typeof globalThis<`u`&&globalThis.crypto&&(r=globalThis.crypto),!r&&typeof window<`u`&&window.msCrypto&&(r=window.msCrypto),!r&&typeof global<`u`&&global.crypto&&(r=global.crypto),!r&&typeof e==`function`)try{r=an()}catch{}var i=function(){if(r){if(typeof r.getRandomValues==`function`)try{return r.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof r.randomBytes==`function`)try{return r.randomBytes(4).readInt32LE()}catch{}}throw Error(`Native crypto module could not be used to get secure random number.`)},a=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},s=o.lib={},c=s.Base=function(){return{extend:function(e){var t=a(this);return e&&t.mixIn(e),(!t.hasOwnProperty(`init`)||this.init===t.init)&&(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty(`toString`)&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),l=s.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=t==n?e.length*4:t},toString:function(e){return(e||d).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var a=0;a<i;a++){var o=n[a>>>2]>>>24-a%4*8&255;t[r+a>>>2]|=o<<24-(r+a)%4*8}else for(var s=0;s<i;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var e=c.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(i());return new l.init(t,e)}}),u=o.enc={},d=u.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push((a>>>4).toString(16)),r.push((a&15).toString(16))}return r.join(``)},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new l.init(n,t/2)}},f=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(a))}return r.join(``)},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(e.charCodeAt(r)&255)<<24-r%4*8;return new l.init(n,t)}},p=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch{throw Error(`Malformed UTF-8 data`)}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},m=s.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){typeof e==`string`&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var n,r=this._data,i=r.words,a=r.sigBytes,o=this.blockSize,s=a/(o*4);s=e?t.ceil(s):t.max((s|0)-this._minBufferSize,0);var c=s*o,u=t.min(c*4,a);if(c){for(var d=0;d<c;d+=o)this._doProcessBlock(i,d);n=i.splice(0,c),r.sigBytes-=u}return new l.init(n,u)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});s.Hasher=m.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){m.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new h.HMAC.init(e,n).finalize(t)}}});var h=o.algo={};return o}(Math);return t})})),sn=r(((e,t)=>{(function(n,r){typeof e==`object`?t.exports=e=r(on()):typeof define==`function`&&define.amd?define([`./core`],r):r(n.CryptoJS)})(e,function(e){return(function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[];(function(){for(var e=0;e<64;e++)s[e]=t.abs(t.sin(e+1))*4294967296|0})();var c=o.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=(i<<8|i>>>24)&16711935|(i<<24|i>>>8)&4278255360}var a=this._hash.words,o=e[t+0],c=e[t+1],p=e[t+2],m=e[t+3],h=e[t+4],g=e[t+5],_=e[t+6],v=e[t+7],y=e[t+8],ee=e[t+9],b=e[t+10],x=e[t+11],te=e[t+12],ne=e[t+13],re=e[t+14],S=e[t+15],C=a[0],w=a[1],T=a[2],E=a[3];C=l(C,w,T,E,o,7,s[0]),E=l(E,C,w,T,c,12,s[1]),T=l(T,E,C,w,p,17,s[2]),w=l(w,T,E,C,m,22,s[3]),C=l(C,w,T,E,h,7,s[4]),E=l(E,C,w,T,g,12,s[5]),T=l(T,E,C,w,_,17,s[6]),w=l(w,T,E,C,v,22,s[7]),C=l(C,w,T,E,y,7,s[8]),E=l(E,C,w,T,ee,12,s[9]),T=l(T,E,C,w,b,17,s[10]),w=l(w,T,E,C,x,22,s[11]),C=l(C,w,T,E,te,7,s[12]),E=l(E,C,w,T,ne,12,s[13]),T=l(T,E,C,w,re,17,s[14]),w=l(w,T,E,C,S,22,s[15]),C=u(C,w,T,E,c,5,s[16]),E=u(E,C,w,T,_,9,s[17]),T=u(T,E,C,w,x,14,s[18]),w=u(w,T,E,C,o,20,s[19]),C=u(C,w,T,E,g,5,s[20]),E=u(E,C,w,T,b,9,s[21]),T=u(T,E,C,w,S,14,s[22]),w=u(w,T,E,C,h,20,s[23]),C=u(C,w,T,E,ee,5,s[24]),E=u(E,C,w,T,re,9,s[25]),T=u(T,E,C,w,m,14,s[26]),w=u(w,T,E,C,y,20,s[27]),C=u(C,w,T,E,ne,5,s[28]),E=u(E,C,w,T,p,9,s[29]),T=u(T,E,C,w,v,14,s[30]),w=u(w,T,E,C,te,20,s[31]),C=d(C,w,T,E,g,4,s[32]),E=d(E,C,w,T,y,11,s[33]),T=d(T,E,C,w,x,16,s[34]),w=d(w,T,E,C,re,23,s[35]),C=d(C,w,T,E,c,4,s[36]),E=d(E,C,w,T,h,11,s[37]),T=d(T,E,C,w,v,16,s[38]),w=d(w,T,E,C,b,23,s[39]),C=d(C,w,T,E,ne,4,s[40]),E=d(E,C,w,T,o,11,s[41]),T=d(T,E,C,w,m,16,s[42]),w=d(w,T,E,C,_,23,s[43]),C=d(C,w,T,E,ee,4,s[44]),E=d(E,C,w,T,te,11,s[45]),T=d(T,E,C,w,S,16,s[46]),w=d(w,T,E,C,p,23,s[47]),C=f(C,w,T,E,o,6,s[48]),E=f(E,C,w,T,v,10,s[49]),T=f(T,E,C,w,re,15,s[50]),w=f(w,T,E,C,g,21,s[51]),C=f(C,w,T,E,te,6,s[52]),E=f(E,C,w,T,m,10,s[53]),T=f(T,E,C,w,b,15,s[54]),w=f(w,T,E,C,c,21,s[55]),C=f(C,w,T,E,y,6,s[56]),E=f(E,C,w,T,S,10,s[57]),T=f(T,E,C,w,_,15,s[58]),w=f(w,T,E,C,ne,21,s[59]),C=f(C,w,T,E,h,6,s[60]),E=f(E,C,w,T,x,10,s[61]),T=f(T,E,C,w,p,15,s[62]),w=f(w,T,E,C,ee,21,s[63]),a[0]=a[0]+C|0,a[1]=a[1]+w|0,a[2]=a[2]+T|0,a[3]=a[3]+E|0},_doFinalize:function(){var e=this._data,n=e.words,r=this._nDataBytes*8,i=e.sigBytes*8;n[i>>>5]|=128<<24-i%32;var a=t.floor(r/4294967296),o=r;n[(i+64>>>9<<4)+15]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360,n[(i+64>>>9<<4)+14]=(o<<8|o>>>24)&16711935|(o<<24|o>>>8)&4278255360,e.sigBytes=(n.length+1)*4,this._process();for(var s=this._hash,c=s.words,l=0;l<4;l++){var u=c[l];c[l]=(u<<8|u>>>24)&16711935|(u<<24|u>>>8)&4278255360}return s},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function l(e,t,n,r,i,a,o){var s=e+(t&n|~t&r)+i+o;return(s<<a|s>>>32-a)+t}function u(e,t,n,r,i,a,o){var s=e+(t&r|n&~r)+i+o;return(s<<a|s>>>32-a)+t}function d(e,t,n,r,i,a,o){var s=e+(t^n^r)+i+o;return(s<<a|s>>>32-a)+t}function f(e,t,n,r,i,a,o){var s=e+(n^(t|~r))+i+o;return(s<<a|s>>>32-a)+t}n.MD5=a._createHelper(c),n.HmacMD5=a._createHmacHelper(c)})(Math),e.MD5})})),cn=n(rn()),ln=n(sn());f();var un=window.innerWidth<=600?12:void 0,dn={add:()=>p.createElement(ye,null),auth:()=>p.createElement(Bt,null),backlight:()=>p.createElement(m,null),book:()=>p.createElement(vt,null),delete:()=>p.createElement(pe,null),dimmer:()=>p.createElement(dt,null),edit:()=>p.createElement(en,null),error:()=>p.createElement(y,null),group:()=>p.createElement(ze,null),help:()=>p.createElement(Se,null),identify:()=>p.createElement(ue,null),info:()=>p.createElement($e,null),light:()=>p.createElement(Pt,null),lines:()=>p.createElement(te,null),next:()=>p.createElement(ht,null),open:()=>p.createElement(bt,null),pair:()=>p.createElement(ut,null),pause:()=>p.createElement(st,null),play:()=>p.createElement(Ve,null),previous:()=>p.createElement(v,null),qrcode:()=>p.createElement(Zt,null),refresh:()=>p.createElement(Ee,null),save:()=>p.createElement(Jt,null),search:()=>p.createElement(ke,null),send:()=>p.createElement(T,null),settings:()=>p.createElement(S,null),socket:()=>p.createElement(Gt,null),stop:()=>p.createElement(pt,null),unpair:()=>p.createElement(We,null),upload:()=>p.createElement(we,null),user:()=>p.createElement(it,null),warning:()=>p.createElement(C,null),web:()=>p.createElement($t,null)};function fn(e){return Object.prototype.toString.call(e)===`[object Object]`}var q=class e extends l{constructor(t){super(t),G(this,`defaultValue`,void 0),G(this,`isError`,void 0),G(this,`lang`,void 0),G(this,`defaultSendToDone`,void 0),G(this,`sendToTimeout`,void 0),G(this,`noPlaceRequired`,void 0),G(this,`reportedHidden`,!1),G(this,`calculateTimeout`,null),G(this,`AsyncFunction`,void 0),G(this,`stateAliases`,null),G(this,`statesSubscribed`,!1),G(this,`onDependsOnStateChanged`,()=>{this.forceUpdate()}),G(this,`onUpdate`,t=>{let n=e.getValue(t||this.props.data,this.props.attr)||``;this.state.value===n?this.forceUpdate():this.setState({value:n})}),G(this,`getObject`,async e=>{try{var t,n;return await((t=(n=this.props.oContext).getCachedObject)==null?void 0:t.call(n,e))||null}catch(e){return console.error(e),null}}),this.AsyncFunction=Object.getPrototypeOf(async function(){}).constructor,this.state={confirmDialog:!1,confirmNewValue:null,confirmAttr:null,confirmData:null,confirmCallback:null},this.isError={},this.lang=W.getLanguage(),t.schema&&(t.custom?t.schema.defaultFunc||(this.defaultValue=t.schema.default):t.schema.type!==`state`&&!t.schema.defaultFunc&&(this.defaultValue=t.schema.default))}async getCachedObject(e){return this.props.oContext.getCachedObject?this.props.oContext.getCachedObject(e):await this.props.oContext.socket.getObject(e)||null}static normalizeDependsOnStates(e){let t={};return e&&(Array.isArray(e)?e.forEach(e=>{e&&typeof e==`string`&&(t[e]=e)}):fn(e)?Object.keys(e).forEach(n=>{e[n]&&typeof e[n]==`string`&&(t[n]=e[n])}):console.error(`[JsonConfigComponent] Invalid dependsOnStates: ${JSON.stringify(e)}`)),t}async resolveStateId(e){let t=(e||``).toString();return t.includes("${")&&(t=await this.getPatternAsync(t,null,!0)),t=t.trim(),t.startsWith(`.`)&&(t=`${this.props.oContext.adapterName}.${this.props.oContext.instance||0}${t}`),t.includes(`*`)?(console.error(`[JsonConfigComponent] Wildcards are not allowed in dependsOnStates: ${t}`),``):t}async resolveDependsOnStates(t){let n=e.normalizeDependsOnStates(t),r={};for(let e of Object.keys(n)){let t=await this.resolveStateId(n[e]);t&&(r[e]=t)}return r}async subscribeOnStateIds(e){var t,n;(e.length||this.statesSubscribed)&&(this.statesSubscribed=!!e.length,await((t=(n=this.props.oContext).subscribeStates)==null?void 0:t.call(n,this,e,this.onDependsOnStateChanged)))}async updateStateSubscriptions(){var e;this.stateAliases=await this.resolveDependsOnStates((e=this.props.schema)==null?void 0:e.dependsOnStates),await this.subscribeOnStateIds(Object.values(this.stateAliases))}usesDependsOnStates(){var e;return!!((e=this.props.schema)!=null&&e.dependsOnStates)||this.statesSubscribed}getStateValues(e){let t=e===void 0?this.stateAliases:e,n={};return t&&Object.keys(t).forEach(e=>{var r,i;n[e]=((r=(i=this.props.oContext).getStateValue)==null?void 0:r.call(i,t[e]))??null}),n}async componentDidMount(){var t;if(this.usesDependsOnStates()&&await this.updateStateSubscriptions(),(t=this.props.schema)!=null&&t.defaultFunc&&(this.props.custom?this.defaultValue=await this.executeCustom(this.props.schema.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData,`defaultFunc`):this.props.schema.type!==`state`&&(this.defaultValue=await this.execute(this.props.schema.defaultFunc,this.props.schema.default,this.props.data,this.props.arrayIndex,this.props.globalData,`defaultFunc`))),this.props.attr){var n,r;(n=(r=this.props.oContext).registerOnForceUpdate)==null||n.call(r,this.props.attr,this.onUpdate)}let i=[`select`,`autocomplete`,`autocompleteSendTo`];if(this.defaultValue!==void 0&&this.props.attr){let t=e.getValue(this.props.data,this.props.attr);(t===void 0||i.includes(this.props.schema.type)&&(t===``||t===null))&&setTimeout(()=>{this.props.attr&&(this.props.custom?this.props.onChange(this.props.attr,this.defaultValue,()=>setTimeout(()=>this.props.attr&&this.props.oContext.forceUpdate([this.props.attr],this.props.data),100)):(e.setValue(this.props.data,this.props.attr,this.defaultValue),this.props.onChange(this.props.data,void 0,()=>this.props.attr&&this.props.oContext.forceUpdate([this.props.attr],this.props.data))))},100)}else this.props.schema.defaultSendTo&&this.defaultSendTo().catch(e=>console.error(e))}async defaultSendTo(){if(this.props.alive&&this.props.schema.defaultSendTo){this.defaultSendToDone=!0;let t=this.props.schema.data;if(t===void 0&&this.props.schema.jsonData){let e=await this.getPatternAsync(this.props.schema.jsonData,null,!0);try{t=JSON.parse(e)}catch{console.error(`Cannot parse json data: ${e}`)}}else t={attr:this.props.attr,value:e.getValue(this.props.data,this.props.attr)};t===void 0&&(t=null);let n=await this.getPatternAsync(this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);if(n!==`${this.props.oContext.adapterName}.${this.props.oContext.instance}`){let e=await this.props.oContext.socket.getState(`system.adapter.${n}.alive`);if(!(e!=null&&e.val)){window.alert(W.t(`jc_Instance %s is not alive`,n));return}}try{let r=await this.props.oContext.socket.sendTo(n,this.props.schema.defaultSendTo,t);r!=null&&this.props.attr&&(this.props.custom?this.props.onChange(this.props.attr,r,()=>this.props.attr&&this.props.oContext.forceUpdate([this.props.attr],this.props.data)):(e.setValue(this.props.data,this.props.attr,r),this.props.onChange(this.props.data,void 0,()=>this.props.attr&&this.props.oContext.forceUpdate([this.props.attr],this.props.data))))}catch(e){console.error(e)}}else this.defaultSendToDone=!1,this.props.schema.allowSaveWithError||this.onError(this.props.attr,W.t(`jc_Instance %s is not alive`,this.props.oContext.instance.toString()))}componentWillUnmount(){var e,t;if(this.props.attr){var n,r;(n=(r=this.props.oContext).registerOnForceUpdate)==null||n.call(r,this.props.attr)}(e=(t=this.props.oContext).unsubscribeStates)==null||e.call(t,this),this.statesSubscribed=!1,this.sendToTimeout&&=(clearTimeout(this.sendToTimeout),null),this.calculateTimeout&&=(clearTimeout(this.calculateTimeout),null)}static getValue(t,n){if(!n)return;if(typeof n==`string`)return e.getValue(t,n.split(`.`));if(n.length===1)return t[n[0]];let r=n.shift();if(typeof r==`string`&&typeof t[r]==`object`)return e.getValue(t[r],n)}static setValue(t,n,r){if(n){if(typeof n==`string`){e.setValue(t,n.split(`.`),r);return}if(n.length===1)r===null?delete t[n[0]]:t[n[0]]=r;else{let i=n.shift();if(typeof i!=`string`)return;(!t[i]||typeof t[i]==`object`)&&(t[i]=t[i]||{}),e.setValue(t[i],n,r)}}}getText(e,t,n){if(!e)return``;if(typeof e==`string`){let r=t?e:W.t(e);return r.includes("${")?this.getPattern(r,void 0,t,n):r}if(e&&typeof e==`object`){let r=e;return r.func?typeof r.func==`object`?this.getPattern(r.func[this.lang]||r.func.en||``,void 0,!0,n):this.getPattern(r.func,void 0,t,n):e[this.lang]||e.en||``}return e.toString()}async getTextAsync(e,t){if(!e)return``;if(typeof e==`string`){let n=t?e:W.t(e);return n.includes("${")?this.getPatternAsync(n,null,t):n}return fn(e)?e.func?typeof e.func==`object`?this.getPatternAsync(e.func[this.lang]||e.func.en||``,null,!0):this.getPatternAsync(e.func,null,t):e[this.lang]||e.en||``:e.toString()}renderDialogConfirm(){if(!this.state.confirmDialog)return null;let t=this.state.confirmData||this.props.schema.confirm;if(!t)return null;let n=null;return t.type===`warning`?n=p.createElement(C,null):t.type===`error`?n=p.createElement(y,null):t.type===`info`&&(n=p.createElement($e,null)),p.createElement(xt,{title:this.getText(t.title)||W.t(`jc_Please confirm`),text:this.getText(t.text),ok:this.getText(t.ok)||W.t(`jc_Ok`),cancel:this.getText(t.cancel)||W.t(`jc_Cancel`),icon:n||void 0,onClose:t=>this.setState({confirmDialog:!1},()=>{if(t){if(this.state.confirmCallback){let e=this.state.confirmCallback;this.setState({confirmCallback:null},()=>e(!0));return}let t=JSON.parse(JSON.stringify(this.props.data));this.state.confirmDepAttr&&e.setValue(t,this.state.confirmDepAttr,this.state.confirmDepNewValue),e.setValue(t,this.state.confirmAttr,this.state.confirmNewValue),this.setState({confirmDialog:!1,confirmDepAttr:null,confirmDepNewValue:null,confirmNewValue:null,confirmAttr:null,confirmData:null},()=>this.props.onChange(t))}else{let e=this.state.confirmCallback;this.setState({confirmDialog:!1,confirmDepAttr:null,confirmDepNewValue:null,confirmNewValue:null,confirmAttr:null,confirmData:null,confirmCallback:null},()=>{e&&e(!1)})}})})}getIcon(e){if(e||=this.props.schema.icon,!e)return null;let t=dn[e];return t?t():((e.endsWith(`.png`)||e.endsWith(`.svg`)||e.endsWith(`.jpg`))&&!e.startsWith(`http://`)&&!e.startsWith(`https://`)&&(e=`${this.props.oContext.imagePrefix}/adapter/${this.props.oContext.adapterName}/${e}`),p.createElement(gt,{src:e,style:{width:22,height:22}}))}onChangeAsync(e,t){return new Promise(n=>{let r=this.onChange(e,t,n);r instanceof Promise&&r.catch(e=>console.error(`Cannot set value: ${e}`))})}async onChange(t,n,r){let i=JSON.parse(JSON.stringify(this.props.data));if(e.setValue(i,t,n),this.props.schema.confirm&&await this.execute(this.props.schema.confirm.condition,!1,i,this.props.arrayIndex,this.props.globalData,`confirm.condition`))return new Promise(e=>{this.setState({confirmDialog:!0,confirmNewValue:n,confirmAttr:t,confirmData:null},()=>{typeof r==`function`?r():e()})});if(this.props.schema.confirmDependsOn)for(let a=0;a<this.props.schema.confirmDependsOn.length;a++){let o=this.props.schema.confirmDependsOn[a];if(o.confirm){let a=e.getValue(i,o.attr);if(await this.execute(o.confirm.condition,!1,i,this.props.arrayIndex,this.props.globalData,`confirm.condition`))return new Promise(e=>{if(!o.confirm)throw Error(`Cannot set value: confirm is not defined for ${o.attr}`);this.setState({confirmDialog:!0,confirmNewValue:n,confirmAttr:t,confirmDepNewValue:a,confirmDepAttr:o.attr,confirmData:o.confirm},()=>{typeof r==`function`?r():e()})})}}let a=[];if(this.props.schema.onChangeDependsOn)for(let t=0;t<this.props.schema.onChangeDependsOn.length;t++){let n=this.props.schema.onChangeDependsOn[t];if(n.onChange){let t=e.getValue(i,n.attr),r;r=this.props.custom?await this.executeCustom(n.onChange.calculateFunc,i,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData,`onChange.calculateFunc`):await this.execute(n.onChange.calculateFunc,t,i,this.props.arrayIndex,this.props.globalData,`onChange.calculateFunc`),r!==t&&n.attr&&(e.setValue(i,n.attr,r),a.push(n.attr))}}if(this.props.schema.hiddenDependsOn)for(let e=0;e<this.props.schema.hiddenDependsOn.length;e++){let t=this.props.schema.hiddenDependsOn[e];t.hidden&&t.attr&&a.push(t.attr)}if(this.props.schema.labelDependsOn)for(let e=0;e<this.props.schema.labelDependsOn.length;e++){let t=this.props.schema.labelDependsOn[e];t.hidden&&t.attr&&a.push(t.attr)}if(this.props.schema.helpDependsOn)for(let e=0;e<this.props.schema.helpDependsOn.length;e++){let t=this.props.schema.helpDependsOn[e];t.hidden&&t.attr&&a.push(t.attr)}if(this.props.schema.onChange&&!this.props.schema.onChange.ignoreOwnChanges){let t=e.getValue(i,this.props.attr),n=this.props.custom?await this.executeCustom(this.props.schema.onChange.calculateFunc,i,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData,`onChange.calculateFunc`):await this.execute(this.props.schema.onChange.calculateFunc,t,i,this.props.arrayIndex,this.props.globalData,`onChange.calculateFunc`);n!==t&&e.setValue(i,this.props.attr,n)}return this.props.custom?(this.props.onChange(t,n,()=>r==null?void 0:r()),a!=null&&a.length&&a.forEach((t,n)=>setTimeout(()=>this.props.onChange(t,e.getValue(i,t)),n*50))):this.props.onChange(i,void 0,()=>{a.length&&this.props.oContext.forceUpdate(a,i),r==null||r()}),Promise.resolve()}static ensureAwaitGetObject(e){return e.replace(/(?<![\w$.])getObject\(/g,(t,n)=>{let r=e.slice(Math.max(0,n-10),n);return/await\s+$/.test(r)?t:`await ${t}`})}debugLog(e,t,n,r){var i,a;if(!((i=this.props.schema)!=null&&i.debug))return;let o=this.props.attr||((a=this.props.schema)==null?void 0:a.attr)||``,s=`%c[jsonConfig]%c ${o?`${o} → `:``}${e}`,c={function:t,result:n,data:r??this.props.data,arrayIndex:this.props.arrayIndex};n instanceof Error?console.error(s,`background:#b71c1c;color:#fff;border-radius:3px;padding:1px 4px`,`color:#e53935`,c):console.log(s,`background:#33691e;color:#fff;border-radius:3px;padding:1px 4px`,`color:#7cb342`,c)}static isHostAllowed(e,t){if(!(e!=null&&e.os)&&!(e!=null&&e.notOs)&&(e==null?void 0:e.docker)===void 0)return!0;let n=t==null?void 0:t.os;return!(n&&(e.os&&!(Array.isArray(e.os)?e.os:[e.os]).includes(n)||e.notOs&&(Array.isArray(e.notOs)?e.notOs:[e.notOs]).includes(n))||e.docker!==void 0&&(t==null?void 0:t.docker)!==void 0&&e.docker!==t.docker)}async execute(t,n,r,i,a,o,s){let c;if(fn(t))c=t.func;else if(typeof t==`string`)c=t;else return t;if(!c)return n;c.includes(`getObject(`)&&(c=e.ensureAwaitGetObject(c));try{var l,u;let e=await new this.AsyncFunction(`data`,`originalData`,`_system`,`_alive`,`_common`,`_socket`,`_instance`,`arrayIndex`,`globalData`,`_changed`,`_href`,`getObject`,`_os`,`_arch`,`_host`,`_states`,c.includes(`return`)?c:`return ${c}`)(r||this.props.data||{},this.props.originalData,this.props.oContext.systemConfig,this.props.alive,this.props.common,this.props.oContext.socket,this.props.oContext.instance,i,a||{},this.props.changed,window.location.href,this.getObject,((l=this.props.oContext.hostInfo)==null?void 0:l.os)||``,((u=this.props.oContext.hostInfo)==null?void 0:u.arch)||``,this.props.oContext.hostInfo||{},s||this.getStateValues());return this.debugLog(o||`JS function`,c,e,r),e}catch(e){return this.debugLog(o||`JS function`,c,e instanceof Error?e:Error(String(e)),r),console.error(`Cannot execute ${JSON.stringify(t)}: ${e}`),n}}async executeCustom(t,n,r,i,a,o,s,c){let l;if(fn(t))l=t.func;else if(typeof t==`string`)l=t;else return t;if(!l)return null;l.includes(`getObject(`)&&(l=e.ensureAwaitGetObject(l));try{var u,d;let e=await new this.AsyncFunction(`data`,`originalData`,`_system`,`instanceObj`,`customObj`,`_socket`,`arrayIndex`,`globalData`,`_changed`,`_href`,`getObject`,`_os`,`_arch`,`_host`,`_states`,l.includes(`return`)?l:`return ${l}`)(n||this.props.data,this.props.originalData,this.props.oContext.systemConfig,i||{},r||{},this.props.oContext.socket,a,o||{},this.props.changed,window.location.href,this.getObject,((u=this.props.oContext.hostInfo)==null?void 0:u.os)||``,((d=this.props.oContext.hostInfo)==null?void 0:d.arch)||``,this.props.oContext.hostInfo||{},c||this.getStateValues());return this.debugLog(s||`JS function`,l,e,n),e}catch(e){return this.debugLog(s||`JS function`,l,e instanceof Error?e:Error(String(e)),n),console.error(`Cannot execute ${l}: ${e}`),null}}async calculate(e){let t,n,r,i;return this.props.custom?(t=e.validator?!await this.executeCustom(e.validator,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData,`validator`):!1,n=e.disabled===!0?!0:e.disabled?await this.executeCustom(e.disabled,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData,`disabled`):!1,r=e.hidden===!0?!0:e.hidden?await this.executeCustom(e.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData,`hidden`):!1,i=e.defaultFunc?await this.executeCustom(e.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData,`defaultFunc`):e.default):(t=e.validator?!await this.execute(e.validator,!1,this.props.data,this.props.arrayIndex,this.props.globalData,`validator`):!1,n=e.disabled===!0?!0:e.disabled?await this.execute(e.disabled,!1,this.props.data,this.props.arrayIndex,this.props.globalData,`disabled`):!1,r=e.hidden===!0?!0:e.hidden?await this.execute(e.hidden,!1,this.props.data,this.props.arrayIndex,this.props.globalData,`hidden`):!1,i=e.defaultFunc?await this.execute(e.defaultFunc,e.default,this.props.data,this.props.arrayIndex,this.props.globalData,`defaultFunc`):e.default),{error:t,disabled:n,hidden:r,defaultValue:i}}onError(e,t){var n,r;e&&(t?this.isError[e]=t:delete this.isError[e]),(n=(r=this.props).onError)==null||n.call(r,e,t)}renderItem(e,t,n){return this.getText(this.props.schema.label)||this.getText(this.props.schema.text)}renderHelp(e,t,n){return t?p.createElement(`a`,{href:t,target:`_blank`,rel:`noreferrer`,style:{color:this.props.oContext.themeType===`dark`?`#a147ff`:`#5b238f`,textDecoration:`underline`}},this.getText(e,n)):(e=this.getText(e,n)||``,e&&(e.includes(`<a `)||e.includes(`<br`)||e.includes(`<b>`)||e.includes(`<i>`))?z.renderTextWithA(e):e)}async renderHelpAsync(e,t,n){return t?p.createElement(`a`,{href:t,target:`_blank`,rel:`noreferrer`,style:{color:this.props.oContext.themeType===`dark`?`#a147ff`:`#5b238f`,textDecoration:`underline`}},await this.getTextAsync(e,n)):(e=await this.getTextAsync(e,n)||``,e&&(e.includes(`<a `)||e.includes(`<br`)||e.includes(`<b>`)||e.includes(`<i>`))?z.renderTextWithA(e):e)}static escapeString(t,n){return typeof t==`string`?(t=t.replace(/`/g,"\\`"),t=t.replace(/\${([^}]+)}/g,(t,r)=>{if(r&&typeof r==`string`&&r.startsWith(`data.`)){let t=e.getValue(n,r.replace(/^data\./,``));if(typeof t==`string`&&(t.includes(`\\`)||t.includes(`"`)))return`\${${r}.replace(/\\\\/g, '\\\\\\\\').replace(/"/g, '\\\\"')}`}return t}),t):``}async getPatternAsync(t,n,r,i){if(n||=this.props.data,!t)return``;let a;typeof t==`object`?t.func?a=t.func:(console.log(`Object must be stringified: ${JSON.stringify(t)}`),a=JSON.stringify(t)):a=t,a.includes(`getObject(`)&&(a=e.ensureAwaitGetObject(a));try{var o,s;if(this.props.custom){var c,l;let t=await new this.AsyncFunction(`data`,`originalData`,`arrayIndex`,`globalData`,`_system`,`instanceObj`,`customObj`,`_socket`,`_changed`,`_href`,`getObject`,`_os`,`_arch`,`_host`,`_states`,`return \`${e.escapeString(a,n)}\``)(n,this.props.originalData,this.props.arrayIndex,this.props.globalData,this.props.oContext.systemConfig,this.props.oContext.instanceObj,this.props.customObj,this.props.oContext.socket,this.props.changed,window.location.href,this.getObject,((c=this.props.oContext.hostInfo)==null?void 0:c.os)||``,((l=this.props.oContext.hostInfo)==null?void 0:l.arch)||``,this.props.oContext.hostInfo||{},i||this.getStateValues());return r?t:W.t(t)}let t=await new this.AsyncFunction(`data`,`originalData`,`arrayIndex`,`globalData`,`_system`,`_alive`,`_common`,`_socket`,`_changed`,`_href`,`getObject`,`_os`,`_arch`,`_host`,`_states`,`return \`${e.escapeString(a,n)}\``)(n,this.props.originalData,this.props.arrayIndex,this.props.globalData,this.props.oContext.systemConfig,this.props.alive,this.props.common,this.props.oContext.socket,this.props.changed,window.location.href,this.getObject,((o=this.props.oContext.hostInfo)==null?void 0:o.os)||``,((s=this.props.oContext.hostInfo)==null?void 0:s.arch)||``,this.props.oContext.hostInfo||{},i||this.getStateValues());return r?t:W.t(t)}catch(e){return console.error(`Cannot execute ${a}: ${e}`),a}}getPattern(t,n,r,i){if(n||=this.props.data,!t)return``;let a;typeof t==`object`?t.func?a=t.func:(console.log(`Object must be stringified: ${JSON.stringify(t)}`),a=JSON.stringify(t)):a=t,a.includes(`getObject(`)&&console.warn(`It is not possible to use getObject function in text patterns: ${a}`);try{var o,s;if(this.props.custom){var c,l;let t=Function(`data`,`originalData`,`arrayIndex`,`globalData`,`_system`,`instanceObj`,`customObj`,`_socket`,`_changed`,`_href`,`_os`,`_arch`,`_host`,`_states`,`return \`${e.escapeString(a,n)}\``)(n,this.props.originalData,this.props.arrayIndex,this.props.globalData,this.props.oContext.systemConfig,this.props.oContext.instanceObj,this.props.customObj,this.props.oContext.socket,this.props.changed,window.location.href,((c=this.props.oContext.hostInfo)==null?void 0:c.os)||``,((l=this.props.oContext.hostInfo)==null?void 0:l.arch)||``,this.props.oContext.hostInfo||{},i||this.getStateValues());return r?t:W.t(t)}let t=Function(`data`,`originalData`,`arrayIndex`,`globalData`,`_system`,`_alive`,`_common`,`_socket`,`_changed`,`_href`,`_os`,`_arch`,`_host`,`_states`,`return \`${e.escapeString(a,n)}\``)(n,this.props.originalData,this.props.arrayIndex,this.props.globalData,this.props.oContext.systemConfig,this.props.alive,this.props.common,this.props.oContext.socket,this.props.changed,window.location.href,((o=this.props.oContext.hostInfo)==null?void 0:o.os)||``,((s=this.props.oContext.hostInfo)==null?void 0:s.arch)||``,this.props.oContext.hostInfo||{},i||this.getStateValues());return r?t:W.t(t)}catch(e){return console.error(`Cannot execute ${a}: ${e}`),a}}updateCalculatedValues(){this.calculateTimeout&&clearTimeout(this.calculateTimeout),this.calculateTimeout=setTimeout(async()=>{this.calculateTimeout=null;let e=this.props.schema;if(!e)return;this.usesDependsOnStates()&&await this.updateStateSubscriptions();let{error:t,disabled:n,hidden:r,defaultValue:i}=await this.calculate(e);(!this.state.calculatedValues||this.state.calculatedValues.error!==t||this.state.calculatedValues.disabled!==n||this.state.calculatedValues.hidden!==r||this.state.calculatedValues.defaultValue!==i)&&this.setState({calculatedValues:{error:t,disabled:n,hidden:r,defaultValue:i}})},50)}render(){let t=this.props.schema;if(!t||this.props.expertMode===!1&&t.expertMode||!e.isHostAllowed(t,this.props.oContext.hostInfo)||(this.props.alive&&this.defaultSendToDone===!1&&(this.sendToTimeout=setTimeout(async()=>{this.sendToTimeout=null,await this.defaultSendTo()},200)),this.updateCalculatedValues(),!this.state.calculatedValues))return null;if(this.state.calculatedValues.hidden){if(Object.keys(this.isError).length&&(setTimeout(e=>Object.keys(e).forEach(e=>this.props.onError(e)),100,JSON.parse(JSON.stringify(this.isError))),this.isError={}),t.hideOnlyControl){let e=p.createElement(Wt,{size:{xs:t.xs||un,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0},style:{marginBottom:0,textAlign:`left`,...t.style,...this.props.oContext.themeType===`dark`?t.darkStyle:{}}});return t.newLine?p.createElement(p.Fragment,null,p.createElement(`div`,{style:{flexBasis:`100%`,height:0}}),e):e}return this.props.onHiddenChanged&&!this.reportedHidden&&(this.reportedHidden=!0,setTimeout(()=>{var e,t;return this.props.attr&&((e=(t=this.props).onHiddenChanged)==null?void 0:e.call(t,this.props.attr,!0))},10)),null}this.props.onHiddenChanged&&this.reportedHidden&&(this.reportedHidden=!1,setTimeout(()=>{var e,t;return this.props.attr&&((e=(t=this.props).onHiddenChanged)==null?void 0:e.call(t,this.props.attr,!1))},10)),t.validatorNoSaveOnError&&this.props.attr&&(this.state.calculatedValues.error&&!Object.keys(this.isError).length?(this.isError={[this.props.attr]:!t.validatorErrorText||W.t(t.validatorErrorText)},setTimeout(e=>Object.keys(e).forEach(t=>this.props.onError(t,e[t])),100,JSON.parse(JSON.stringify(this.isError)))):!this.state.calculatedValues.error&&Object.keys(this.isError).length&&(setTimeout(e=>Object.keys(e).forEach(e=>this.props.onError(e)),100,JSON.parse(JSON.stringify(this.isError))),this.isError={}));let n=this.renderItem(this.state.calculatedValues.error,this.state.calculatedValues.disabled||this.props.commandRunning||this.props.disabled||!1,this.state.calculatedValues.defaultValue);if(this.noPlaceRequired)return n;let r=p.createElement(Wt,{title:this.getText(t.tooltip),size:{xs:t.xs||12,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0},style:{marginBottom:0,textAlign:`left`,width:t.type===`divider`||t.type===`header`?t.width||`100%`:void 0,...t.style,...this.props.oContext.themeType===`dark`?t.darkStyle:{}}},this.props.schema.defaultSendTo&&this.props.schema.button?p.createElement(Wt,{container:!0,style:{width:`100%`}},p.createElement(Wt,{sx:{flex:1}},n),p.createElement(Wt,null,p.createElement(h,{disabled:this.state.calculatedValues.disabled,variant:`outlined`,onClick:()=>this.defaultSendTo(),title:this.props.schema.buttonTooltip?this.getText(this.props.schema.buttonTooltip,this.props.schema.buttonTooltipNoTranslation):W.t(`jc_Request data by instance`)},this.getText(this.props.schema.button)))):n);return t.newLine?p.createElement(p.Fragment,null,p.createElement(`div`,{style:{flexBasis:`100%`,height:0}}),this.renderDialogConfirm(),r):this.state.confirmDialog?p.createElement(p.Fragment,null,this.renderDialogConfirm(),r):r}};G(q,`DIFFERENT_VALUE`,`__different__`),G(q,`DIFFERENT_LABEL`,`jc___different__`),G(q,`NONE_VALUE`,``),G(q,`NONE_LABEL`,`jc_none`),f();var pn={fullWidth:{width:`100%`},accordionSummary:e=>({backgroundColor:e.palette.mode===`dark`?`rgba(255, 255, 255, 0.08)`:`rgba(0, 0, 0, 0.08)`}),accordionTitle:{},toolbar:e=>({backgroundColor:e.palette.mode===`dark`?`rgba(255, 255, 255, 0.08)`:`rgba(0, 0, 0, 0.08)`,borderRadius:`3px`}),tooltip:{pointerEvents:`none`}},mn=class extends q{constructor(e){super(e),G(this,`typingTimer`,null),G(this,`onAccordionError`,e=>(t,n)=>{let r={...this.state.accordionErrors};r[e]||(r[e]={}),t&&(n?r[e][t]=n:(delete r[e][t],Object.keys(r[e]).length===0&&delete r[e])),this.setState({accordionErrors:r}),this.props.onError(t,n)}),G(this,`hasAccordionErrors`,e=>!!this.state.accordionErrors[e]&&Object.keys(this.state.accordionErrors[e]).length>0),G(this,`onDelete`,e=>()=>{let t=JSON.parse(JSON.stringify(this.state.value));t.splice(e,1),this.setState({value:t,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(t))}),G(this,`onClone`,e=>()=>{let t=JSON.parse(JSON.stringify(this.state.value)),n=JSON.parse(JSON.stringify(t[e]));if(typeof this.props.schema.clone==`string`&&typeof n[this.props.schema.clone]==`string`){let e=1,r=n[this.props.schema.clone],i=r.match(/(\d+)$/);for(i?(r=r.replace(i[0],``),e=parseInt(i[0],10)+1):r+=`_`;t.find(t=>t[this.props.schema.clone]===r+e.toString());)e++;n[this.props.schema.clone]=`${n[this.props.schema.clone]}_${e}`}t.splice(e,0,n),this.setState({value:t,activeIndex:-1,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(t))}),G(this,`onChangeWrapper`,e=>{this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout(e=>{if(this.typingTimer=null,this.props.attr){let t=this.onChange(this.props.attr,e);t instanceof Promise&&t.catch(e=>this.onError(e))}},300,e)}),G(this,`onAdd`,async()=>{let{schema:e}=this.props,t=JSON.parse(JSON.stringify(this.state.value)),n={};if(e.items)for(let r of e.items){let e;e=r.defaultFunc?this.props.custom?r.defaultFunc?await this.executeCustom(r.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,t.length,this.props.data):this.props.schema.default:r.defaultFunc?await this.execute(r.defaultFunc,this.props.schema.default,this.props.data,t.length,this.props.data):this.props.schema.default:r.default??null,r.attr&&(n[r.attr]=e)}t.push(n),this.setState({value:t,activeIndex:t.length-1},()=>this.onChangeWrapper(t))}),G(this,`onExport`,()=>{let{value:e}=this.state,t=JSON.stringify(e,null,2),n=`data:application/json;charset=utf-8,${encodeURIComponent(t)}`,r=`config_section_${new Date().toISOString().slice(0,19).replace(/:/g,`-`)}.json`,i=document.createElement(`a`);i.setAttribute(`href`,n),i.setAttribute(`download`,r),i.click()}),G(this,`onImport`,e=>{let t=document.createElement(`input`);t.type=`file`,t.accept=`.json`,t.onchange=t=>{var n;let r=(n=t.target.files)==null?void 0:n[0];if(!r)return;let i=new FileReader;i.onload=t=>{try{var n;let r=JSON.parse((n=t.target)==null?void 0:n.result);if(!Array.isArray(r)){alert(W.t(`jc_Invalid JSON format. Expected an array.`));return}let i;i=e?r:[...this.state.value,...r],this.setState({value:i,activeIndex:-1},()=>this.onChangeWrapper(i))}catch{alert(W.t(`jc_Invalid JSON file.`))}},i.readAsText(r)},t.click()}),this.props.schema.items||=[]}async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr)||[];Array.isArray(e)||(e=[]),this.setState({value:e,activeIndex:-1,iteration:0,accordionErrors:{}})}componentWillUnmount(){this.typingTimer&&=(clearTimeout(this.typingTimer),null),super.componentWillUnmount()}itemAccordion(e,t){let{value:n}=this.state,{schema:r}=this.props,i={type:`panel`,items:r.items.reduce((e,t)=>(t.attr&&(e[t.attr]=t),e),{}),style:{marginLeft:`-8px`,marginTop:`10px`,marginBottom:`10px`}};return p.createElement(Pc,{oContext:this.props.oContext,index:t+this.state.iteration,arrayIndex:t,changed:this.props.changed,expertMode:this.props.expertMode,globalData:this.props.data,common:this.props.common,alive:this.props.alive,themeName:this.props.themeName,data:e,custom:!0,schema:i,originalData:this.props.originalData,onChange:(e,r)=>{if(typeof e==`string`&&e){let i=JSON.parse(JSON.stringify(n));i[t][e]=r,this.setState({value:i},()=>this.onChangeWrapper(i))}},onError:this.onAccordionError(t),onHiddenChanged:this.props.onHiddenChanged,table:this.props.table,customComponents:this.props.customComponents})}onMoveUp(e){let t=JSON.parse(JSON.stringify(this.state.value)),n=t[e];t.splice(e,1),t.splice(e-1,0,n);let r=this.state.activeIndex-1;this.setState({value:t,activeIndex:r,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(t))}onMoveDown(e){let t=JSON.parse(JSON.stringify(this.state.value)),n=t[e];t.splice(e,1),t.splice(e+1,0,n);let r=this.state.activeIndex+1;this.setState({value:t,activeIndex:r,iteration:this.state.iteration+1e4},()=>this.onChangeWrapper(t))}renderItem(){let{schema:e}=this.props,{value:t}=this.state;return t?p.createElement(he,null,e.label||!e.noDelete?p.createElement(jt,{variant:`dense`},e.label?p.createElement(Re,{variant:`h6`,id:`tableTitle`,component:`div`},this.getText(e.label)):null,e.noDelete?null:p.createElement(p.Fragment,null,p.createElement(A,{title:W.t(`jc_Export configuration section`)},p.createElement(B,{size:`small`,color:`primary`,onClick:this.onExport},p.createElement(Ne,null))),p.createElement(A,{title:W.t(`jc_Import and replace configuration section`)},p.createElement(B,{size:`small`,color:`primary`,onClick:()=>this.onImport(!0)},p.createElement(ae,null))),p.createElement(A,{title:W.t(`jc_Import and add configuration section`)},p.createElement(B,{size:`small`,color:`primary`,onClick:()=>this.onImport(!1)},p.createElement(g,null))),p.createElement(B,{size:`small`,color:`primary`,onClick:this.onAdd},p.createElement(ye,null)))):null,t.map((n,r)=>p.createElement(xe,{key:`${n}_${r}`,expanded:this.state.activeIndex===r,onChange:(e,t)=>this.setState({activeIndex:t?r:-1})},p.createElement(Xe,{expandIcon:p.createElement(je,null),sx:z.getStyle(this.props.oContext.theme,pn.fullWidth,pn.accordionSummary)},p.createElement(R,{sx:{display:`flex`,alignItems:`center`,gap:1,width:`100%`}},e.titleAttr&&p.createElement(Re,{style:pn.accordionTitle},n[e.titleAttr]),this.hasAccordionErrors(r)&&p.createElement(y,{sx:{fontSize:20,color:`error.main`}}))),p.createElement(lt,{style:{...e.style,...this.props.oContext.themeType?e.darkStyle:void 0}},this.itemAccordion(t[r],r),p.createElement(jt,{sx:pn.toolbar},r?p.createElement(A,{title:W.t(`jc_Move up`),slotProps:{popper:{sx:pn.tooltip}}},p.createElement(B,{size:`small`,onClick:()=>this.onMoveUp(r)},p.createElement(Ht,null))):p.createElement(`div`,{style:pn.buttonEmpty}),r<t.length-1?p.createElement(A,{title:W.t(`jc_Move down`),slotProps:{popper:{sx:pn.tooltip}}},p.createElement(B,{size:`small`,onClick:()=>this.onMoveDown(r)},p.createElement(Et,null))):p.createElement(`div`,{style:pn.buttonEmpty}),e.noDelete?null:p.createElement(A,{title:W.t(`jc_Delete current row`),slotProps:{popper:{sx:pn.tooltip}}},p.createElement(B,{size:`small`,onClick:this.onDelete(r)},p.createElement(pe,null))),e.clone?p.createElement(A,{title:W.t(`jc_Clone current row`),slotProps:{popper:{sx:pn.tooltip}}},p.createElement(B,{size:`small`,onClick:this.onClone(r)},p.createElement(ce,null))):null)))),!e.noDelete&&t.length>0?p.createElement(jt,{variant:`dense`,sx:pn.rootTool},p.createElement(B,{size:`small`,color:`primary`,onClick:this.onAdd},p.createElement(ye,null))):null,e.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null):null}};f();var hn={root:{width:`100%`},notAlive:{color:`#a30000`}},gn=class extends q{constructor(...e){super(...e),G(this,`aliveId`,null),G(this,`checkTimeout`,null),G(this,`onAliveChanged`,(e,t)=>{e===this.aliveId&&this.state.alive!==!!(t!=null&&t.val)&&this.setState({alive:!!(t!=null&&t.val)})})}async componentDidMount(){await super.componentDidMount();let e=await this.getInstance();this.aliveId=`${e}.alive`;let t=await this.props.oContext.socket.getState(this.aliveId);this.setState({alive:!!(t!=null&&t.val),instance:e},async()=>{this.aliveId&&await this.props.oContext.socket.subscribeState(this.aliveId,this.onAliveChanged)})}componentWillUnmount(){this.checkTimeout&&=(clearTimeout(this.checkTimeout),null),this.aliveId&&this.props.oContext.socket.unsubscribeState(this.aliveId,this.onAliveChanged)}async getInstance(){let e=this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`;return e.includes("${")&&(e=await this.getPatternAsync(e,null,!0)),e&&!e.startsWith(`system.adapter.`)&&(e=`system.adapter.${e}`),e}checkIfInstanceChanged(){this.checkTimeout&&clearTimeout(this.checkTimeout),this.checkTimeout=setTimeout(async()=>{this.checkTimeout=null;let e=await this.getInstance();e!==this.state.instance&&(e?this.props.oContext.socket.getState(`${e}.alive`).then(t=>this.setState({alive:!!(t&&t.val),instance:e})):this.setState({alive:null,instance:e}))},200)}renderItem(){var e;if(this.checkIfInstanceChanged(),this.state.alive!==!1&&this.state.alive!==!0)return null;let t=(e=this.state.instance)==null?void 0:e.replace(/^system\.adapter\./,``);return p.createElement(`div`,{style:{...hn.root,...this.state.alive?void 0:hn.notAlive}},this.state.alive?this.props.schema.textAlive===void 0?W.t(`jc_Instance %s is alive`,t):this.props.schema.textAlive?W.t(this.props.schema.textAlive,t):``:this.props.schema.textNotAlive===void 0?W.t(`jc_Instance %s is not alive`,t):this.props.schema.textNotAlive?W.t(this.props.schema.textNotAlive,t):``)}};f();var _n=class extends q{async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr),t=this.props.schema.options.map(e=>typeof e==`string`?{label:e,value:e}:JSON.parse(JSON.stringify(e)));if(this.props.onFilterLabelUpdate&&this.props.table&&this.props.attr){let e={};for(let n of t)n.value!==q.DIFFERENT_VALUE&&(e[n.value]=this.getText(n.label));this.props.onFilterLabelUpdate(this.props.attr,e)}Array.isArray(e)?(t.unshift({label:W.t(q.DIFFERENT_LABEL),value:q.DIFFERENT_VALUE}),this.setState({value:q.DIFFERENT_VALUE,selectOptions:t})):this.setState({value:e,selectOptions:t})}renderItem(e,t){if(!this.state.selectOptions)return null;let n,r=JSON.parse(JSON.stringify(this.state.selectOptions));return Array.isArray(this.state.value)||this.state.value===q.DIFFERENT_VALUE?([...this.state.value].filter(e=>!r.find(t=>typeof t==`object`?t.value===e:t===e)).forEach(e=>r.push({label:e.toString(),value:e})),n={label:W.t(q.DIFFERENT_LABEL),value:q.DIFFERENT_VALUE},r.unshift(n)):(n=this.state.value!==null&&this.state.value!==void 0&&r.find(e=>typeof e==`object`?e.value==this.state.value:e==this.state.value),this.state.value!==null&&this.state.value!==void 0&&!n&&this.props.schema.freeSolo&&(n={value:this.state.value,label:this.state.value},r.push(n)),n||=null),p.createElement(ft,{fullWidth:!0,freeSolo:!!this.props.schema.freeSolo,value:n,options:r,isOptionEqualToValue:(e,t)=>e.value===(typeof t==`string`?t:t.value),filterOptions:(e,t)=>{let n=t.inputValue.toLowerCase(),r=e.filter(e=>t.inputValue===``||this.getText(e.label??``).toLowerCase().includes(n)||String(e.value??``).toLowerCase().includes(n));return this.props.schema.freeSolo&&t.inputValue!==``&&r.push({label:t.inputValue,value:t.inputValue}),r},onInputChange:e=>{if(!e||!this.props.schema.freeSolo)return;let t=e.target.value;t!==this.state.value&&this.setState({value:t},()=>this.props.attr&&this.onChange(this.props.attr,t))},onChange:(e,t)=>{let n=typeof t==`object`?t?t.value:``:t;n!==this.state.value&&this.setState({value:n},()=>this.props.attr&&this.onChange(this.props.attr,n))},getOptionLabel:e=>typeof e==`object`?this.getText((e==null?void 0:e.label)??``):``,renderInput:n=>p.createElement(O,{variant:`standard`,...n,error:!!e,placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:t})})}};f();var vn=class extends q{constructor(...e){super(...e),G(this,`initialized`,!1),G(this,`localContext`,void 0)}async askInstance(){let e=q.getValue(this.props.data,this.props.attr),t=this.props.schema.options?this.props.schema.options.map(e=>typeof e==`string`?{label:e,value:e}:JSON.parse(JSON.stringify(e))):[];if(this.props.alive){let n=this.props.schema.data;if(n===void 0&&this.props.schema.jsonData){let e=await this.getPatternAsync(this.props.schema.jsonData,null,!0);try{typeof e==`string`&&(n=JSON.parse(e))}catch{console.error(`Cannot parse json data: ${JSON.stringify(n)}`)}}n===void 0&&(n=null),this.setState({loading:!0});let r=await this.getPatternAsync(this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);if(r!==`${this.props.oContext.adapterName}.${this.props.oContext.instance}`){let e=await this.props.oContext.socket.getState(`system.adapter.${r}.alive`);if(!(e!=null&&e.val)){window.alert(W.t(`jc_Instance %s is not alive`,r));return}}this.props.oContext.socket.sendTo(r,this.props.schema.command||`send`,n).then(n=>{n&&Array.isArray(n)&&n.forEach(e=>t.push(typeof e==`string`?{label:e,value:e}:JSON.parse(JSON.stringify(e)))),this.reportFilterLabels(t),Array.isArray(e)?(t.unshift({label:W.t(q.DIFFERENT_LABEL),value:q.DIFFERENT_VALUE}),this.setState({value:q.DIFFERENT_VALUE,selectOptions:t,loading:!1})):this.setState({value:e,selectOptions:t,loading:!1})}).catch(e=>{console.error(`Error in autocompleteSendTo:`,e),this.setState({loading:!1})})}else Array.isArray(e)?(t.unshift({label:W.t(q.DIFFERENT_LABEL),value:q.DIFFERENT_VALUE}),this.reportFilterLabels(t),this.setState({value:q.DIFFERENT_VALUE,selectOptions:t})):(this.reportFilterLabels(t),this.setState({value:e,selectOptions:t}))}reportFilterLabels(e){if(this.props.onFilterLabelUpdate&&this.props.table&&this.props.attr){let t={};for(let n of e)n.value!==q.DIFFERENT_VALUE&&(t[n.value]=n.label);this.props.onFilterLabelUpdate(this.props.attr,t)}}getContext(){let e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=q.getValue(this.props.data,t)),JSON.stringify(e)}renderItem(e,t){if(this.props.alive){let e=this.getContext();(e!==this.localContext||!this.initialized)&&(this.localContext=e,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}let n,r=this.state.selectOptions?JSON.parse(JSON.stringify(this.state.selectOptions)):[];return Array.isArray(this.state.value)||this.state.value===q.DIFFERENT_LABEL?([...this.state.value].filter(e=>!r.find(t=>t.value===e)).forEach(e=>r.push({label:e.toString(),value:e})),n={label:W.t(q.DIFFERENT_LABEL),value:q.DIFFERENT_VALUE},r.unshift(n)):(n=this.state.value!==null&&this.state.value!==void 0&&r.find(e=>e.value==this.state.value),this.state.value!==null&&this.state.value!==void 0&&!n&&this.props.schema.freeSolo&&(n={value:this.state.value,label:this.state.value},r.push(n)),n||=null),r.length?p.createElement(ft,{value:n,fullWidth:!0,freeSolo:!!this.props.schema.freeSolo,options:r,disabled:t,isOptionEqualToValue:(e,t)=>e.value===(typeof t==`string`?t:t.value),filterOptions:(e,t)=>{let n=t.inputValue.toLowerCase(),r=e.filter(e=>t.inputValue===``||String(e.label??``).toLowerCase().includes(n)||String(e.value??``).toLowerCase().includes(n));return this.props.schema.freeSolo&&t.inputValue!==``&&r.push({label:t.inputValue,value:t.inputValue}),r},getOptionLabel:e=>this.getText(typeof e==`object`?(e==null?void 0:e.label)??``:e),onInputChange:e=>{if(!e||!this.props.schema.freeSolo)return;let t=e.target.value;t!==this.state.value&&this.setState({value:t},()=>this.props.attr&&this.onChange(this.props.attr,t))},onChange:(e,t)=>{let n=typeof t==`object`?t?t.value:``:t;n!==this.state.value&&this.setState({value:n},()=>this.props.attr&&this.onChange(this.props.attr,n))},renderInput:n=>p.createElement(O,{variant:`standard`,...n,error:!!e,placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:t,slotProps:{...n.slotProps,input:{...n.slotProps.input,endAdornment:p.createElement(p.Fragment,null,this.state.loading?p.createElement(Te,{position:`end`},p.createElement(Nt,{size:20})):null,t?null:n.slotProps.input.endAdornment)}}})}):p.createElement(O,{variant:`standard`,fullWidth:!0,value:this.state.value??``,error:!!e,disabled:t,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0},input:{endAdornment:this.state.loading?p.createElement(Te,{position:`end`},p.createElement(Nt,{size:20})):null}},onChange:e=>{let t=e.target.value;this.setState({value:t},()=>this.props.attr&&this.onChange(this.props.attr,(t||``).trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}};f();var yn={fullWidth:{width:`100%`},flex:{display:`flex`},button:{height:48,marginLeft:4,minWidth:48}},bn=class extends q{async componentDidMount(){await super.componentDidMount();let{data:e,attr:t}=this.props,n=q.getValue(e,t)||``;this.setState({value:n,showDialog:!1})}renderItem(e,t){let{schema:n,attr:r}=this.props,{value:i,showDialog:a}=this.state;return p.createElement(U,{style:yn.fullWidth,variant:`standard`},n.label?p.createElement(x,{shrink:!0},this.getText(n.label)):null,p.createElement(`div`,{style:yn.flex},p.createElement(O,{variant:`standard`,fullWidth:!0,value:i??``,error:!!e,disabled:t,placeholder:this.getText(n.placeholder),label:this.getText(n.label),helperText:this.renderHelp(n.help,n.helpLink,n.noTranslation),onChange:e=>{let t=e.target.value;this.setState({value:t},()=>this.onChange(r,t))}}),p.createElement(h,{color:`grey`,disabled:t,style:yn.button,size:`small`,variant:`outlined`,onClick:()=>this.setState({showDialog:!0})},`...`)),a?p.createElement(ct,{title:W.t(`jc_Define schedule`),simple:n.simple,complex:n.complex,cron:i,onClose:()=>this.setState({showDialog:!1}),cancel:W.t(`jc_Cancel`),ok:W.t(`jc_Ok`),theme:this.props.oContext.theme,onOk:e=>this.setState({showDialog:!1,value:e},()=>this.onChange(r,e))}):null)}};f();var xn=class extends q{async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr),t=(await this.props.oContext.socket.getCertificates()).filter(e=>{let t=this.props.attr.toLowerCase();return t.includes(e.type)||e.type===`public`&&t.includes(`cert`)||e.type===`private`&&(t.includes(`priv`)||t.includes(`key`))?!0:!(e.type!==`chained`||!t.includes(`chain`)&&!t.includes(`ca`))}).map(e=>({label:e.name,value:e.name}));t.unshift({label:W.t(q.NONE_LABEL),value:q.NONE_VALUE}),this.setState({value:e,selectOptions:t})}renderItem(e,t){var n,r;if(!this.state.selectOptions)return null;let i=(n=this.state.selectOptions)==null?void 0:n.find(e=>e.value===this.state.value);return p.createElement(U,{style:{width:`100%`},variant:`standard`},this.props.schema.label?p.createElement(x,{shrink:!0},this.getText(this.props.schema.label)):null,p.createElement(D,{variant:`standard`,error:!!e,displayEmpty:!0,disabled:!!t,value:this.state.value,renderValue:()=>this.getText(i==null?void 0:i.label,this.props.schema.noTranslation!==!1),onChange:e=>this.setState({value:e.target.value},()=>this.onChange(this.props.attr,this.state.value))},(r=this.state.selectOptions)==null?void 0:r.map(e=>p.createElement(H,{key:e.value,value:e.value,style:e.value===q.NONE_VALUE?{opacity:.5}:{}},this.getText(e.label,this.props.schema.noTranslation!==!1)))),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();var Sn={fullWidth:{width:`100%`},leWidth:{width:620,marginBottom:10},certWidth:{width:200,marginRight:10}},Cn=class extends q{async componentDidMount(){var e;await super.componentDidMount();let t=await this.props.oContext.socket.getCertificates(),n=[],r=[],i=[],a,o=await this.getCachedObject(`system.certificates`);a=o!=null&&(e=o.native)!=null&&e.collections?Object.keys(o.native.collections):null,t.forEach(e=>{e.type===`public`?n.push({label:e.name,value:e.name}):e.type===`private`?r.push({label:e.name,value:e.name}):e.type===`chained`?i.push({label:e.name,value:e.name}):(n.push({label:e.name,value:e.name}),r.push({label:e.name,value:e.name}),i.push({label:e.name,value:e.name}))}),n.unshift({label:W.t(q.NONE_LABEL),value:q.NONE_VALUE}),r.unshift({label:W.t(q.NONE_LABEL),value:q.NONE_VALUE}),i.unshift({label:W.t(q.NONE_LABEL),value:q.NONE_VALUE}),this.setState({certsPublicOptions:n,certsChainOptions:i,certsPrivateOptions:r,collectionsOptions:a})}renderItem(e,t){var n,r,i,a,o,s,c;if(!this.state.certsPublicOptions||!this.state.certsPrivateOptions||!this.state.certsChainOptions)return null;let l=(q.getValue(this.props.data,this.props.schema.leCollectionName||`leCollection`)||`false`).toString(),u=q.getValue(this.props.data,this.props.schema.certPublicName||`certPublic`),d=q.getValue(this.props.data,this.props.schema.certPrivateName||`certPrivate`),f=q.getValue(this.props.data,this.props.schema.certChainedName||`certChained`),m=(n=this.state.certsPublicOptions)==null?void 0:n.find(e=>e.value===u),h=(r=this.state.certsPrivateOptions)==null?void 0:r.find(e=>e.value===d),g=(i=this.state.certsChainOptions)==null?void 0:i.find(e=>e.value===f);return p.createElement(`div`,{style:Sn.fullWidth},this.state.collectionsOptions?p.createElement(U,{style:Sn.leWidth,variant:`standard`},p.createElement(x,{shrink:!0},`Let's encrypt`),p.createElement(D,{variant:`standard`,error:!!e,displayEmpty:!0,disabled:!!t,value:l,onChange:e=>this.onChange(this.props.schema.leCollectionName||`leCollection`,e.target.value===`false`?!1:e.target.value===`true`||e.target.value)},p.createElement(H,{key:`_false`,value:`false`,style:{fontWeight:`bold`}},W.t(`jc_Do not use let's encrypt`)),p.createElement(H,{key:`_true`,value:`true`,style:{fontWeight:`bold`}},W.t(`jc_Use all available let's encrypt certificates`)),(a=this.state.collectionsOptions)==null?void 0:a.map(e=>p.createElement(H,{key:e,value:e},e)))):null,this.state.collectionsOptions?p.createElement(`br`,null):null,this.state.collectionsOptions&&l!==`false`?p.createElement(`div`,null,W.t(`jc_Fallback custom certificates`)):null,p.createElement(U,{style:Sn.certWidth,variant:`standard`},p.createElement(x,{shrink:!0},W.t(`jc_Public certificate`)),p.createElement(D,{variant:`standard`,error:!!e,displayEmpty:!0,disabled:!!t,value:u||``,renderValue:()=>this.getText(m==null?void 0:m.label,!0),onChange:e=>this.onChange(this.props.schema.certPublicName||`certPublic`,e.target.value)},(o=this.state.certsPublicOptions)==null?void 0:o.map((e,t)=>p.createElement(H,{key:`${e.value}_${t}`,value:e.value,style:e.value===q.NONE_VALUE?{opacity:.5}:{}},this.getText(e.label,!0))))),p.createElement(U,{style:Sn.certWidth,variant:`standard`},p.createElement(x,{shrink:!0},W.t(`jc_Private certificate`)),p.createElement(D,{variant:`standard`,error:!!e,displayEmpty:!0,disabled:!!t,value:d||``,renderValue:()=>this.getText(h==null?void 0:h.label,!0),onChange:e=>this.onChange(this.props.schema.certPrivateName||`certPrivate`,e.target.value)},(s=this.state.certsPrivateOptions)==null?void 0:s.map((e,t)=>p.createElement(H,{key:`${e.value}_${t}`,value:e.value,style:e.value===q.NONE_VALUE?{opacity:.5}:{}},this.getText(e.label,!0))))),p.createElement(U,{style:Sn.certWidth,variant:`standard`},p.createElement(x,{shrink:!0},W.t(`jc_Chained certificate`)),p.createElement(D,{variant:`standard`,error:!!e,displayEmpty:!0,disabled:!!t,value:f||``,renderValue:()=>this.getText(g==null?void 0:g.label,!0),onChange:e=>this.onChange(this.props.schema.certChainedName||`certChained`,e.target.value)},(c=this.state.certsChainOptions)==null?void 0:c.map((e,t)=>p.createElement(H,{key:`${e.value}_${t}`,value:e.value,style:e.value===q.NONE_VALUE?{opacity:.5}:{}},this.getText(e.label,!0))))))}};f();var wn=class extends q{async componentDidMount(){var e;await super.componentDidMount();let t,n=await this.getCachedObject(`system.certificates`);t=n!=null&&(e=n.native)!=null&&e.collections?Object.keys(n.native.collections):[],this.setState({collectionsOptions:t})}renderItem(e,t){var n;if(!this.state.collectionsOptions)return null;let r=(q.getValue(this.props.data,this.props.schema.leCollectionName||`leCollection`)||`false`).toString();return p.createElement(U,{style:{width:`100%`},variant:`standard`},this.props.schema.label?p.createElement(x,{shrink:!0},this.getText(this.props.schema.label)):null,p.createElement(D,{variant:`standard`,error:!!e,displayEmpty:!0,disabled:!!t,value:r,onChange:e=>this.onChange(this.props.schema.leCollectionName||`leCollection`,e.target.value===`false`?!1:e.target.value===`true`||e.target.value)},p.createElement(H,{key:`_false`,value:`false`,style:{fontWeight:`bold`}},W.t(`jc_Do not use let's encrypt`)),p.createElement(H,{key:`_true`,value:`true`,style:{fontWeight:`bold`}},W.t(`jc_Use all available let's encrypt certificates`)),(n=this.state.collectionsOptions)==null?void 0:n.map(e=>p.createElement(H,{key:e,value:e},e))),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();var Tn=class extends q{async componentDidMount(){await super.componentDidMount();let e=await this.props.oContext.socket.getCurrentInstance();this.setState({requesting:!0},async()=>{let t=await this.props.oContext.socket.sendTo(e,`checkDocker`,null);this.setState({requesting:!1,version:(t==null?void 0:t.version)||``,errorDocker:t?t.daemonRunning?``:W.t(`jc_Docker is not installed or not running`):W.t(`jc_No response from admin`)})})}renderItem(e,t){let n=q.getValue(this.props.data,this.props.attr);return this.state.requesting?p.createElement(Nt,null):this.state.errorDocker&&!n?p.createElement(V,{style:{color:`orange`}},W.t(`jc_Docker is not available`),`:\xA0`,W.t(`jc_${this.state.errorDocker}`).replace(/^jc_/,``)):p.createElement(U,{style:{width:`100%`},variant:`standard`},p.createElement(ot,{onClick:e=>{if(e.preventDefault(),e.stopPropagation(),!t&&this.props.attr){let e=this.onChange(this.props.attr,!n);e instanceof Promise&&e.catch(e=>console.error(`Cannot set value: ${e}`))}},control:p.createElement(zt,{checked:!!n,onChange:e=>{this.props.attr&&this.onChange(this.props.attr,e.target.checked)},disabled:t||!!this.state.errorDocker&&!n}),label:this.getText(this.props.schema.label)}),this.props.schema.hideVersion?null:p.createElement(V,null,this.state.errorDocker?this.state.errorDocker:this.state.version),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();var En=`system.credentials.`,Dn=1,On=[`email`,`cloud`,`ai`,`aws`,`azure`,`custom`],kn={email:`E-mail`,cloud:`Cloud`,ai:`AI`,aws:`AWS`,azure:`Azure`,custom:`Custom`},An={login:[{name:`login`,type:`text`,required:!0,label:`Login`},{name:`password`,type:`password`,encrypted:!0,required:!0,label:`Password`}],key:[{name:`key`,type:`password`,encrypted:!0,required:!0,label:`Key`}],aws:[{name:`accessKeyId`,type:`text`,required:!0,label:`Access Key ID`},{name:`secretAccessKey`,type:`password`,encrypted:!0,required:!0,label:`Secret Access Key`},{name:`region`,type:`select`,required:!0,label:`Region`,options:[{value:`us-east-1`,label:`us-east-1 (US East, N. Virginia)`},{value:`us-east-2`,label:`us-east-2 (US East, Ohio)`},{value:`us-west-1`,label:`us-west-1 (US West, N. California)`},{value:`us-west-2`,label:`us-west-2 (US West, Oregon)`},{value:`ca-central-1`,label:`ca-central-1 (Canada Central)`},{value:`sa-east-1`,label:`sa-east-1 (South America, São Paulo)`},{value:`eu-west-1`,label:`eu-west-1 (Europe, Ireland)`},{value:`eu-west-2`,label:`eu-west-2 (Europe, London)`},{value:`eu-west-3`,label:`eu-west-3 (Europe, Paris)`},{value:`eu-central-1`,label:`eu-central-1 (Europe, Frankfurt)`},{value:`eu-central-2`,label:`eu-central-2 (Europe, Zurich)`},{value:`eu-north-1`,label:`eu-north-1 (Europe, Stockholm)`},{value:`eu-south-1`,label:`eu-south-1 (Europe, Milan)`},{value:`eu-south-2`,label:`eu-south-2 (Europe, Spain)`},{value:`ap-south-1`,label:`ap-south-1 (Asia Pacific, Mumbai)`},{value:`ap-northeast-1`,label:`ap-northeast-1 (Asia Pacific, Tokyo)`},{value:`ap-northeast-2`,label:`ap-northeast-2 (Asia Pacific, Seoul)`},{value:`ap-northeast-3`,label:`ap-northeast-3 (Asia Pacific, Osaka)`},{value:`ap-southeast-1`,label:`ap-southeast-1 (Asia Pacific, Singapore)`},{value:`ap-southeast-2`,label:`ap-southeast-2 (Asia Pacific, Sydney)`},{value:`me-central-1`,label:`me-central-1 (Middle East, UAE)`},{value:`me-south-1`,label:`me-south-1 (Middle East, Bahrain)`},{value:`af-south-1`,label:`af-south-1 (Africa, Cape Town)`}]}],azure:[{name:`subscriptionKey`,type:`password`,encrypted:!0,required:!0,label:`Subscription Key`},{name:`region`,type:`select`,required:!0,label:`Region`,options:[{value:`eastus`,label:`eastus (East US)`},{value:`eastus2`,label:`eastus2 (East US 2)`},{value:`centralus`,label:`centralus (Central US)`},{value:`northcentralus`,label:`northcentralus (North Central US)`},{value:`southcentralus`,label:`southcentralus (South Central US)`},{value:`westus`,label:`westus (West US)`},{value:`westus2`,label:`westus2 (West US 2)`},{value:`westus3`,label:`westus3 (West US 3)`},{value:`canadacentral`,label:`canadacentral (Canada Central)`},{value:`brazilsouth`,label:`brazilsouth (Brazil South)`},{value:`northeurope`,label:`northeurope (North Europe)`},{value:`westeurope`,label:`westeurope (West Europe)`},{value:`francecentral`,label:`francecentral (France Central)`},{value:`germanywestcentral`,label:`germanywestcentral (Germany West Central)`},{value:`norwayeast`,label:`norwayeast (Norway East)`},{value:`swedencentral`,label:`swedencentral (Sweden Central)`},{value:`switzerlandnorth`,label:`switzerlandnorth (Switzerland North)`},{value:`uksouth`,label:`uksouth (UK South)`},{value:`ukwest`,label:`ukwest (UK West)`},{value:`uaenorth`,label:`uaenorth (UAE North)`},{value:`southafricanorth`,label:`southafricanorth (South Africa North)`},{value:`centralindia`,label:`centralindia (Central India)`},{value:`eastasia`,label:`eastasia (East Asia)`},{value:`southeastasia`,label:`southeastasia (Southeast Asia)`},{value:`japaneast`,label:`japaneast (Japan East)`},{value:`koreacentral`,label:`koreacentral (Korea Central)`},{value:`australiaeast`,label:`australiaeast (Australia East)`}]}]},jn={anthropic:`M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5527h3.7442L10.5363 3.541Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z`,chatgpt:`M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.073zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.8956zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654 2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z`,gemini:`M11.04 19.32Q12 21.51 12 24q0-2.49.93-4.68.96-2.19 2.58-3.81t3.81-2.55Q21.51 12 24 12q-2.49 0-4.68-.93a12.3 12.3 0 0 1-3.81-2.58 12.3 12.3 0 0 1-2.58-3.81Q12 2.49 12 0q0 2.49-.96 4.68-.93 2.19-2.55 3.81a12.3 12.3 0 0 1-3.81 2.58Q2.49 12 0 12q2.49 0 4.68.96 2.19.93 3.81 2.55t2.55 3.81`,email:`M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z`,login:`M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z`,key:`M21 10h-8.35A5.99 5.99 0 0 0 7 6c-3.31 0-6 2.69-6 6s2.69 6 6 6a5.99 5.99 0 0 0 5.65-4H13l2 2 2-2 2 2 4-4.04L21 10zM7 15c-1.65 0-3-1.35-3-3s1.35-3 3-3 3 1.35 3 3-1.35 3-3 3z`,aws:`M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 0 1-.287-.375 6.18 6.18 0 0 1-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272a2.287 2.287 0 0 1-.28.104.488.488 0 0 1-.127.023c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 0 1 .224-.167c.279-.144.614-.264 1.005-.36a4.84 4.84 0 0 1 1.246-.151c.95 0 1.644.216 2.091.647.439.43.662 1.085.662 1.963v2.586zm-3.24 1.214c.263 0 .534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 5.55a1.398 1.398 0 0 1-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 0 1 .32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 0 1 .311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 0 1-.056.2l-1.923 6.17c-.048.16-.104.263-.168.311a.51.51 0 0 1-.303.08h-.687c-.151 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563 0 0 1-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.559c-.144-.151-.416-.287-.807-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 0 1-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.175 0 .359.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 0 1 .24.2.43.43 0 0 1 .071.263v.375c0 .168-.064.256-.184.256a.83.83 0 0 1-.303-.096 3.652 3.652 0 0 0-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.159.152.454.304.877.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167zM21.698 16.207c-2.626 1.94-6.442 2.969-9.722 2.969-4.598 0-8.74-1.7-11.87-4.526-.247-.223-.024-.527.272-.351 3.384 1.963 7.559 3.153 11.877 3.153 2.914 0 6.114-.607 9.06-1.852.439-.2.814.287.383.607zM22.792 14.961c-.336-.43-2.22-.207-3.074-.103-.255.032-.295-.192-.063-.36 1.5-1.053 3.967-.75 4.254-.399.287.36-.08 2.826-1.485 4.007-.215.184-.423.088-.327-.151.32-.79 1.03-2.57.695-2.994z`,azure:`M22.379 23.343a1.62 1.62 0 0 0 1.536-2.14v.002L17.35 1.76A1.62 1.62 0 0 0 15.816.657H8.184A1.62 1.62 0 0 0 6.65 1.76L.086 21.204a1.62 1.62 0 0 0 1.536 2.139h4.741a1.62 1.62 0 0 0 1.535-1.103l.977-2.892 4.947 3.675c.28.208.618.32.966.32m-3.084-12.531 3.624 10.739a.54.54 0 0 1-.51.713v-.001h-.03a.54.54 0 0 1-.322-.106l-9.287-6.9h4.853m6.313 7.006c.116-.326.13-.694.007-1.058L9.79 1.76a1.722 1.722 0 0 0-.007-.02h6.034a.54.54 0 0 1 .512.366l6.562 19.445a.54.54 0 0 1-.338.684`};function Mn(e,t){let n=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="${t}" d="${e}"/></svg>`;return`data:image/svg+xml;base64,${window.btoa(n)}`}var Nn={anthropic:Mn(jn.anthropic,`#d97757`),chatgpt:Mn(jn.chatgpt,`#74aa9c`),gemini:Mn(jn.gemini,`#8e75b2`),email:Mn(jn.email,`#2196f3`),login:Mn(jn.login,`#9e9e9e`),key:Mn(jn.key,`#ffc107`),aws:Mn(jn.aws,`#ff9900`),azure:Mn(jn.azure,`#0089d6`)},Pn={anthropic:{label:`Anthropic`,icon:Nn.anthropic,form:`key`,type:`ai`,name:`anthropic`},chatgpt:{label:`ChatGPT`,icon:Nn.chatgpt,form:`key`,type:`ai`,name:`chatgpt`},gemini:{label:`Google Gemini`,icon:Nn.gemini,form:`key`,type:`ai`,name:`gemini`},aws:{label:`AWS`,icon:Nn.aws,form:`aws`,type:`aws`,name:`aws`},azure:{label:`Azure`,icon:Nn.azure,form:`azure`,type:`azure`,name:`azure`},email:{label:`E-mail`,icon:Nn.email,form:`login`,type:`email`},login:{label:`Login & password`,icon:Nn.login,form:`login`,type:null},key:{label:`Key`,icon:Nn.key,form:`key`,type:null}};function Fn(e,t,n){return p.createElement(`span`,{style:{display:`flex`,alignItems:`center`,gap:8}},e!=null&&e.icon?p.createElement(gt,{src:e.icon,style:{width:20,height:20}}):n?p.createElement(`span`,{style:{width:20,height:20,flexShrink:0}}):null,t)}var In=class e extends q{async componentDidMount(){if(await super.componentDidMount(),!this.props.attr)throw Error(`Missing attribute attribute`);let e=q.getValue(this.props.data,this.props.attr),t=await this.readCredentials();this.setState({value:e,selectOptions:t})}async readCredentials(){let t=[];try{let n=await this.props.oContext.socket.getObjectViewSystem(`config`,En,`${En}香`);t=Object.values(n).filter(e=>{var t;return!!e&&(!this.props.schema.credentialType||((t=e.native)==null?void 0:t.type)===this.props.schema.credentialType)}).map(t=>{var n;return{label:e.getCredentialName(t),value:t._id,icon:typeof((n=t.common)==null?void 0:n.icon)==`string`?t.common.icon:void 0}}).sort((e,t)=>e.label.localeCompare(t.label))}catch(e){console.error(`Cannot read credentials: ${e}`)}return t.unshift({label:W.t(q.NONE_LABEL),value:q.NONE_VALUE}),t}static getCredentialName(e){var t;let n=(t=e.common)==null?void 0:t.name,r;return r=n&&typeof n==`object`?n[W.getLanguage()]||n.en||Object.values(n)[0]||``:n||``,r||e._id.substring(19)}templateKeys(){let e=this.props.schema.credentialType;return Object.keys(Pn).filter(t=>{let n=Pn[t];return!e||n.type===e||n.type===null})}selectTemplate(e){let t=Pn[e];this.setState({addTemplate:e,addName:t.name||``,addType:t.type||this.props.schema.credentialType||`custom`,addFields:{},addError:``})}openAddDialog(){let e=this.templateKeys()[0],t=Pn[e];this.setState({addOpen:!0,addTemplate:e,addName:t.name||``,addType:t.type||this.props.schema.credentialType||`custom`,addFields:{},addError:``,addSaving:!1})}async createCredential(){let e=Pn[this.state.addTemplate||``],t=(this.state.addName||``).trim().replace(z.FORBIDDEN_CHARS,`_`);if(!t){this.setState({addError:W.t(`jc_A unique name is required`)});return}let n=`${En}${t}`;if((this.state.selectOptions||[]).find(e=>e.value===n)){this.setState({addError:W.t(`jc_A credential with this name already exists`)});return}let r=(e==null?void 0:e.form)||`login`,i=An[r],a=this.state.addFields||{};if(i.some(e=>e.required&&!(a[e.name]||``).trim())){this.setState({addError:W.t(`jc_Please fill in all required fields`)});return}let o=(e==null?void 0:e.type)||this.props.schema.credentialType||this.state.addType||`custom`;this.setState({addSaving:!0,addError:``});try{let s=this.props.oContext.socket,c={type:o,form:r,version:Dn,encryptedFields:i.filter(e=>e.encrypted).map(e=>e.name)};for(let e of i){let t=a[e.name]||``;c[e.name]=e.encrypted&&t?await s.encrypt(t):t}let l={_id:n,type:`config`,common:{name:t,...e!=null&&e.icon?{icon:e.icon}:{}},native:c,acl:{object:1536,owner:`system.user.admin`,ownerGroup:`system.group.administrator`}};await s.setObject(n,l);let u=this.state.selectOptions||[],d=u.find(e=>e.value===q.NONE_VALUE),f=u.filter(e=>e.value!==q.NONE_VALUE);f.push({label:t,value:n,icon:e==null?void 0:e.icon}),f.sort((e,t)=>e.label.localeCompare(t.label));let p=d?[d,...f]:f;this.setState({addOpen:!1,addSaving:!1,selectOptions:p,value:n},()=>this.onChange(this.props.attr,n))}catch(e){this.setState({addSaving:!1,addError:W.t(`jc_Cannot create credential: %s`,e.toString())})}}renderAddDialog(){if(!this.state.addOpen)return null;let e=Pn[this.state.addTemplate||``],t=An[(e==null?void 0:e.form)||`login`],n=`${En}${(this.state.addName||``).trim().replace(z.FORBIDDEN_CHARS,`_`)}`,r=!this.props.schema.credentialType&&(e==null?void 0:e.type)===null;return p.createElement(Tt,{open:!0,maxWidth:`sm`,fullWidth:!0,onClose:()=>this.setState({addOpen:!1})},p.createElement(Vt,null,W.t(`jc_Add credential`)),p.createElement(qe,{style:{display:`flex`,flexDirection:`column`,gap:12,paddingTop:8}},p.createElement(U,{fullWidth:!0,variant:`standard`},p.createElement(x,{shrink:!0},W.t(`jc_Template`)),p.createElement(D,{variant:`standard`,value:this.state.addTemplate||``,onChange:e=>this.selectTemplate(e.target.value)},this.templateKeys().map(e=>p.createElement(H,{key:e,value:e},p.createElement(`span`,{style:{display:`flex`,alignItems:`center`,gap:8}},p.createElement(`img`,{src:Pn[e].icon,width:20,height:20,alt:``}),W.t(Pn[e].label)))))),r?p.createElement(U,{fullWidth:!0,variant:`standard`},p.createElement(x,{shrink:!0},W.t(`jc_Credential type`)),p.createElement(D,{variant:`standard`,value:this.state.addType||`custom`,onChange:e=>this.setState({addType:e.target.value})},On.map(e=>p.createElement(H,{key:e,value:e},W.t(kn[e]))))):null,p.createElement(O,{variant:`standard`,fullWidth:!0,label:W.t(`jc_Name`),value:this.state.addName||``,error:!!this.state.addError,helperText:this.state.addName?n:``,slotProps:{inputLabel:{shrink:!0},htmlInput:{autoComplete:`off`}},onChange:e=>this.setState({addName:e.target.value,addError:``})}),t.map(e=>{var t;let n=((t=this.state.addFields)==null?void 0:t[e.name])||``;if(e.type===`select`){let t=e.options?[...e.options]:[];return n&&!t.find(e=>e.value===n)&&t.unshift({value:n}),p.createElement(O,{key:e.name,select:!0,variant:`standard`,fullWidth:!0,required:e.required,label:W.t(e.label),value:n,slotProps:{inputLabel:{shrink:!0}},onChange:t=>this.setState({addFields:{...this.state.addFields||{},[e.name]:t.target.value},addError:``})},t.map(e=>p.createElement(H,{key:e.value,value:e.value},e.label||e.value)))}return p.createElement(O,{key:e.name,variant:`standard`,fullWidth:!0,type:e.type===`password`?`password`:`text`,required:e.required,label:W.t(e.label),value:n,slotProps:{inputLabel:{shrink:!0},htmlInput:{autoComplete:e.type===`password`?`new-password`:`off`}},onChange:t=>this.setState({addFields:{...this.state.addFields||{},[e.name]:t.target.value},addError:``})})}),this.state.addError?p.createElement(Qt,{severity:`error`},this.state.addError):null),p.createElement(It,null,p.createElement(h,{variant:`contained`,color:`primary`,disabled:!!this.state.addSaving||!(this.state.addName||``).trim(),startIcon:p.createElement(j,null),onClick:()=>this.createCredential()},W.t(`jc_Create`)),p.createElement(h,{variant:`contained`,color:`grey`,disabled:!!this.state.addSaving,startIcon:p.createElement(ge,null),onClick:()=>this.setState({addOpen:!1})},W.t(`jc_Cancel`))))}renderItem(e,t){var n,r;if(!this.state.selectOptions)return null;let i=(n=this.state.selectOptions)==null?void 0:n.find(e=>e.value===this.state.value),a=this.state.value&&this.state.value!==q.NONE_VALUE&&!i?this.state.value:null,o=this.state.selectOptions.some(e=>!!e.icon),s=!this.props.schema.disableCreation;return p.createElement(`div`,{style:{display:`flex`,alignItems:`flex-end`,gap:4,width:`100%`}},p.createElement(U,{style:{flex:1,minWidth:0},variant:`standard`},this.props.schema.label?p.createElement(x,{shrink:!0},this.getText(this.props.schema.label)):null,p.createElement(D,{variant:`standard`,error:!!e||!!a,displayEmpty:!0,disabled:!!t,value:this.state.value||q.NONE_VALUE,renderValue:()=>a||Fn(i,this.getText(i==null?void 0:i.label,this.props.schema.noTranslation!==!1),o),onChange:e=>this.setState({value:e.target.value===q.NONE_VALUE?``:e.target.value},()=>this.onChange(this.props.attr,this.state.value))},(r=this.state.selectOptions)==null?void 0:r.map(e=>p.createElement(H,{key:e.value,value:e.value,style:e.value===q.NONE_VALUE?{opacity:.5}:{}},Fn(e,this.getText(e.label,this.props.schema.noTranslation!==!1),o)))),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null),s?p.createElement(B,{size:`small`,disabled:!!t,title:W.t(`jc_Add credential`),onClick:()=>this.openAddDialog()},p.createElement(ye,null)):null,this.renderAddDialog())}};f();var Ln={fullWidth:{width:`100%`},icon:{width:24,height:24,marginRight:4},licLabel:{fontWeight:`bold`,minWidth:100,marginRight:10,textTransform:`capitalize`,display:`inline-block`},licValue:{fontWeight:`normal`},errorTitle:e=>({color:e.palette.mode===`dark`?`#e39191`:`#b62020`}),okTitle:e=>({color:e.palette.mode===`dark`?`#6fd56f`:`#007c00`}),errorText:e=>({color:e.palette.mode===`dark`?`#e39191`:`#b62020`,mb:`30px`})},Rn=class e extends q{async componentDidMount(){await super.componentDidMount(),this.setState({_error:``,running:!1,showLicenseData:null,foundSuitableLicense:!1,licenseOfflineCheck:!1,result:null,allLicenses:null,askForUpdate:!1,showLinkToProfile:!1})}renderErrorDialog(){if(this.state._error&&!this.state.showLicenseData){let e=this.state._error;return this.state.allLicenses&&(e=[p.createElement(`div`,{key:`error`},e)],e.push(p.createElement(h,{key:`button`,variant:`contained`,onClick:()=>window.open(`https://iobroker.net/www/account/licenses`,`_blank`)},`iobroker.net`)),this.state.allLicenses.length?e.push(p.createElement(ee,{key:`table`},p.createElement(me,{size:`small`},p.createElement(Me,null,p.createElement(se,null,p.createElement(K,null,W.t(`jc_Product`)),p.createElement(K,null,W.t(`jc_Version`)),p.createElement(K,null,`UUID`),p.createElement(K,null,W.t(`jc_ValidTill`)),p.createElement(K,null,W.t(`jc_Commercial`)),p.createElement(K,null,`ID`))),p.createElement(I,null,this.state.allLicenses.map(e=>p.createElement(se,{key:e.id},p.createElement(K,{sx:e.validName?null:Ln.errorText},e.license.product),p.createElement(K,{sx:e.validVersion?null:Ln.errorText},e.license.version),p.createElement(K,{sx:e.validUuid?null:Ln.errorText},e.license.uuid||`--`),p.createElement(K,{sx:e.validTill?null:Ln.errorText},e.license.validTill&&e.license.validTill!==`0000-00-00 00:00:00`?new Date(e.license.validTill).toLocaleDateString():`--`),p.createElement(K,null,e.license.invoice===`free`?`-`:e.license.invoice===`MANUALLY_CREATED`?`✓`:e.license.invoice),p.createElement(K,null,e.id))))))):(e.push(p.createElement(`div`,{key:`text1`},W.t(`jc_No one license found in license manager`))),e.push(p.createElement(`div`,{key:`text2`},W.t(`jc_Please create license`))))),p.createElement(Tt,{open:!0,maxWidth:`xl`,fullWidth:this.props.fullWidth===void 0||this.props.fullWidth,onClick:()=>this.setState({_error:``,allLicenses:null})},p.createElement(Vt,null,W.t(`jc_Error`)),p.createElement(qe,null,p.createElement(_t,null,e)),p.createElement(It,null,p.createElement(h,{variant:`contained`,onClick:()=>this.setState({_error:``,allLicenses:null}),color:`primary`,autoFocus:!0,startIcon:p.createElement(j,null)},W.t(`jc_Ok`))))}return null}renderMessageDialog(){if(this.state.showLicenseData){let e=[],t=this.state.showLicenseData;return Object.keys(t).forEach(n=>{if(t[n]!==null&&t[n]!==void 0){if(typeof t[n]==`object`){let r=t[n];Object.keys(r).forEach(t=>{r[t]!==null&&r[t]!==void 0&&(typeof r[t]==`object`?e.push(p.createElement(`div`,{key:t},p.createElement(`div`,{style:Ln.licLabel},t,`:`),JSON.stringify(r[t],null,2))):e.push(p.createElement(`div`,{key:t},p.createElement(`div`,{style:Ln.licLabel},n,` -`,t,`:`),r[t].toString())))})}else e.push(p.createElement(`div`,{key:n},p.createElement(`div`,{style:Ln.licLabel},n.replace(/_/g,` `),`:`),t[n].toString()))}}),e.push(p.createElement(`div`,{key:`checked`},p.createElement(`div`,{style:Ln.licLabel},W.t(`jc_Checked`),`:`),this.state.licenseOfflineCheck?W.t(`jc_locally`):W.t(`jc_via internet`))),p.createElement(Tt,{open:!0,onClose:()=>this.setState({showLicenseData:null})},p.createElement(Vt,null,p.createElement(R,{component:`span`,sx:this.state.result?Ln.okTitle:Ln.errorTitle},W.t(`jc_License %s`,this.state.result?`OK`:`INVALID`))),p.createElement(qe,null,this.state.showLinkToProfile?p.createElement(h,{variant:`contained`,onClick:()=>window.open(`https://iobroker.net/www/account/licenses`,`_blank`)},`https://iobroker.net`):null,this.state._error?p.createElement(R,{component:`div`,sx:Ln.errorText},this.state._error):null,e),p.createElement(It,null,p.createElement(h,{onClick:()=>this.setState({showLicenseData:null,_error:``}),color:`primary`,variant:`contained`},W.t(`jc_Close`))))}return null}static parseJwt(e){let t=e.split(`.`)[1].replace(/-/g,`+`).replace(/_/g,`/`),n=decodeURIComponent(atob(t).split(``).map(e=>`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`).join(``));try{return JSON.parse(n)}catch{return null}}static isVersionValid(e,t,n,r){if(!t||!e)return!0;let[i]=e.split(`.`);return t.startsWith(`>=`)||t.startsWith(`<=`)?parseInt(t.substring(2,10)):t.startsWith(`>`)||t.startsWith(`<`)||t.startsWith(`=`)?parseInt(t.substring(1,10)):t.startsWith(`==`)?parseInt(t.substring(2,10)):t.startsWith(`===`)&&parseInt(t.substring(3,10)),!0}async findInLicenseManager(t){var n;let r=await this.getCachedObject(`system.licenses`),i=[];if(r!=null&&(n=r.native)!=null&&(n=n.licenses)!=null&&n.length){let n=null,s=Date.now(),c;if(this.props.schema.uuid){var a;let e=await this.getCachedObject(`system.meta.uuid`);c=e==null||(a=e.native)==null?void 0:a.uuid}let l;if(this.props.schema.version){var o;let e=await this.getCachedObject(`system.adapter.${t}`);l=e==null||(o=e.common)==null?void 0:o.version}if(r.native.licenses.forEach(r=>{let a=!r.validTill||r.validTill===`0000-00-00 00:00:00`||new Date(r.validTill).getTime()>s,o=(r.product||``).split(`.`),u=o[1]===t||t===`vis-2`&&o[1]===`vis`,d=!c||!r.uuid||r.uuid===c,f=e.isVersionValid(l,r.version,r.invoice,t);(!n||r.invoice!==`free`)&&a&&u&&d&&f&&(n=r),i.push({id:r.id,validName:u,validUuid:d,validVersion:f,validTill:a,license:r})}),n){let e=i.find(e=>e.id===(n==null?void 0:n.id));e&&(e.used=!0)}}return i}async checkLicense(t,n){let r;if(this.props.schema.uuid){var i;let e=await this.getCachedObject(`system.meta.uuid`);r=e==null||(i=e.native)==null?void 0:i.uuid}let a;if(this.props.schema.version){var o;let e=await this.getCachedObject(`system.adapter.${n}`);a=e==null||(o=e.common)==null?void 0:o.version}let s=new AbortController,c=setTimeout(()=>{c=null,s.abort()},5e3);try{let i=await window.fetch(`https://iobroker.net/api/v1/public/cert/`,{method:`POST`,body:JSON.stringify({json:t,uuid:r}),headers:{"Content-Type":`text/plain`},signal:s.signal});c&&clearTimeout(c);let o=await i.text(),l;try{l=JSON.parse(o)}catch{}if(l!=null&&l.error)try{let n=e.parseJwt(t),r=W.t(`jc_${(n==null?void 0:n.error)||l.error||`Unknown error`}`).replace(/^jc_/,``);return this.setState({_error:r,licenseOfflineCheck:!1,showLicenseData:n,result:!1,running:!1})}catch{return console.log(`Cannot parse license`),this.setState({_error:l.error,result:!1,running:!1})}{let i=null;try{i=e.parseJwt(t)}catch{}if(l){let t=l.validTill||l.valid_till;if(t&&t!==`0000-00-00 00:00:00`&&new Date(t).getTime()<Date.now())return this.setState({_error:W.t(`jc_License expired on %s`,new Date(t).toLocaleString()),licenseOfflineCheck:!1,showLicenseData:i,result:!1,running:!1});let o=(l.name||``).split(`.`);return o[1]===n||o[1]===`vis`&&n===`vis-2`?r&&!l.uuid&&n===`vis-2`?this.setState({_error:W.t(`jc_License must be converted`,l.uuid),showLinkToProfile:!0,licenseOfflineCheck:!1,showLicenseData:i,result:!1,running:!1}):r&&l.uuid&&l.uuid!==r?this.setState({_error:W.t(`jc_Serial number (UUID) "%s" in license is for other device.`,l.uuid),licenseOfflineCheck:!1,showLicenseData:i,result:!1,running:!1}):e.isVersionValid(a,l.version,l.invoice,n)?this.setState({licenseOfflineCheck:!1,showLicenseData:i,result:!0,running:!1}):this.setState({_error:W.t(`jc_License is for version %s, but required version is %s`,l.version,this.props.schema.version),licenseOfflineCheck:!1,showLicenseData:i,result:!1,running:!1}):this.setState({_error:W.t(`jc_License for other product "%s"`,l.name),licenseOfflineCheck:!1,showLicenseData:i,result:!1,running:!1})}throw Error(`jc_Invalid answer from server`)}}catch(i){var l;if((i==null||(l=i.response)==null?void 0:l.status)===404)return this.setState({_error:W.t(`jc_License does not exist`),result:!1,running:!1});try{let i=e.parseJwt(t),o=((i==null?void 0:i.name)||``).split(`.`);return i!=null&&i.valid_till&&i.valid_till!==`0000-00-00 00:00:00`&&new Date(i.valid_till).getTime()<Date.now()?this.setState({_error:W.t(`jc_License expired on %s`,new Date(i.valid_till).toLocaleString()),showLicenseData:i,licenseOfflineCheck:!0,running:!1,result:!1}):o[1]===n?r&&i!=null&&i.uuid&&i.uuid!==r?this.setState({_error:W.t(`jc_Serial number (UUID) "%s" in license is for other device.`,i==null?void 0:i.uuid),showLicenseData:i,licenseOfflineCheck:!0,result:!1,running:!1}):e.isVersionValid(a,i==null?void 0:i.version,i==null?void 0:i.invoice,n)?this.setState({running:!1,result:!0,licenseOfflineCheck:!0,showLicenseData:i}):this.setState({_error:W.t(`jc_License is for version %s, but required version is %s`,i==null?void 0:i.version,this.props.schema.version),licenseOfflineCheck:!0,showLicenseData:i,result:!1,running:!1}):this.setState({_error:W.t(`jc_License for other product "%s"`,i==null?void 0:i.name),licenseOfflineCheck:!0,showLicenseData:i,result:!1,running:!1})}catch{return this.setState({_error:W.t(`jc_Cannot decode license`),result:!1,licenseOfflineCheck:!0,running:!1})}}}renderAskForUpdate(){return this.state.askForUpdate?p.createElement(xt,{text:W.t(`jc_License not found in license manager. Do you want to read licenses from iobroker.net?`),ok:W.t(`jc_Yes`),onClose:async e=>{if(e){this.setState({askForUpdate:!1});try{await this.props.oContext.socket.updateLicenses(``,``)}catch(e){window.alert(W.t(`jc_Cannot read licenses: %s`,e));return}await this._onClick(!0)}else this.setState({askForUpdate:!1,running:!1})}}):null}async _onClick(e){let t=this.props.oContext.adapterName===`vis-2`?`vis`:this.props.oContext.adapterName;this.setState({running:!0});let n,r;if(this.props.data.useLicenseManager){if(r=await this.findInLicenseManager(t),n=r.find(e=>e.used),n&&=n.license.json,!n&&!e){this.setState({askForUpdate:!0});return}}else n=this.props.data.license;n?await this.checkLicense(n,t):this.props.data.useLicenseManager?this.setState({_error:W.t(`jc_Suitable license not found in license manager`),result:!1,running:!1,allLicenses:r||null}):this.setState({_error:W.t(`jc_Please enter the license`),result:!1,running:!1})}renderItem(){return p.createElement(`div`,{style:Ln.fullWidth},p.createElement(h,{variant:this.props.schema.variant||`outlined`,color:this.props.schema.color||`primary`,style:Ln.fullWidth,disabled:!this.props.data.license&&!this.props.data.useLicenseManager||this.state.running,startIcon:p.createElement(T,null),onClick:()=>this._onClick()},this.state.running?p.createElement(Nt,{size:20,style:{marginRight:8}}):null,this.getText(this.props.schema.label||`jc_Check license`,this.props.schema.noTranslation)),this.renderMessageDialog(),this.renderErrorDialog(),this.renderAskForUpdate())}};f();var zn=class extends q{renderItem(e,t){let n=q.getValue(this.props.data,this.props.attr),r=Array.isArray(n);return p.createElement(U,{style:{width:`100%`},variant:`standard`},p.createElement(ot,{onClick:e=>{if(e.preventDefault(),e.stopPropagation(),!t&&this.props.attr){let e=this.onChange(this.props.attr,!n);e instanceof Promise&&e.catch(e=>console.error(`Cannot set value: ${e}`))}},control:p.createElement(zt,{indeterminate:r,checked:!!n,onChange:e=>{if(this.props.attr){let t;t=r?this.onChange(this.props.attr,!0):this.onChange(this.props.attr,e.target.checked),t instanceof Promise&&t.catch(e=>console.error(`Cannot set value: ${e}`))}},disabled:t||this.props.schema.readOnly}),label:this.getText(this.props.schema.label)}),p.createElement(V,{style:{color:`red`}},e?this.props.schema.validatorErrorText?W.t(this.props.schema.validatorErrorText):W.t(`jc_Error`):null),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();var Bn={standard:Xt,filled:Ot,outlined:_},Vn=e=>{let t=e.palette.mode===`light`,n=t?`rgba(0, 0, 0, 0.42)`:`rgba(255, 255, 255, 0.7)`;return{inputRoot:{display:`inline-flex`,flexWrap:`wrap`,flex:1,marginTop:0,minWidth:70,"&.mui-variant-outlined,&.mui-variant-filled":{boxSizing:`border-box`},"&.mui-variant-outlined":{paddingTop:`14px`},"&.mui-variant-filled":{paddingTop:`28px`}},input:{display:`inline-block`,textOverflow:`ellipsis`,overflow:`hidden`,whiteSpace:`nowrap`,appearance:`none`,WebkitTapHighlightColor:`rgba(0,0,0,0)`,float:`left`,flex:1},chipContainer:{display:`flex`,flexFlow:`row wrap`,alignItems:`center`,cursor:`text`,marginBottom:`-2px`,minHeight:40},outlined:{"& input":{height:16,paddingTop:`4px`,paddingBottom:`12px`,marginTop:`4px`,marginBottom:`4px`}},standard:{marginTop:`18px`},filled:{"& input":{height:22,marginBottom:`4px`,marginTop:`4px`,paddingTop:0},"$marginDense & input":{height:26}},labeled:{},label:{top:4,"&$outlined&:not($labelShrink)":{top:2,"$marginDense &":{top:5}},"&$filled&:not($labelShrink)":{top:15,"$marginDense &":{top:20}}},labelShrink:{top:0},helperText:{marginBottom:-20},focused:{},disabled:{},underline:{"&:after":{borderBottom:`2px solid ${e.palette.primary[t?`dark`:`light`]}`,left:0,bottom:0,content:`""`,position:`absolute`,right:0,transform:`scaleX(0)`,transition:e.transitions.create(`transform`,{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:`none`},"&$focused:after":{transform:`scaleX(1)`},"&$error:after":{borderBottomColor:e.palette.error.main,transform:`scaleX(1)`},"&:before":{borderBottom:`1px solid ${n}`,left:0,bottom:0,content:`"\\00a0"`,position:`absolute`,right:0,transition:e.transitions.create(`border-bottom-color`,{duration:e.transitions.duration.shorter}),pointerEvents:`none`},"&:hover:not($disabled):not($focused):not($error):before":{borderBottom:`2px solid ${e.palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${n}`}},"&$disabled:before":{borderBottomStyle:`dotted`}},error:{"&:after":{backgroundColor:e.palette.error.main,transform:`scaleX(1)`}},chip:{margin:`0 8px 8px 0`,float:`left`}}},Hn={BACKSPACE:8,DELETE:46,LEFT_ARROW:37,RIGHT_ARROW:39},Un=({value:e,isFocused:t,isDisabled:n,isReadOnly:r,handleClick:i,handleDelete:a,style:o},s)=>p.createElement(St,{key:s,style:{...o,pointerEvents:n||r?`none`:void 0,backgroundColor:t?ve[300]:void 0},onClick:i,onDelete:a,label:e}),Wn=class extends p.Component{constructor(e){super(e),G(this,`labelRef`,void 0),G(this,`labelNode`,null),G(this,`input`,void 0),G(this,`newChipKeyCodes`,void 0),G(this,`newChipKeys`,void 0),G(this,`actualInput`,null),G(this,`inputBlurTimeout`,null),G(this,`_keyPressed`,!1),G(this,`_preventChipCreation`,!1),G(this,`styles`,{}),G(this,`styleTheme`,null),G(this,`focus`,()=>{var e;(e=this.actualInput)==null||e.focus(),this.state.focusedChip&&this.setState({focusedChip:null})}),G(this,`handleInputBlur`,e=>{this.props.onBlur&&this.props.onBlur(e),this.setState({isFocused:!1}),this.state.focusedChip&&this.setState({focusedChip:null});let t=e.target.value,n;switch(this.props.blurBehavior||`clear`){case`add-or-clear`:n={clearInputOnFail:!0};case`add`:if(this.props.delayBeforeAdd){let e=(this.props.value||this.state.chips).length;this.inputBlurTimeout=setTimeout(()=>{let r=(this.props.value||this.state.chips).length;e===r?this.handleAddChip(t,n):this.clearInput()},150)}else this.handleAddChip(t,n);break;case`clear`:this.clearInput()}}),G(this,`handleInputFocus`,e=>{var t,n;this.setState({isFocused:!0}),(t=(n=this.props).onFocus)==null||t.call(n,e)}),G(this,`handleKeyDown`,e=>{let{focusedChip:t}=this.state;if(this._keyPressed=!1,this._preventChipCreation=!1,this.props.onKeyDown&&(this.props.onKeyDown(e),e.isDefaultPrevented()))return;let n=this.props.value||this.state.chips;if(this.newChipKeyCodes.includes(e.keyCode)||this.newChipKeys.includes(e.key)){this.handleAddChip(e.target.value)!==!1&&e.preventDefault();return}switch(e.keyCode){case Hn.BACKSPACE:e.target.value===``&&(t?(this.handleDeleteChip(n[t],t),t&&this.setState({focusedChip:t-1})):this.setState({focusedChip:n.length-1}));break;case Hn.DELETE:e.target.value===``&&t&&(this.handleDeleteChip(n[t],t),t<=n.length-1&&this.setState({focusedChip:t}));break;case Hn.LEFT_ARROW:t===null&&e.target.value===``&&n.length?this.setState({focusedChip:n.length-1}):t!==null&&t>0&&this.setState({focusedChip:t-1});break;case Hn.RIGHT_ARROW:t!==null&&t<n.length-1?this.setState({focusedChip:t+1}):this.setState({focusedChip:null});break;default:this.setState({focusedChip:null})}}),G(this,`handleKeyUp`,e=>{!this._preventChipCreation&&(this.newChipKeyCodes.includes(e.keyCode)||this.newChipKeys.includes(e.key))&&this._keyPressed?this.clearInput():this.updateInput(e.target.value),this.props.onKeyUp&&this.props.onKeyUp(e)}),G(this,`handleUpdateInput`,e=>{(this.props.inputValue===null||this.props.inputValue===void 0)&&this.updateInput(e.target.value),this.props.onUpdateInput&&this.props.onUpdateInput(e)}),G(this,`setActualInputRef`,e=>{this.actualInput=e,this.props.inputRef&&this.props.inputRef(e)}),this.state={chips:e.defaultValue||[],focusedChip:null,inputValue:``,isFocused:!1,chipsUpdated:!1,prevPropsValue:[],variant:this.props.variant||`standard`},this.newChipKeyCodes=e.newChipKeyCodes||[13],this.newChipKeys=e.newChipKeys||[`Enter`],this.labelRef=p.createRef(),this.input=p.createRef()}componentDidMount(){this.state.variant===`outlined`&&(this.labelNode=this.labelRef.current,this.forceUpdate())}componentWillUnmount(){this.inputBlurTimeout&&clearTimeout(this.inputBlurTimeout)}static getDerivedStateFromProps(e,t){let n=null;return e.value&&e.value.length!==t.prevPropsValue.length&&(n={prevPropsValue:e.value},e.clearInputValueOnChange&&(n.inputValue=``)),e.clearInputValueOnChange&&e.value&&e.value.length!==t.prevPropsValue.length&&(n={prevPropsValue:e.value,inputValue:``}),e.disabled&&(n={...n,focusedChip:null}),!t.chipsUpdated&&e.defaultValue&&(n={...n,chips:e.defaultValue}),n}handleAddChip(e,t){if(this.props.onBeforeAdd&&!this.props.onBeforeAdd(e))return this._preventChipCreation=!0,t&&t.clearInputOnFail&&this.clearInput(),!1;this.clearInput();let n=this.props.value||this.state.chips;return e.trim().length?((this.props.allowDuplicates||!n.includes(e))&&(this.props.value&&this.props.onAdd?this.props.onAdd(e):this.updateChips([...this.state.chips,e])),!0):!1}handleDeleteChip(e,t){if(this.props.value)this.props.onDelete&&this.props.onDelete(e,t);else{let e=this.state.chips.slice();if(e.splice(t,1)){let n=this.state.focusedChip;this.state.focusedChip===t?n=null:this.state.focusedChip!==null&&this.state.focusedChip>t&&(n=this.state.focusedChip-1),this.updateChips(e,{focusedChip:n})}}}updateChips(e,t={}){this.setState({chips:e,chipsUpdated:!0,...t}),this.props.onChange&&this.props.onChange(e)}clearInput(){this.updateInput(``)}updateInput(e){this.setState({inputValue:e})}render(){let{alwaysShowPlaceholder:e,chipRenderer:t=Un,className:n,disabled:r,disableUnderline:i,error:a,FormHelperTextProps:o,fullWidth:s,fullWidthInput:c,helperText:l,id:u,InputProps:d={},InputLabelProps:f={},inputValue:m,label:h,placeholder:g,readOnly:_,required:v,rootRef:y,value:ee,margin:b}=this.props,te=this.state.variant;this.styleTheme!==this.props.theme.palette.mode&&(this.styleTheme=this.props.theme.palette.mode,this.styles=z.getStyle(this.props.theme,Vn));let ne=ee||this.state.chips||[];Array.isArray(ne)||(ne=(ne||``).toString().split(/[,\s]+/).map(e=>e.trim()));let re=m??this.state.inputValue,S=(this.props.value||re).length||re.length,C=typeof f.shrink==`boolean`?f.shrink:h!==null&&(S||this.state.isFocused||ne.length),w=ne.map((e,n)=>t({value:e,isDisabled:!!r,isReadOnly:!!_,isFocused:this.state.focusedChip===n,handleClick:()=>this.setState({focusedChip:n}),handleDelete:()=>this.handleDeleteChip(e,n),style:this.styles.chip},n.toString())),T={};te===`outlined`&&(T.notched=!!C,T.labelWidth=C&&this.labelNode&&this.labelNode.offsetWidth||0),te===`standard`?d.disableUnderline=!0:T.startAdornment=w;let E=Bn[te];return p.createElement(U,{ref:y,fullWidth:s,className:n,error:a,required:ne.length>0?void 0:v,onClick:this.focus,disabled:r,variant:te,component:`div`,margin:b},h&&p.createElement(x,{htmlFor:u,sx:{"&.MuiInputLabel-root":this.styles.label,"&.MuiInputLabel-shrink":this.styles.labelShrink},shrink:!!C,focused:this.state.isFocused,variant:te,ref:this.labelRef,required:v,component:`label`,...f},h),p.createElement(R,{component:`div`,id:`input-chip-container`,sx:{...this.styles[te],...this.styles.chipContainer,...this.state.isFocused?this.styles.focused:void 0,...!i&&te===`standard`?this.styles.underline:void 0,...r?this.styles.disabled:void 0,...h?this.styles.labeled:void 0,...a?this.styles.error:void 0}},te===`standard`&&w,p.createElement(E,{ref:this.input,className:`mui-variant-${this.styles[te]} ${h?`mui-chip-with-label`:`mui-chip-no-label`}`,sx:{"&.MuiInputBase-input":{...this.styles.input,...this.styles[te]},"&.MuiInputBase-root":{...this.styles.inputRoot}},id:u,value:re,onChange:this.handleUpdateInput,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur,inputRef:this.setActualInputRef,disabled:r,fullWidth:c,placeholder:!S&&(C||h==null)||e?g:void 0,readOnly:_,...d,...T})),l&&p.createElement(V,{...o,className:o==null?void 0:o.className,style:this.styles.helperText},l))}};f();var Gn=class extends q{async componentDidMount(){await super.componentDidMount();let{data:e,attr:t}=this.props,n=q.getValue(e,t);if(this.props.schema.delimiter&&typeof n==`string`){let e=n.split(this.props.schema.delimiter).map(e=>e.trim()).filter(e=>e);this.setState({value:e})}else this.setState({value:n||[]})}renderItem(e,t){let{attr:n,schema:r}=this.props,{value:i}=this.state;return p.createElement(U,{fullWidth:!0,variant:`standard`},p.createElement(Wn,{value:i,disabled:!!t,label:this.getText(r.label),error:!!e,onAdd:e=>{let t=JSON.parse(JSON.stringify(i));t.push(e),this.setState({value:t},()=>{if(n){let e;e=this.props.schema.delimiter?this.onChange(n,t.join(`${this.props.schema.delimiter} `)):this.onChange(n,t),e instanceof Promise&&e.catch(e=>console.error(e))}})},theme:this.props.oContext.theme,onDelete:(e,t)=>{let r=JSON.parse(JSON.stringify(i));r.splice(t,1),this.setState({value:r},()=>{if(n){let e;e=this.props.schema.delimiter?this.onChange(n,r.join(`${this.props.schema.delimiter} `)):this.onChange(n,r),e instanceof Promise&&e.catch(e=>console.error(e))}})}}),p.createElement(V,null,W.t(`jc_Press ENTER Key to add new item`)),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();var Kn=class extends q{renderItem(e,t){let n=q.getValue(this.props.data,this.props.attr);return p.createElement(yt,{id:`color_${this.props.attr||``}_${this.props.index??``}`,disabled:!!t,style:{minWidth:100,width:`calc(100% - 8px)`},label:this.getText(this.props.schema.label),value:n||``,format:`hex`,sx:this.props.schema.noClearButton?{"& > .MuiIconButton-root":{display:`none`},"& > .MuiFormControl-root":{width:`calc(100% - 56px)`,mr:1}}:void 0,onChange:e=>{let t=this.props.attr&&this.onChange(this.props.attr,e);t instanceof Promise&&t.catch(e=>console.error(`Cannot set value: ${e}`))}})}};f();var qn={width:{width:`calc(100% - 85px)`},width50:{width:120,marginRight:5}},Jn=class extends q{async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr);this.setState({value:e});let t={};this.props.schema.useSystemName&&(t.useSystem=!!q.getValue(this.props.data,this.props.schema.useSystemName)),this.props.schema.longitudeName&&this.props.schema.latitudeName?(t.longitude=q.getValue(this.props.data,this.props.schema.longitudeName),t.latitude=q.getValue(this.props.data,this.props.schema.latitudeName),!t.longitude&&!t.latitude&&this.props.schema.autoInit&&setTimeout(()=>this.getCoordinates(),300)):!q.getValue(this.props.data,this.props.attr)&&this.props.schema.autoInit&&setTimeout(()=>this.getCoordinates(),300),Object.keys(t).length&&setTimeout(()=>this.setState(t),50)}async getSystemCoordinates(){let e;try{e=this.props.oContext.socket.getCompactSystemConfig?await this.props.oContext.socket.getCompactSystemConfig():await this.getCachedObject(`system.config`)}catch(e){console.error(`Cannot get system configuration: ${e}`)}if(e!=null&&e.common&&(e.common.longitude||e.common.latitude)){if(window.alert(W.t(`jc_Used system settings`)),this.props.schema.longitudeName&&this.props.schema.latitudeName)this.setState({longitude:e.common.longitude,latitude:e.common.latitude},async()=>{await this.onChange(this.props.schema.longitudeName,e.common.longitude),await this.onChange(this.props.schema.latitudeName,e.common.latitude)});else{let t=e.common.latitude+(this.props.schema.divider||`,`)+e.common.longitude;this.setState({value:t},()=>{let e=this.props.attr&&this.onChange(this.props.attr,t);e instanceof Promise&&e.catch(e=>console.error(`Cannot set value: ${e}`))})}}else window.alert(W.t(`jc_Cannot determine position: System settings are empty and GPS detection is disabled in browser`))}getCoordinates(){navigator.geolocation?navigator.geolocation.getCurrentPosition(async e=>{if(e!=null&&e.coords){if(this.props.schema.longitudeName&&this.props.schema.latitudeName)this.setState({longitude:e.coords.longitude,latitude:e.coords.latitude},async()=>{await this.onChange(this.props.schema.longitudeName,e.coords.longitude||``),await this.onChange(this.props.schema.latitudeName,e.coords.latitude||``)});else{let t=e.coords.latitude+(this.props.schema.divider||`,`)+e.coords.longitude;this.setState({value:t},()=>{let e=this.onChange(this.props.attr,t);e instanceof Promise&&e.catch(e=>console.error(`Cannot set value: ${e}`))})}}else await this.getSystemCoordinates()},async e=>{console.error(`Cannot determine coordinates from browser: ${e.message}`),await this.getSystemCoordinates()}):this.getSystemCoordinates().catch(e=>{console.error(`Cannot determine coordinates: ${e}`)})}renderItem(e,t){return p.createElement(p.Fragment,null,this.props.schema.useSystemName?p.createElement(ot,{control:p.createElement(zt,{checked:!!this.state.useSystem,onChange:e=>{let t=e.target.checked;t&&this.getSystemCoordinates().catch(e=>console.error(`Cannot determine coordinates: ${e}`)),this.setState({useSystem:t},()=>this.onChange(this.props.schema.useSystemName,t))}}),label:W.t(`jc_Use system settings for position`)}):null,this.props.schema.longitudeName&&this.props.schema.latitudeName?p.createElement(O,{variant:`standard`,style:qn.width50,value:this.state.longitude??``,error:!!e,disabled:this.state.useSystem||!!t,onChange:e=>{let t=e.target.value;this.setState({longitude:t},()=>{let e=this.onChange(this.props.schema.longitudeName,(t||``).trim());e instanceof Promise&&e.catch(e=>console.error(`Cannot set value: ${e}`))})},label:W.t(`jc_Longitude`)}):null,this.props.schema.longitudeName&&this.props.schema.latitudeName?p.createElement(O,{variant:`standard`,style:qn.width50,value:this.state.latitude??``,error:!!e,disabled:this.state.useSystem||!!t,onChange:e=>{let t=e.target.value;this.setState({latitude:t},()=>this.onChange(this.props.schema.latitudeName,(t||``).trim()))},label:W.t(`jc_Latitude`)}):null,!this.props.schema.longitudeName||!this.props.schema.latitudeName?p.createElement(O,{variant:`standard`,style:qn.width,value:this.state.value??``,error:!!e,disabled:!!t,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.state.useSystem}},onChange:e=>{let t=e.target.value;this.setState({value:t},()=>this.onChange(this.props.attr,(t||``).trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}):null,this.state.useSystem?null:p.createElement(tt,{size:`small`,onClick:()=>this.getCoordinates(),title:W.t(`jc_Take browser position`),style:{marginRight:4}},p.createElement(Lt,null)),this.state.useSystem?null:p.createElement(tt,{size:`small`,onClick:()=>this.getSystemCoordinates(),title:W.t(`jc_Take position from system settings`)},p.createElement(Fe,null)))}};f();var Yn=class extends p.Component{constructor(e){super(e),this.state={error:null}}static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`Custom component "${this.props.name}" from "${this.props.url||`unknown URL`}" crashed while rendering. It was probably built for an older admin version.`,e,t.componentStack)}componentDidUpdate(e){this.state.error&&(e.name!==this.props.name||e.url!==this.props.url)&&this.setState({error:null})}render(){return this.state.error?p.createElement(Ye,{type:`error`,iconPosition:`top`},p.createElement(`div`,null,p.createElement(`div`,{style:{fontWeight:`bold`}},W.t(`jc_Cannot display the custom component "%s"`,this.props.name)),p.createElement(`div`,null,W.t(`jc_It was probably built for an older admin version. Please update the adapter.`)),p.createElement(`div`,{style:{marginTop:8,fontStyle:`italic`,wordBreak:`break-word`}},this.state.error.message||String(this.state.error)))):p.createElement(p.Fragment,null,this.props.children)}},Xn=`@iobroker/gui-components`,Zn=`@iobroker/adapter-react-v5`,Qn=5e3,$n=new Map;async function er(e){let t=e.lastIndexOf(`/`),n=`${t===-1?e:e.substring(0,t)}/mf-manifest.json`,r=$n.get(n);return r||(r=(async()=>{let e=new AbortController,t=setTimeout(()=>e.abort(),Qn);try{let t=await fetch(n,{signal:e.signal});return t.ok?await t.json():null}catch{return null}finally{clearTimeout(t)}})(),$n.set(n,r)),r}function tr(e){let t=e==null?void 0:e.shared;return Array.isArray(t)?t.some(e=>(e==null?void 0:e.name)===Zn)?Zn:t.some(e=>(e==null?void 0:e.name)===Xn)?Xn:null:null}async function nr(e,t){let n=tr(await er(e));return n===Zn?{compatible:!1,declared:1,tooNew:!1}:typeof t==`number`&&Number.isFinite(t)?{compatible:t===2,declared:t,tooNew:t>2}:n===Xn?{compatible:!0,declared:2,tooNew:!1}:{compatible:!1,declared:1,tooNew:!1}}f(),s({name:`iobroker_admin`,shared:{},remotes:[]});var rr=class e extends q{constructor(e){super(e),Object.assign(this.state,{Component:null,error:``,incompatible:null})}async componentDidMount(){if(!this.props.schema.url){console.error(`URL is empty. Cannot load custom component!`),this.setState({error:`URL is empty. Cannot load custom component!`});return}let t;t=this.props.schema.url.startsWith(`http:`)||this.props.schema.url.startsWith(`https:`)?this.props.schema.url:this.props.schema.url.startsWith(`./`)?`${window.location.protocol}//${window.location.host}${this.props.schema.url.replace(/^\./,``)}`:`${window.location.protocol}//${window.location.host}/adapter/${this.props.oContext.adapterName}/${this.props.schema.url}`;let[n,r,...i]=this.props.schema.name.split(`/`),s=i.join(`/`);if(!t){console.error(`Cannot find URL for custom component! Please define "url" as "custom/customComponents.js" in the schema`);return}if(!n||!r||!s){console.error(`Invalid format of "name"! Please define "name" as "ConfigCustomBackItUpSet/Components/AdapterExist" in the schema`);return}let c=await nr(t,this.props.schema.guiApi);if(!c.compatible){console.warn(`Custom component "${this.props.schema.name}" from "${t}" was not started: it targets GUI API generation ${c.declared}, but this admin provides generation 2.`),this.setState({incompatible:c});return}let l=e.runningLoads[`${t}!${r}`];if(!(l instanceof Promise)){let i;if(this.props.schema.i18n===!0){let e=t.lastIndexOf(`/`),n;n=e===-1?t:t.substring(0,e);let r=W.getLanguage(),a=`${n}/i18n/${r}.json`;i=fetch(a).then(e=>e.json()).then(e=>W.extendTranslations(e,r)).catch(e=>{if(r!==`en`){fetch(`${n}/i18n/en.json`).then(e=>e.json()).then(e=>W.extendTranslations(e,r)).catch(e=>console.log(`Cannot load i18n "${a}": ${e}`));return}console.log(`Cannot load i18n "${a}": ${e}`)})}else if(this.props.schema.i18n&&typeof this.props.schema.i18n==`object`)try{W.extendTranslations(this.props.schema.i18n)}catch(e){console.error(`Cannot import i18n: ${e}`)}try{console.log(t,n,r,s),o([{name:n,entry:t,type:`module`}]),l=a(`${n}/${r}`),i instanceof Promise&&(l=Promise.all([l,i]).then(e=>e[0])),e.runningLoads[`${t}!${r}`]=l}catch(e){console.error(e),this.setState({error:`Cannot import from ${this.props.schema.url}: ${e}`})}}try{var u;let e=(u=await l)==null?void 0:u.default;if(e!=null&&e[s])this.setState({Component:e[s]});else{let t=Object.keys(e||{});console.error(`URL is empty. Cannot load custom component!`),this.setState({error:`Component ${this.props.schema.name} not found in ${this.props.schema.url}. Found: ${t.join(`, `)}`})}}catch(e){console.error(e),this.setState({error:`Cannot import from ${this.props.schema.url}: ${e}`})}}renderIncompatible(e){return p.createElement(Ye,{type:`warning`,iconPosition:`top`},p.createElement(`div`,null,p.createElement(`div`,{style:{fontWeight:`bold`}},W.t(`jc_Custom component "%s" was not started`,this.props.schema.name)),p.createElement(`div`,null,e.tooNew?W.t(`jc_It requires GUI API generation %s, but this admin provides generation %s. Please update the admin.`,e.declared,2):W.t(`jc_It was built for GUI API generation %s, but this admin provides generation %s. Please update the adapter.`,e.declared,2))))}render(){let e=this.state.Component,t=this.props.schema||{},n=e?p.createElement(Yn,{name:t.name,url:t.url},p.createElement(e,{...this.props,socket:this.props.oContext.socket,theme:this.props.oContext.theme,themeType:this.props.oContext.themeType,instance:this.props.oContext.instance,adapterName:this.props.oContext.adapterName,systemConfig:this.props.oContext.systemConfig,forceUpdate:this.props.oContext.forceUpdate})):this.state.incompatible?this.renderIncompatible(this.state.incompatible):this.state.error?p.createElement(`div`,null,this.state.error):p.createElement(qt,null);return t.newLine?p.createElement(p.Fragment,null,p.createElement(`div`,{style:{flexBasis:`100%`,height:0}}),n):n}};G(rr,`runningLoads`,{}),f();var ir=class extends q{async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr);if(e)try{let t=new Date(e);this.setState({value:t})}catch{}}renderItem(e,t){return p.createElement(tn,{sx:t=>({width:`100%`,borderBottom:`1px solid ${e?`#F00`:t.palette.text.primary}`,"& fieldset":{display:`none`},"& input":{padding:`${t.spacing(1.5)} 0 4px 0`},"& .MuiInputAdornment-root":{marginLeft:0,marginTop:1},"& label":{transform:`translate(0px, -9px) scale(0.75)`}}),format:this.props.oContext.systemConfig.dateFormat.toLowerCase().replace(`mm`,`MM`),disabled:!!t,value:this.state.value||null,onChange:e=>this.setState({value:e},()=>{try{if(this.props.attr){let e=this.state.value.toISOString();this.onChange(this.props.attr,e).catch(e=>console.warn(`Error saving value for ${this.props.attr}:`,e))}}catch{}}),label:this.getText(this.props.schema.label)})}};f();var ar=class extends q{renderItem(){if(!this.props.schema)return null;if(this.props.oContext.DeviceManager){let e=this.props.oContext.DeviceManager;return p.createElement(e,{uploadImagesToInstance:`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,title:this.getText(this.props.schema.label),socket:this.props.oContext.socket,selectedInstance:`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,themeName:this.props.themeName,theme:this.props.oContext.theme,themeType:this.props.oContext.themeType,isFloatComma:this.props.oContext.isFloatComma,dateFormat:this.props.oContext.dateFormat,smallCards:this.props.schema.smallCards})}return p.createElement(`div`,null,`DeviceManager not found`)}};f();var or={fullWidth:{width:`100%`},fullWidthOneButton:{width:`calc(100% - 42px)`},fullWidthTwoButtons:{width:`calc(100% - 84px)`},fullWidthThreeButtons:{width:`calc(100% - 126x)`},dropZone:{width:`100%`,height:`100%`,position:`absolute`},dropZoneEmpty:{},image:{objectFit:`contain`,margin:`auto`,display:`flex`,width:`100%`,height:`100%`},uploadDiv:{position:`relative`,width:`100%`},uploadDivDragging:{opacity:1,background:`rgba(128,255,128,0.1)`},uploadCenterDiv:{margin:5,border:`3px dashed grey`,borderRadius:5,width:`100%`,height:`100%`,position:`absolute`,display:`flex`},uploadCenterIcon:{paddingTop:10,width:48,height:48},uploadCenterText:{fontSize:16},uploadCenterTextAndIcon:{textAlign:`center`,position:`absolute`,top:0,bottom:0,left:0,right:0,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`},disabledOpacity:{opacity:.3,cursor:`default`},error:{border:`2px solid red`},deleteButton:{},selectedImage:{height:40,width:40,display:`inline-block`,marginRight:8}},sr=[`jpg`,`jpeg`,`svg`,`png`,`webp`,`gif`,`apng`,`avif`,`webp`],cr=[`mp3`,`ogg`,`wav`,`aac`],lr=[`avi`,`mp4`,`mov`],ur=[`txt`,`log`,`html`,`htm`],dr=[`json`,`js`,`ts`],fr=class e extends q{constructor(e){super(e),G(this,`dropzoneRef`,void 0),G(this,`imagePrefix`,void 0),G(this,`objectID`,void 0),G(this,`path`,void 0),G(this,`onFolderChanged`,(e,t)=>{this.path&&t.startsWith(this.path)&&this.updateFiles().catch(e=>console.error(`Cannot update files: ${e}`))}),this.state={...this.state,deleteFile:``},this.dropzoneRef=p.createRef(),this.imagePrefix=this.props.oContext.imagePrefix??`./files`}async componentDidMount(){await super.componentDidMount(),this.objectID=(this.props.schema.objectID||`0_userdata.0`).replace(`%INSTANCE%`,(this.props.oContext.instance||0).toString()),this.path=this.props.schema.upload||``,this.path&&(this.path===`/`?this.path=``:this.path.endsWith(`/`)||(this.path=`${this.path}/`)),this.updateFiles().then(()=>{let e=q.getValue(this.props.data,this.props.attr);this.setState({value:e}),this.props.oContext.socket.subscribeFiles(this.objectID,`${this.path}/*`,this.onFolderChanged).catch(e=>console.error(`Cannot subscribe: ${e}`))})}componentWillUnmount(){this.props.oContext.socket.subscribeFiles(this.objectID,`${this.path}/*`,this.onFolderChanged).catch(e=>console.error(`Cannot subscribe: ${e}`)),super.componentWillUnmount()}async updateFiles(){let e=await this.readFiles(this.props.schema.pattern);await new Promise(t=>this.setState({files:e},t))}async readFolder(e,t,n){try{let i=await this.props.oContext.socket.readDir(this.objectID,e.replace(/^\//,``));for(let a=0;a<i.length;a++){let o=i[a];if(o.isDir)await this.readFolder(`${e+o.file}/`,t,n);else{let i=!1;if(i=n===`*.*`&&o.file.includes(`.`)||!n||n===`*`||n===`.*`&&o.file.startsWith(`.`)?!0:RegExp(`^${n.replace(/\./g,`\\.`).replace(/\*/g,`.*`)}$`).test(o.file),i){var r;t.push({name:e+o.file,size:(r=o.stats)!=null&&r.size?z.formatBytes(o.stats.size):`--`})}}}}catch(t){console.error(`Cannot read "${e}": ${t}`)}return t}async readFiles(e){let t=[];e||=this.props.schema.pattern,e||=`**/*.*`;let n,r=e.lastIndexOf(`/`);if(n=r===-1?e:e.substring(r+1),e.startsWith(`**`))await this.readFolder(`/`,t,n);else{let r=e.lastIndexOf(`/`);if(r===-1)await this.readFolder(`/`,t,n);else{let i=e.substring(0,r+1);await this.readFolder(i,t,n)}}return t}onDrop(e){let t=e[0],n=new FileReader,r=this.props.schema.maxSize||2097152;n.onabort=()=>console.log(`file reading was aborted`),n.onerror=()=>console.log(`file reading has failed`),n.onload=()=>{if(t.size>r){window.alert(W.t(`jc_File is too big. Max %sk allowed. Try use SVG.`,Math.round(r/1024)));return}let e=n.result;if(e===null){console.error(`Cannot read file ${t.name}`);return}this.props.oContext.socket.writeFile64(this.objectID,this.path+t.name,e).then(()=>this.updateFiles()).then(()=>this.setState({value:this.path+t.name},()=>this.onChange(this.props.attr,this.path+t.name))).catch(e=>window.alert(`Cannot upload file: ${e}`))},n.readAsArrayBuffer(t)}renderDeleteDialog(){return this.state.deleteFile?p.createElement(xt,{title:W.t(`jc_Are you sure?`),text:W.t(`jc_File will be deleted`),ok:W.t(`jc_Delete`),cancel:W.t(`jc_Cancel`),onClose:e=>{let t=this.state.deleteFile;this.setState({deleteFile:``},()=>{e&&this.props.oContext.socket.deleteFile(this.objectID,t).then(()=>this.updateFiles()).catch(e=>window.alert(`Cannot delete file: ${e}`))})}}):null}static base64ToArrayBuffer(e){let t=window.atob(e),n=t.length,r=new Uint8Array(n);for(let e=0;e<n;e++)r[e]=t.charCodeAt(e);return r.buffer}loadFile(){return this.props.oContext.socket.readFile(this.objectID,this.state.value,!0)}play(){this.loadFile().then(t=>{if(typeof AudioContext<`u`){let n=new AudioContext,r=e.base64ToArrayBuffer(t.file);n.decodeAudioData(r,e=>{let t=n.createBufferSource();t.buffer=e,t.connect(n.destination),t.start(0)},e=>window.alert(`Cannot play: ${e.message}`))}})}getFileIcon(e){return e!=null&&e.extension?sr.includes(e.extension)?p.createElement(`div`,{style:{...or.selectedImage,backgroundImage:`url(${this.imagePrefix}/${this.objectID}/${e.value})`,backgroundSize:`contain`,backgroundRepeat:`no-repeat`}}):cr.includes(e.extension)?p.createElement(nt,null):ur.includes(e.extension)?p.createElement(Ze,null):lr.includes(e.extension)?p.createElement(b,null):dr.includes(e.extension)?p.createElement(E,null):null:null}renderItem(e,t){if(!this.state.files)return null;let n=[];this.props.schema.withFolder||this.state.files.forEach(e=>{let t=e.name.lastIndexOf(`/`);if(t===-1)n.includes(`/`)||n.push(`/`);else{let r=e.name.substring(0,t+1);n.includes(r)||n.push(r)}});let r=this.state.files.map(e=>({value:e.name,label:!this.props.schema.withFolder&&n.length===1?`${e.name.substring(n[0].length)}`:`${e.name}${this.props.schema.noSize?``:`(${e.size})`}`,extension:e.name.toLowerCase().split(`.`).pop()}));this.props.schema.noNone||r.unshift({label:W.t(`jc_none`),value:``});let i=r.find(e=>e.value===this.state.value),a=0;this.props.schema.upload&&a++,this.props.schema.refresh&&a++;let o=this.state.value&&(this.state.value.endsWith(`.mp3`)||this.state.value.endsWith(`.ogg`)||this.state.value.endsWith(`.wav`));o&&a++;let s=p.createElement(`div`,{style:or.fullWidth},p.createElement(U,{variant:`standard`,style:{width:`calc(100% - ${a*42}px)`}},this.props.schema.label?p.createElement(x,null,this.getText(this.props.schema.label)):null,p.createElement(D,{variant:`standard`,error:!!e,disabled:!!t,value:this.state.value||`_`,renderValue:()=>p.createElement(p.Fragment,null,this.getFileIcon(i),p.createElement(`span`,null,(i==null?void 0:i.label)||``)),onChange:e=>{this.setState({value:e.target.value===`_`?``:e.target.value},()=>this.onChange(this.props.attr,this.state.value))}},r.map(e=>p.createElement(H,{key:e.value,value:e.value},p.createElement(Oe,null,this.getFileIcon(e)),p.createElement(w,null,e.label),this.props.schema.delete&&e.value?p.createElement(B,{style:or.deleteButton,size:`small`,onClick:t=>{t.stopPropagation(),this.setState({deleteFile:e.value})}},p.createElement(pe,null)):null))),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null),this.props.schema.refresh&&p.createElement(B,{onClick:()=>this.updateFiles()},p.createElement(Ee,null)),this.props.schema.upload&&p.createElement(B,{onClick:()=>{var e;return(e=this.dropzoneRef.current)==null?void 0:e.open()}},p.createElement(we,null)),o&&p.createElement(B,{style:{color:`#00FF00`},onClick:()=>this.play()},p.createElement(Ve,null)));if(!this.props.schema.upload)return p.createElement(p.Fragment,null,s,this.renderDeleteDialog());let c={"*/*":[]};if(this.props.schema.fileTypes===`image`?c={"image/*":[`.png`,`.jpg`,`.svg`,`.gif`,`.apng`,`.avif`,`.webp`]}:this.props.schema.fileTypes===`audio`?c={"audio/*":[`.mp3`,`.ogg`,`.wav`,`.mp4`]}:this.props.schema.fileTypes===`text`&&(c={"text/plain":[`.txt`]}),this.props.schema.pattern){let e=(this.props.schema.pattern.split(`/`).pop()||``).toLowerCase().replace(/.*\./,``);c=e===`png`||e===`jpg`||e===`svg`||e===`gif`||e===`apng`||e===`avif`||e===`webp`?{"image/*":[`.png`,`.jpg`,`.svg`,`.gif`,`.apng`,`.avif`,`.webp`]}:e===`mp3`||e===`ogg`||e===`wav`?{"audio/*":[`.mp3`,`.ogg`,`.wav`,`.mp4`]}:e===`ics`?{"text/calendar":[`.ics`]}:e===`txt`?{"text/plain":[`.txt`]}:e===`pem`?{"text/plain":[`.pem`]}:{"*/*":[`.${e}`]}}return p.createElement(Yt,{ref:this.dropzoneRef,multiple:!1,accept:c,noKeyboard:!0,noClick:!0,maxSize:this.props.schema.maxSize||2097152,onDragEnter:()=>{this.setState({uploadFile:`dragging`})},onDragLeave:()=>this.setState({uploadFile:!0}),onDrop:(e,t)=>{if(this.setState({uploadFile:!1}),e.length)this.onDrop(e);else{var n;window.alert((t==null||(n=t[0])==null||(n=n.errors)==null||(n=n[0])==null?void 0:n.message)||W.t(`jc_Cannot upload`))}}},({getRootProps:e,getInputProps:n})=>p.createElement(`div`,{style:{...or.uploadDiv,...this.state.uploadFile===`dragging`?or.uploadDivDragging:void 0,...t?or.disabledOpacity:void 0},...e()},p.createElement(`input`,{...n()}),this.state.uploadFile===`dragging`?p.createElement(`div`,{style:{...or.uploadCenterDiv,...this.state.uploadError?or.error:void 0}},p.createElement(`div`,{style:or.uploadCenterTextAndIcon},p.createElement(we,{style:or.uploadCenterIcon}),p.createElement(`div`,{style:or.uploadCenterText},this.state.uploadFile===`dragging`?W.t(`jc_Drop file here`):W.t(`jc_Place your files here or click here to open the browse dialog`)))):null,s,this.renderDeleteDialog()))}};f();var pr={fullWidth:{width:`100%`},fullWidthOneButton:{width:`calc(100% - 69px)`,marginRight:4},fullWidthIcon:{width:`calc(100% - 119px)`,marginRight:4},selectedImage:{height:40,width:40,display:`inline-block`,marginRight:8}},mr=[`jpg`,`jpeg`,`svg`,`png`,`webp`,`gif`,`apng`,`avif`,`webp`],hr=[`mp3`,`ogg`,`wav`,`aac`],gr=[`avi`,`mp4`,`mov`],_r=[`txt`,`log`,`html`,`htm`],vr=[`json`,`js`,`ts`],yr=class extends q{constructor(...e){super(...e),G(this,`imagePrefix`,`../..`)}async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr);this.imagePrefix=this.props.oContext.imagePrefix??`./files`,this.setState({value:e??``})}static getDerivedStateFromProps(e,t){let n=q.getValue(e.data,e.attr);return n==null||n.toString().trim()!==(t.value||``).toString().trim()?{value:n??``}:null}loadFile(){let e=this.state.value.indexOf(`/`);if(e!==-1){let t=this.state.value.substring(0,e),n=this.state.value.substring(e+1);return this.props.oContext.socket.readFile(t,n,!0)}return Promise.resolve(null)}play(){this.loadFile().then(e=>{if(typeof AudioContext<`u`&&e!=null&&e.file){let t=new AudioContext,n=fr.base64ToArrayBuffer(e.file);t.decodeAudioData(n,e=>{let n=t.createBufferSource();n.buffer=e,n.connect(t.destination),n.start(0)},e=>window.alert(`Cannot play: ${e.message}`))}})}getIcon(){let e=this.state.value.split(`.`).pop().toLowerCase();return mr.includes(e)?p.createElement(`div`,{style:{...pr.selectedImage,backgroundImage:`url(${this.imagePrefix}/${this.state.value})`,backgroundSize:`contain`,backgroundRepeat:`no-repeat`}}):hr.includes(e)?p.createElement(B,{style:{color:`#00FF00`},onClick:()=>this.play()},p.createElement(Ve,null)):_r.includes(e)?p.createElement(Ze,null):gr.includes(e)?p.createElement(b,null):vr.includes(e)?p.createElement(E,null):null}renderFileBrowser(){return this.state.showFileBrowser?p.createElement(Ke,{imagePrefix:this.props.oContext.imagePrefix,socket:this.props.oContext.socket,selected:this.state.value,onClose:()=>this.setState({showFileBrowser:!1}),onOk:e=>{let t=Array.isArray(e)?e[0]:e;this.setState({value:t},()=>this.props.attr&&this.onChange(this.props.attr,this.props.schema.trim===!1?t:(t||``).trim()))},selectOnlyFolders:this.props.schema.selectOnlyFolders,allowUpload:this.props.schema.allowUpload,allowDownload:this.props.schema.allowDownload,allowCreateFolder:this.props.schema.allowCreateFolder,allowView:this.props.schema.allowView,showToolbar:this.props.schema.showToolbar,limitPath:this.props.schema.limitPath,theme:this.props.oContext.theme}):null}renderItem(e,t){let n=this.getIcon();return p.createElement(`div`,{style:pr.fullWidth},n,p.createElement(O,{variant:`standard`,style:n?pr.fullWidthIcon:pr.fullWidthOneButton,value:this.state.value??``,error:!!e,disabled:!!t,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:!!this.props.schema.disableEdit}},onChange:e=>{let t=e.target.value;this.setState({value:t},()=>this.props.attr&&this.onChange(this.props.attr,this.props.schema.trim===!1?t:(t||``).trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}),p.createElement(h,{disabled:t,variant:`outlined`,onClick:()=>this.setState({showFileBrowser:!0})},`...`),this.renderFileBrowser())}};f();var br=class extends q{async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr);this.props.oContext.socket.getEnums(`functions`).then(t=>{let n=Object.keys(t).map(e=>({value:this.props.schema.short?e.replace(`enum.functions.`,``):e,label:this.getText(t[e].common.name),obj:t[e]}));this.props.schema.allowDeactivate!==!1&&n.unshift({label:W.t(q.NONE_LABEL),value:q.NONE_VALUE}),this.setState({value:e,selectOptions:n})})}renderItem(e,t){if(!this.state.selectOptions)return null;let n=this.state.selectOptions.find(e=>e.value===this.state.value);return p.createElement(U,{variant:`standard`,fullWidth:!0},this.props.schema.label?p.createElement(x,null,this.getText(this.props.schema.label)):null,p.createElement(D,{variant:`standard`,error:!!e,disabled:!!t,value:this.state.value||`_`,renderValue:()=>n?n.obj?p.createElement(at,{value:n.obj,themeType:this.props.oContext.themeType,lang:W.getLanguage()}):n.label:``,onChange:e=>{this.setState({value:e.target.value===`_`?``:e.target.value},()=>this.props.attr&&this.onChange(this.props.attr,this.state.value))}},this.state.selectOptions.map(e=>p.createElement(H,{key:e.value,value:e.value,style:e.value===q.DIFFERENT_VALUE?{opacity:.5}:{}},e.obj?p.createElement(at,{value:e.obj,themeType:this.props.oContext.themeType,lang:W.getLanguage()}):e.label))),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();var xr=class extends q{constructor(...e){super(...e),G(this,`iframeRef`,p.createRef()),G(this,`observer`,null)}async componentDidMount(){await super.componentDidMount(),this.props.schema.reloadOnShow&&(this.observer=new IntersectionObserver(([e])=>{if(e.isIntersecting&&this.state.isVisible===!1&&this.iframeRef.current){let e=this.iframeRef.current.src;this.iframeRef.current.src=``,setTimeout(()=>{this.iframeRef.current&&(this.iframeRef.current.src=e)},0)}this.setState({isVisible:e.isIntersecting})}),this.iframeRef.current&&this.observer.observe(this.iframeRef.current))}componentWillUnmount(){var e,t;(e=super.componentWillUnmount)==null||e.call(this),(t=this.observer)==null||t.disconnect()}renderItem(e,t){let n=this.props.schema.url||q.getValue(this.props.data,this.props.attr);return p.createElement(`div`,{style:{position:`relative`,width:`100%`,height:`100%`}},p.createElement(`iframe`,{style:{width:`100%`,height:`100%`,borderWidth:this.props.schema.frameBorder??0,...this.props.schema.innerStyle,border:e?`1px solid red`:void 0},ref:this.iframeRef,src:n,allowFullScreen:this.props.schema.allowFullscreen??!1,sandbox:this.props.schema.sandbox,loading:this.props.schema.lazyLoad??`lazy`}),t&&p.createElement(`div`,{style:{position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,backgroundColor:`rgba(255, 255, 255, 0.3)`,cursor:`not-allowed`,zIndex:1}}))}};f();var Sr=class extends q{constructor(...e){super(...e),G(this,`initialized`,!1),G(this,`localContext`,void 0),G(this,`iframeRef`,p.createRef()),G(this,`observer`,null)}async componentDidMount(){await super.componentDidMount(),this.askInstance().catch(e=>console.error(e)),this.props.schema.reloadOnShow&&(this.observer=new IntersectionObserver(([e])=>{if(e.isIntersecting&&this.state.isVisible===!1&&this.iframeRef.current){let e=this.iframeRef.current.src;this.iframeRef.current.src=``,setTimeout(()=>{this.iframeRef.current&&(this.iframeRef.current.src=e)},0)}this.setState({isVisible:e.isIntersecting})}),this.iframeRef.current&&this.observer.observe(this.iframeRef.current))}async askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){let t=await this.getPatternAsync(this.props.schema.jsonData,null,!0);if(t)try{e=JSON.parse(t)}catch{console.error(`Cannot parse json data: ${JSON.stringify(e)}`)}}e??=null;let t=await this.getPatternAsync(this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);if(t!==`${this.props.oContext.adapterName}.${this.props.oContext.instance}`){let e=await this.props.oContext.socket.getState(`system.adapter.${t}.alive`);if(!(e!=null&&e.val)){window.alert(W.t(`jc_Instance %s is not alive`,t));return}}this.props.oContext.socket.sendTo(t,this.props.schema.command||`send`,e).then(e=>this.setState({url:e||``}))}}getContext(){let e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=q.getValue(this.props.data,t)),JSON.stringify(e)}renderItem(e,t){if(this.props.alive){let e=this.getContext();(e!==this.localContext||!this.initialized)&&(this.localContext=e,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}return this.state.url?p.createElement(`div`,{style:{position:`relative`,width:`100%`,height:`100%`}},p.createElement(`iframe`,{style:{width:`100%`,height:`100%`,borderWidth:this.props.schema.frameBorder??0,...this.props.schema.innerStyle,border:e?`1px solid red`:void 0},ref:this.iframeRef,src:this.state.url,allowFullScreen:this.props.schema.allowFullscreen??!1,sandbox:this.props.schema.sandbox,loading:this.props.schema.lazyLoad??`lazy`}),t&&p.createElement(`div`,{style:{position:`absolute`,top:0,left:0,width:`100%`,height:`100%`,backgroundColor:`rgba(255, 255, 255, 0.3)`,cursor:`not-allowed`,zIndex:1}})):null}};f();var Cr=class extends q{async componentDidMount(){var e;await super.componentDidMount(),(e=this.props.common)!=null&&e.host&&this.props.oContext.socket.getHostByIp(this.props.common.host).then(e=>{this.props.schema.listenOnAllPorts||(e=e.filter(e=>e.address!==`0.0.0.0`&&e.address!==`::`)),this.props.schema.onlyIp4?e=e.filter(e=>e.family===`ipv4`):this.props.schema.onlyIp6&&(e=e.filter(e=>e.family===`ipv6`)),this.props.schema.noInternal&&(e=e.filter(e=>!e.internal)),e.forEach(e=>{e.address===`0.0.0.0`?e.name=`[IPv4] 0.0.0.0 - ${W.t(`jc_Listen on all IPs`)}`:e.address===`::`&&(e.name=`[IPv6] :: - ${W.t(`jc_Listen on all IPs`)}`)}),this.setState({ips:e})}).catch(e=>console.error(e))}renderItem(e,t){var n,r;let i=q.getValue(this.props.data,this.props.attr),a=(n=this.state.ips)==null?void 0:n.find(e=>e.address===i);return p.createElement(U,{fullWidth:!0,variant:`standard`},this.state.ips&&this.props.schema.label?p.createElement(x,null,this.getText(this.props.schema.label)):null,this.state.ips?p.createElement(D,{variant:`standard`,error:!!e,disabled:!!t,value:i,renderValue:e=>(a==null?void 0:a.name)||e,onChange:e=>this.props.attr&&this.onChange(this.props.attr,e.target.value)},(r=this.state.ips)==null?void 0:r.map((e,t)=>p.createElement(H,{key:t,value:e.address},e.name))):p.createElement(O,{fullWidth:!0,variant:`standard`,error:!!e,disabled:!!t,value:i,onChange:e=>this.props.attr&&this.onChange(this.props.attr,e.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();var wr=class extends q{constructor(...e){super(...e),G(this,`initialized`,!1),G(this,`localContext`,void 0)}async componentDidMount(){await super.componentDidMount(),this.props.schema.sendFirstByClick||this.askInstance().catch(e=>console.error(e))}async askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){let t=await this.getPatternAsync(this.props.schema.jsonData,null,!0);if(t)try{e=JSON.parse(t)}catch{console.error(`Cannot parse json data: ${JSON.stringify(e)}`)}}e??=null;let t=await this.getPatternAsync(this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);if(t!==`${this.props.oContext.adapterName}.${this.props.oContext.instance}`){let e=await this.props.oContext.socket.getState(`system.adapter.${t}.alive`);if(!(e!=null&&e.val)){window.alert(W.t(`jc_Instance %s is not alive`,t));return}}this.setState({loading:!0},()=>this.props.oContext.socket.sendTo(t,this.props.schema.command||`send`,e).then(e=>this.setState({image:e||``})))}}getContext(){let e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=q.getValue(this.props.data,t)),JSON.stringify(e)}renderItem(){if(this.props.alive){let e=this.getContext();(e!==this.localContext||!this.initialized)&&(this.localContext=e,(!this.props.schema.sendFirstByClick||this.state.image!==void 0)&&setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}return!this.state.image&&this.props.schema.sendFirstByClick?p.createElement(`div`,{style:{width:this.props.schema.width||`100%`,height:this.props.schema.height,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:this.state.loading?`default`:`pointer`},onClick:()=>!this.state.loading&&this.askInstance()},this.state.loading?p.createElement(Nt,null):typeof this.props.schema.sendFirstByClick==`boolean`?W.t(`jc_Click to show`):this.getText(this.props.schema.sendFirstByClick,this.props.schema.noTranslation)):this.state.image===void 0?null:p.createElement(gt,{title:this.getText(this.props.schema.tooltip),src:this.state.image,style:{width:this.props.schema.width||`100%`,height:this.props.schema.height}})}};f();var Tr=class extends q{constructor(e){super(e),G(this,`index`,void 0),this.index=Date.now()}async componentDidMount(){if(await super.componentDidMount(),this.props.schema.base64){let e=q.getValue(this.props.data,this.props.attr);this.setState({value:e})}else this.props.attr&&this.props.oContext.socket.fileExists(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr).then(e=>e&&this.loadImage())}_getUrl(e){e&&(this.index=Date.now());let t=`files/${this.props.oContext.adapterName}.${this.props.oContext.instance}/${this.props.attr}?t=${this.index}`;return window.location.port===`3000`&&(t=`${window.location.protocol}//${window.location.hostname}:8081/${t}`),t}loadImage(){fetch(this._getUrl()).then(e=>e.blob()).then(e=>{let t=new FileReader;t.onload=()=>{this.setState({value:t.result})},t.readAsDataURL(e)}).catch(e=>console.error(e))}renderItem(e,t){return p.createElement(U,{fullWidth:!0,variant:`standard`},this.props.schema.label?p.createElement(x,{shrink:!0},this.getText(this.props.schema.label)):null,p.createElement(rt,{error:!!e,disabled:t,accept:this.props.schema.accept,crop:this.props.schema.crop,maxSize:this.props.schema.maxSize||262144,icon:this.state.value||void 0,removeIconFunc:()=>this.setState({value:null},()=>{if(this.props.attr){if(this.props.schema.base64){let e=this.onChange(this.props.attr,this.state.value);e instanceof Promise&&e.catch(e=>console.error(`Cannot set value: ${e}`))}else this.props.oContext.socket.deleteFile(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr).catch(e=>console.error(e))}}),onChange:e=>this.setState({value:e},()=>{if(this.props.attr){if(this.props.schema.base64){let e=this.onChange(this.props.attr,this.state.value);e instanceof Promise&&e.catch(e=>console.error(`Cannot set value: ${e}`))}else e.startsWith(`data`)&&(e=e.split(`,`)[1]);this.props.oContext.socket.writeFile64(`${this.props.oContext.adapterName}.${this.props.oContext.instance}`,this.props.attr,e).catch(e=>console.error(e))}})}),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();var Er=class extends q{renderItem(){return p.createElement(Ye,{type:this.props.schema.boxType||`info`,closeable:this.props.schema.closeable===void 0||this.props.schema.closeable,storeId:this.props.schema.closed===void 0?`${!!this.props.oContext.adapterName} ${this.props.attr}`:void 0,closed:this.props.schema.closed,style:{width:`100%`,...this.props.schema.style}},this.props.schema.title?p.createElement(R,{component:`div`,sx:{fontWeight:`bold`,fontSize:`larger`}},this.getText(this.props.schema.title)):null,this.getText(this.props.schema.text))}};f();var Dr={icon:{width:20,height:20,marginRight:4}},Or=class extends q{constructor(...e){super(...e),G(this,`onInstancesUpdate`,(e,t)=>{var n;if(!e.match(/^system\.adapter\.[-_a-z\d]+\.\d+$/))return;let r=this.props.schema.long?e:this.props.schema.short?e.split(`.`).pop():e.replace(/^system\.adapter\./,``),i=((n=this.state.selectOptions)==null?void 0:n.findIndex(e=>e.value===r))??-1;if(t){if(this.props.schema.adapter===`_dataSources`&&(!t.common||!t.common.getHistory))return;if(i===-1){let e=JSON.parse(JSON.stringify(this.state.selectOptions)),n=typeof t.common.name==`object`?t.common.name[W.getLanguage()]||t.common.name.en:t.common.name;e.push({value:this.props.schema.long?t._id:this.props.schema.short?t._id.split(`.`).pop()||``:t._id.replace(/^system\.adapter\./,``),label:`${n} [${t._id.replace(/^system\.adapter\./,``)}]`,icon:`${this.props.oContext.imagePrefix}/adapter/${n}/${t.common.icon}`}),e.sort((e,t)=>e.label>t.label?1:e.label<t.label?-1:0),this.setState({selectOptions:e})}}else if(i!==-1){let e=JSON.parse(JSON.stringify(this.state.selectOptions)),t={};this.state.value===e[i].value&&(t.value=q.NONE_VALUE),e.splice(i,1),t.selectOptions=e,this.setState(t)}})}async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr),t=this.props.schema.adapter;t===`_dataSources`&&(t=void 0),this.props.oContext.socket.getAdapterInstances(t,!0).then(async n=>{this.props.schema.adapter===`_dataSources`?n=n.filter(e=>{var t;return e==null||(t=e.common)==null?void 0:t.getHistory}):this.props.schema.adapter?n=n.filter(e=>e==null?void 0:e._id.startsWith(`system.adapter.${this.props.schema.adapter}.`)):this.props.schema.adapters&&Array.isArray(this.props.schema.adapters)&&(n=n.filter(e=>{var t,n;return(t=this.props.schema.adapters)==null?void 0:t.includes(e==null||(n=e.common)==null?void 0:n.name)})),this.props.schema.onlyEnabled&&(n=n.filter(e=>{var t;return e==null||(t=e.common)==null?void 0:t.enabled}));let r=n.map(e=>({value:this.props.schema.long?e._id:this.props.schema.short?e._id.split(`.`).pop()||``:e._id.replace(/^system\.adapter\./,``),label:`${e.common.name} [${e._id.replace(/^system\.adapter\./,``)}]`,icon:`${this.props.oContext.imagePrefix}/adapter/${e.common.name}/${e.common.icon}`}));r.sort((e,t)=>e.value>t.value?1:e.value<t.value?-1:0),this.props.schema.allowDeactivate!==!1&&r.unshift({label:W.t(q.NONE_LABEL),value:q.NONE_VALUE}),this.props.schema.all&&r.unshift({label:W.t(`sch_all`),value:`*`}),this.setState({value:e||``,selectOptions:r}),await this.props.oContext.socket.subscribeObject(`system.adapter.${t?`${t}.`:``}*`,this.onInstancesUpdate)}).catch(e=>console.error(`Cannot get instances: ${e}`))}componentWillUnmount(){this.props.oContext.socket.unsubscribeObject(`system.adapter.*`,this.onInstancesUpdate).then(()=>{}),super.componentWillUnmount()}renderItem(e,t){var n;if(!this.state.selectOptions)return null;let r=(n=this.state.selectOptions)==null?void 0:n.find(e=>e.value===this.state.value);return p.createElement(U,{fullWidth:!0,key:this.props.attr,variant:`standard`},this.props.schema.label?p.createElement(x,{shrink:!0},this.getText(this.props.schema.label)):null,p.createElement(D,{variant:`standard`,error:!!e,displayEmpty:!0,disabled:!!t,value:this.state.value,renderValue:()=>p.createElement(`span`,{style:{display:`flex`}},r!=null&&r.icon?p.createElement(gt,{src:`./${r.icon}`,style:Dr.icon}):null,this.getText(r==null?void 0:r.label,!0)),onChange:e=>this.setState({value:e.target.value},()=>this.props.attr&&this.onChange(this.props.attr,this.state.value))},this.state.selectOptions.map(e=>p.createElement(H,{key:e.value,value:e.value,style:e.value===q.NONE_VALUE?{opacity:.5}:{}},e.icon?p.createElement(gt,{src:`./${e.icon}`,style:Dr.icon}):null,this.getText(e.label,!0)))),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();var kr={address:{fontSize:`smaller`,opacity:.5,marginLeft:8}},Ar=class extends q{async componentDidMount(){var e;if(await super.componentDidMount(),(e=this.props.common)!=null&&e.host)try{var t,n,r;let e=await((t=(n=this.props.oContext).getCachedObject)==null?void 0:t.call(n,`system.host.${this.props.common.host}`)),i=[];if(e!=null&&(r=e.native)!=null&&(r=r.hardware)!=null&&r.networkInterfaces){let t=e.native.hardware.networkInterfaces;Object.keys(t).forEach(e=>{var n,r,a,o;if(this.props.schema.ignoreInternal&&!((n=t[e])!=null&&n.find(e=>!e.internal))||this.props.schema.ignoreLoopback&&(r=t[e])!=null&&r.find(e=>e.address===`127.0.0.1`||e.address===`::1`))return;let s=(a=t[e])==null?void 0:a.find(e=>e.family===`IPv4`);s||=(o=t[e])==null?void 0:o.find(e=>e.family===`IPv6`),i.push({value:e,address:(s==null?void 0:s.address)||``})})}this.setState({interfaces:i})}catch(e){window.alert(`Cannot read interfaces: ${e}`)}}renderItem(e,t){var n,r,i;let a=q.getValue(this.props.data,this.props.attr),o=(n=this.state.interfaces)==null?void 0:n.find(e=>e.value===a);return p.createElement(U,{fullWidth:!0,variant:`standard`},(r=this.state.interfaces)!=null&&r.length&&this.props.schema.label?p.createElement(x,null,this.getText(this.props.schema.label)):null,(i=this.state.interfaces)!=null&&i.length?p.createElement(D,{variant:`standard`,error:!!e,disabled:!!t,value:a,renderValue:e=>o?p.createElement(`span`,null,o.value,p.createElement(`span`,{style:kr.address},o.address)):e,onChange:e=>this.props.attr&&this.onChange(this.props.attr,e.target.value)},this.state.interfaces.map((e,t)=>p.createElement(H,{key:t,value:e.value},p.createElement(`span`,null,e.value,p.createElement(`span`,{style:kr.address},e.address))))):p.createElement(O,{fullWidth:!0,variant:`standard`,error:!!e,disabled:!!t,value:a,onChange:e=>this.props.attr&&this.onChange(this.props.attr,e.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();var jr={modalDialog:{minWidth:400,maxWidth:800},overflowHidden:{display:`flex`,overflow:`hidden`},titleIcon:{marginRight:5},content:{fontSize:16},languageButton:{position:`absolute`,right:8,top:8},languageButtonActive:{color:`primary.main`}},Mr=({toggleTranslation:e,noTranslation:t,title:n,fullWidth:r,help:i,maxWidth:a,progress:o,applyDisabled:s,applyButton:c,onClose:l,children:f,titleButtonApply:m,titleButtonClose:g,onApply:_,textInput:v,defaultValue:y,overflowHidden:ee})=>{let[b,x]=d(y);u(()=>{x(y)},[y]);let te=F(),ne=Ie(te.breakpoints.down(`md`));return p.createElement(Tt,{open:!0,maxWidth:ne?!1:a||`md`,fullWidth:!!r,fullScreen:ne,onClose:l,sx:{"& .MuiPaper-root":ne?{}:jr.modalDialog}},n&&p.createElement(Vt,null,n,W.getLanguage()!==`en`&&e?p.createElement(B,{size:`large`,style:{...jr.languageButton,...t?jr.languageButtonActive:{}},onClick:()=>e(),title:W.t(`jc_Disable/Enable translation`)},p.createElement(Ct,null)):null),p.createElement(qe,{sx:{...ee?jr.overflowHidden:{},...jr.content},style:{paddingTop:8}},v&&p.createElement(O,{autoComplete:`off`,fullWidth:!0,autoFocus:!0,variant:`outlined`,size:`medium`,multiline:!0,value:b,onChange:e=>x(e.target.value)}),f,i?p.createElement(`div`,null,i):null),p.createElement(It,null,c!==!1&&p.createElement(h,{startIcon:p.createElement(j,null),disabled:o||s&&y===b,onClick:()=>_==null?void 0:_(v&&b||``),variant:`contained`,color:`primary`},W.t(m||`jc_Ok`)),p.createElement(h,{color:`grey`,onClick:()=>l&&l(),disabled:o,variant:`contained`,startIcon:p.createElement(ge,null)},W.t(g||`jc_Cancel`))))};f();var Nr={jsonError:{border:`1px solid red`,minHeight:200},jsonNoError:{border:`1px solid #00000000`,minHeight:200},fallback:{width:`100%`,height:`100%`}};function Pr(e){let t=e.error===!0?Nr.jsonError:e.error===!1?Nr.jsonNoError:void 0;if(!e.AceEditor)return p.createElement(O,{variant:`outlined`,style:{...Nr.fallback,...t},slotProps:{htmlInput:{style:{fontFamily:`monospace`,fontSize:e.fontSize||14},spellCheck:!1}},multiline:!0,fullWidth:!0,error:e.error===!0,value:e.value??e.defaultValue??``,onChange:t=>{var n;return(n=e.onChange)==null?void 0:n.call(e,t.target.value)},disabled:!e.onChange,name:e.name});let n=e.AceEditor;return p.createElement(n,{style:t,mode:e.mode||`json`,width:`100%`,height:`100%`,showPrintMargin:e.editValueMode,showGutter:e.editValueMode,highlightActiveLine:e.editValueMode,defaultValue:e.defaultValue,theme:e.themeType===`dark`?`clouds_midnight`:`chrome`,value:e.value,readOnly:!e.onChange,onChange:t=>{var n;return(n=e.onChange)==null?void 0:n.call(e,t)},name:e.name||`UNIQUE_ID_OF_DIV1`,fontSize:e.fontSize||14,setOptions:{enableBasicAutocompletion:!0,enableLiveAutocompletion:!0,enableSnippets:!0,showLineNumbers:e.editValueMode,tabSize:e.editValueMode?2:void 0},editorProps:{$blockScrolling:!0}})}f();var Fr={fullWidth:{width:`100%`},flex:{display:`flex`},button:{height:48,minWidth:48},wrapper:{width:`calc(100vw - 40px)`,height:`calc(100vh - 188px)`}},Ir=class extends q{async componentDidMount(){await super.componentDidMount();let{data:e,attr:t}=this.props,n=q.getValue(e,t)||`{}`;this.setState({value:n,initialized:!0,jsonError:this.validateJson(n)})}validateJson(e){let t=!1;if(this.props.schema.validateJson!==!1&&(e||!this.props.schema.allowEmpty))try{this.props.schema.json5?cn.default.parse(e):JSON.parse(e)}catch(e){console.log(`Error in JSON`,e),t=!0}return t}renderItem(e,t){if(!this.state.initialized)return null;let{schema:n,data:r,attr:i}=this.props,{value:a,showSelectId:o}=this.state,s=n.readOnly===!0||t;return p.createElement(U,{fullWidth:!0,variant:`standard`},p.createElement(`div`,{style:Fr.flex},p.createElement(h,{color:`grey`,style:Fr.button,size:`small`,variant:`outlined`,onClick:()=>this.setState({showSelectId:!0})},W.t(`jc_JSON editor`))),o?p.createElement(Mr,{title:this.getText(n.label),overflowHidden:!0,applyDisabled:this.state.jsonError&&this.props.schema.doNotApplyWithError||s,onClose:()=>{s?this.setState({showSelectId:!1}):this.setState({showSelectId:!1,value:q.getValue(r,i)||{}})},onApply:s?void 0:()=>this.setState({showSelectId:!1},()=>i&&this.onChange(i,a))},p.createElement(`div`,{style:{...Fr.wrapper,border:this.state.jsonError?`2px solid red`:`2px solid transparent`}},p.createElement(Pr,{mode:this.props.schema.json5?`json5`:`json`,value:typeof a==`object`?JSON.stringify(a):a,onChange:s?void 0:e=>this.setState({value:e,jsonError:this.validateJson(e)}),name:`ConfigJsonEditor`,themeType:this.props.oContext.themeType,AceEditor:this.props.oContext.AceEditor}))):null,n.help||this.state.jsonError?p.createElement(V,null,this.state.jsonError?W.t(`jc_Invalid JSON`):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();var Lr=[{value:`en`,label:`English`},{value:`de`,label:`Deutsch`},{value:`ru`,label:`русский`},{value:`pt`,label:`Portugues`},{value:`nl`,label:`Nederlands`},{value:`fr`,label:`français`},{value:`it`,label:`Italiano`},{value:`es`,label:`Espanol`},{value:`pl`,label:`Polski`},{value:`uk`,label:`Український`},{value:`zh-cn`,label:`简体中文`}],Rr=class extends q{async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr),t=[...Lr];this.props.schema.system?t.unshift({value:``,label:W.t(`jc_System language`)}):t.unshift({value:``,label:W.t(`jc_none`)}),this.setState({value:this.props.schema.system?e||``:e||W.getLanguage(),selectOptions:t})}renderItem(e,t){var n,r;if(!this.state.selectOptions)return null;let i=(n=this.state.selectOptions)==null?void 0:n.find(e=>e.value===this.state.value||!e.value&&!this.state.value);return p.createElement(U,{fullWidth:!0,variant:`standard`},this.props.schema.label?p.createElement(x,null,this.getText(this.props.schema.label)):null,p.createElement(D,{variant:`standard`,error:!!e,disabled:t,value:this.state.value||`_`,renderValue:()=>this.getText(i==null?void 0:i.label,this.props.schema.noTranslation),onChange:e=>{let{value:t}=e.target;t===`_`&&(t=``),this.setState({value:t},()=>{if(this.props.attr){let e=this.onChange(this.props.attr,t);e instanceof Promise&&e.catch(e=>console.error(e))}if(this.props.schema.changeGuiLanguage){if(t){var e,n;if(t===W.getLanguage())return;W.setLanguage(t),(e=(n=this.props.oContext).changeLanguage)==null||e.call(n)}else this.props.oContext.socket.getSystemConfig().then(e=>{if(e.common.language!==W.getLanguage()&&e.common.language){var t,n;W.setLanguage(e.common.language),(t=(n=this.props.oContext).changeLanguage)==null||t.call(n)}}).catch(e=>console.error(`Cannot read system config: ${e}`))}})}},(r=this.state.selectOptions)==null?void 0:r.map(e=>p.createElement(H,{key:e.value,value:e.value},e.label))),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();var zr=class extends q{constructor(e){super(e),G(this,`scrollRef`,void 0),this.scrollRef=p.createRef()}scrolledDown(){return this.scrollRef.current?this.scrollRef.current.offsetHeight+this.scrollRef.current.scrollTop>=this.scrollRef.current.scrollHeight:!1}async componentDidMount(){await super.componentDidMount(),q.getValue(this.props.data,this.props.attr)||(this.props.schema.licenseUrl?(this.setState({showLicenseDialog:!0,loading:!0,scrolledDown:!1}),fetch(this.props.schema.licenseUrl).then(e=>e.text()).then(e=>this.setState({license:e,loading:!1})).catch(e=>this.setState({license:e.toString(),loading:!1,error:!0,scrolledDown:!1}))):this.setState({showLicenseDialog:!0,scrolledDown:!1}),setTimeout(()=>{this.scrollRef.current&&(this.scrolledDown()?this.setState({scrolledDown:!0}):this.scrollRef.current.addEventListener(`scroll`,()=>{!this.state.scrolledDown&&this.scrolledDown()&&this.setState({scrolledDown:!0})}))},1e3))}renderItem(e,t){return this.state.showLicenseDialog?p.createElement(Tt,{maxWidth:`lg`,open:!0,onClose:(e,t)=>{t!==`escapeKeyDown`&&t!==`backdropClick`&&this.setState({showLicenseDialog:!1})}},p.createElement(Vt,null,this.props.schema.title?W.t(this.props.schema.title):W.t(`jc_License agreement`)),p.createElement(qe,null,this.props.schema.licenseUrl?p.createElement(p.Fragment,null,this.state.loading?p.createElement(qt,null):null,p.createElement(`pre`,{ref:this.scrollRef,style:{width:`100%`,height:`100%`,overflowY:`auto`,fontSize:14}},this.state.license)):null,!this.props.schema.licenseUrl&&this.props.schema.texts?p.createElement(`div`,{ref:this.scrollRef,style:{width:`100%`,height:`100%`,overflowY:`auto`,fontSize:14}},this.props.schema.texts.map((e,t)=>this.props.schema.noTranslation?p.createElement(`p`,{key:t},e):p.createElement(`p`,{key:t},W.t(e)))):null),p.createElement(It,null,this.props.schema.checkBox?p.createElement(ot,{control:p.createElement(zt,{disabled:t,checked:!!this.state.licenseChecked,onClick:()=>this.setState({licenseChecked:!this.state.licenseChecked})}),label:W.t(this.props.schema.checkBox)}):null,p.createElement(h,{disabled:t||this.state.loading||this.state.error||this.props.schema.checkBox&&!this.state.licenseChecked||!this.state.scrolledDown,onClick:()=>{if(this.setState({showLicenseDialog:!1}),this.props.attr){let e=this.onChange(this.props.attr,!0);e instanceof Promise&&e.catch(e=>console.error(`Cannot set value: ${e}`))}},color:`primary`,variant:`contained`,startIcon:p.createElement(j,null)},this.props.schema.agreeText?W.t(this.props.schema.agreeText):W.t(`jc_Accept license`)),p.createElement(h,{onClick:()=>{this.setState({showLicenseDialog:!1}),setTimeout(()=>this.setState({showLicenseDialog:!0}),2e3)},color:`grey`,variant:`contained`,startIcon:p.createElement(ge,null)},W.t(`jc_Close`)))):null}};f();var Br={indeterminate:{opacity:.5},control:{flexDirection:`row`,width:`100%`}},Vr=class extends q{constructor(...e){super(...e),G(this,`updateTimeout`,void 0)}async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr);if(e??=``,Array.isArray(e)&&this.props.oContext.multiEdit){e=q.DIFFERENT_VALUE,this.setState({_value:e,oldValue:e});return}this.setState({_value:e.toString(),oldValue:e.toString()})}static getDerivedStateFromProps(e,t){if(e.schema.min!==void 0&&e.schema.min<0||e.schema.max!==void 0&&e.schema.max<0)return null;let n=q.getValue(e.data,e.attr);return e.oContext.multiEdit&&t._value===q.DIFFERENT_VALUE?{_value:q.DIFFERENT_VALUE}:n==null||t.oldValue===null||t.oldValue===void 0||n.toString()!==parseFloat(t._value).toString()&&n.toString()!==t.oldValue.toString()?{_value:n}:null}checkValue(e){if(e==null||(e=e.toString().trim().replace(`,`,`.`),e===`-`))return null;let t=e===``?0:parseFloat(e);return e!==``&&Number.isNaN(t)?`jc_Not a number`:e!==``&&window.isFinite(t)?this.props.schema.min!==void 0&&t<this.props.schema.min?`jc_Too small`:this.props.schema.max!==void 0&&t>this.props.schema.max?`jc_Too big`:e===``||e===`-`||Number.isNaN(t)?`jc_Not a number`:null:`jc_Not a number`}renderItem(e,t){var n;let r=Array.isArray(this.state._value)||this.state._value===q.DIFFERENT_VALUE;if(this.state.oldValue!==null&&this.state.oldValue!==void 0?(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=void 0,this.setState({oldValue:null})},30)):this.updateTimeout&&=(clearTimeout(this.updateTimeout),void 0),r){let n=q.getValue(this.props.data,this.props.attr),r=(n==null?void 0:n.filter(e=>e||e===0).map(e=>({label:e.toString(),value:e})))||[];return r.unshift({label:W.t(q.DIFFERENT_LABEL),value:q.DIFFERENT_VALUE}),p.createElement(ft,{style:Br.indeterminate,fullWidth:!0,freeSolo:!0,value:r[0],getOptionSelected:(e,t)=>e.label===t.label,onChange:(e,t)=>{if(this.props.attr){let e=this.onChange(this.props.attr,t==null?void 0:t.value,()=>{this.setState({_value:t==null?void 0:t.value,oldValue:this.state._value})});e instanceof Promise&&e.catch(e=>console.error(e))}},options:r,getOptionLabel:e=>e.label,renderInput:n=>p.createElement(O,{...n,label:this.getText(this.props.schema.label),variant:`standard`,slotProps:{...n.slotProps,htmlInput:{...n.slotProps.htmlInput,readOnly:this.props.schema.readOnly||!1},input:{...n.slotProps.input,endAdornment:this.props.schema.unit?p.createElement(p.Fragment,null,this.getText(this.props.schema.unit,this.props.schema.noTranslation),n.slotProps.input.endAdornment):n.slotProps.input.endAdornment}},error:!!e,placeholder:this.getText(this.props.schema.placeholder),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:!!t})})}!e&&this.state._value!==null&&this.state._value!==void 0&&this.state._value&&(e=this.checkValue(this.state._value),e&&=W.t(e));let i=parseFloat(((n=this.state._value)==null?void 0:n.toString().replace(`,`,`.`))||``);return p.createElement(U,{variant:`standard`,style:Br.control},p.createElement(O,{sx:{"& .up-down":{display:`none`},"&:hover .up-down":{display:`block`}},variant:`standard`,type:Number.isNaN(i)?`text`:this.props.schema.min!==void 0&&this.props.schema.min>=0?`number`:`text`,fullWidth:!0,slotProps:{htmlInput:{min:this.props.schema.min,max:this.props.schema.max,step:this.props.schema.step,readOnly:this.props.schema.readOnly||!1},input:{endAdornment:this.props.schema.unit?this.getText(this.props.schema.unit,this.props.schema.noTranslation):null}},value:this.state._value??``,error:!!e,disabled:!!t,onChange:e=>{let t=e.target.value,n=this.checkValue(t);n?this.onError(this.props.attr,W.t(n)):this.onError(this.props.attr),this.setState({_value:t,oldValue:this.state._value},()=>{let e=parseFloat(t.toString().replace(`,`,`.`));Number.isNaN(e)?this.onChange(this.props.attr,t.toString().replace(`,`,`.`)):this.onChange(this.props.attr,e)})},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:e&&typeof e==`string`?e:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}))}};f();var Hr=class extends q{constructor(e){super(e),G(this,`authWindow`,void 0),G(this,`oid`,void 0),G(this,`url`,void 0),G(this,`onTokensUpdated`,(e,t)=>{if(t!=null&&t.val){let e=JSON.parse(t.val);if(new Date(e.access_token_expires_on).getTime()>Date.now()){this.state.accessTokens!==t.val&&this.setState({accessTokens:t.val});return}}this.setState({accessTokens:``})}),G(this,`onMessage`,e=>{if(e.origin===`https://oauth2.iobroker.in`&&(typeof e.data==`string`&&e.data.startsWith(`${this.props.schema.identifier}-authentication:`)||typeof e.message==`string`&&e.message.startsWith(`${this.props.schema.identifier}-authentication:`))){let i=(e.data||e.message).split(`:`);if(i[1]===`success`){var t;this.setState({accessTokens:i[2],success:!0,pressed:!1},()=>this.saveToken(this.state.accessTokens)),(t=this.authWindow)==null||t.postMessage(`close`,e.origin),this.authWindow=null}else{var n,r;(n=(r=this.props).onError)==null||n.call(r,i[2])}}}),this.state={...this.state,accessTokens:``,success:!1,blocked:!1,running:!1,pressed:!1,clientId:``,clientSecret:``,accessTokenError:``},this.url=`https://oauth2.iobroker.in/${e.schema.identifier}?redirect=true`,e.schema.scope&&(this.url+=`&scope=${encodeURIComponent(e.schema.scope)}`),this.oid=`${this.props.oContext.adapterName}.${this.props.oContext.instance}.${this.props.schema.saveTokenIn||`oauth2Tokens`}`}async componentDidMount(){await super.componentDidMount(),window.addEventListener?window.addEventListener(`message`,this.onMessage,!1):window.attachEvent(`onmessage`,this.onMessage,!1),await this.props.oContext.socket.subscribeState(this.oid,this.onTokensUpdated);let e;this.props.schema.ownClientId&&(e={clientId:q.getValue(this.props.data,this.props.schema.ownClientId)}),this.props.schema.ownClientId&&(e||={},e.clientSecret=q.getValue(this.props.data,this.props.schema.ownClientSecret));let t=await this.props.oContext.socket.getState(this.oid);if(t){let n=JSON.parse(t.val);new Date(n.access_token_expires_on).getTime()>Date.now()&&(e||={},e.accessTokens=t.val)}e&&this.setState(e)}componentWillUnmount(){super.componentWillUnmount(),window.removeEventListener?window.removeEventListener(`message`,this.onMessage,!1):window.detachEvent(`onmessage`,this.onMessage,!1),this.props.oContext.socket.unsubscribeState(this.oid,this.onTokensUpdated)}saveToken(e){try{e&&!e.startsWith(`{`)&&(e=atob(e));let t=JSON.parse(e);t.access_token&&t.refresh_token&&t.expires_in&&(t.access_token_expires_on||=new Date(Date.now()+t.expires_in*1e3).toISOString(),this.props.schema.ownClientId&&(t.client_id=q.getValue(this.props.data,this.props.schema.ownClientId)),this.props.oContext.socket.setState(this.oid,JSON.stringify(t),!0).catch(e=>console.log(`Error occurred: ${e.toString()}`)))}catch(e){console.warn(e)}}onOpenUrl(){this.authWindow=window.open(this.url+(this.props.schema.ownClientId?`&client_id=${encodeURIComponent(this.state.clientId)}&client_secret=${encodeURIComponent(this.state.clientSecret)}`:``),this.props.schema.identifier),!this.authWindow||this.authWindow.closed||this.authWindow.closed===void 0?this.setState({blocked:!0}):this.setState({pressed:!0})}renderItem(e,t){let n=``;if(this.state.accessTokens)try{let e=JSON.parse(this.state.accessTokens);n=new Date(e.access_token_expires_on).toLocaleString()}catch{}let r;r=this.state.accessTokens?this.props.schema.refreshLabel?this.getText(this.props.schema.refreshLabel):W.t(`jc_Renew %s access`,this.props.schema.identifier[0].toUpperCase()+this.props.schema.identifier.slice(1)):this.props.schema.label?this.getText(this.props.schema.label):W.t(`jc_Get %s access`,this.props.schema.identifier[0].toUpperCase()+this.props.schema.identifier.slice(1));let i=this.getIcon();return p.createElement(`div`,{style:{width:`100%`,margin:`0 0 1rem 0`}},this.props.schema.ownClientId?p.createElement(O,{value:this.state.clientId,onChange:e=>{let t=e.target.value;this.setState({clientId:t},()=>this.onChange(this.props.schema.ownClientId,t))},style:{marginBottom:8},variant:`standard`,fullWidth:!0,error:!this.state.clientId,disabled:!!t,label:W.t(`jc_OAuth Client ID`),slotProps:{input:{endAdornment:this.state.clientId?p.createElement(B,{size:`small`,tabIndex:-1,onClick:()=>this.setState({clientId:``},()=>this.onChange(this.props.schema.ownClientId,``))},p.createElement(ge,null)):null}}}):null,this.props.schema.ownClientSecret?p.createElement(O,{value:this.state.clientSecret,onChange:e=>{let t=e.target.value;this.setState({clientSecret:t},()=>this.onChange(this.props.schema.ownClientSecret,t))},style:{marginBottom:8},variant:`standard`,fullWidth:!0,error:!this.state.clientSecret,disabled:!!t,label:W.t(`jc_OAuth Client secret`),slotProps:{input:{endAdornment:this.state.clientSecret?p.createElement(B,{size:`small`,tabIndex:-1,onClick:()=>this.setState({clientSecret:``},()=>this.onChange(this.props.schema.ownClientSecret,``))},p.createElement(ge,null)):null}}}):null,p.createElement(h,{disabled:this.state.running||!(!this.props.schema.ownClientSecret||this.state.clientSecret)||!(!this.props.schema.ownClientId||this.state.clientId),endIcon:i||p.createElement(be,null),variant:`contained`,onClick:()=>this.onOpenUrl()},r),this.state.blocked?p.createElement(`div`,{style:{color:`red`,fontSize:16,marginTop:20}},W.t(`jc_Please allow popups in your browser for this page!`)):null,this.state.accessTokens?p.createElement(`div`,{style:{color:`green`,fontSize:16,marginTop:20}},this.props.alive?W.t(`jc_Successfully authorized. Token valid till %s and will be automatically renewed.`,n):W.t(`jc_Successfully authorized. Token valid till %s but it can expire as the instance is not running.`,n)):null,this.state.pressed?p.createElement(p.Fragment,null,p.createElement(`div`,{style:{width:`100%`,margin:`1rem 0 1rem 0`}},p.createElement(`span`,{style:{marginRight:4}},`${W.t(`jc_If the button above does not work, you can authorize manually this app by visiting this url`)}`,`:`),p.createElement(`br`,null),p.createElement(`a`,{target:this.props.schema.identifier,href:this.url,rel:`noreferrer`},this.url)),p.createElement(O,{value:this.state.accessTokens,label:W.t(`jc_Enter the code from that page here`),variant:`standard`,error:!!this.state.accessTokenError,helperText:this.state.accessTokenError||``,onChange:e=>{let t=e.target.value;try{t!=null&&t.trim()&&!t.trim().startsWith(`{`)&&(t=atob(t.trim()))}catch{this.setState({accessTokenError:`Invalid access token. Cannot decode from base64`})}if(t!=null&&t.startsWith(`{`))try{let e=JSON.parse(t);e.access_token&&(e.access_token_expires_on=new Date(Date.now()+(e.expires_in-10)*1e3).toISOString(),this.setState({accessTokens:JSON.stringify(e),accessTokenError:``},()=>this.saveToken(this.state.accessTokens)))}catch{this.setState({accessTokens:t,accessTokenError:`Invalid access token. Cannot parse JSON`})}else t&&this.setState({accessTokens:t,accessTokenError:`Invalid access token. Not JSON`})},fullWidth:!0})):null)}};f();var Ur={flex:{display:`flex`},button:{maxHeight:48,marginLeft:4,minWidth:48}},Wr=class extends q{constructor(...e){super(...e),G(this,`fillOnSelect`,[]),G(this,`onObjectChanged`,async(e,t)=>{if(await this.onChange(e,t),this.fillOnSelect.length)try{let e=t&&await this.getCachedObject(t);if(e){for(let t of this.fillOnSelect)if(t.overwrite||!q.getValue(this.props.data,t.attr)){let n=q.getValue(e,t.pathInObject);typeof n==`object`&&(n=this.getText(n,!0)),await this.onChange(t.attr,n)}}}catch(e){console.error(e.toString())}})}async componentDidMount(){await super.componentDidMount();let{data:e,attr:t}=this.props,n=q.getValue(e,t)||``;if(this.props.schema.fillOnSelect){let e=this.props.schema.fillOnSelect.split(`,`).map(e=>e.trim());for(let t of e){let e=t.split(`=>`);if(e.length===2){let t={pathInObject:e[0],attr:e[1]};(t.attr.includes(`(X)`)||t.attr.includes(`(x)`))&&(t.overwrite=!0,t.attr=t.attr.replace(/\(X\)|\(x\)/g,``)),this.fillOnSelect.push(t)}else console.error(`Invalid format for fillOnSelect: ${this.props.schema.fillOnSelect}`)}}this.setState({value:n,initialized:!0})}renderItem(e,t){if(!this.state.initialized)return null;let n=this.props.oContext.socket,{schema:r,attr:i}=this.props,{value:a,showSelectId:o}=this.state;return p.createElement(U,{fullWidth:!0,variant:`standard`},r.label?p.createElement(x,{shrink:!0},this.getText(r.label)):null,p.createElement(`div`,{style:Ur.flex},p.createElement(O,{variant:`standard`,fullWidth:!0,value:a,error:!!e,disabled:t,placeholder:this.getText(r.placeholder),label:this.getText(r.label),helperText:this.renderHelp(r.help,r.helpLink,r.noTranslation),onChange:e=>{let t=Array.isArray(e.target.value)?e.target.value[0]:e.target.value;this.setState({value:t},()=>i&&void this.onObjectChanged(i,t))}}),p.createElement(h,{color:`grey`,disabled:t,style:Ur.button,size:`small`,variant:`outlined`,onClick:()=>this.setState({showSelectId:!0})},`...`)),o?p.createElement(Ft,{imagePrefix:this.props.oContext.imagePrefix??`../..`,dialogName:`admin.${this.props.oContext.adapterName}`,filterFunc:r.filterFunc,themeType:this.props.oContext.themeType,theme:this.props.oContext.theme,types:r.types?Array.isArray(r.types)?r.types:[r.types]:void 0,customFilter:r.customFilter,filters:r.filters,socket:n,selected:a,root:r.root,onClose:()=>this.setState({showSelectId:!1}),onOk:e=>{let t=Array.isArray(e)?e[0]:e;this.setState({showSelectId:!1,value:t},()=>i&&void this.onObjectChanged(i,t))}}):null)}};f();var Gr={fullWidth:{width:`100%`,display:`inline-block`},halfWidth1:{width:`calc(50% - 5px)`,display:`inline-block`,marginRight:8},halfWidth2:{width:`calc(50% - 5px)`,display:`inline-block`}},Kr=`____ppp____`,qr=class extends q{async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr);this.setState({_repeat:e?Kr:``,_visible:!1,value:e?Kr:``,_notEqual:!1})}onChangePassword(e,t){e===void 0&&(e=this.state.value),t===void 0&&(t=this.state._repeat);let n=!!this.props.schema.repeat&&t!==e;this.setState({value:e,_repeat:t,_notEqual:n},()=>{if(n)this.onError(this.props.attr,W.t(`jc_Passwords are not equal!`));else{this.onError(this.props.attr);let t=this.onChange(this.props.attr,e);t instanceof Promise&&t.catch(e=>this.onError(this.props.attr,e))}})}renderItem(e,t){if(this.state._notEqual===void 0)return null;let n=p.createElement(O,{variant:`standard`,fullWidth:!0,type:this.state._visible&&this.state.value!==Kr?`text`:`password`,value:this.state.value,error:!!e||this.state._notEqual,disabled:!!t,onChange:e=>this.onChangePassword(e.target.value),label:this.getText(this.props.schema.label),slotProps:{input:{autoComplete:`new-password`,endAdornment:this.state.value&&this.state.value!==Kr&&this.props.schema.visible&&!t&&!this.props.schema.readOnly?p.createElement(Te,{position:`end`},p.createElement(B,{size:`large`,tabIndex:-1,onClick:e=>{e.preventDefault(),e.stopPropagation(),this.setState({_visible:!this.state._visible})},edge:`end`},this.state._visible?p.createElement(De,null):p.createElement(Kt,null))):void 0},htmlInput:{autoComplete:`new-password`,form:{autoComplete:`off`},maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.props.schema.readOnly||!1}},helperText:this.state._notEqual?W.t(`jc_Passwords are not equal!`):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)});if(this.props.schema.repeat&&!this.props.schema.readOnly){let r=this.state._visible?null:p.createElement(O,{variant:`standard`,fullWidth:!0,type:`password`,value:this.state._repeat,error:!!e||this.state._notEqual,disabled:!!t,onChange:e=>this.onChangePassword(void 0,e.target.value),label:`${this.getText(this.props.schema.label)} (${W.t(`jc_repeat`)})`,slotProps:{input:{autoComplete:`new-password`},htmlInput:{autoComplete:`new-password`,form:{autoComplete:`off`},maxLength:this.props.schema.maxLength||this.props.schema.max||void 0}},helperText:this.state._notEqual?W.t(`jc_Passwords are not equal!`):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)});return p.createElement(`div`,{style:Gr.fullWidth},p.createElement(`div`,{style:Gr.halfWidth1},n),p.createElement(`div`,{style:Gr.halfWidth2},r))}return n}};f();var Jr=class extends q{constructor(...e){super(...e),G(this,`checkTimeout`,null)}async componentDidMount(){await super.componentDidMount();let e=await this.getPatternAsync(this.props.schema.pattern,null,!0)??``;this.setState({pattern:e})}componentWillUnmount(){this.checkTimeout&&=(clearTimeout(this.checkTimeout),null),super.componentWillUnmount()}checkIfInstanceChanged(){this.checkTimeout&&clearTimeout(this.checkTimeout),this.checkTimeout=setTimeout(async()=>{this.checkTimeout=null;let e=await this.getPatternAsync(this.props.schema.pattern,null,!0)??``;e!==this.state.pattern&&this.setState({pattern:e})},200)}renderItem(e,t){return this.checkIfInstanceChanged(),p.createElement(O,{variant:`standard`,fullWidth:!0,disabled:!!t,slotProps:{input:{endAdornment:this.props.schema.copyToClipboard?p.createElement(B,{tabIndex:-1,size:`small`,onClick:async()=>{z.copyToClipboard(await this.getPatternAsync(this.props.schema.pattern,null,this.props.schema.noTranslation)),window.alert(W.t(`jc_Copied`))}},p.createElement(Ut,null)):void 0}},value:this.state.pattern||``,label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}};f();var Yr={warning:{"& .Mui-error":{color:`orange`}}},Xr=class extends q{constructor(...e){super(...e),G(this,`updateTimeout`,void 0)}async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr);e??=``,this.setState({_value:e.toString(),oldValue:e.toString()});let t=await this.props.oContext.socket.getAdapterInstances(),n=`system.adapter.${this.props.oContext.adapterName}.${this.props.oContext.instance}`,r=await this.getCachedObject(n),i=r==null?void 0:r.common.host,a=[];t.forEach(e=>{var t,r;if(!e||e._id===n||e.common.host!==i||!((t=e.native)!=null&&t.bind))return;if(e!=null&&e.native&&e.native.secure&&e.native.leEnabled&&e.native.leUpdate){let t=parseInt(e.native.leCheckPort||e.native.lePort,10);if(t){var o;a.push({name:`${e._id.replace(`system.adapter.`,``)} (LE)`,port:t,v6bind:e.native.bind.includes(`:`)?e.native.bind:e.native.v6bind,bind:e.native.bind,enabled:!!((o=e.common)!=null&&o.enabled)})}}let s=parseInt(e==null||(r=e.native)==null?void 0:r.port,10);if(s){var c;a.push({name:e._id.replace(`system.adapter.`,``),bind:e.native.bind,v6bind:e.native.bind.includes(`:`)?e.native.bind:e.native.v6bind,port:s,enabled:!!((c=e.common)!=null&&c.enabled)})}}),this.setState({ports:a})}static getDerivedStateFromProps(e,t){let n=q.getValue(e.data,e.attr);return n==null||t.oldValue===null||t.oldValue===void 0||n.toString()!==parseInt(t._value,10).toString()&&n.toString()!==t.oldValue.toString()?{_value:n}:null}checkValue(e){if(e==null)return null;let t=this.props.schema.min??20,n=this.props.schema.max||65535;e=e.toString().trim();let r=e===``?0:parseInt(e,10);return e!==``&&Number.isNaN(r)?`jc_Not a number`:e!==``&&window.isFinite(Number(e))?r<t?`jc_Too small`:r>n?`jc_Too big`:e===``||e===`-`||Number.isNaN(r)?`jc_Not a number`:null:`jc_Not a number`}renderItem(e,t){this.state.oldValue!==null&&this.state.oldValue!==void 0?(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=void 0,this.setState({oldValue:null})},30)):this.updateTimeout&&=(clearTimeout(this.updateTimeout),void 0);let n=this.props.schema.min??20,r=this.props.schema.max||65535,i;if(this.state.ports){let t=parseInt(this.state._value,10);if(t){let n=this.props.data.bind,r=this.state.ports.filter(e=>{if(e.port!==t)return!1;let r=e.bind,i=e.v6bind;return!n||!r||n===`0.0.0.0`||r===`0.0.0.0`||n===`::`||i===`::`||n===r||n===i}),a=r.findIndex(e=>e.port===t&&e.enabled);if(a!==-1){let n=this.state.ports.find(e=>e.port===t&&e.enabled&&r.some(t=>t.name===e.name&&t.bind===e.bind));e=W.t(`jc_Port is already used by %s`,(n==null?void 0:n.name)||r[a].name)}else if(a=r.findIndex(e=>e.port===t&&!e.enabled),a!==-1){i=!0;let n=this.state.ports.find(e=>e.port===t&&!e.enabled&&r.some(t=>t.name===e.name&&t.bind===e.bind));e=W.t(`jc_Port could be used by %s`,(n==null?void 0:n.name)||r[a].name)}}}return!e&&this.state._value!==null&&this.state._value!==void 0&&(e=this.checkValue(this.state._value),typeof e==`string`&&(e=W.t(e))),p.createElement(O,{variant:`standard`,type:`number`,fullWidth:!0,slotProps:{htmlInput:{min:n,max:r,readOnly:this.props.schema.readOnly||!1}},value:this.state._value??``,error:!!e,disabled:!!t,sx:i?Yr.warning:void 0,onChange:e=>{let t=Number(e.target.value.toString().replace(/[^0-9]/g,``)).toString(),n=this.checkValue(t);n?this.onError(this.props.attr,W.t(n)):this.onError(this.props.attr),this.setState({_value:t,oldValue:this.state._value},()=>{if(t.trim()===parseInt(t,10).toString()){let e=this.onChange(this.props.attr,parseInt(t,10)||0);e instanceof Promise&&e.catch(e=>{console.error(`Cannot set value for ${this.props.attr}: ${e}`)})}})},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:e&&typeof e==`string`?e:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}};f();var Zr=class extends q{async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr);this.props.oContext.socket.getEnums(`rooms`).then(t=>{let n=Object.keys(t).map(e=>({value:this.props.schema.short?e.replace(`enum.rooms.`,``):e,label:this.getText(t[e].common.name),obj:t[e]}));this.props.schema.allowDeactivate!==!1&&n.unshift({label:W.t(q.NONE_LABEL),value:q.NONE_VALUE}),this.setState({value:e,selectOptions:n})}).catch(e=>console.error(`Cannot get enums: ${e}`))}renderItem(e,t){if(!this.state.selectOptions)return null;let n=this.state.selectOptions.find(e=>e.value===this.state.value);return p.createElement(U,{variant:`standard`,fullWidth:!0},this.props.schema.label?p.createElement(x,null,this.getText(this.props.schema.label)):null,p.createElement(D,{variant:`standard`,error:!!e,disabled:!!t,value:this.state.value||`_`,renderValue:()=>n?n.obj?p.createElement(at,{value:n.obj,themeType:this.props.oContext.themeType,lang:W.getLanguage()}):n.label:``,onChange:e=>{this.setState({value:e.target.value===`_`?``:e.target.value},()=>this.onChange(this.props.attr,this.state.value))}},this.state.selectOptions.map(e=>p.createElement(H,{key:e.value,value:e.value,style:e.value===q.DIFFERENT_VALUE?{opacity:.5}:{}},e.obj?p.createElement(at,{value:e.obj,themeType:this.props.oContext.themeType,lang:W.getLanguage()}):e.label))),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();var Qr={fullWidth:{width:`100%`},noMargin:{"&>div":{marginTop:0}},icon:{width:20,height:20,marginRight:4}},$r=class extends q{constructor(...e){super(...e),G(this,`initialValue`,``)}async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr);this.props.schema.multiple&&(typeof e==`string`?e=[e]:e??=[]);let t=[];for(let e of this.props.schema.options||[]){let n=e;if(Array.isArray(n.items)){t.push({label:this.getText(e.label,this.props.schema.noTranslation),value:e.value,group:!0,hidden:n.hidden,os:n.os,notOs:n.notOs,docker:n.docker,color:e.color,description:this.getText(e.description)});for(let e of n.items)t.push({label:this.getText(e.label,this.props.schema.noTranslation||e.noTranslation),value:e.value,inGroup:!0,hidden:e.hidden,os:e.os,notOs:e.notOs,docker:e.docker,color:e.color,description:this.getText(e.description),icon:e.icon})}else t.push({label:this.getText(e.label,this.props.schema.noTranslation||e.noTranslation),value:e.value,hidden:e.hidden,os:e.os,notOs:e.notOs,docker:e.docker,color:e.color,description:this.getText(e.description),icon:e.icon})}if(this.props.onFilterLabelUpdate&&this.props.table&&this.props.attr){let e={};for(let n of t)!n.group&&n.value!==q.DIFFERENT_VALUE&&(e[n.value.toString()]=n.label);this.props.onFilterLabelUpdate(this.props.attr,e)}let n=Array.isArray(e)&&!this.props.schema.multiple;n&&(this.initialValue=[...e],t.unshift({label:W.t(q.DIFFERENT_LABEL),value:q.DIFFERENT_VALUE})),await this.evaluateHidden(t),n?this.setState({value:q.DIFFERENT_VALUE,selectOptions:t}):this.setState({value:e,selectOptions:t})}async evaluateHidden(e){let t=!1,n=!1;for(let r of e){let e=await this.isHidden(r);r.group?n=e:r.inGroup?e||=n:n=!1,r.hiddenValue!==e&&(r.hiddenValue=e,t=!0)}return t}async componentDidUpdate(e){if(e.data===this.props.data||!this.state.selectOptions||!this.state.selectOptions.some(e=>typeof e.hidden==`string`))return;let t=this.state.selectOptions.map(e=>({...e}));await this.evaluateHidden(t)&&this.setState({selectOptions:t})}_getValue(){let e=this.state.value===null||this.state.value===void 0?q.getValue(this.props.data,this.props.attr):this.state.value;return this.props.schema.multiple&&(typeof e==`string`?e=[e]:e??=[]),e}async isHidden(e){return q.isHostAllowed(e,this.props.oContext.hostInfo)?e.hidden?this.props.custom?!!await this.executeCustom(e.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!!await this.execute(e.hidden,this.props.schema.default,this.props.data,this.props.arrayIndex,this.props.globalData):!1:!0}renderRadio(e,t){var n;let r=(n=this.state.selectOptions)==null?void 0:n.filter(e=>!e.hiddenValue&&!e.group),i=this._getValue();return p.createElement(U,{fullWidth:!0,error:!!e,disabled:!!t,id:`jsonSelect_${this.props.attr}_${this.props.index||this.props.index===0?this.props.index:``}`},this.props.schema.label?p.createElement(Be,null,this.getText(this.props.schema.label)):null,p.createElement(P,{row:!!this.props.schema.horizontal,value:i==null?``:i.toString(),onChange:e=>{let t=r==null?void 0:r.find(t=>t.value.toString()===e.target.value),n=t?t.value:e.target.value;this.setState({value:n},()=>{let e=this.onChange(this.props.attr,n);e instanceof Promise&&e.catch(e=>console.error(e))})}},r==null?void 0:r.map((e,t)=>p.createElement(ot,{key:t,value:e.value.toString(),control:p.createElement(_e,null),title:e.description||``,label:p.createElement(`span`,{style:{display:`flex`,alignItems:`center`}},e.icon?p.createElement(gt,{src:e.icon,style:Qr.icon}):null,p.createElement(Re,{component:`span`,style:{color:e.color}},e.label)),style:e.value===q.DIFFERENT_VALUE?{opacity:.5}:{}}))),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}renderItem(e,t){if(!this.state.selectOptions)return null;if(this.props.schema.format===`radio`)return this.renderRadio(e,t);let n=this.state.selectOptions.filter(e=>!e.hiddenValue),r=this._getValue(),i=this.props.schema.multiple?null:n.find(e=>e.value==r);return p.createElement(U,{variant:`standard`,fullWidth:!0,sx:this.props.table===void 0?void 0:Qr.noMargin,id:`jsonSelect_${this.props.attr}_${this.props.index||this.props.index===0?this.props.index:``}`},this.props.schema.label?p.createElement(x,null,this.getText(this.props.schema.label)):null,p.createElement(D,{variant:`standard`,error:!!e,multiple:this.props.schema.multiple,disabled:!!t,value:r||`_`,renderValue:e=>this.props.schema.multiple?p.createElement(`div`,{style:{display:`flex`,flexWrap:`wrap`,gap:.5}},e.map(e=>{let t=n.find(t=>t.value===e);if(t||this.props.schema.showAllValues!==!1){let n=(t==null?void 0:t.label)||e;return p.createElement(St,{key:e,label:n})}return null})):i!=null&&i.color?p.createElement(`span`,{style:{display:`flex`,alignItems:`center`}},i.icon?p.createElement(gt,{src:i.icon,style:Qr.icon}):null,p.createElement(`span`,null,p.createElement(`div`,{style:{color:i.color}},i.label??e),i.description?p.createElement(`div`,{style:{opacity:.7,fontStyle:`italic`,fontSize:`smaller`}},i.description):null)):(i==null?void 0:i.label)===void 0?i!=null&&i.icon?p.createElement(`span`,{style:{display:`flex`,alignItems:`center`}},p.createElement(gt,{src:i.icon,style:Qr.icon}),e):e:p.createElement(`span`,{style:{display:`flex`,alignItems:`center`}},i.icon?p.createElement(gt,{src:i.icon,style:Qr.icon}):null,p.createElement(`span`,null,p.createElement(`div`,null,i.label),i.description?p.createElement(`div`,{style:{opacity:.7,fontStyle:`italic`,fontSize:`smaller`}},i.description):null)),onChange:e=>{this.setState({value:e.target.value===`_`?``:e.target.value},()=>{let e;e=this.state.value===q.DIFFERENT_VALUE?this.onChange(this.props.attr,this.initialValue):this.onChange(this.props.attr,this.state.value),e instanceof Promise&&e.catch(e=>console.error(e))})}},n.map((e,t)=>e.group?p.createElement(re,{key:t,style:{color:e.color}},p.createElement(`div`,null,e.label),e.description?p.createElement(`div`,{style:{opacity:.7,fontStyle:`italic`,fontSize:`smaller`}},e.description):null):p.createElement(H,{key:t,value:e.value,style:e.value===q.DIFFERENT_VALUE?{opacity:.5}:{}},this.props.schema.multiple?p.createElement(zt,{checked:r.includes(e.value),onClick:()=>{let t=JSON.parse(JSON.stringify(this._getValue())),n=r.indexOf(e.value);n===-1?(t.push(e.value),t.sort()):t.splice(n,1),this.setState({value:t},()=>this.onChange(this.props.attr,t))}}):null,e.icon?p.createElement(gt,{src:e.icon,style:Qr.icon}):null,p.createElement(w,{primary:e.label,secondary:e.description,slotProps:{secondary:{style:{fontSize:`smaller`,fontStyle:`italic`,opacity:.7}}},style:{color:e.color}})))),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();var ei={menuPaper:{maxHeight:800}},ti=class extends q{constructor(...e){super(...e),G(this,`initialized`,!1),G(this,`localContext`,void 0)}async askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){let t=await this.getPatternAsync(this.props.schema.jsonData,null,!0);try{e=JSON.parse(t)}catch{console.error(`Cannot parse json data: ${t}`)}}e??=null,this.setState({running:!0},async()=>{let t=await this.getPatternAsync(this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);if(t!==`${this.props.oContext.adapterName}.${this.props.oContext.instance}`){let e=await this.props.oContext.socket.getState(`system.adapter.${t}.alive`);if(!(e!=null&&e.val)){window.alert(W.t(`jc_Instance %s is not alive`,t));return}}try{let n=await this.props.oContext.socket.sendTo(t,this.props.schema.command||`send`,e);this.reportFilterLabels(n);for(let e of n)e.hiddenValue=await this.isHidden(e);this.setState({list:n,running:!1})}catch(e){console.error(`Cannot send command: ${e}`)}})}else{let e=q.getValue(this.props.data,this.props.attr);this.setState({value:e,running:!1})}}reportFilterLabels(e){if(this.props.onFilterLabelUpdate&&this.props.table&&Array.isArray(e)&&this.props.attr){let t={};for(let n of e)n.value!==q.DIFFERENT_VALUE&&(t[n.value]=n.label);this.props.onFilterLabelUpdate(this.props.attr,t)}}getContext(){let e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=q.getValue(this.props.data,t)),JSON.stringify(e)}_getValue(){let e=this.state.value==null?q.getValue(this.props.data,this.props.attr):this.state.value;return this.props.schema.multiple&&(typeof e==`string`?e=[e]:e??=[]),e}async isHidden(e){return e.hidden?this.props.custom?!!await this.executeCustom(e.hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.arrayIndex,this.props.globalData):!!await this.execute(e.hidden,this.props.schema.default,this.props.data,this.props.arrayIndex,this.props.globalData):!1}renderItem(e,t){var n;if(this.props.alive){let e=this.getContext();(e!==this.localContext||!this.initialized)&&(this.localContext=e,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}let r=this._getValue();if(!this.props.alive||!this.state.running&&!Array.isArray(this.state.list))return this.props.schema.multiple||this.props.schema.manual===!1?W.t(`jc_Cannot retrieve options, as instance is offline`):p.createElement(O,{variant:`standard`,fullWidth:!0,value:r,error:!!e,disabled:!!t,onChange:e=>{let t=e.target.value;this.setState({value:t},()=>this.onChange(this.props.attr,(t||``).trim()))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),slotProps:{input:{endAdornment:this.state.value&&!this.props.schema.noClearButton?p.createElement(Te,{position:`end`},p.createElement(B,{tabIndex:-1,size:`small`,onClick:()=>this.setState({value:``},()=>this.onChange(this.props.attr,``))},p.createElement(ge,null))):null}}});if(this.state.running)return p.createElement(Nt,{size:`24`});let i=(n=this.state.list)==null?void 0:n.filter(e=>!e.hiddenValue),a=i==null?void 0:i.find(e=>e.value===r);return p.createElement(U,{variant:`standard`,fullWidth:!0},this.props.schema.label?p.createElement(x,null,this.getText(this.props.schema.label)):null,p.createElement(D,{variant:`standard`,error:!!e,multiple:this.props.schema.multiple,disabled:!!t,sx:this.props.schema.multiple?{"&.MuiSelect-paper":ei.menuPaper}:void 0,value:r||``,renderValue:e=>this.props.schema.multiple?p.createElement(R,{sx:{display:`flex`,flexWrap:`wrap`,gap:.5}},e.map(e=>{let t=i==null?void 0:i.find(t=>t.value===e);if(t||this.props.schema.showAllValues!==!1){let n=(t==null?void 0:t.label)||e;return p.createElement(St,{key:e,label:n})}return null})):this.getText((a==null?void 0:a.label)||e,this.props.schema.noTranslation),onChange:e=>{let t=this.onChange(this.props.attr,e.target.value);t instanceof Promise&&t.catch(e=>console.error(`Cannot set value: ${e}`))}},i==null?void 0:i.map((e,t)=>e.group?p.createElement(re,{key:t},p.createElement(`div`,null,this.getText(e.label,this.props.schema.noTranslation)),e.description?p.createElement(`div`,{style:{opacity:.7,fontStyle:`italic`,fontSize:`smaller`}},this.getText(e.description)):null):p.createElement(H,{key:t,value:e.value},this.props.schema.multiple?p.createElement(zt,{checked:r==null?void 0:r.includes(e.value.toString()),onClick:()=>{let t=JSON.parse(JSON.stringify(this._getValue())),n=r==null?void 0:r.indexOf(e.value.toString());n===-1?(t.push(e.value),t.sort()):t.splice(n,1),this.setState({value:t},()=>this.onChange(this.props.attr,t))}}):null,p.createElement(w,{primary:this.getText(e.label),secondary:this.getText(e.description),slotProps:{secondary:{style:{fontSize:`smaller`,fontStyle:`italic`,opacity:.7}}}})))),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();var ni={fullWidth:{width:`100%`}};function ri(e){return e.split(`.`).reduce((e,t)=>(e<<8)+parseInt(t,10),0)>>>0}function ii(e,t){var n;let r=e==null||(n=e.native)==null||(n=n.hardware)==null?void 0:n.networkInterfaces;if(!r)return null;let i;return Object.keys(r).forEach(e=>r[e].forEach(e=>{e.internal||t.includes(`:`)&&e.family!==`IPv6`||(!t.includes(`.`)||t.match(/[^.\d]/)||e.family===`IPv4`)&&(e.family===`IPv4`&&!e.address.startsWith(`172`)&&(t===`127.0.0.0`||t===`localhost`||t.match(/[^.\d]/))?i=e.address:i||=(e.family===`IPv4`&&t.includes(`.`)&&(ri(t)&ri(e.netmask),ri(e.address)&ri(e.netmask)),e.address))})),i||Object.keys(r).forEach(e=>r[e].forEach(e=>{e.internal||t.includes(`:`)&&e.family!==`IPv6`||(!t.includes(`.`)||t.match(/[^.\d]/)||e.family===`IPv4`)&&(e.family===`IPv6`&&(t===`127.0.0.0`||t===`localhost`||t.match(/[^.\d]/))?i=e.address:i||=(e.family===`IPv4`&&t.includes(`.`)&&(ri(t)&ri(e.netmask),ri(e.address)&ri(e.netmask)),e.address))})),i||Object.keys(r).forEach(e=>{r[e].forEach(e=>{e.internal||t.includes(`:`)&&e.family!==`IPv6`||(!t.includes(`.`)||t.match(/[^.\d]/)||e.family===`IPv4`)&&(i=(t===`127.0.0.0`||t===`localhost`||t.match(/[^.\d]/),e.address))})}),i||Object.keys(r).forEach(e=>{r[e].forEach(e=>{e.internal||(i=e.address)})}),i||null}var ai=class extends q{async componentDidMount(){await super.componentDidMount();let e=window.location.hostname;if(this.props.schema.openUrl){let n=await this.props.oContext.socket.getCurrentInstance(),r=await this.getCachedObject(`system.adapter.${n}`);if(r){var t;let n=await this.getCachedObject(`system.host.${r==null||(t=r.common)==null?void 0:t.host}`);if(n){let t=ii(n,window.location.hostname);if(t)e=`${t}:${window.location.port}`;else{console.warn(`Cannot find suitable IP in host ${r.common.host} for ${r._id}`);return}}}}await new Promise(t=>{this.setState({_error:``,_message:``,hostname:e},t)}),this.props.schema.onLoaded&&this._onClick().catch(e=>console.error(e))}renderErrorDialog(){return this.state._error?p.createElement(He,{text:this.state._error,onClose:()=>this.setState({_error:``})}):null}renderMessageDialog(){return this.state._message?p.createElement(wt,{text:this.state._message,onClose:()=>this.setState({_message:``})}):null}renderCopyDialog(){return this.state._copyDialog?p.createElement(Mr,{title:this.getText(this.state._copyDialog.title||W.t(`jc_Result`)),overflowHidden:!0,onClose:()=>{this.setState({_copyDialog:null})},onApply:()=>{Mt(this.state._copyDialog.text),window.alert(W.t(`jc_Copied`)),this.setState({_copyDialog:null})},titleButtonApply:W.t(`jc_Copy content`)},p.createElement(`div`,{style:{width:`calc(100vw - 40px)`,height:`calc(100vh - 188px)`}},p.createElement(Pr,{mode:this.state._copyDialog.type,value:this.state._copyDialog.text,name:`CopyDialog`,themeType:this.props.oContext.themeType,AceEditor:this.props.oContext.AceEditor}))):null}async _onClick(){this.props.oContext.onCommandRunning(!0),this.setState({running:!0});let e=`${window.location.protocol}//${window.location.host}${window.location.pathname.replace(/\/index\.html$/,``)}`,t=`${window.location.protocol}//${this.state.hostname.split(`:`).length>3?`[${this.state.hostname}]`:this.state.hostname}${window.location.pathname.replace(/\/index\.html$/,``)}`,n=this.props.schema.data;if(n===void 0&&this.props.schema.jsonData){let r=await this.getPatternAsync(this.props.schema.jsonData,{_origin:e,_originIp:t,...this.props.data},!0);try{n=JSON.parse(r)}catch{console.error(`Cannot parse json data: ${r}`)}}n??=null,this.props.schema.openUrl&&!n&&(n={_origin:e,_originIp:t});let r;this.props.schema.timeout&&(r=setTimeout(()=>{this.props.oContext.onCommandRunning(!1),this.setState({_error:W.t(`jc_Request timed out`),running:!1})},parseInt(this.props.schema.timeout,10)||1e4));let i=await this.getPatternAsync(this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);if(i!==`${this.props.oContext.adapterName}.${this.props.oContext.instance}`){let e=await this.props.oContext.socket.getState(`system.adapter.${i}.alive`);if(!(e!=null&&e.val)){window.alert(W.t(`jc_Instance %s is not alive`,i));return}}this.props.oContext.socket.sendTo(i,this.props.schema.command||`send`,n).then(async e=>{if(r&&=(clearTimeout(r),void 0),e!=null&&e.error){var t;if((t=this.props.schema.error)!=null&&t[e.error]){var n;let t=this.getText(this.props.schema.error[e.error]);(n=e.args)==null||n.forEach(e=>t=t.replace(`%s`,e)),this.setState({_error:t})}else this.setState({_error:e.error?typeof e.error==`string`?W.t(e.error):JSON.stringify(e.error):W.t(`jc_Error`)})}else{var i;if(e!=null&&e.command){var a,o;(a=(o=this.props.oContext).onBackEndCommand)==null||a.call(o,e.command);return}if(e!=null&&e.reloadBrowser&&this.props.schema.reloadBrowser)window.location.reload();else if(e!=null&&e.openUrl&&this.props.schema.openUrl)window.open(e.openUrl,e.window||this.props.schema.window||`_blank`);else if(e!=null&&e.result&&(i=this.props.schema.result)!=null&&i[e.result]){var s;let t=this.getText(this.props.schema.result[e.result]);(s=e.args)==null||s.forEach(e=>t=t.replace(`%s`,e)),window.alert(t)}if(e!=null&&e.native&&this.props.schema.useNative){for(let[t,n]of Object.entries(e.native))await this.onChangeAsync(t,n);setTimeout(()=>this.props.oContext.forceUpdate(Object.keys(e.native),this.props.data),300)}else e!=null&&e.result?window.alert(typeof e.result==`object`?JSON.stringify(e.result):e.result):e!=null&&e.copyDialog?this.setState({_copyDialog:e.copyDialog}):window.alert(W.t(`jc_Ok`));e!=null&&e.saveConfig&&this.props.onChange(void 0,null,void 0,!0)}}).catch(e=>{this.props.schema.error&&this.props.schema.error[e.toString()]?this.setState({_error:this.getText(this.props.schema.error[e.toString()])}):this.setState({_error:W.t(e.toString())||W.t(`jc_Error`)})}).then(()=>{this.props.oContext.onCommandRunning(!1),this.setState({running:!1})})}renderDialogConfirm(){if(!this.state.confirmDialog)return null;let e=this.state.confirmData||this.props.schema.confirm;if(!e)throw Error(`Confirm dialog requested but no confirm data provided`);let t=null;return e.type===`warning`?t=p.createElement(C,null):e.type===`error`?t=p.createElement(y,null):e.type===`info`&&(t=p.createElement($e,null)),p.createElement(xt,{title:this.getText(e.title)||W.t(`jc_Please confirm`),text:this.getText(e.text),ok:this.getText(e.ok)||W.t(`jc_Ok`),cancel:this.getText(e.cancel)||W.t(`jc_Cancel`),icon:t||void 0,onClose:e=>this.setState({confirmDialog:!1},()=>e&&this._onClick())})}renderItem(e,t){let n=this.getIcon();return p.createElement(`div`,{style:ni.fullWidth},p.createElement(h,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||`grey`,style:{...ni.fullWidth,...this.props.schema.controlStyle||void 0},disabled:t||!this.props.alive,startIcon:n,title:this.props.alive?this.getText(this.props.schema.title)||``:W.t(`jc_Instance %s is not alive`,this.props.oContext.instance.toString()),onClick:()=>{this.props.schema.confirm?this.setState({confirmDialog:!0}):this._onClick().catch(e=>console.error(e))}},this.props.schema.showProcess&&this.state.running?p.createElement(Nt,{size:20,style:{marginRight:8}}):null,this.getText(this.props.schema.label,this.props.schema.noTranslation)),this.renderErrorDialog(),this.renderMessageDialog(),this.renderCopyDialog())}};f();var oi={fullWidth:{width:`100%`}},si=class extends q{async _onClick(){let e=this.props.schema.val;if(typeof e==`string`&&e.includes("${")){var t,n;e=await this.getPatternAsync(e,null,!0);let r=await this.getCachedObject(this.props.schema.id);(r==null||(t=r.common)==null?void 0:t.type)===`number`?e=parseFloat(e):(r==null||(n=r.common)==null?void 0:n.type)===`boolean`&&(e=e===`true`||e===!0||e===`1`||e===1)}let r=(this.props.schema.id||``).replace(/%INSTANCE%/g,(this.props.oContext.instance||0).toString());try{await this.props.oContext.socket.setState(r,{val:e,ack:!!this.props.schema.ack}),this.props.schema.okText&&window.alert(this.getText(this.props.schema.okText))}catch(e){this.props.schema.error&&this.props.schema.error[e.toString()]?window.alert(this.getText(this.props.schema.error[e.toString()])):window.alert(W.t(e.toString())||W.t(`jc_Error`))}}renderDialogConfirm(){if(!this.state.confirmDialog)return null;let e=this.state.confirmData||this.props.schema.confirm;if(!e)return null;let t;return e.type===`warning`?t=p.createElement(C,null):e.type===`error`?t=p.createElement(y,null):e.type===`info`&&(t=p.createElement($e,null)),p.createElement(xt,{title:this.getText(e.title)||W.t(`jc_Please confirm`),text:this.getText(e.text),ok:this.getText(e.ok)||W.t(`jc_Ok`),cancel:this.getText(e.cancel)||W.t(`jc_Cancel`),icon:t,onClose:e=>this.setState({confirmDialog:!1},()=>e&&this._onClick())})}renderItem(e,t){let n=this.getIcon();return p.createElement(h,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||`grey`,style:oi.fullWidth,disabled:t,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0}):await this._onClick()},startIcon:n||void 0},this.getText(this.props.schema.label,this.props.schema.noTranslation))}};f();var ci={fullWidth:{width:`100%`},slider:{marginLeft:10,marginRight:10,width:`calc(100% - 20px)`}},li=class extends q{async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr);this.setState({_value:e})}static getDerivedStateFromProps(e,t){if(e.schema.min!==void 0&&e.schema.min<0||e.schema.max!==void 0&&e.schema.max<0)return null;let n=q.getValue(e.data,e.attr);return n==null||n.toString()!==parseFloat(t._value).toString()?{_value:n}:null}renderItem(e,t){let n=this.props.schema.min||0,r=this.props.schema.max||100,i=this.props.schema.unit?this.getText(this.props.schema.unit,this.props.schema.noTranslation):``,a=[{value:n,label:n+i},{value:r,label:r+i}];return p.createElement(R,{style:ci.fullWidth},this.props.schema.label?p.createElement(Re,{gutterBottom:!0},this.getText(this.props.schema.label)):null,p.createElement(le,{style:ci.slider,value:this.state._value,getAriaValueText:e=>e+i,step:this.props.schema.step||(r-n)/100,valueLabelDisplay:`auto`,marks:a,min:n,max:r,disabled:!!t,onChange:e=>{let t=e.target.value;this.setState({_value:t},()=>this.onChange(this.props.attr,t))}}),this.props.schema.help?p.createElement(Re,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();function ui(e,t){return e===`edit`||e===`rename`?p.createElement(en,{style:t}):e===`delete`?p.createElement(pe,{style:t}):e===`refresh`?p.createElement(Ee,{style:t}):e===`newDevice`||e===`new`||e===`add`?p.createElement(ye,{style:t}):e===`discover`||e===`search`?p.createElement(ke,{style:t}):e===`unpairDevice`||e===`unpair`?p.createElement(We,{style:t}):e===`pairDevice`||e===`pair`?p.createElement(ut,{style:t}):e===`identify`?p.createElement(kt,{style:t}):e===`play`?p.createElement(Ve,{style:t}):e===`stop`?p.createElement(pt,{style:t}):e===`pause`?p.createElement(st,{style:t}):e===`forward`||e===`next`?p.createElement(oe,{style:t}):e===`rewind`||e===`previous`?p.createElement(Ae,{style:t}):e===`lamp`||e===`light`?p.createElement(Pt,{style:t}):e===`backlight`?p.createElement(Le,{style:t}):e===`dimmer`?p.createElement(ne,{style:t}):e===`socket`?p.createElement(Gt,{style:t}):e===`settings`?p.createElement(S,{style:t}):e===`users`||e===`group`?p.createElement(ze,{style:t}):e===`user`?p.createElement(it,{style:t}):e===`qrcode`?p.createElement(Zt,{style:t}):e===`connection`?p.createElement(M,{style:t}):e===`no-connection`?p.createElement(mt,{style:t}):e===`visible`?p.createElement(Kt,{style:t}):null}f();function di(e,t){return typeof t==`string`?{"@keyframes newStateAnimationOnceColor":{"0%":{color:t},"100%":{color:e.palette.mode===`dark`?`#fff`:`#000`}},animation:`newStateAnimationOnceColor 2s ease-in-out`}:{"@keyframes newStateAnimationOnce":{"0%":{color:`#00f900`},"80%":{color:e.palette.mode===`dark`?`#518851`:`#008000`},"100%":{color:e.palette.mode===`dark`?`#fff`:`#000`}},animation:`newStateAnimationOnce 2s ease-in-out`}}var fi=class extends q{constructor(...e){super(...e),G(this,`controlTimeout`,null),G(this,`delayedUpdate`,{timer:null,value:null}),G(this,`onStateChanged`,(e,t)=>{let n=t?t.val:null;this.state.controlType===`button`||this.state.controlType===`switch`?(n=!!n,this.state.stateValue!==n&&this.setState({stateValue:n})):n!==null&&(this.state.controlType===`slider`||this.state.controlType===`number`)?(n=parseFloat(n),console.log(`${Date.now()} Received new value: ${n}`),n===this.state.stateValue?this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null):(this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null),this.delayedUpdate.value=n,this.delayedUpdate.timer=setTimeout(()=>{this.setState({stateValue:this.delayedUpdate.value})},500))):(this.state.stateValue===null||this.state.stateValue===void 0?null:this.state.stateValue.toString())!==(n==null?null:n.toString())&&this.setState({stateValue:n})})}get ack(){return!!this.props.schema.ack}async getObjectID(){let e=(this.props.schema.oid||``).toString();return e.includes("${")&&(e=await this.getPatternAsync(e,null,!0)),this.props.schema.foreign?e:`${this.props.schema.system?`system.adapter.`:``}${this.props.oContext.adapterName}.${this.props.oContext.instance||0}.${e}`}async componentDidMount(){var e;await super.componentDidMount();let t=await this.getObjectID(),n=await this.getCachedObject(t);if(n!=null&&(e=n.common)!=null&&e.states&&!this.props.schema.options){var r;if(Array.isArray(n==null||(r=n.common)==null?void 0:r.states)){let e={};n.common.states.forEach((t,n)=>{e[n.toString()]=t}),n.common.states=e}Object.keys(n.common.states).length||(n.common.states=void 0)}let i=this.props.schema.control||this.detectType(n);try{let e=await this.props.oContext.socket.getState(t);this.setState({stateValue:e?e.val:null,controlType:i,obj:n,objId:t},async()=>{let e=await this.getObjectID();await this.props.oContext.socket.subscribeState(e,this.onStateChanged)})}catch(e){console.error(`Cannot get state ${t}: ${e}`),this.setState({controlType:i,obj:n,objId:t})}}componentWillUnmount(){super.componentWillUnmount(),this.state.objId&&this.props.oContext.socket.unsubscribeState(this.state.objId,this.onStateChanged),this.delayedUpdate.timer&&(clearTimeout(this.delayedUpdate.timer),this.delayedUpdate.timer=null),this.controlTimeout&&(clearTimeout(this.controlTimeout),this.controlTimeout=null,this.state.objId&&this.props.oContext.socket.setState(this.state.objId,this.state.stateValue??null,this.ack).catch(e=>console.error(`Cannot control value: ${e.toString()}`)))}detectType(e){if(e||={},e.common||={},e.common.type===`boolean`){if(this.props.schema.controlled!==!1){if(e.common.read===!1||this.props.schema.controlled===!0)return`button`;if(e.common.write||this.props.schema.controlled===!0)return`switch`}return`text`}return e.common.type===`number`&&this.props.schema.controlled!==!1?e.common.write||this.props.schema.controlled===!0?e.common.states||this.props.schema.options?`select`:e.common.max===void 0?`input`:`slider`:`text`:e.common.write&&this.props.schema.controlled!==!1?e.common.states||this.props.schema.options?`select`:`input`:`text`}getNormalizedStates(){var e;let t;return this.props.schema.options?t=this.props.schema.options.map(e=>typeof e==`string`?{value:e,label:this.getText(e,this.props.schema.noTranslation)}:{value:e.value,label:this.getText(e.label,this.props.schema.noTranslation),color:e.color}):(e=this.state.obj)!=null&&e.common.states?(t=[],Object.keys(this.state.obj.common.states).forEach(e=>{t.push({value:e,label:this.getText(this.state.obj.common.states[e],this.props.schema.noTranslation)})})):t=[],t}renderItem(e,t){var n;if(!this.state.obj)return null;let r;if(this.state.controlType===`select`||!this.state.controlType&&(this.state.obj.common.type===`number`||this.state.obj.common.type===`string`)&&this.state.obj.common.write!==!1&&(this.props.schema.options||this.state.obj.common.states)){let e=this.getNormalizedStates(),n=e.find(e=>e.value===this.state.stateValue);r=p.createElement(U,{fullWidth:!0},p.createElement(x,null,this.getText(this.props.schema.label)),p.createElement(D,{value:this.state.stateValue??``,disabled:!!this.props.schema.readOnly||t,onChange:e=>{this.setState({stateValue:e.target.value},()=>{var e;let t=this.state.stateValue;((e=this.state.obj)==null?void 0:e.common.type)===`number`&&(t=parseFloat(t.toString().replace(`,`,`.`))),this.state.objId&&this.props.oContext.socket.setState(this.state.objId,t,this.ack)})},renderValue:e=>n!=null&&n.color?p.createElement(`div`,{style:{color:n.color}},n.label):e},e.map(e=>p.createElement(H,{key:(e.value??``).toString(),value:e.value,style:{color:e.color}},`$`,e.label))))}else if(this.state.controlType===`button`||!this.state.controlType&&this.state.obj.common.type===`boolean`&&(this.state.obj.common.write&&this.state.obj.common.read===!1||(n=this.state.obj.common.role)!=null&&n.includes(`button`))){let e=null;this.props.schema.falseImage&&(e=ui(this.props.schema.falseImage));let n=this.getText(this.props.schema.falseText||this.props.schema.label,this.props.schema.noTranslation);r=!n&&e?p.createElement(B,{style:this.props.schema.falseTextStyle,disabled:!!this.props.schema.readOnly,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async e=>{e&&this.state.objId&&await this.props.oContext.socket.setState(this.state.objId,this.props.schema.buttonValue===void 0||this.props.schema.buttonValue,this.ack)}}):this.state.objId&&await this.props.oContext.socket.setState(this.state.objId,this.props.schema.buttonValue===void 0||this.props.schema.buttonValue,this.ack)}},e):p.createElement(h,{variant:this.props.schema.variant||`contained`,startIcon:e,style:this.props.schema.falseTextStyle,disabled:t||!!this.props.schema.readOnly,onClick:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async e=>{e&&this.state.objId&&await this.props.oContext.socket.setState(this.state.objId,this.props.schema.buttonValue===void 0||this.props.schema.buttonValue,this.ack)}}):this.state.objId&&await this.props.oContext.socket.setState(this.state.objId,this.props.schema.buttonValue===void 0||this.props.schema.buttonValue,this.ack)}},n||(this.state.objId||``).split(`.`).pop())}else if(this.state.controlType===`input`||!this.state.controlType&&this.state.obj.common.write&&this.state.obj.common.type===`string`)r=p.createElement(`div`,{style:{width:`100%`,display:`flex`,flexDirection:`row`,gap:8,alignItems:`baseline`}},p.createElement(O,{style:{flex:1},value:this.state.stateValue,variant:`standard`,disabled:!!this.props.schema.readOnly||t,slotProps:{input:{endAdornment:this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit||void 0},htmlInput:{readOnly:!!this.props.schema.readOnly}},onKeyUp:e=>{this.props.schema.setOnEnterKey&&e.key===`Enter`&&this.state.objId&&this.props.oContext.socket.setState(this.state.objId,this.state.stateValue??null,this.ack)},onChange:e=>{this.setState({stateValue:e.target.value},()=>{this.props.schema.setOnEnterKey||this.props.schema.showEnterButton||(this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{var e;this.controlTimeout=null;let t=this.state.stateValue;((e=this.state.obj)==null?void 0:e.common.type)===`number`&&(t=parseFloat(t.toString().replace(`,`,`.`))),this.state.objId&&await this.props.oContext.socket.setState(this.state.objId,t,this.ack)},this.props.schema.controlDelay||0))})},label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}),this.props.schema.showEnterButton&&!this.props.schema.readOnly&&p.createElement(h,{variant:`outlined`,disabled:t,onClick:()=>{this.state.objId&&this.props.oContext.socket.setState(this.state.objId,this.state.stateValue??null,this.ack)}},this.getText(typeof this.props.schema.showEnterButton==`string`?this.props.schema.showEnterButton:`Set`)));else{var i,a,o,s;let e;this.props.schema.size===`normal`?e=16:this.props.schema.size===`large`?e=20:typeof this.props.schema.size==`number`&&(e=this.props.schema.size);let n=this.getText(this.props.schema.label,this.props.schema.noTranslation),c={display:`flex`,alignItems:`center`,fontSize:e||`1rem`,gap:8};this.props.schema.narrow||(c.width=`100%`,c.justifyContent=`space-between`),n.trim()&&!n.trim().endsWith(`:`)&&this.props.schema.addColon&&(n=`${n.trim()}:`);let l;this.props.schema.blinkOnUpdate&&(l=di(this.props.oContext.theme,this.props.schema.blinkOnUpdate));let u;this.props.schema.labelIcon&&(u=p.createElement(gt,{src:this.props.schema.labelIcon,style:{marginRight:4}}));let d;if(n&&u?d=p.createElement(`div`,{style:{whiteSpace:`nowrap`}},u,n):n?d=p.createElement(`div`,{style:{whiteSpace:`nowrap`}},n):u&&(d=u),this.state.controlType===`switch`||!this.state.controlType&&this.state.obj.common.type===`boolean`&&(this.state.obj.common.write&&this.state.obj.common.read!==!1||(i=this.state.obj.common.role)!=null&&i.includes(`switch`))){let e=null,n=this.getText(this.props.schema.falseText,this.props.schema.noTranslation);this.props.schema.falseImage&&(e=ui(this.props.schema.falseImage,n?{marginLeft:8}:void 0));let i=null,a=this.getText(this.props.schema.trueText,this.props.schema.noTranslation);this.props.schema.trueImage&&(i=ui(this.props.schema.trueImage,a?{marginRight:8}:void 0)),r=p.createElement(ie,{checked:!!this.state.stateValue,disabled:!!this.props.schema.readOnly||t,onChange:async()=>{this.props.schema.confirm?this.setState({confirmDialog:!0,confirmCallback:async e=>{e&&this.state.objId&&await this.props.oContext.socket.setState(this.state.objId,!this.state.stateValue,this.ack)}}):this.state.objId&&await this.props.oContext.socket.setState(this.state.objId,!this.state.stateValue,this.ack)}}),(n||e||a||i)&&(r=p.createElement(`div`,{style:{display:`flex`,alignItems:`center`,fontSize:14}},p.createElement(`span`,{style:this.props.schema.falseTextStyle},n,e),r,p.createElement(`span`,{style:this.props.schema.trueTextStyle},i,a))),d&&(r=p.createElement(`div`,{style:c},d,r))}else if(this.state.controlType===`slider`||!this.state.controlType&&this.state.obj.common.type===`number`&&(this.state.obj.common.write&&(this.state.obj.common.max!==void 0||this.state.obj.common.unit===`%`)||(a=this.state.obj.common.role)!=null&&a.includes(`slider`)||(o=this.state.obj.common.role)!=null&&o.includes(`dimmer`)||(s=this.state.obj.common.role)!=null&&s.includes(`blind`))){let e=null,n=this.getText(this.props.schema.falseText,this.props.schema.noTranslation);this.props.schema.falseImage&&(e=ui(this.props.schema.falseImage,n?{marginLeft:8}:void 0));let i=null,a=this.getText(this.props.schema.trueText,this.props.schema.noTranslation);this.props.schema.trueImage&&(i=ui(this.props.schema.trueImage,a?{marginRight:8}:void 0));let o=this.props.schema.min??(this.state.obj.common.min||0),s=this.props.schema.max??this.state.obj.common.max??100,l=this.props.schema.step??(this.state.obj.common.step||1);r=p.createElement(le,{style:{width:`100%`,flexGrow:1},min:o,max:s,disabled:!!this.props.schema.readOnly||t,step:l,value:this.state.stateValue,valueLabelDisplay:`auto`,valueLabelFormat:e=>{var t;let n=this.props.schema.digits===void 0?e.toString():e.toFixed(this.props.schema.digits);return this.props.oContext.isFloatComma&&(n=n.replace(`.`,`,`)),`${n}${this.getText(this.props.schema.unit,this.props.schema.noTranslation)||((t=this.state.obj)==null?void 0:t.common.unit)||``}`},onChange:(e,t)=>{Array.isArray(t)&&(t=t[0]),this.setState({stateValue:t},()=>{this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{console.log(`${Date.now()} Send new value: ${this.state.stateValue}`),this.controlTimeout=null,this.state.objId&&await this.props.oContext.socket.setState(this.state.objId,this.state.stateValue??null,this.ack)},this.props.schema.controlDelay||0)})}}),(n||e||a||i)&&(r=p.createElement(`div`,{style:{display:`flex`,width:`100%`,flexGrow:1,alignItems:`center`}},p.createElement(`span`,{style:{marginRight:16,...this.props.schema.falseTextStyle}},n,e),r,p.createElement(`span`,{style:{marginLeft:16,...this.props.schema.trueTextStyle}},i,a))),d&&(r=p.createElement(`div`,{style:c},d,r))}else if(this.state.obj.common.type===`number`&&this.state.obj.common.write&&!this.state.controlType){let e=this.props.schema.min??this.state.obj.common.min??void 0,n=this.props.schema.max??this.state.obj.common.max??void 0,i=this.props.schema.step??this.state.obj.common.step??void 0;r=p.createElement(O,{variant:`standard`,style:{width:`100%`},value:this.state.stateValue,type:`number`,disabled:!!this.props.schema.readOnly||t,slotProps:{htmlInput:{min:e,max:n,step:i,readOnly:!!this.props.schema.readOnly},input:{endAdornment:this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit||void 0}},onChange:e=>{this.setState({stateValue:e.target.value},()=>{this.controlTimeout&&clearTimeout(this.controlTimeout),this.controlTimeout=setTimeout(async()=>{if(this.controlTimeout=null,this.state.objId){let e=parseFloat(this.state.stateValue);await this.props.oContext.socket.setState(this.state.objId,e,this.ack)}},this.props.schema.controlDelay||0)})},label:this.getText(this.props.schema.label,this.props.schema.noTranslation),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}else if(this.state.obj.common.type===`boolean`){let e=null,t,n;this.state.stateValue?(t=this.getText(this.props.schema.trueText,this.props.schema.noTranslation),this.props.schema.trueImage&&(e=ui(this.props.schema.falseImage,t?{marginRight:8}:void 0)),n=this.props.schema.trueTextStyle):(t=this.getText(this.props.schema.falseText,this.props.schema.noTranslation),this.props.schema.falseImage&&(e=ui(this.props.schema.falseImage,t?{marginLeft:8}:void 0)),n=this.props.schema.falseTextStyle),n=Object.assign(c,n),r=p.createElement(`div`,{style:n},d,p.createElement(R,{style:{display:`flex`,alignItems:`center`,gap:8},sx:l,key:this.props.schema.blinkOnUpdate?t:void 0},e,t||(this.state.stateValue?W.t(`jc_true`):W.t(`jc_false`))))}else if(this.state.obj.common.write===!1&&this.state.obj.common.type===`number`&&(this.state.obj.common.unit===`%`||this.state.obj.common.max!=null)){let e=this.props.schema.min??this.state.obj.common.min??0,t=this.props.schema.max??this.state.obj.common.max??100;r=p.createElement(`div`,{style:c},d,p.createElement(R,{sx:{width:`100%`,display:`flex`,flexDirection:`column`,gap:4}},p.createElement(qt,{variant:`determinate`,value:Math.min(Math.max((this.state.stateValue-e)/(t-e),0),1)*100}),p.createElement(`div`,{style:{textAlign:`right`}},this.state.stateValue,this.state.obj.common.unit)))}else{let e=this.getText(this.props.schema.unit,this.props.schema.noTranslation)||this.state.obj.common.unit,t=this.state.stateValue;if(t!=null&&(this.props.schema.options||this.state.obj.common.states)){let e=this.getNormalizedStates().find(e=>e.value.toString()===t.toString());e&&(t=e.label)}let n,i;this.state.controlType===`html`?(i=(t??``).toString(),n=p.createElement(`span`,{dangerouslySetInnerHTML:{__html:t}})):this.state.stateValue===null?(n=`null`,i=n):this.state.stateValue===void 0?(n=`undefined`,i=n):(this.props.schema.digits!==void 0&&typeof t==`number`?(n=t.toFixed(this.props.schema.digits),this.props.oContext.isFloatComma&&(n=n.replace(`.`,`,`))):n=(t??``).toString(),i=n),r=p.createElement(`div`,{style:c},d,p.createElement(`div`,{style:{display:`flex`,alignItems:`baseline`,gap:4}},p.createElement(R,{sx:l,key:this.props.schema.blinkOnUpdate?i:void 0},n),e?p.createElement(`span`,{style:{opacity:.7,fontSize:`smaller`}},e):null))}}return r&&this.props.schema.highlight&&(r=p.createElement(R,{component:`div`,sx:{width:`100%`,"&:hover":{backgroundColor:this.props.oContext.themeType===`dark`?`#51515180`:`#b8b8b880`}}},r)),r}};f();var pi={fullWidth:e=>({width:`100%`,backgroundColor:e.palette.mode===`dark`?`#FFF`:`#000`,borderStyle:`hidden`}),primary:e=>({backgroundColor:e.palette.primary.main}),secondary:e=>({backgroundColor:e.palette.secondary.main})},mi=class extends q{renderItem(){return p.createElement(R,{component:`hr`,sx:z.getStyle(this.props.oContext.theme,pi.fullWidth,this.props.schema.color===`primary`?pi.primary:this.props.schema.color===`secondary`?pi.secondary:{backgroundColor:this.props.schema.color||(this.props.oContext.themeType===`dark`?`#333`:`#ddd`)},{height:this.props.schema.color?this.props.schema.height||2:this.props.schema.height||1})})}};f();var hi={header:e=>({width:`100%`,background:e.palette.primary.main,color:e.palette.primary.contrastText,padding:`4px !important`,borderRadius:`3px`,marginBlockEnd:0,marginBlockStart:0})},gi=class extends q{renderItem(){let e=`h5`;switch((this.props.schema.size||5).toString()){case`1`:e=`h1`;break;case`2`:e=`h2`;break;case`3`:e=`h3`;break;case`4`:e=`h4`;break;default:e=`h5`}return p.createElement(R,{component:e,sx:hi.header},this.getText(this.props.schema.label||this.props.schema.text,this.props.schema.noTranslation))}};f();var _i=class extends q{getSrc(){let e=this.props.schema.src;return e&&!e.startsWith(`.`)&&!e.startsWith(`http`)&&!e.startsWith(`adapter/${this.props.oContext.adapterName}/`)&&!e.startsWith(`./adapter/${this.props.oContext.adapterName}/`)&&(e=`${this.props.oContext.imagePrefix}/adapter/${this.props.oContext.adapterName}/${e}`),e}renderItem(){let{schema:e}=this.props,t=this.getSrc();if(e.showInDialog){let n=e.showInDialogSmallSize||100,r=e.showInDialogButtonLabel?this.getText(e.showInDialogButtonLabel):``;return p.createElement(p.Fragment,null,p.createElement(A,{title:W.t(`jc_Click to see in full size`)},p.createElement(`img`,{src:t,style:{cursor:`pointer`,width:`auto`,height:n,objectFit:`contain`},alt:``,onClick:()=>this.setState({showDialog:!0})})),` `,r?p.createElement(h,{variant:`outlined`,color:`grey`,onClick:()=>this.setState({showDialog:!0})},r):null,this.state.showDialog?p.createElement(Tt,{open:!0,onClose:()=>this.setState({showDialog:!1}),maxWidth:`lg`},p.createElement(qe,null,p.createElement(gt,{src:t,style:{width:`100%`,height:`100%`,objectFit:`contain`}})),p.createElement(It,null,p.createElement(h,{variant:`contained`,onClick:()=>this.setState({showDialog:!1}),color:`primary`},W.t(`jc_Close`)))):null)}return p.createElement(`img`,{src:t,style:{cursor:e.href?`pointer`:void 0,width:`100%`,height:`100%`},onClick:e.href?()=>e.href&&window.open(e.href,`_blank`):void 0,alt:``})}};f();function vi(e,t,n){return typeof n==`string`?{"@keyframes newValueAnimationOnceColor":{"0%":{color:t?`${n} !important`:n},"100%":{color:e.palette.mode===`dark`?t?`#fff !important`:`#fff`:t?`#000 !important`:`#000`}},animation:`newValueAnimationOnceColor 2s ease-in-out`}:{"@keyframes newValueAnimationOnce":{"0%":{color:t?`#00f900 !important`:`#00f900`},"80%":{color:e.palette.mode===`dark`?t?`#518851 !important`:`#518851`:t?`#008000 !important`:`#008000`},"100%":{color:e.palette.mode===`dark`?t?`#fff !important`:`#fff`:t?`#000 !important`:`#000`}},animation:`newValueAnimationOnce 2s ease-in-out`}}function yi(e,t){return typeof t==`string`?{"@keyframes blinkAnimationColor":{"0%":{color:t},"100%":{color:e.palette.mode===`dark`?`#fff`:`#000`}},animation:`blinkAnimationColor 2s ease-in-out infinite`}:{"@keyframes blinkAnimation":{"0%":{color:`#00f900`},"80%":{color:e.palette.mode===`dark`?`#518851`:`#008000`},"100%":{color:e.palette.mode===`dark`?`#fff`:`#000`}},animation:`blinkAnimation 2s ease-in-out infinite`}}var bi={label:{fontWeight:`bold`,whiteSpace:`nowrap`},valueImage:{maxHeight:`100%`},valueAndUnit:{display:`flex`,gap:4,alignItems:`baseline`},value:{},unit:{fontSize:`smaller`,opacity:.7}},xi=class extends q{renderItem(e){let t=this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation);this.props.schema.addColon&&typeof t==`string`&&!t.trim().endsWith(`:`)&&(t=`${t.trim()}:`),t&&(t.includes(`<a `)||t.includes(`<br`)||t.includes(`<b>`)||t.includes(`<i>`))&&(t=z.renderTextWithA(t));let n;this.props.schema.size===`normal`?n=16:this.props.schema.size===`large`?n=20:typeof this.props.schema.size==`number`&&(n=this.props.schema.size);let r={width:`100%`,height:`100%`,display:`flex`,alignItems:`center`,position:`relative`,fontSize:n};this.props.schema.narrow?r.gap=8:r.justifyContent=`space-between`;let i,a;this.props.schema.data&&typeof this.props.schema.data==`object`&&this.props.schema.data.en?a=this.getText(this.props.schema.data):typeof this.props.schema.data==`object`||this.props.schema.data===void 0||this.props.schema.data===null?a=JSON.stringify(this.props.schema.data):typeof this.props.schema.data==`number`?(a=this.props.schema.data.toString(),this.props.oContext.isFloatComma&&(a=a.replace(`.`,`,`))):a=this.props.schema.data.toString();let o=!1;if(this.props.schema.booleanAsCheckbox&&typeof this.props.schema.data==`boolean`)i=p.createElement(zt,{checked:this.props.schema.data,disabled:!0,size:this.props.schema.size===`small`?`small`:this.props.schema.size===`large`?`large`:void 0});else if(a.startsWith(`data:image/`))i=p.createElement(`div`,{style:{...bi.value,...bi.valueImage,...this.props.schema.styleValue||void 0}},p.createElement(gt,{src:a}));else{let e={...bi.value,...this.props.schema.styleValue||void 0};this.props.schema.html?i=p.createElement(`div`,{style:e,dangerouslySetInnerHTML:{__html:a}}):Array.isArray(this.props.schema.data)?(o=!0,i=p.createElement(`div`,{style:e},this.props.schema.data.map((e,t)=>p.createElement(`div`,{key:t},typeof e==`object`||e==null?JSON.stringify(e):e)))):a.includes(`
|
|
16
|
-
`)?(o=!0,i=p.createElement(`div`,{style:e},z.renderTextWithA(a))):i=p.createElement(`div`,{style:e},a)}if(this.props.schema.blinkOnUpdate&&this.props.schema.blink){let e=vi(this.props.oContext.theme,!0,this.props.schema.blinkOnUpdate),t=yi(this.props.oContext.theme,this.props.schema.blink);i=p.createElement(R,{key:a,sx:{...e,...t}},i)}else if(this.props.schema.blinkOnUpdate){let e=vi(this.props.oContext.theme,!1,this.props.schema.blinkOnUpdate);i=p.createElement(R,{key:a,sx:e},i)}else if(this.props.schema.blink){let e=yi(this.props.oContext.theme,this.props.schema.blink);i=p.createElement(R,{sx:e},i)}this.props.schema.unit&&(i=p.createElement(`div`,{style:bi.valueAndUnit},i,p.createElement(`div`,{style:{...bi.unit,...this.props.schema.styleUnit||void 0}},this.getText(this.props.schema.unit,this.props.schema.noTranslation))));let s;this.props.schema.labelIcon&&(s=p.createElement(gt,{src:this.props.schema.labelIcon,style:{marginRight:4}}));let c;this.props.schema.copyToClipboard&&(c=p.createElement(ce,{className:`staticCopyButton`,style:{position:`absolute`,top:`calc(50% - 12px)`,right:0,cursor:`pointer`},onClick:()=>{z.copyToClipboard(a),window.alert(W.t(`jc_Copied`))}}));let l={"& .staticCopyButton":{display:`none`},"& .staticCopyButton:action":{transform:`scale(0.9)`},"&:hover .staticCopyButton":{display:`block`}};return this.props.schema.highlight&&(l[`&:hover`]={backgroundColor:this.props.oContext.themeType===`dark`?`#51515180`:`#b8b8b880`}),o&&(r.alignItems=`top`),p.createElement(R,{component:`div`,style:r,sx:l},p.createElement(`div`,{style:{...bi.label,...this.props.schema.styleLabel||void 0}},s,t),i,c)}};f();var Si={fullWidth:{height:`100%`,width:`100%`},link:e=>({textDecoration:`underline`,color:e.palette.mode===`dark`?`#4dabf5`:`#254e72`,cursor:`pointer`})};function Ci(e,t,n){let r,i=``;e?e.toString().startsWith(`#`)||e.toString().startsWith(`/`)?(r=t||`_self`,i=e):e.startsWith(`http://`)||e.startsWith(`https://`)?(r=t||`_blank`,i=e):(i=`#tab-instances/config/${n}/${e}`,r=t||`_self`):(i=`#tab-instances/config/${n}`,r=t||`_self`),r===`_self`?setTimeout(e=>{e.startsWith(`#`)?window.location.hash=e:e.startsWith(`/`)?i=`${window.location.protocol}//${window.location.host}${i}`:(e.startsWith(`http://`)||e.startsWith(`https://`))&&(window.location.href=e)},100,i):(i.startsWith(`#`)?i=`${window.location.protocol}//${window.location.host}${window.location.pathname}${i}`:i.startsWith(`/`)&&(i=`${window.location.protocol}//${window.location.host}${i}`),window.open(i,r))}var wi=class extends q{renderItem(e,t){if(this.props.schema.button){let e=this.getIcon();return p.createElement(h,{variant:this.props.schema.variant||void 0,color:this.props.schema.color||`grey`,style:{...Si.fullWidth,...this.props.schema.controlStyle||void 0},disabled:t,startIcon:e,onClick:this.props.schema.href?()=>{let e=this.props.schema.href?this.getText(this.props.schema.href,!0):null;e&&(this.props.oContext.onBackEndCommand?this.props.oContext.onBackEndCommand({command:`link`,url:e,target:this.props.schema.target,close:this.props.schema.close}):Ci(e,this.props.schema.target,`${this.props.oContext.adapterName}.${this.props.oContext.instance}`))}:void 0},this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation))}let n=this.getText(this.props.schema.text||this.props.schema.label,this.props.schema.noTranslation);if(this.props.schema.format===`html`)n=p.createElement(`div`,{dangerouslySetInnerHTML:{__html:n}});else if(this.props.schema.format===`json`)try{let e=typeof n==`string`?JSON.parse(n):n;n=p.createElement(`pre`,{style:{whiteSpace:`pre-wrap`,wordBreak:`break-word`,margin:0}},JSON.stringify(e,null,2))}catch{}else n&&(n.includes(`<a `)||n.includes(`<br`)||n.includes(`<b>`)||n.includes(`<i>`))&&(n=z.renderTextWithA(n));return p.createElement(R,{component:`span`,style:{...this.props.schema.controlStyle||void 0},sx:this.props.schema.href?Si.link:void 0,onClick:this.props.schema.href?()=>{let e=this.props.schema.href?this.getText(this.props.schema.href,!0):null;e&&(this.props.oContext.onBackEndCommand?this.props.oContext.onBackEndCommand({command:`link`,url:e,target:this.props.schema.target||`_blank`,close:this.props.schema.close}):Ci(e,this.props.schema.target||`_blank`,`${this.props.oContext.adapterName}.${this.props.oContext.instance}`))}:void 0},n)}};f();var Ti=1048576,J={fullWidth:{width:`100%`},root:{width:`100%`},paper:{width:`100%`,marginBottom:16,backgroundColor:`rgba(255, 255, 255, 0.1)`},headerText:{width:`100%`},table:{minWidth:750},visuallyHidden:{border:0,clip:`rect(0 0 0 0)`,height:1,margin:-1,overflow:`hidden`,padding:0,position:`absolute`,top:20,width:1},label:{display:`flex`,justifyContent:`space-between`},title:{flex:`1 1 100%`},rootTool:{paddingLeft:16,paddingRight:8},silver:{opacity:.2},flex:{display:`flex`,alignItems:`baseline`},filteredOut:{padding:10,display:`flex`,textAlign:`center`},buttonEmpty:{width:34,display:`inline-block`},buttonCell:{whiteSpace:`nowrap`},dropZone:{width:`100%`,height:100,position:`relative`},dropZoneEmpty:{},uploadDiv:{position:`relative`,width:`100%`,minHeight:300,opacity:.9,marginTop:30,cursor:`pointer`,outline:`none`},uploadDivDragging:{opacity:1,background:`rgba(128,255,128,0.1)`},image:{objectFit:`contain`,margin:`auto`,display:`flex`,width:`100%`,height:`100%`},uploadCenterDiv:{margin:5,border:`3px dashed grey`,borderRadius:5,width:`calc(100% - 10px)`,height:`calc(100% - 10px)`,minHeight:300,position:`relative`,display:`flex`},uploadCenterIcon:{paddingTop:10,width:48,height:48},uploadCenterText:{fontSize:16},uploadCenterTextAndIcon:{textAlign:`center`,position:`absolute`,top:0,bottom:0,left:0,right:0,display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`},buttonRemoveWrapper:{position:`absolute`,zIndex:222,right:0},error:{border:`2px solid red`,boxSizing:`border-box`},tooltip:{pointerEvents:`none`},cardHeader:e=>({color:e.palette.mode===`light`?e.palette.secondary.main:e.palette.text.primary,height:`100%`,fontWeight:`bold`,fontSize:20,fontStyle:`italic`,padding:`4px 16px`,backgroundColor:e.palette.primary.main,display:`flex`,justifyContent:`space-between`})};function Ei(e,t,n){t||=`key`;let r=[];return Object.keys(e).forEach(i=>{let a={};a[t]=i,n?(a[n]=e[i],r.push(a)):r.push(Object.assign(a,e[i]))}),r}function Di(e,t,n){t||=`key`;let r={};return e.forEach(e=>{let i=e[t]??``;delete e[t],n?r[i]=e[n]:r[i]=e}),r}function Oi(e,t){let n=``;for(let r=0;r<t.length;r++)n+=String.fromCharCode(e[r%e.length].charCodeAt(0)^t.charCodeAt(r));return n}function ki(e,t){let n=``;for(let r=0;r<t.length;r++)n+=String.fromCharCode(e[r%e.length].charCodeAt(0)^t.charCodeAt(r));return n}var Ai=class e extends q{constructor(t){super(t),G(this,`filterRefs`,void 0),G(this,`typingTimer`,null),G(this,`resizeTimeout`,null),G(this,`secret`,`Zgfr56gFe87jJOM`),G(this,`refDiv`,void 0),G(this,`listOfHiddenElements`,[]),G(this,`refreshBecauseOfHiddenElements`,null),G(this,`onTableRowError`,e=>(t,n)=>{let r={...this.state.tableErrors};r[e]||={},t&&(n?r[e][t]=n:(delete r[e][t],Object.keys(r[e]).length===0&&delete r[e])),this.setState({tableErrors:r}),this.props.onError(t,n)}),G(this,`handleRequestSort`,(e,t=!1)=>{let{order:n,orderBy:r}=this.state,i=t?n:r===e&&n===`asc`?`desc`:`asc`,a=this.stableSort(i,e);JSON.stringify(a)!==JSON.stringify(this.state.value)&&this.setState({value:a,order:i,orderBy:e,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,a))}),G(this,`stableSort`,(t,n)=>{let{value:r}=this.state,i=e.getComparator(t,n),a=r.map((e,t)=>({el:e,index:t}));return a.sort((e,t)=>{let n=i(e.el,t.el);return n===0?e.index-t.index:n}),a.map(e=>e.el)}),G(this,`onDelete`,e=>()=>{let t=JSON.parse(JSON.stringify(this.state.value));t.splice(e,1);let n={...this.state.tableErrors};n[e]&&(Object.keys(n[e]).forEach(e=>{this.props.onError(e,void 0)}),delete n[e]);let r={};Object.keys(n).forEach(t=>{let i=parseInt(t,10);i>e?r[i-1]=n[i]:r[i]=n[i]}),this.setState({value:t,iteration:this.state.iteration+1e4,tableErrors:r},()=>this.applyFilter(!1,void 0,()=>this.onChangeWrapper(t)))}),G(this,`onClone`,e=>()=>{let t=JSON.parse(JSON.stringify(this.state.value)),n=JSON.parse(JSON.stringify(t[e]));if(typeof this.props.schema.clone==`string`&&typeof n[this.props.schema.clone]==`string`){let e=1,r=n[this.props.schema.clone],i=r.match(/(\d+)$/);for(i?(r=r.replace(i[0],``),e=parseInt(i[0],10)+1):r+=`_`;t.find(t=>t[this.props.schema.clone]===r+e.toString());)e++;n[this.props.schema.clone]=`${n[this.props.schema.clone]}_${e}`}t.splice(e,0,n),this.setState({value:t,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,void 0,()=>this.onChangeWrapper(t)))}),G(this,`onChangeWrapper`,(e,t)=>{this.typingTimer&&clearTimeout(this.typingTimer),this.typingTimer=setTimeout((e,t)=>{this.typingTimer=null;let n;if(this.props.schema.encryptedAttributes){let t=JSON.parse(JSON.stringify(e));if(t.forEach(e=>{this.props.schema.encryptedAttributes.forEach(t=>{e[t]&&(e[t]=Oi(this.secret,e[t]))})}),this.props.schema.objKeyName){let e=Di(t,this.props.schema.objKeyName,this.props.schema.objValueName);n=this.onChange(this.props.attr,e)}else n=this.onChange(this.props.attr,t)}else if(this.props.schema.objKeyName){let t=Di(JSON.parse(JSON.stringify(e)),this.props.schema.objKeyName,this.props.schema.objValueName);n=this.onChange(this.props.attr,t)}else n=this.onChange(this.props.attr,e);n instanceof Promise&&n.catch(e=>console.error(`Cannot save: ${e}`)),t&&(this.applyFilter(!1,e),this.handleRequestSort(this.state.orderBy,!0))},300,e,t)}),G(this,`onAdd`,async()=>{let{schema:e}=this.props,t=JSON.parse(JSON.stringify(this.state.value)),n={};if(e.items)for(let r of e.items){let e;e=r.defaultFunc?this.props.custom?r.defaultFunc?await this.executeCustom(r.defaultFunc,this.props.data,this.props.customObj,this.props.oContext.instanceObj,t.length,this.props.data):this.props.schema.default:r.defaultFunc?await this.execute(r.defaultFunc,this.props.schema.default,this.props.data,t.length,this.props.data):this.props.schema.default:r.default??null,r.attr&&(n[r.attr]=e)}t.push(n),this.setState({value:t},()=>this.applyFilter(!1,void 0,()=>this.onChangeWrapper(t)))}),G(this,`applyFilter`,(t,n,r)=>{n||=this.state.value;let i=n.map((e,t)=>t);if(Object.keys(this.filterRefs).forEach(r=>{let a=e.getFilterValue(this.filterRefs[r]);if(!t&&a){var o;a=a.toLowerCase();let e=(o=this.state.filterLabelMap)==null?void 0:o[r];i=i==null?void 0:i.filter(t=>{if(!n[t]||n[t][r]==null)return!1;if(n[t][r].toString().toLowerCase().includes(a))return!0;if(e){let i=e[n[t][r]];if(i!=null&&i.toLowerCase().includes(a))return!0}return!1})}else this.filterRefs[r].current&&e.setFilterValue(this.filterRefs[r],``)}),i&&i.length===n.length&&(i=null),i==null&&this.state.visibleValue===null){r==null||r();return}JSON.stringify(i)===JSON.stringify(this.state.visibleValue)?r&&r():this.setState({visibleValue:i},()=>r&&r())}),this.filterRefs={},this.props.schema.items||=[],this.props.schema.items=this.props.schema.items.filter(e=>q.isHostAllowed(e,this.props.oContext.hostInfo)),this.props.schema.items.forEach(e=>{e.filter&&e.attr&&(this.filterRefs[e.attr]=c())}),this.refDiv=p.createRef()}async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr)||[],t;if(t=this.props.schema.objKeyName?Ei(e,this.props.schema.objKeyName,this.props.schema.objValueName):e,Array.isArray(t)||(t=[]),this.props.schema.encryptedAttributes){var n;let t;try{t=this.props.oContext.socket.getCompactSystemConfig?await this.props.oContext.socket.getCompactSystemConfig():await this.getCachedObject(`system.config`)}catch(e){console.error(`Cannot get system configuration: ${e}`)}this.secret=(t==null||(n=t.native)==null?void 0:n.secret)||this.secret,e.forEach(e=>{var t;(t=this.props.schema.encryptedAttributes)==null||t.forEach(t=>{e[t]||=ki(this.secret,e[t])})})}let r=window.localStorage.getItem(`table.collapsed.${this.props.oContext.instance}.${this.props.attr}`),i=[];if(r)try{i=JSON.parse(r)}catch{}this.setState({value:t,visibleValue:null,orderBy:``,order:`asc`,iteration:0,filterOn:[],width:0,tableErrors:{},collapsed:i,filterLabelMap:{}},()=>this.validateUniqueProps())}componentWillUnmount(){this.typingTimer&&=(clearTimeout(this.typingTimer),null),this.resizeTimeout&&=(clearTimeout(this.resizeTimeout),null),this.refreshBecauseOfHiddenElements&&=(clearTimeout(this.refreshBecauseOfHiddenElements),null),super.componentWillUnmount()}itemTable(e,t,n,r){var i;let{schema:a}=this.props,o=(i=a.items)==null?void 0:i.find(t=>t.attr===e);if(!o)return null;let s={items:{[e]:o}};return p.createElement(Pc,{oContext:this.props.oContext,alive:this.props.alive,arrayIndex:n,changed:this.props.changed,common:this.props.common,expertMode:this.props.expertMode,custom:!0,data:t,globalData:this.props.data,index:n+this.state.iteration,onChange:(e,t)=>{let r=JSON.parse(JSON.stringify(this.state.value));r[n][e]=t,this.setState({value:r},()=>{this.validateUniqueProps(),this.onChangeWrapper(r,!0)})},onError:this.onTableRowError(n),originalData:this.props.originalData,schema:s,table:!0,themeName:this.props.themeName,onFilterLabelUpdate:(e,t)=>{let n=this.state.filterLabelMap[e],r={...n,...t};JSON.stringify(n)!==JSON.stringify(r)&&this.setState(t=>({filterLabelMap:{...t.filterLabelMap,[e]:r}}))},customComponents:this.props.customComponents,onHiddenChanged:r?(e,t)=>{if(t)this.listOfHiddenElements[n]||=[],this.listOfHiddenElements[n].includes(e)||(this.listOfHiddenElements[n].push(e),this.refreshBecauseOfHiddenElements&&clearTimeout(this.refreshBecauseOfHiddenElements),this.refreshBecauseOfHiddenElements=setTimeout(()=>{this.forceUpdate()},100));else if(this.listOfHiddenElements[n]){let t=this.listOfHiddenElements[n].indexOf(e);t!==-1&&(this.listOfHiddenElements[n].splice(t,1),this.refreshBecauseOfHiddenElements&&clearTimeout(this.refreshBecauseOfHiddenElements),this.refreshBecauseOfHiddenElements=setTimeout(()=>{this.forceUpdate()},100))}}:void 0})}validateUniqueProps(){if(!this.props.schema.uniqueColumns)return;let e=null,t=null;for(let n of this.props.schema.uniqueColumns){let r=[];this.state.value.find(i=>{let a=i[n];return r.includes(a)?(e||(e=n,t=a),this.onError(n,`is not unique`),!0):(r.push(a),!1)})||this.onError(n)}e?this.setState({errorMessage:W.t(`jc_Non-allowed duplicate entry "%s" in column "%s"`,t,e)}):this.setState({errorMessage:``})}static descendingComparator(e,t,n){return t[n]<e[n]?-1:+(t[n]>e[n])}static getComparator(t,n){return t===`desc`?(t,r)=>e.descendingComparator(t,r,n):(t,r)=>-e.descendingComparator(t,r,n)}static getFilterValue(e){var t;return e==null||(t=e.current)==null||(t=t.children[0])==null||(t=t.children[0])==null?void 0:t.value}static setFilterValue(e,t){e.current&&(e.current.children[0].children[0].value=t)}renderShowHideFilter(t){return!t.filter||!t.attr?null:p.createElement(B,{title:W.t(`jc_Show/hide filter input`),size:`small`,onClick:()=>{let n=[...this.state.filterOn];if(t.attr){let r=this.state.filterOn.indexOf(t.attr);r===-1?n.push(t.attr):n.splice(r,1),this.setState({filterOn:n},()=>{r&&e.getFilterValue(this.filterRefs[t.attr])&&(e.setFilterValue(this.filterRefs[t.attr],``),this.applyFilter())})}}},this.state.filterOn.includes(t.attr)?p.createElement(At,null):p.createElement(de,null))}renderImportExportButtons(e){return p.createElement(p.Fragment,null,!e.noDelete&&e.import?p.createElement(A,{title:W.t(`jc_Import data from %s file`,`CSV`),slotProps:{popper:{sx:J.tooltip}}},p.createElement(B,{size:`small`,onClick:()=>this.setState({showImportDialog:!0})},p.createElement(we,null))):null,e.export?p.createElement(A,{title:W.t(`jc_Export data to %s file`,`CSV`),slotProps:{popper:{sx:J.tooltip}}},p.createElement(B,{size:`small`,onClick:()=>this.onExport()},p.createElement(Ce,null))):null,e.noDelete?null:p.createElement(B,{disabled:!0,size:`small`},p.createElement(pe,null)))}renderAddButton(e){return p.createElement(A,{title:e?W.t(`jc_Cannot add items with set filter`):W.t(`jc_Add row`),slotProps:{popper:{sx:J.tooltip}}},p.createElement(`span`,null,p.createElement(B,{size:`small`,color:`primary`,disabled:!!e&&!this.props.schema.allowAddByFilter,onClick:this.onAdd},p.createElement(ye,null))))}enhancedTableHead(e,t){var n;let{schema:r}=this.props,{order:i,orderBy:a}=this.state;return p.createElement(Me,null,p.createElement(se,null,(n=r.items)==null?void 0:n.map((e,n)=>this.renderOneFilter({schema:r,style:{width:e.width},showAddButton:!n&&!r.noDelete,headCell:e,order:i,orderBy:a,index:n,doAnyFilterSet:t})),!r.noDelete&&p.createElement(K,{style:{paddingLeft:20,paddingRight:20,width:e,textAlign:`right`},padding:`checkbox`},this.renderImportExportButtons(r))))}onExport(){var e;let{schema:t}=this.props,{value:n}=this.state,r=(e=t.items)==null?void 0:e.map(e=>e.attr),i=r?[r.join(`;`)]:[];n.forEach(e=>{var n;let r=[];(n=t.items)==null||n.forEach(t=>{t.attr&&(e[t.attr]&&typeof e[t.attr]==`string`&&e[t.attr].includes(`;`)?r.push(`"${e[t.attr]}"`):r.push(e[t.attr]??``))}),i.push(r.join(`;`))});let a=document.createElement(`a`);a.setAttribute(`href`,`data:text/csv;charset=utf-8,${encodeURIComponent(i.join(`
|
|
17
|
-
`))}`);let o=new Date;a.setAttribute(`download`,`${o.getFullYear()}_${(o.getMonth()+1).toString().padStart(2,`0`)}_${o.getDate().toString().padStart(2,`0`)}_${this.props.oContext.adapterName}.${this.props.oContext.instance}_${this.props.attr}.csv`),a.style.display=`none`,document.body.appendChild(a),a.click(),document.body.removeChild(a)}onImport(e){let t=e.split(`
|
|
18
|
-
`).map(e=>e.replace(`\r`,``).trim()),{schema:n}=this.props,r=((t==null?void 0:t.shift())||``).split(`;`).filter(e=>{var t;return e&&((t=n.items)==null?void 0:t.find(t=>t.attr===e))}),i=[];if(t.forEach(e=>{let t=e.split(`;`),n={};for(let e=0;e<t.length;e++){let i=t[e];if(i.startsWith(`"`)){for(i=i.substring(1);e<t.length&&!i.endsWith(`"`);)i+=`;${t[++e]}`;i=i.substring(0,i.length-1)}let o=i;if(i===`true`)o=!0;else if(i===`false`)o=!1;else if(window.isFinite(i)){var a;let t=(a=this.props.schema.items)==null?void 0:a.find(t=>t.attr===r[e]);o=t&&t.type===`number`?parseFloat(i):i}else o=i;n[r[e]]=o}i.push(n)}),i.length){var a;(a=this.state.value)!=null&&a.length?this.setState({showTypeOfImportDialog:i,showImportDialog:!1}):this.setState({value:i,showImportDialog:!1})}else window.alert(`jc_No data found in file`)}isAnyFilterSet(){return!!Object.keys(this.filterRefs).find(t=>e.getFilterValue(this.filterRefs[t]))}onMoveUp(e){let t=JSON.parse(JSON.stringify(this.state.value)),n=t[e];t.splice(e,1),t.splice(e-1,0,n),this.setState({value:t,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,void 0,()=>this.onChangeWrapper(t)))}onMoveDown(e){let t=JSON.parse(JSON.stringify(this.state.value)),n=t[e];t.splice(e,1),t.splice(e+1,0,n),this.setState({value:t,iteration:this.state.iteration+1e4},()=>this.applyFilter(!1,void 0,()=>this.onChangeWrapper(t)))}onDrop(e){let t=e[0],n=new FileReader;n.onabort=()=>console.log(`file reading was aborted`),n.onerror=()=>console.log(`file reading has failed`),n.onload=()=>{if(t.size>Ti){window.alert(W.t(`jc_File is too big. Max %sk allowed. Try use SVG.`,Math.round(Ti/1024)));return}let e=new Uint8Array(n.result).reduce((e,t)=>e+String.fromCharCode(t),``);this.onImport(e)},n.readAsArrayBuffer(t)}showTypeOfImportDialog(){return this.state.showTypeOfImportDialog?p.createElement(Tt,{open:!0,onClose:()=>this.setState({showTypeOfImportDialog:!1}),maxWidth:`md`},p.createElement(Vt,null,W.t(`jc_Append or replace?`)),p.createElement(qe,null,W.t(`jc_Append %s entries or replace existing?`,this.state.showTypeOfImportDialog.length)),p.createElement(It,null,p.createElement(h,{variant:`contained`,color:`primary`,autoFocus:!0,onClick:()=>{let e=JSON.parse(JSON.stringify(this.state.value));this.state.showTypeOfImportDialog.forEach(t=>e.push(t)),this.setState({value:e,iteration:this.state.iteration+1e4,showTypeOfImportDialog:!1},()=>this.applyFilter(!1,void 0,()=>this.onChangeWrapper(e)))}},W.t(`jc_Append`)),p.createElement(h,{variant:`contained`,color:`secondary`,autoFocus:!0,onClick:()=>{let e=this.state.showTypeOfImportDialog;this.setState({value:e,iteration:this.state.iteration+1e4,showTypeOfImportDialog:!1},()=>this.applyFilter(!1,void 0,()=>this.onChangeWrapper(e)))}},W.t(`jc_Replace`)))):null}showImportDialog(){return this.state.showImportDialog?p.createElement(Tt,{open:!0,onClose:()=>this.setState({showImportDialog:!1}),sx:{"& .MuiDialog-paper":{minHeight:500}},maxWidth:`md`,fullWidth:!0},p.createElement(Vt,null,W.t(`jc_Import from %s`,`CSV`)),p.createElement(qe,null,p.createElement(Yt,{multiple:!1,accept:{"text/csv":[`.csv`]},maxSize:Ti,onDragEnter:()=>this.setState({uploadFile:`dragging`}),onDragLeave:()=>this.setState({uploadFile:!0}),onDrop:(e,t)=>{if(this.setState({uploadFile:!1}),e.length)this.onDrop(e);else{var n;window.alert((t==null||(n=t[0])==null||(n=n.errors)==null||(n=n[0])==null?void 0:n.message)||W.t(`jc_Cannot upload`))}}},({getRootProps:e,getInputProps:t})=>p.createElement(`div`,{style:{...J.uploadDiv,...this.state.uploadFile===`dragging`?J.uploadDivDragging:void 0,...J.dropZone,...this.state.icon?void 0:J.dropZoneEmpty},...e()},p.createElement(`input`,{...t()}),p.createElement(`div`,{style:J.uploadCenterDiv},p.createElement(`div`,{style:J.uploadCenterTextAndIcon},p.createElement(we,{style:J.uploadCenterIcon}),p.createElement(`div`,{style:J.uploadCenterText},this.state.uploadFile===`dragging`?W.t(`jc_Drop file here`):W.t(`jc_Place your files here or click here to open the browse dialog`))))))),p.createElement(It,null,p.createElement(h,{variant:`contained`,onClick:()=>this.setState({showImportDialog:!1}),color:`primary`,startIcon:p.createElement(ge,null)},W.t(`jc_Cancel`)))):null}renderOneFilter(t){return p.createElement(K,{key:`${t.headCell.attr}_${t.index}`,style:t.style,align:`left`,sortDirection:t.orderBy===t.headCell.attr&&t.order},p.createElement(`div`,{style:{...J.flex,...t.schema.showFirstAddOnTop?{flexDirection:`column`}:void 0}},t.showAddButton?this.renderAddButton(t.doAnyFilterSet):null,t.headCell.sort&&p.createElement(L,{active:!0,style:t.orderBy===t.headCell.attr?void 0:J.silver,direction:t.orderBy===t.headCell.attr?t.order:`asc`,onClick:()=>t.headCell.attr&&this.handleRequestSort(t.headCell.attr)}),t.headCell.filter&&t.headCell.attr&&this.state.filterOn.includes(t.headCell.attr)?p.createElement(O,{variant:`standard`,ref:this.filterRefs[t.headCell.attr],onChange:()=>this.applyFilter(),title:W.t(`jc_You can filter entries by entering here some text`),slotProps:{input:{endAdornment:e.getFilterValue(this.filterRefs[t.headCell.attr])&&p.createElement(Te,{position:`end`},p.createElement(B,{size:`small`,tabIndex:-1,onClick:()=>{e.setFilterValue(this.filterRefs[t.headCell.attr],``),this.applyFilter()}},p.createElement(ge,null)))}},fullWidth:!0,placeholder:this.getText(t.headCell.title)}):p.createElement(`span`,{style:J.headerText},this.getText(t.headCell.title)),this.renderShowHideFilter(t.headCell)))}enhancedFilterCard(){var e;let{schema:t}=this.props,{order:n,orderBy:r}=this.state,i;this.props.schema.compact&&(i={paddingTop:1,paddingBottom:1});let a=!t.noDelete&&t.import||t.export;if(a||(e=t.items)!=null&&e.find(e=>e.sort||e.filter)){var o;return p.createElement(Wt,{size:{xs:t.xs||12,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0}},p.createElement(Qe,null,p.createElement(he,{style:J.paper},p.createElement(xe,{style:J.paper},p.createElement(Xe,{expandIcon:p.createElement(je,null)},p.createElement(Re,null,W.t(`jc_Filter and Data Actions`))),p.createElement(lt,null,p.createElement(me,null,p.createElement(I,null,((o=t.items)==null?void 0:o.find(e=>e.sort||e.filter))&&t.items.map((e,a)=>p.createElement(se,{key:`${e.attr}_${a}`},this.renderOneFilter({schema:t,style:i,showAddButton:!1,headCell:e,order:n,orderBy:r,index:a,doAnyFilterSet:!1}))),a?p.createElement(se,null,p.createElement(K,{align:`left`,style:i},p.createElement(`span`,{style:J.headerText},W.t(`jc_Actions`))),p.createElement(K,{style:i},this.renderImportExportButtons(t))):null)))))))}return null}enhancedBottomCard(){var e;let{schema:t}=this.props,n;this.props.schema.compact&&(n={paddingTop:1,paddingBottom:1});let r=this.isAnyFilterSet();return p.createElement(Wt,{size:{xs:t.xs||12,sm:t.sm||void 0,md:t.md||void 0,lg:t.lg||void 0,xl:t.xl||void 0}},p.createElement(Qe,null,p.createElement(he,{style:J.paper},p.createElement(me,null,p.createElement(I,null,p.createElement(se,null,p.createElement(K,{colSpan:(((e=t.items)==null?void 0:e.length)||0)+1,style:n},this.renderAddButton(r))))))))}renderCards(){let{schema:e}=this.props,{visibleValue:t}=this.state,n;this.props.schema.compact&&(n={paddingTop:1,paddingBottom:1});let r={padding:0,borderBottom:`none`};t||=this.state.value.map((e,t)=>t);let i=this.isAnyFilterSet();return p.createElement(Wt,{container:!0},this.showImportDialog(),this.showTypeOfImportDialog(),this.enhancedFilterCard(),t.map((a,o)=>{var s,c,l;return p.createElement(Wt,{key:`${a}_${o}`,size:{xs:e.xs||12,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0}},p.createElement(Qe,{sx:this.state.tableErrors[a]?{outline:`1px solid red`}:void 0},p.createElement(he,{style:J.paper},this.props.schema.titleAttribute?p.createElement(R,{sx:J.cardHeader},p.createElement(`div`,null,this.state.value[a][this.props.schema.titleAttribute]),p.createElement(`div`,null,!i&&!this.state.orderBy?p.createElement(A,{title:W.t(`jc_Move up`),slotProps:{popper:{sx:J.tooltip}}},p.createElement(`span`,null,p.createElement(B,{size:`small`,onClick:()=>this.onMoveUp(a),disabled:o===0},p.createElement(Ht,null)))):null,!i&&!this.state.orderBy?p.createElement(A,{title:W.t(`jc_Move down`),slotProps:{popper:{sx:J.tooltip}}},p.createElement(`span`,null,p.createElement(B,{size:`small`,onClick:()=>this.onMoveDown(a),disabled:o===t.length-1},p.createElement(Et,null)))):null,p.createElement(A,{title:W.t(`jc_Delete current row`),slotProps:{popper:{sx:J.tooltip}}},p.createElement(B,{size:`small`,onClick:this.onDelete(a)},p.createElement(pe,null))),this.props.schema.clone?p.createElement(A,{title:W.t(`jc_Clone current row`),slotProps:{popper:{sx:J.tooltip}}},p.createElement(B,{size:`small`,onClick:this.onClone(a)},p.createElement(ce,null))):null,p.createElement(A,{title:W.t(`jc_Expand/Collapse card`),slotProps:{popper:{sx:J.tooltip}}},p.createElement(B,{size:`small`,onClick:()=>{let e=[...this.state.collapsed],t=e.indexOf(a);t===-1?e.push(a):e.splice(t,1),window.localStorage.setItem(`table.collapsed.${this.props.oContext.instance}.${this.props.attr}`,JSON.stringify(e)),this.setState({collapsed:e})}},p.createElement(je,{style:{rotate:(s=this.state.collapsed)!=null&&s.includes(a)?`0deg`:`180deg`,transition:`0.3s`,transitionProperty:`rotate`}}))))):null,p.createElement(Ue,{in:!((c=this.state.collapsed)!=null&&c.includes(a)),timeout:`auto`,unmountOnExit:!0},p.createElement(me,null,p.createElement(I,null,(l=e.items)==null?void 0:l.map(e=>{var t;let i=e.attr&&((t=this.listOfHiddenElements)==null||(t=t[a])==null?void 0:t.includes(e.attr));return p.createElement(se,{key:`${e.attr}_${a}`},p.createElement(K,{align:`left`,style:i?r:n},i?null:p.createElement(`span`,{style:J.headerText},this.getText(e.title))),p.createElement(K,{align:`left`,style:i?r:n},e.attr&&this.itemTable(e.attr,this.state.value[a],a,!0)))}),!this.props.schema.titleAttribute&&!e.noDelete&&p.createElement(se,null,p.createElement(K,{align:`left`,style:n},p.createElement(`span`,{style:J.headerText},this.getText(`Actions`))),p.createElement(K,{align:`left`,style:n},!i&&!this.state.orderBy?p.createElement(A,{title:W.t(`jc_Move up`),slotProps:{popper:{sx:J.tooltip}}},p.createElement(`span`,null,p.createElement(B,{size:`small`,onClick:()=>this.onMoveUp(a),disabled:o===0},p.createElement(Ht,null)))):null,!i&&!this.state.orderBy?p.createElement(A,{title:W.t(`jc_Move down`),slotProps:{popper:{sx:J.tooltip}}},p.createElement(`span`,null,p.createElement(B,{size:`small`,onClick:()=>this.onMoveDown(a),disabled:o===t.length-1},p.createElement(Et,null)))):null,p.createElement(A,{title:W.t(`jc_Delete current row`),slotProps:{popper:{sx:J.tooltip}}},p.createElement(B,{size:`small`,onClick:this.onDelete(a)},p.createElement(pe,null))),this.props.schema.clone?p.createElement(A,{title:W.t(`jc_Clone current row`),slotProps:{popper:{sx:J.tooltip}}},p.createElement(B,{size:`small`,onClick:this.onClone(a)},p.createElement(ce,null))):null))))))))}),this.enhancedBottomCard())}renderTable(){var e;let{schema:t}=this.props,{visibleValue:n}=this.state;n||=this.state.value.map((e,t)=>t);let r=this.isAnyFilterSet(),i;return this.props.schema.compact&&(i={paddingTop:1,paddingBottom:1}),p.createElement(he,{style:J.paper},this.showImportDialog(),this.showTypeOfImportDialog(),t.label?p.createElement(`div`,{style:J.label},p.createElement(jt,{variant:`dense`,style:J.rootTool},p.createElement(Re,{style:J.title,variant:`h6`,id:`tableTitle`,component:`div`},this.getText(t.label)))):null,p.createElement(ee,null,p.createElement(me,{style:J.table,size:`small`},this.enhancedTableHead(!r&&!this.state.orderBy?120:64,r),p.createElement(I,null,n.map((e,a)=>{var o;return p.createElement(se,{hover:!0,key:`${e}_${a}`,sx:this.state.tableErrors[e]?{outline:`1px solid red`}:void 0},(o=t.items)==null?void 0:o.map(t=>p.createElement(K,{key:`${t.attr}_${e}`,align:`left`,style:i},t.attr&&this.itemTable(t.attr,this.state.value[e],e,!1))),!t.noDelete&&p.createElement(K,{align:`left`,style:{...i,...J.buttonCell}},!r&&!this.state.orderBy?a?p.createElement(A,{title:W.t(`jc_Move up`),slotProps:{popper:{sx:J.tooltip}}},p.createElement(B,{size:`small`,onClick:()=>this.onMoveUp(e)},p.createElement(Ht,null))):p.createElement(`div`,{style:J.buttonEmpty}):null,!r&&!this.state.orderBy?a<n.length-1?p.createElement(A,{title:W.t(`jc_Move down`),slotProps:{popper:{sx:J.tooltip}}},p.createElement(B,{size:`small`,onClick:()=>this.onMoveDown(e)},p.createElement(Et,null))):p.createElement(`div`,{style:J.buttonEmpty}):null,p.createElement(A,{title:W.t(`jc_Delete current row`),slotProps:{popper:{sx:J.tooltip}}},p.createElement(B,{size:`small`,onClick:this.onDelete(e)},p.createElement(pe,null))),this.props.schema.clone?p.createElement(A,{title:W.t(`jc_Clone current row`),slotProps:{popper:{sx:J.tooltip}}},p.createElement(B,{size:`small`,onClick:this.onClone(e)},p.createElement(ce,null))):null))}),!t.noDelete&&n.length>=(t.showSecondAddAt||5)?p.createElement(se,null,p.createElement(K,{colSpan:(((e=t.items)==null?void 0:e.length)||0)+1,style:{...i}},this.renderAddButton(r))):null)),!n.length&&this.state.value.length?p.createElement(`div`,{style:J.filteredOut},p.createElement(Re,{style:J.title,variant:`h6`,id:`tableTitle`,component:`div`},W.t(`jc_All items are filtered out`),p.createElement(B,{size:`small`,onClick:()=>this.applyFilter(!0)},p.createElement(ge,null)))):null),t.help?p.createElement(V,{style:{paddingLeft:16}},this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null,this.state.errorMessage?p.createElement(`div`,{style:{display:`flex`,padding:`5px`}},p.createElement(C,{color:`error`}),p.createElement(`span`,{style:{color:`red`,alignSelf:`center`}},this.state.errorMessage)):null)}componentDidUpdate(){var e;(e=this.refDiv.current)!=null&&e.clientWidth&&this.refDiv.current.clientWidth!==this.state.width&&(this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{var e;this.resizeTimeout=null,(e=this.refDiv.current)!=null&&e.clientWidth&&this.setState({width:this.refDiv.current.clientWidth})},50))}getCurrentBreakpoint(){return this.state.width?this.state.width<600?`xs`:this.state.width<900?`sm`:this.state.width<1200?`md`:this.state.width<1536?`lg`:`xl`:`md`}renderItem(){let{schema:e}=this.props;if(!this.state.value||!Array.isArray(this.state.value))return null;let t=this.getCurrentBreakpoint(),n=null;return n=t&&(e.useCardFor||[`xs`]).includes(t)?this.renderCards():this.renderTable(),p.createElement(`div`,{ref:this.refDiv,style:{width:`100%`}},n)}};f();var ji={indeterminate:{opacity:.5},label:{width:`100%`,fontSize:14,marginBottom:2},helper:{width:`100%`,fontSize:12},error:{width:`100%`,fontSize:12,color:`#FF0000`}},Mi=class extends q{constructor(...e){super(...e),G(this,`updateTimeout`,null)}async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr);if(Array.isArray(e)&&this.props.oContext.multiEdit){e=q.DIFFERENT_VALUE,this.setState({value:e,oldValue:e,jsonError:!1});return}this.setState({value:e,oldValue:e,jsonError:this.validateJson(e)})}validateJson(e){let t=!1;if(this.props.schema.validateJson&&(e||!this.props.schema.allowEmpty))try{JSON.parse(e)}catch(e){console.log(`Error in JSON`,e),t=!0}return t}static getDerivedStateFromProps(e,t){if(e.oContext.multiEdit&&t.value===q.DIFFERENT_VALUE)return{value:q.DIFFERENT_VALUE};let n=q.getValue(e.data,e.attr);return n!=null&&(n=n.toString()),n==null||n!==t.value&&n!==t.oldValue?{value:n}:null}renderItem(e,t){let n=Array.isArray(this.state.value)||this.state.value===q.DIFFERENT_VALUE;if(this.props.schema.time){let n=``;return typeof this.state.value==`number`?n=this.state.value&&this.state.value<9466596e5?new Date(this.state.value*1e3).toLocaleString():new Date(this.state.value).toLocaleString():typeof this.state.value==`string`&&(n=new Date(this.state.value).toLocaleString()),p.createElement(O,{variant:`standard`,fullWidth:!0,value:n,error:!!e||!!this.state.jsonError,disabled:!!t,slotProps:{htmlInput:{readOnly:!0}},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}if(this.state.oldValue==null?this.updateTimeout&&=(clearTimeout(this.updateTimeout),null):(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=null,this.setState({oldValue:void 0})},30)),n){let n=q.getValue(this.props.data,this.props.attr),r=(n==null?void 0:n.filter(e=>e||e===0).map(e=>({label:e.toString()||``,value:e})))||[];return r.unshift({label:W.t(q.DIFFERENT_LABEL),value:q.DIFFERENT_VALUE}),p.createElement(ft,{style:ji.indeterminate,fullWidth:!0,value:r[0],onChange:(e,t)=>{let n=t?t.value:``,r=this.onChange(this.props.attr,n,()=>{this.setState({value:n,oldValue:n,jsonError:this.validateJson(t)})});r instanceof Promise&&r.catch(e=>console.error(`Cannot set value: ${e}`))},options:r,getOptionLabel:e=>e.label,renderInput:n=>p.createElement(O,{variant:`standard`,...n,error:!!e,placeholder:this.getText(this.props.schema.placeholder),slotProps:{...n.slotProps,htmlInput:{...n.slotProps.htmlInput,maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.props.schema.readOnly||!1}},label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),disabled:!!t})})}let r,i;if((this.props.schema.readOnly||t)&&this.props.schema.copyToClipboard?((this.props.schema.minRows||0)>1&&(i={position:`absolute`,right:3,top:20,zIndex:1e3}),r=p.createElement(B,{tabIndex:-1,style:i,size:`small`,onClick:()=>{z.copyToClipboard(this.state.value),window.alert(W.t(`jc_Copied`))}},p.createElement(Ut,null))):!this.props.schema.readOnly&&!t&&this.state.value&&!this.props.schema.noClearButton&&((this.props.schema.minRows||0)>1&&(i={position:`absolute`,right:3,top:20,zIndex:1e3}),r=p.createElement(B,{style:i,size:`small`,tabIndex:-1,onClick:()=>this.setState({value:``,oldValue:this.state.value},()=>this.onChange(this.props.attr,``))},p.createElement(ge,null)),(this.props.schema.minRows||0)<=1&&(r=p.createElement(Te,{position:`end`},r))),(this.props.schema.minRows||0)>1){let n=this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation);return p.createElement(`div`,{style:{width:`100%`,position:`relative`}},this.props.schema.label?p.createElement(`div`,{style:ji.label},this.getText(this.props.schema.label)):null,p.createElement(fe,{style:{width:`100%`,resize:`vertical`,backgroundColor:this.props.oContext.themeType===`dark`?`#363636`:`#cccccc`,color:this.props.oContext.themeType===`dark`?`#fff`:`#111`},minRows:this.props.schema.minRows,maxRows:this.props.schema.maxRows,value:this.state.value??``,disabled:!!t,readOnly:this.props.schema.readOnly||!1,onChange:e=>{let t=e.target.value;this.setState({value:t,oldValue:this.state.value,jsonError:this.validateJson(t)},()=>this.onChange(this.props.attr,t||``))},placeholder:this.getText(this.props.schema.placeholder)}),n||e||this.state.jsonError?p.createElement(`div`,{style:e?ji.error:ji.helper},e||(this.state.jsonError?W.t(`jc_Invalid JSON`):n)):null)}return p.createElement(O,{variant:`standard`,fullWidth:!0,value:this.state.value??``,error:!!e||!!this.state.jsonError,disabled:!!t,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0,readOnly:this.props.schema.readOnly||!1},input:{endAdornment:r}},onChange:e=>{let t=e.target.value;this.setState({value:t,oldValue:this.state.value,jsonError:this.validateJson(t)},()=>this.onChange(this.props.attr,t))},placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.state.jsonError?W.t(`jc_Invalid JSON`):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}};f();var Ni={fullWidth:{width:`100%`}},Pi=class extends q{constructor(...e){super(...e),G(this,`initialized`,!1),G(this,`localContext`,void 0)}async askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){let t=await this.getPatternAsync(this.props.schema.jsonData,null,!0);try{e=JSON.parse(t)}catch{console.error(`Cannot parse json data: ${t}`)}}e??=null;let t=await this.getPatternAsync(this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);if(t!==`${this.props.oContext.adapterName}.${this.props.oContext.instance}`){let e=await this.props.oContext.socket.getState(`system.adapter.${t}.alive`);if(!(e!=null&&e.val)){window.alert(W.t(`jc_Instance %s is not alive`,t));return}}this.props.oContext.socket.sendTo(t,this.props.schema.command||`send`,e).then(e=>{if(typeof e==`object`){let t=e;this.setState({text:t.text||``,style:t.style,icon:t.icon,iconStyle:t.iconStyle})}else typeof e==`string`&&this.setState({text:e||``})}).catch(e=>console.error(`Cannot send command: ${e}`))}}getLocalContext(){let e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=q.getValue(this.props.data,t)),JSON.stringify(e)}renderItem(){if(this.props.alive){let e=this.getLocalContext();(e!==this.localContext||!this.initialized)&&(this.localContext=e,setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}if(this.state.text===void 0)return null;let e=null;return this.state.icon&&(e=ui(this.state.icon,{marginRight:this.state.text?8:void 0,...this.state.iconStyle||void 0}),e||=p.createElement(gt,{src:this.state.icon,style:{marginRight:this.state.text?8:void 0,...this.state.iconStyle||void 0}})),this.props.schema.container===`text`?p.createElement(O,{variant:`standard`,fullWidth:!0,slotProps:{input:{endAdornment:this.props.schema.copyToClipboard?p.createElement(B,{tabIndex:-1,size:`small`,onClick:()=>{z.copyToClipboard(this.state.text||``),window.alert(W.t(`jc_Copied`))}},p.createElement(Ut,null)):void 0}},value:this.state.text,label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)}):p.createElement(`div`,{style:{...Ni.fullWidth,...this.state.style||void 0}},e,this.props.schema.container===`html`?p.createElement(`span`,{dangerouslySetInnerHTML:{__html:this.state.text||``}}):this.state.text)}};f();var Fi=class extends q{async componentDidMount(){await super.componentDidMount();let e=q.getValue(this.props.data,this.props.attr);this.setState({value:e})}renderItem(e,t){let n=this.props.schema.returnFormat!==`HH:mm:ss`,r=new Date(Date.parse(`Thu, 01 Jan 1970 ${this.state.value||`00:00:00`}`));return p.createElement(nn,{sx:e=>({width:`100%`,borderBottom:`1px solid ${e.palette.text.primary}`,"& fieldset":{display:`none`},"& input":{padding:`${e.spacing(1.5)} 0 4px 0`},"& .MuiInputAdornment-root":{marginLeft:0,marginTop:1},"& label":{transform:`translate(0px, -9px) scale(0.75)`}}),ampm:this.props.oContext.systemConfig.dateFormat.includes(`/`),timeSteps:this.props.schema.timeSteps||this.props.schema.timesteps||{hours:1,minutes:5,seconds:5},format:this.props.schema.format||`HH:mm:ss`,disabled:!!t,value:r,onChange:e=>{let t;t=e instanceof Date?e.toTimeString().split(` `)[0]:``,n&&t&&(t=t.split(`:`).slice(0,2).join(`:`)),this.setState({value:t},()=>this.onChange(this.props.attr,this.state.value))},views:this.props.schema.views||[`hours`,`minutes`,`seconds`],label:this.getText(this.props.schema.label)})}};f();function Ii(e,t){let n;return n=t&&e.substring(0,t.length)===t?e.substring(t.length+1):e,n=n.replace(/\./g,`/`).replace(/_/g,` `),n}var Li=class extends q{async componentDidMount(){var e;await super.componentDidMount();let t=q.getValue(this.props.data,this.props.attr);if(!t&&(e=this.props.customObj)!=null&&e._id){let e=Ii(this.props.customObj._id,`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);this.setState({value:e})}else this.setState({value:t||``})}renderItem(e,t){return p.createElement(O,{variant:`standard`,fullWidth:!0,slotProps:{htmlInput:{maxLength:this.props.schema.maxLength||this.props.schema.max||void 0}},value:this.state.value,error:!!e,disabled:t,placeholder:this.getText(this.props.schema.placeholder),label:this.getText(this.props.schema.label),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation),onChange:e=>{let t=e.target.value;this.setState({value:t},()=>this.onChange(this.props.attr,t))}})}};f();var Ri=class extends q{async componentDidMount(){var e;await super.componentDidMount();let t=await this.getCachedObject(`system.meta.uuid`);this.setState({uuid:(t==null||(e=t.native)==null?void 0:e.uuid)||`unknown`})}renderItem(e,t){return p.createElement(O,{variant:`standard`,fullWidth:!0,error:!!e,disabled:!!t,slotProps:{htmlInput:{readOnly:!0},input:{endAdornment:p.createElement(B,{tabIndex:-1,onClick:()=>{z.copyToClipboard(this.state.uuid||``),window.alert(W.t(`jc_Copied %s`,this.state.uuid))}},p.createElement(ce,null))}},value:this.state.uuid||``,label:this.getText(this.props.schema.label)||W.t(`jc_Serial number (UUID)`),helperText:this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)})}};f();var zi={icon:{width:16,height:16,marginRight:8}},Bi=class extends q{async componentDidMount(){await super.componentDidMount(),this.props.oContext.socket.getUsers().then(e=>{let t={},n=W.getLanguage();this.props.schema.short?e.forEach(e=>{var r,i;return t[e._id]={color:(r=e.common)==null?void 0:r.color,icon:(i=e.common)==null?void 0:i.icon,name:z.getObjectNameFromObj(e,n)}}):e.forEach(e=>{var r,i;return t[e._id.replace(/^system\.user\./,``)]={color:(r=e.common)==null?void 0:r.color,icon:(i=e.common)==null?void 0:i.icon,name:z.getObjectNameFromObj(e,n)}}),this.setState({users:t})}).catch(e=>console.error(`Cannot get users: ${e}`))}renderItem(e,t){var n,r;let i=q.getValue(this.props.data,this.props.attr);return p.createElement(U,{variant:`standard`,fullWidth:!0},this.state.users&&this.props.schema.label?p.createElement(x,null,this.getText(this.props.schema.label)):null,this.state.users?p.createElement(D,{variant:`standard`,error:!!e,disabled:!!t,value:i,renderValue:e=>{var t,n,r;return p.createElement(`span`,null,this.state.users&&(t=this.state.users[e])!=null&&t.icon?p.createElement(gt,{src:this.state.users&&((n=this.state.users[e])==null?void 0:n.icon),style:zi.icon}):null,this.state.users&&((r=this.state.users[e])==null?void 0:r.name)||e||``)},style:{color:this.state.users&&((n=this.state.users[i])==null?void 0:n.color)||void 0,backgroundColor:z.getInvertedColor((r=this.state.users)==null||(r=r[i])==null?void 0:r.color,this.props.oContext.themeType)},onChange:e=>this.onChange(this.props.attr,e.target.value)},this.state.users&&Object.keys(this.state.users).map(e=>p.createElement(H,{style:{color:this.state.users[e].color||void 0,backgroundColor:z.getInvertedColor(this.state.users[e].color,this.props.oContext.themeType)},key:e,value:e},this.state.users[e].icon?p.createElement(gt,{src:this.state.users[e].icon,style:zi.icon}):null,this.state.users[e].name))):p.createElement(O,{variant:`standard`,error:!!e,disabled:!!t,value:i,onChange:e=>this.props.attr&&this.onChange(this.props.attr,e.target.value),label:this.getText(this.props.schema.label)}),this.props.schema.help?p.createElement(V,null,this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}},Vi=Symbol.for(`yaml.alias`),Hi=Symbol.for(`yaml.document`),Ui=Symbol.for(`yaml.map`),Wi=Symbol.for(`yaml.pair`),Gi=Symbol.for(`yaml.scalar`),Ki=Symbol.for(`yaml.seq`),qi=Symbol.for(`yaml.node.type`),Ji=e=>!!e&&typeof e==`object`&&e[qi]===Vi,Yi=e=>!!e&&typeof e==`object`&&e[qi]===Hi,Xi=e=>!!e&&typeof e==`object`&&e[qi]===Ui,Y=e=>!!e&&typeof e==`object`&&e[qi]===Wi,X=e=>!!e&&typeof e==`object`&&e[qi]===Gi,Zi=e=>!!e&&typeof e==`object`&&e[qi]===Ki;function Z(e){if(e&&typeof e==`object`)switch(e[qi]){case Ui:case Ki:return!0}return!1}function Q(e){if(e&&typeof e==`object`)switch(e[qi]){case Vi:case Ui:case Gi:case Ki:return!0}return!1}var Qi=e=>(X(e)||Z(e))&&!!e.anchor,$i=Symbol(`break visit`),ea=Symbol(`skip children`),ta=Symbol(`remove node`);function na(e,t){let n=ia(t);Yi(e)?ra(null,e.contents,n,Object.freeze([e]))===ta&&(e.contents=null):ra(null,e,n,Object.freeze([]))}na.BREAK=$i,na.SKIP=ea,na.REMOVE=ta;function ra(e,t,n,r){let i=aa(e,t,n,r);if(Q(i)||Y(i))return oa(e,r,i),ra(e,i,n,r);if(typeof i!=`symbol`){if(Z(t)){r=Object.freeze(r.concat(t));for(let e=0;e<t.items.length;++e){let i=ra(e,t.items[e],n,r);if(typeof i==`number`)e=i-1;else if(i===$i)return $i;else i===ta&&(t.items.splice(e,1),--e)}}else if(Y(t)){r=Object.freeze(r.concat(t));let e=ra(`key`,t.key,n,r);if(e===$i)return $i;e===ta&&(t.key=null);let i=ra(`value`,t.value,n,r);if(i===$i)return $i;i===ta&&(t.value=null)}}return i}function ia(e){return typeof e==`object`&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function aa(e,t,n,r){var i,a,o,s,c;if(typeof n==`function`)return n(e,t,r);if(Xi(t))return(i=n.Map)==null?void 0:i.call(n,e,t,r);if(Zi(t))return(a=n.Seq)==null?void 0:a.call(n,e,t,r);if(Y(t))return(o=n.Pair)==null?void 0:o.call(n,e,t,r);if(X(t))return(s=n.Scalar)==null?void 0:s.call(n,e,t,r);if(Ji(t))return(c=n.Alias)==null?void 0:c.call(n,e,t,r)}function oa(e,t,n){let r=t[t.length-1];if(Z(r))r.items[e]=n;else if(Y(r))e===`key`?r.key=n:r.value=n;else if(Yi(r))r.contents=n;else{let e=Ji(r)?`alias`:`scalar`;throw Error(`Cannot replace node with ${e} parent`)}}var sa={"!":`%21`,",":`%2C`,"[":`%5B`,"]":`%5D`,"{":`%7B`,"}":`%7D`},ca=e=>e.replace(/[!,[\]{}]/g,e=>sa[e]),la=class e{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},e.defaultYaml,t),this.tags=Object.assign({},e.defaultTags,n)}clone(){let t=new e(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){let t=new e(this.yaml,this.tags);switch(this.yaml.version){case`1.1`:this.atNextDocument=!0;break;case`1.2`:this.atNextDocument=!1,this.yaml={explicit:e.defaultYaml.explicit,version:`1.2`},this.tags=Object.assign({},e.defaultTags)}return t}add(t,n){this.atNextDocument&&=(this.yaml={explicit:e.defaultYaml.explicit,version:`1.1`},this.tags=Object.assign({},e.defaultTags),!1);let r=t.trim().split(/[ \t]+/),i=r.shift();switch(i){case`%TAG`:{if(r.length!==2&&(n(0,`%TAG directive should contain exactly two parts`),r.length<2))return!1;let[e,t]=r;return this.tags[e]=t,!0}case`%YAML`:{if(this.yaml.explicit=!0,r.length!==1)return n(0,`%YAML directive should contain exactly one part`),!1;let[e]=r;if(e===`1.1`||e===`1.2`)return this.yaml.version=e,!0;{let t=/^\d+\.\d+$/.test(e);return n(6,`Unsupported YAML version ${e}`,t),!1}}default:return n(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e===`!`)return`!`;if(e[0]!==`!`)return t(`Not a valid tag: ${e}`),null;if(e[1]===`<`){let n=e.slice(2,-1);return n===`!`||n===`!!`?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==`>`&&t(`Verbatim tags must end with a >`),n)}let[,n,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);let i=this.tags[n];if(i)try{return i+decodeURIComponent(r)}catch(e){return t(String(e)),null}return n===`!`?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(let[t,n]of Object.entries(this.tags))if(e.startsWith(n))return t+ca(e.substring(n.length));return e[0]===`!`?e:`!<${e}>`}toString(e){let t=this.yaml.explicit?[`%YAML ${this.yaml.version||`1.2`}`]:[],n=Object.entries(this.tags),r;if(e&&n.length>0&&Q(e.contents)){let t={};na(e.contents,(e,n)=>{Q(n)&&n.tag&&(t[n.tag]=!0)}),r=Object.keys(t)}else r=[];for(let[i,a]of n)(i!==`!!`||a!==`tag:yaml.org,2002:`)&&(!e||r.some(e=>e.startsWith(a)))&&t.push(`%TAG ${i} ${a}`);return t.join(`
|
|
19
|
-
`)}};la.defaultYaml={explicit:!1,version:`1.2`},la.defaultTags={"!!":`tag:yaml.org,2002:`};function ua(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){let t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw Error(t)}return!0}function da(e){let t=new Set;return na(e,{Value(e,n){n.anchor&&t.add(n.anchor)}}),t}function fa(e,t){for(let n=1;;++n){let r=`${e}${n}`;if(!t.has(r))return r}}function pa(e,t){let n=[],r=new Map,i=null;return{onAnchor:r=>{n.push(r),i??=da(e);let a=fa(t,i);return i.add(a),a},setAnchors:()=>{for(let e of n){let t=r.get(e);if(typeof t==`object`&&t.anchor&&(X(t.node)||Z(t.node)))t.node.anchor=t.anchor;else{let t=Error(`Failed to resolve repeated object (this should not happen)`);throw t.source=e,t}}},sourceObjects:r}}function ma(e,t,n,r){if(r&&typeof r==`object`){if(Array.isArray(r))for(let t=0,n=r.length;t<n;++t){let n=r[t],i=ma(e,r,String(t),n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}else if(r instanceof Map)for(let t of Array.from(r.keys())){let n=r.get(t),i=ma(e,r,t,n);i===void 0?r.delete(t):i!==n&&r.set(t,i)}else if(r instanceof Set)for(let t of Array.from(r)){let n=ma(e,r,t,t);n===void 0?r.delete(t):n!==t&&(r.delete(t),r.add(n))}else for(let[t,n]of Object.entries(r)){let i=ma(e,r,t,n);i===void 0?delete r[t]:i!==n&&(r[t]=i)}}return e.call(t,n,r)}function ha(e,t,n){if(Array.isArray(e))return e.map((e,t)=>ha(e,String(t),n));if(e&&typeof e.toJSON==`function`){if(!n||!Qi(e))return e.toJSON(t,n);let r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=e=>{r.res=e,delete n.onCreate};let i=e.toJSON(t,n);return n.onCreate&&n.onCreate(i),i}return typeof e==`bigint`&&!(n!=null&&n.keep)?Number(e):e}var ga=class{constructor(e){Object.defineProperty(this,qi,{value:e})}clone(){let e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:n,onAnchor:r,reviver:i}={}){if(!Yi(e))throw TypeError(`A document argument is required`);let a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof n==`number`?n:100},o=ha(this,``,a);if(typeof r==`function`)for(let{count:e,res:t}of a.anchors.values())r(t,e);return typeof i==`function`?ma(i,{"":o},``,o):o}},_a=class extends ga{constructor(e){super(Vi),this.source=e,Object.defineProperty(this,"tag",{set(){throw Error(`Alias nodes cannot have tags`)}})}resolve(e,t){if((t==null?void 0:t.maxAliasCount)===0)throw ReferenceError(`Alias resolution is disabled`);let n;t!=null&&t.aliasResolveCache?n=t.aliasResolveCache:(n=[],na(e,{Node:(e,t)=>{(Ji(t)||Qi(t))&&n.push(t)}}),t&&(t.aliasResolveCache=n));let r;for(let e of n){if(e===this)break;e.anchor===this.source&&(r=e)}if(r&&t){let{anchors:e,doc:n,maxAliasCount:i}=t,a=e.get(r);if(a||=(ha(r,null,t),e.get(r)),(a==null?void 0:a.res)===void 0)throw ReferenceError(`This should not happen: Alias anchor was not resolved?`);if(i>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=va(n,r,e)),a.count*a.aliasCount>i))throw ReferenceError(`Excessive alias count indicates a resource exhaustion attack`)}return r}toJSON(e,t){if(!t)return{source:this.source};let n=this.resolve(t.doc,t);if(!n){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw ReferenceError(e)}return t.anchors.get(n).res}toString(e,t,n){let r=`*${this.source}`;if(e){if(ua(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){let e=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw Error(e)}if(e.implicitKey)return`${r} `}return r}};function va(e,t,n){if(Ji(t)){let r=t.resolve(e),i=n&&r&&n.get(r);return i?i.count*i.aliasCount:0}if(Z(t)){let r=0;for(let i of t.items){let t=va(e,i,n);t>r&&(r=t)}return r}if(Y(t)){let r=va(e,t.key,n),i=va(e,t.value,n);return Math.max(r,i)}return 1}var ya=e=>!e||typeof e!=`function`&&typeof e!=`object`,$=class extends ga{constructor(e){super(Gi),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:ha(this.value,e,t)}toString(){return String(this.value)}};$.BLOCK_FOLDED=`BLOCK_FOLDED`,$.BLOCK_LITERAL=`BLOCK_LITERAL`,$.PLAIN=`PLAIN`,$.QUOTE_DOUBLE=`QUOTE_DOUBLE`,$.QUOTE_SINGLE=`QUOTE_SINGLE`;var ba=`tag:yaml.org,2002:`;function xa(e,t,n){if(t){let e=n.filter(e=>e.tag===t),r=e.find(e=>!e.format)??e[0];if(!r)throw Error(`Tag ${t} not found`);return r}return n.find(t=>{var n;return((n=t.identify)==null?void 0:n.call(t,e))&&!t.format})}function Sa(e,t,n){var r;if(Yi(e)&&(e=e.contents),Q(e))return e;if(Y(e)){var i,a;let t=(i=(a=n.schema[Ui]).createNode)==null?void 0:i.call(a,n.schema,null,n);return t.items.push(e),t}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<`u`&&e instanceof BigInt)&&(e=e.valueOf());let{aliasDuplicateObjects:o,onAnchor:s,onTagObj:c,schema:l,sourceObjects:u}=n,d;if(o&&e&&typeof e==`object`){if(d=u.get(e),d)return d.anchor??(d.anchor=s(e)),new _a(d.anchor);d={anchor:null,node:null},u.set(e,d)}t!=null&&t.startsWith(`!!`)&&(t=ba+t.slice(2));let f=xa(e,t,l.tags);if(!f){if(e&&typeof e.toJSON==`function`&&(e=e.toJSON()),!e||typeof e!=`object`){let t=new $(e);return d&&(d.node=t),t}f=e instanceof Map?l[Ui]:Symbol.iterator in Object(e)?l[Ki]:l[Ui]}c&&(c(f),delete n.onTagObj);let p=f!=null&&f.createNode?f.createNode(n.schema,e,n):typeof(f==null||(r=f.nodeClass)==null?void 0:r.from)==`function`?f.nodeClass.from(n.schema,e,n):new $(e);return t?p.tag=t:f.default||(p.tag=f.tag),d&&(d.node=p),p}function Ca(e,t,n){let r=n;for(let e=t.length-1;e>=0;--e){let n=t[e];if(typeof n==`number`&&Number.isInteger(n)&&n>=0){let e=[];e[n]=r,r=e}else r=new Map([[n,r]])}return Sa(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw Error(`This should not happen, please report a bug.`)},schema:e,sourceObjects:new Map})}var wa=e=>e==null||typeof e==`object`&&!!e[Symbol.iterator]().next().done,Ta=class extends ga{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){let t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(t=>Q(t)||Y(t)?t.clone(e):t),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(wa(e))this.add(t);else{let[n,...r]=e,i=this.get(n,!0);if(Z(i))i.addIn(r,t);else if(i===void 0&&this.schema)this.set(n,Ca(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}deleteIn(e){let[t,...n]=e;if(n.length===0)return this.delete(t);let r=this.get(t,!0);if(Z(r))return r.deleteIn(n);throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`)}getIn(e,t){let[n,...r]=e,i=this.get(n,!0);return r.length===0?!t&&X(i)?i.value:i:Z(i)?i.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!Y(t))return!1;let n=t.value;return n==null||e&&X(n)&&n.value==null&&!n.commentBefore&&!n.comment&&!n.tag})}hasIn(e){let[t,...n]=e;if(n.length===0)return this.has(t);let r=this.get(t,!0);return Z(r)?r.hasIn(n):!1}setIn(e,t){let[n,...r]=e;if(r.length===0)this.set(n,t);else{let e=this.get(n,!0);if(Z(e))e.setIn(r,t);else if(e===void 0&&this.schema)this.set(n,Ca(this.schema,r,t));else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}}},Ea=e=>e.replace(/^(?!$)(?: $)?/gm,`#`);function Da(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}var Oa=(e,t,n)=>e.endsWith(`
|
|
20
|
-
`)?Da(n,t):n.includes(`
|
|
21
|
-
`)?`
|
|
22
|
-
`+Da(n,t):(e.endsWith(` `)?``:` `)+n,ka=`flow`,Aa=`block`,ja=`quoted`;function Ma(e,t,n=`flow`,{indentAtStart:r,lineWidth:i=80,minContentWidth:a=20,onFold:o,onOverflow:s}={}){if(!i||i<0)return e;i<a&&(a=0);let c=Math.max(1+a,1+i-t.length);if(e.length<=c)return e;let l=[],u={},d=i-t.length;typeof r==`number`&&(r>i-Math.max(2,a)?l.push(0):d=i-r);let f,p,m=!1,h=-1,g=-1,_=-1;n===`block`&&(h=Na(e,h,t.length),h!==-1&&(d=h+c));for(let r;r=e[h+=1];){if(n===`quoted`&&r===`\\`){switch(g=h,e[h+1]){case`x`:h+=3;break;case`u`:h+=5;break;case`U`:h+=9;break;default:h+=1}_=h}if(r===`
|
|
23
|
-
`)n===`block`&&(h=Na(e,h,t.length)),d=h+t.length+c,f=void 0;else{if(r===` `&&p&&p!==` `&&p!==`
|
|
24
|
-
`&&p!==` `){let t=e[h+1];t&&t!==` `&&t!==`
|
|
25
|
-
`&&t!==` `&&(f=h)}if(h>=d){if(f)l.push(f),d=f+c,f=void 0;else if(n===`quoted`){for(;p===` `||p===` `;)p=r,r=e[h+=1],m=!0;let t=h>_+1?h-2:g-1;if(u[t])return e;l.push(t),u[t]=!0,d=t+c,f=void 0}else m=!0}}p=r}if(m&&s&&s(),l.length===0)return e;o&&o();let v=e.slice(0,l[0]);for(let r=0;r<l.length;++r){let i=l[r],a=l[r+1]||e.length;i===0?v=`\n${t}${e.slice(0,a)}`:(n===`quoted`&&u[i]&&(v+=`${e[i]}\\`),v+=`\n${t}${e.slice(i+1,a)}`)}return v}function Na(e,t,n){let r=t,i=t+1,a=e[i];for(;a===` `||a===` `;)if(t<i+n)a=e[++t];else{do a=e[++t];while(a&&a!==`
|
|
26
|
-
`);r=t,i=t+1,a=e[i]}return r}var Pa=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Fa=e=>/^(%|---|\.\.\.)/m.test(e);function Ia(e,t,n){if(!t||t<0)return!1;let r=t-n,i=e.length;if(i<=r)return!1;for(let t=0,n=0;t<i;++t)if(e[t]===`
|
|
27
|
-
`){if(t-n>r)return!0;if(n=t+1,i-n<=r)return!1}return!0}function La(e,t){let n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;let{implicitKey:r}=t,i=t.options.doubleQuotedMinMultiLineLength,a=t.indent||(Fa(e)?` `:``),o=``,s=0;for(let e=0,t=n[e];t;t=n[++e])if(t===` `&&n[e+1]===`\\`&&n[e+2]===`n`&&(o+=n.slice(s,e)+`\\ `,e+=1,s=e,t=`\\`),t===`\\`)switch(n[e+1]){case`u`:{o+=n.slice(s,e);let t=n.substr(e+2,4);switch(t){case`0000`:o+=`\\0`;break;case`0007`:o+=`\\a`;break;case`000b`:o+=`\\v`;break;case`001b`:o+=`\\e`;break;case`0085`:o+=`\\N`;break;case`00a0`:o+=`\\_`;break;case`2028`:o+=`\\L`;break;case`2029`:o+=`\\P`;break;default:t.substr(0,2)===`00`?o+=`\\x`+t.substr(2):o+=n.substr(e,6)}e+=5,s=e+1}break;case`n`:if(r||n[e+2]===`"`||n.length<i)e+=1;else{for(o+=n.slice(s,e)+`
|
|
28
|
-
|
|
29
|
-
`;n[e+2]===`\\`&&n[e+3]===`n`&&n[e+4]!==`"`;)o+=`
|
|
30
|
-
`,e+=2;o+=a,n[e+2]===` `&&(o+=`\\`),e+=1,s=e+1}break;default:e+=1}return o=s?o+n.slice(s):n,r?o:Ma(o,a,ja,Pa(t,!1))}function Ra(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
31
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return La(e,t);let n=t.indent||(Fa(e)?` `:``),r=`'`+e.replace(/'/g,`''`).replace(/\n+/g,`$&\n${n}`)+`'`;return t.implicitKey?r:Ma(r,n,ka,Pa(t,!1))}function za(e,t){let{singleQuote:n}=t.options,r;if(n===!1)r=La;else{let t=e.includes(`"`),i=e.includes(`'`);r=t&&!i?Ra:i&&!t?La:n?Ra:La}return r(e,t)}var Ba;try{Ba=RegExp(`(^|(?<!
|
|
32
|
-
))
|
|
33
|
-
+(?!
|
|
34
|
-
|$)`,`g`)}catch{Ba=/\n+(?!\n|$)/g}function Va({comment:e,type:t,value:n},r,i,a){let{blockQuote:o,commentString:s,lineWidth:c}=r.options;if(!o||/\n[\t ]+$/.test(n))return za(n,r);let l=r.indent||(r.forceBlockIndent||Fa(n)?` `:``),u=o===`literal`?!0:o===`folded`||t===$.BLOCK_FOLDED?!1:t===$.BLOCK_LITERAL||!Ia(n,c,l.length);if(!n)return u?`|
|
|
35
|
-
`:`>
|
|
36
|
-
`;let d,f;for(f=n.length;f>0;--f){let e=n[f-1];if(e!==`
|
|
37
|
-
`&&e!==` `&&e!==` `)break}let p=n.substring(f),m=p.indexOf(`
|
|
38
|
-
`);m===-1?d=`-`:n===p||m!==p.length-1?(d=`+`,a&&a()):d=``,p&&=(n=n.slice(0,-p.length),p[p.length-1]===`
|
|
39
|
-
`&&(p=p.slice(0,-1)),p.replace(Ba,`$&${l}`));let h=!1,g,_=-1;for(g=0;g<n.length;++g){let e=n[g];if(e===` `)h=!0;else if(e===`
|
|
40
|
-
`)_=g;else break}let v=n.substring(0,_<g?_+1:g);v&&=(n=n.substring(v.length),v.replace(/\n+/g,`$&${l}`));let y=(h?l?`2`:`1`:``)+d;if(e&&(y+=` `+s(e.replace(/ ?[\r\n]+/g,` `)),i&&i()),!u){let e=n.replace(/\n+/g,`
|
|
41
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,`$1$2`).replace(/\n+/g,`$&${l}`),i=!1,a=Pa(r,!0);o!==`folded`&&t!==$.BLOCK_FOLDED&&(a.onOverflow=()=>{i=!0});let s=Ma(`${v}${e}${p}`,l,Aa,a);if(!i)return`>${y}\n${l}${s}`}return n=n.replace(/\n+/g,`$&${l}`),`|${y}\n${l}${v}${n}${p}`}function Ha(e,t,n,r){let{type:i,value:a}=e,{actualString:o,implicitKey:s,indent:c,indentStep:l,inFlow:u}=t;if(s&&a.includes(`
|
|
42
|
-
`)||u&&/[[\]{},]/.test(a))return za(a,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a))return s||u||!a.includes(`
|
|
43
|
-
`)?za(a,t):Va(e,t,n,r);if(!s&&!u&&i!==$.PLAIN&&a.includes(`
|
|
44
|
-
`))return Va(e,t,n,r);if(Fa(a)){if(c===``)return t.forceBlockIndent=!0,Va(e,t,n,r);if(s&&c===l)return za(a,t)}let d=a.replace(/\n+/g,`$&\n${c}`);if(o){let e=e=>{var t;return e.default&&e.tag!==`tag:yaml.org,2002:str`&&((t=e.test)==null?void 0:t.test(d))},{compat:n,tags:r}=t.doc.schema;if(r.some(e)||n!=null&&n.some(e))return za(a,t)}return s?d:Ma(d,c,ka,Pa(t,!1))}function Ua(e,t,n,r){let{implicitKey:i,inFlow:a}=t,o=typeof e.value==`string`?e:Object.assign({},e,{value:String(e.value)}),{type:s}=e;s!==$.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(s=$.QUOTE_DOUBLE);let c=e=>{switch(e){case $.BLOCK_FOLDED:case $.BLOCK_LITERAL:return i||a?za(o.value,t):Va(o,t,n,r);case $.QUOTE_DOUBLE:return La(o.value,t);case $.QUOTE_SINGLE:return Ra(o.value,t);case $.PLAIN:return Ha(o,t,n,r);default:return null}},l=c(s);if(l===null){let{defaultKeyType:e,defaultStringType:n}=t.options,r=i&&e||n;if(l=c(r),l===null)throw Error(`Unsupported default string type ${r}`)}return l}function Wa(e,t){let n=Object.assign({blockQuote:!0,commentString:Ea,defaultKeyType:null,defaultStringType:`PLAIN`,directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:`false`,flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:`null`,simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:`true`,verifyAliasOrder:!0},e.schema.toStringOptions,t),r;switch(n.collectionStyle){case`block`:r=!1;break;case`flow`:r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?` `:``,indent:``,indentStep:typeof n.indent==`number`?` `.repeat(n.indent):` `,inFlow:r,options:n}}function Ga(e,t){if(t.tag){let n=e.filter(e=>e.tag===t.tag);if(n.length>0)return n.find(e=>e.format===t.format)??n[0]}let n,r;if(X(t)){r=t.value;let i=e.filter(e=>{var t;return(t=e.identify)==null?void 0:t.call(e,r)});if(i.length>1){let e=i.filter(e=>e.test);e.length>0&&(i=e)}n=i.find(e=>e.format===t.format)??i.find(e=>!e.format)}else r=t,n=e.find(e=>e.nodeClass&&r instanceof e.nodeClass);if(!n){var i;let e=(r==null||(i=r.constructor)==null?void 0:i.name)??(r===null?`null`:typeof r);throw Error(`Tag not resolved for ${e} value`)}return n}function Ka(e,t,{anchors:n,doc:r}){if(!r.directives)return``;let i=[],a=(X(e)||Z(e))&&e.anchor;a&&ua(a)&&(n.add(a),i.push(`&${a}`));let o=e.tag??(t.default?null:t.tag);return o&&i.push(r.directives.tagString(o)),i.join(` `)}function qa(e,t,n,r){if(Y(e))return e.toString(t,n,r);if(Ji(e)){var i;if(t.doc.directives)return e.toString(t);if((i=t.resolvedAliases)!=null&&i.has(e))throw TypeError(`Cannot stringify circular structure without alias nodes`);t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let a,o=Q(e)?e:t.doc.createNode(e,{onTagObj:e=>a=e});a??=Ga(t.doc.schema.tags,o);let s=Ka(o,a,t);s.length>0&&(t.indentAtStart=(t.indentAtStart??0)+s.length+1);let c=typeof a.stringify==`function`?a.stringify(o,t,n,r):X(o)?Ua(o,t,n,r):o.toString(t,n,r);return s?X(o)||c[0]===`{`||c[0]===`[`?`${s} ${c}`:`${s}\n${t.indent}${c}`:c}function Ja({key:e,value:t},n,r,i){let{allNullValues:a,doc:o,indent:s,indentStep:c,options:{commentString:l,indentSeq:u,simpleKeys:d}}=n,f=Q(e)&&e.comment||null;if(d){if(f)throw Error(`With simple keys, key nodes cannot have comments`);if(Z(e)||!Q(e)&&typeof e==`object`)throw Error(`With simple keys, collection cannot be used as a key value`)}let p=!d&&(!e||f&&t==null&&!n.inFlow||Z(e)||(X(e)?e.type===$.BLOCK_FOLDED||e.type===$.BLOCK_LITERAL:typeof e==`object`));n=Object.assign({},n,{allNullValues:!1,implicitKey:!p&&(d||!a),indent:s+c});let m=!1,h=!1,g=qa(e,n,()=>m=!0,()=>h=!0);if(!p&&!n.inFlow&&g.length>1024){if(d)throw Error(`With simple keys, single line scalar must not span more than 1024 characters`);p=!0}if(n.inFlow){if(a||t==null)return m&&r&&r(),g===``?`?`:p?`? ${g}`:g}else if(a&&!d||t==null&&p)return g=`? ${g}`,f&&!m?g+=Oa(g,n.indent,l(f)):h&&i&&i(),g;m&&(f=null),p?(f&&(g+=Oa(g,n.indent,l(f))),g=`? ${g}\n${s}:`):(g=`${g}:`,f&&(g+=Oa(g,n.indent,l(f))));let _,v,y;Q(t)?(_=!!t.spaceBefore,v=t.commentBefore,y=t.comment):(_=!1,v=null,y=null,t&&typeof t==`object`&&(t=o.createNode(t))),n.implicitKey=!1,!p&&!f&&X(t)&&(n.indentAtStart=g.length+1),h=!1,!u&&c.length>=2&&!n.inFlow&&!p&&Zi(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let ee=!1,b=qa(t,n,()=>ee=!0,()=>h=!0),x=` `;if(f||_||v){if(x=_?`
|
|
45
|
-
`:``,v){let e=l(v);x+=`\n${Da(e,n.indent)}`}b===``&&!n.inFlow?x===`
|
|
46
|
-
`&&y&&(x=`
|
|
47
|
-
|
|
48
|
-
`):x+=`\n${n.indent}`}else if(!p&&Z(t)){let e=b[0],r=b.indexOf(`
|
|
49
|
-
`),i=r!==-1,a=n.inFlow??t.flow??t.items.length===0;if(i||!a){let t=!1;if(i&&(e===`&`||e===`!`)){let n=b.indexOf(` `);e===`&`&&n!==-1&&n<r&&b[n+1]===`!`&&(n=b.indexOf(` `,n+1)),(n===-1||r<n)&&(t=!0)}t||(x=`\n${n.indent}`)}}else(b===``||b[0]===`
|
|
50
|
-
`)&&(x=``);return g+=x+b,n.inFlow?ee&&r&&r():y&&!ee?g+=Oa(g,n.indent,l(y)):h&&i&&i(),g}function Ya(e,t){(e===`debug`||e===`warn`)&&console.warn(t)}var Xa=`<<`,Za={identify:e=>e===Xa||typeof e==`symbol`&&e.description===Xa,default:`key`,tag:`tag:yaml.org,2002:merge`,test:/^<<$/,resolve:()=>Object.assign(new $(Symbol(Xa)),{addToJSMap:$a}),stringify:()=>Xa},Qa=(e,t)=>(Za.identify(t)||X(t)&&(!t.type||t.type===$.PLAIN)&&Za.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(e=>e.tag===Za.tag&&e.default));function $a(e,t,n){let r=to(e,n);if(Zi(r))for(let n of r.items)eo(e,t,n);else if(Array.isArray(r))for(let n of r)eo(e,t,n);else eo(e,t,r)}function eo(e,t,n){let r=to(e,n);if(!Xi(r))throw Error(`Merge sources must be maps or map aliases`);let i=r.toJSON(null,e,Map);for(let[e,n]of i)t instanceof Map?t.has(e)||t.set(e,n):t instanceof Set?t.add(e):Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0});return t}function to(e,t){return e&&Ji(t)?t.resolve(e.doc,e):t}function no(e,t,{key:n,value:r}){if(Q(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(Qa(e,n))$a(e,t,r);else{let i=ha(n,``,e);if(t instanceof Map)t.set(i,ha(r,i,e));else if(t instanceof Set)t.add(i);else{let a=ro(n,i,e),o=ha(r,a,e);a in t?Object.defineProperty(t,a,{value:o,writable:!0,enumerable:!0,configurable:!0}):t[a]=o}}return t}function ro(e,t,n){if(t===null)return``;if(typeof t!=`object`)return String(t);if(Q(e)&&n!=null&&n.doc){let t=Wa(n.doc,{});t.anchors=new Set;for(let e of n.anchors.keys())t.anchors.add(e.anchor);t.inFlow=!0,t.inStringifyKey=!0;let r=e.toString(t);if(!n.mapKeyWarned){let e=JSON.stringify(r);e.length>40&&(e=e.substring(0,36)+`..."`),Ya(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return r}return JSON.stringify(t)}function io(e,t,n){return new ao(Sa(e,void 0,n),Sa(t,void 0,n))}var ao=class e{constructor(e,t=null){Object.defineProperty(this,qi,{value:Wi}),this.key=e,this.value=t}clone(t){let{key:n,value:r}=this;return Q(n)&&(n=n.clone(t)),Q(r)&&(r=r.clone(t)),new e(n,r)}toJSON(e,t){return no(t,t!=null&&t.mapAsMap?new Map:{},this)}toString(e,t,n){return e!=null&&e.doc?Ja(this,e,t,n):JSON.stringify(this)}};function oo(e,t,n){return(t.inFlow??e.flow?co:so)(e,t,n)}function so({comment:e,items:t},n,{blockItemPrefix:r,flowChars:i,itemIndent:a,onChompKeep:o,onComment:s}){let{indent:c,options:{commentString:l}}=n,u=Object.assign({},n,{indent:a,type:null}),d=!1,f=[];for(let e=0;e<t.length;++e){let i=t[e],o=null;if(Q(i))!d&&i.spaceBefore&&f.push(``),lo(n,f,i.commentBefore,d),i.comment&&(o=i.comment);else if(Y(i)){let e=Q(i.key)?i.key:null;e&&(!d&&e.spaceBefore&&f.push(``),lo(n,f,e.commentBefore,d))}d=!1;let s=qa(i,u,()=>o=null,()=>d=!0);o&&(s+=Oa(s,a,l(o))),d&&o&&(d=!1),f.push(r+s)}let p;if(f.length===0)p=i.start+i.end;else{p=f[0];for(let e=1;e<f.length;++e){let t=f[e];p+=t?`\n${c}${t}`:`
|
|
51
|
-
`}}return e?(p+=`
|
|
52
|
-
`+Da(l(e),c),s&&s()):d&&o&&o(),p}function co({items:e},t,{flowChars:n,itemIndent:r}){let{indent:i,indentStep:a,flowCollectionPadding:o,options:{commentString:s}}=t;r+=a;let c=Object.assign({},t,{indent:r,inFlow:!0,type:null}),l=!1,u=0,d=[];for(let n=0;n<e.length;++n){let i=e[n],a=null;if(Q(i))i.spaceBefore&&d.push(``),lo(t,d,i.commentBefore,!1),i.comment&&(a=i.comment);else if(Y(i)){let e=Q(i.key)?i.key:null;e&&(e.spaceBefore&&d.push(``),lo(t,d,e.commentBefore,!1),e.comment&&(l=!0));let n=Q(i.value)?i.value:null;n?(n.comment&&(a=n.comment),n.commentBefore&&(l=!0)):i.value==null&&e!=null&&e.comment&&(a=e.comment)}a&&(l=!0);let o=qa(i,c,()=>a=null);l||=d.length>u||o.includes(`
|
|
53
|
-
`),n<e.length-1?o+=`,`:t.options.trailingComma&&(t.options.lineWidth>0&&(l||=d.reduce((e,t)=>e+t.length+2,2)+(o.length+2)>t.options.lineWidth),l&&(o+=`,`)),a&&(o+=Oa(o,r,s(a))),d.push(o),u=d.length}let{start:f,end:p}=n;if(d.length===0)return f+p;if(!l){let e=d.reduce((e,t)=>e+t.length+2,2);l=t.options.lineWidth>0&&e>t.options.lineWidth}if(l){let e=f;for(let t of d)e+=t?`\n${a}${i}${t}`:`
|
|
54
|
-
`;return`${e}\n${i}${p}`}return`${f}${o}${d.join(` `)}${o}${p}`}function lo({indent:e,options:{commentString:t}},n,r,i){if(r&&i&&(r=r.replace(/^\n+/,``)),r){let i=Da(t(r),e);n.push(i.trimStart())}}function uo(e,t){let n=X(t)?t.value:t;for(let r of e)if(Y(r)&&(r.key===t||r.key===n||X(r.key)&&r.key.value===n))return r}var fo=class extends Ta{static get tagName(){return`tag:yaml.org,2002:map`}constructor(e){super(Ui,e),this.items=[]}static from(e,t,n){let{keepUndefined:r,replacer:i}=n,a=new this(e),o=(e,o)=>{if(typeof i==`function`)o=i.call(t,e,o);else if(Array.isArray(i)&&!i.includes(e))return;(o!==void 0||r)&&a.items.push(io(e,o,n))};if(t instanceof Map)for(let[e,n]of t)o(e,n);else if(t&&typeof t==`object`)for(let e of Object.keys(t))o(e,t[e]);return typeof e.sortMapEntries==`function`&&a.items.sort(e.sortMapEntries),a}add(e,t){var n;let r;r=Y(e)?e:!e||typeof e!=`object`||!(`key`in e)?new ao(e,e==null?void 0:e.value):new ao(e.key,e.value);let i=uo(this.items,r.key),a=(n=this.schema)==null?void 0:n.sortMapEntries;if(i){if(!t)throw Error(`Key ${r.key} already set`);X(i.value)&&ya(r.value)?i.value.value=r.value:i.value=r.value}else if(a){let e=this.items.findIndex(e=>a(r,e)<0);e===-1?this.items.push(r):this.items.splice(e,0,r)}else this.items.push(r)}delete(e){let t=uo(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){let n=uo(this.items,e),r=n==null?void 0:n.value;return(!t&&X(r)?r.value:r)??void 0}has(e){return!!uo(this.items,e)}set(e,t){this.add(new ao(e,t),!0)}toJSON(e,t,n){let r=n?new n:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(r);for(let e of this.items)no(t,r,e);return r}toString(e,t,n){if(!e)return JSON.stringify(this);for(let e of this.items)if(!Y(e))throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),oo(this,e,{blockItemPrefix:``,flowChars:{start:`{`,end:`}`},itemIndent:e.indent||``,onChompKeep:n,onComment:t})}},po={collection:`map`,default:!0,nodeClass:fo,tag:`tag:yaml.org,2002:map`,resolve(e,t){return Xi(e)||t(`Expected a mapping for this tag`),e},createNode:(e,t,n)=>fo.from(e,t,n)},mo=class extends Ta{static get tagName(){return`tag:yaml.org,2002:seq`}constructor(e){super(Ki,e),this.items=[]}add(e){this.items.push(e)}delete(e){let t=ho(e);return typeof t==`number`&&this.items.splice(t,1).length>0}get(e,t){let n=ho(e);if(typeof n!=`number`)return;let r=this.items[n];return!t&&X(r)?r.value:r}has(e){let t=ho(e);return typeof t==`number`&&t<this.items.length}set(e,t){let n=ho(e);if(typeof n!=`number`)throw Error(`Expected a valid index, not ${e}.`);let r=this.items[n];X(r)&&ya(t)?r.value=t:this.items[n]=t}toJSON(e,t){let n=[];t!=null&&t.onCreate&&t.onCreate(n);let r=0;for(let e of this.items)n.push(ha(e,String(r++),t));return n}toString(e,t,n){return e?oo(this,e,{blockItemPrefix:`- `,flowChars:{start:`[`,end:`]`},itemIndent:(e.indent||``)+` `,onChompKeep:n,onComment:t}):JSON.stringify(this)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t)){let e=0;for(let a of t){if(typeof r==`function`){let n=t instanceof Set?a:String(e++);a=r.call(t,n,a)}i.items.push(Sa(a,void 0,n))}}return i}};function ho(e){let t=X(e)?e.value:e;return t&&typeof t==`string`&&(t=Number(t)),typeof t==`number`&&Number.isInteger(t)&&t>=0?t:null}var go={collection:`seq`,default:!0,nodeClass:mo,tag:`tag:yaml.org,2002:seq`,resolve(e,t){return Zi(e)||t(`Expected a sequence for this tag`),e},createNode:(e,t,n)=>mo.from(e,t,n)},_o={identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Ua(e,t,n,r)}},vo={identify:e=>e==null,createNode:()=>new $(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new $(null),stringify:({source:e},t)=>typeof e==`string`&&vo.test.test(e)?e:t.options.nullStr},yo={identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new $(e[0]===`t`||e[0]===`T`),stringify({source:e,value:t},n){return e&&yo.test.test(e)&&t===(e[0]===`t`||e[0]===`T`)?e:t?n.options.trueStr:n.options.falseStr}};function bo({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r==`bigint`)return String(r);let i=typeof r==`number`?r:Number(r);if(!isFinite(i))return isNaN(i)?`.nan`:i<0?`-.inf`:`.inf`;let a=Object.is(r,-0)?`-0`:JSON.stringify(r);if(!e&&t&&(!n||n===`tag:yaml.org,2002:float`)&&/^-?\d/.test(a)&&!a.includes(`e`)){let e=a.indexOf(`.`);e<0&&(e=a.length,a+=`.`);let n=t-(a.length-e-1);for(;n-->0;)a+=`0`}return a}var xo={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:bo},So={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():bo(e)}},Co={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){let t=new $(parseFloat(e)),n=e.indexOf(`.`);return n!==-1&&e[e.length-1]===`0`&&(t.minFractionDigits=e.length-n-1),t},stringify:bo},wo=e=>typeof e==`bigint`||Number.isInteger(e),To=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function Eo(e,t,n){let{value:r}=e;return wo(r)&&r>=0?n+r.toString(t):bo(e)}var Do={identify:e=>wo(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^0o[0-7]+$/,resolve:(e,t,n)=>To(e,2,8,n),stringify:e=>Eo(e,8,`0o`)},Oo={identify:wo,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>To(e,0,10,n),stringify:bo},ko={identify:e=>wo(e)&&e>=0,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>To(e,2,16,n),stringify:e=>Eo(e,16,`0x`)},Ao=[po,go,_o,vo,yo,Do,Oo,ko,xo,So,Co];function jo(e){return typeof e==`bigint`||Number.isInteger(e)}var Mo=({value:e})=>JSON.stringify(e),No=[{identify:e=>typeof e==`string`,default:!0,tag:`tag:yaml.org,2002:str`,resolve:e=>e,stringify:Mo},{identify:e=>e==null,createNode:()=>new $(null),default:!0,tag:`tag:yaml.org,2002:null`,test:/^null$/,resolve:()=>null,stringify:Mo},{identify:e=>typeof e==`boolean`,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^true$|^false$/,resolve:e=>e===`true`,stringify:Mo},{identify:jo,default:!0,tag:`tag:yaml.org,2002:int`,test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>jo(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Mo}],Po=[po,go].concat(No,{default:!0,tag:``,test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}}),Fo={identify:e=>e instanceof Uint8Array,default:!1,tag:`tag:yaml.org,2002:binary`,resolve(e,t){if(typeof atob==`function`){let t=atob(e.replace(/[\n\r]/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;++e)n[e]=t.charCodeAt(e);return n}return t(`This environment does not support reading binary tags; either Buffer or atob is required`),e},stringify({comment:e,type:t,value:n},r,i,a){if(!n)return``;let o=n,s;if(typeof btoa==`function`){let e=``;for(let t=0;t<o.length;++t)e+=String.fromCharCode(o[t]);s=btoa(e)}else throw Error(`This environment does not support writing binary tags; either Buffer or btoa is required`);if(t??=$.BLOCK_LITERAL,t!==$.QUOTE_DOUBLE){let e=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),n=Math.ceil(s.length/e),i=Array(n);for(let t=0,r=0;t<n;++t,r+=e)i[t]=s.substr(r,e);s=i.join(t===$.BLOCK_LITERAL?`
|
|
55
|
-
`:` `)}return Ua({comment:e,type:t,value:s},r,i,a)}};function Io(e,t){if(Zi(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!Y(r)){if(Xi(r)){r.items.length>1&&t(`Each pair must have its own sequence indicator`);let e=r.items[0]||new ao(new $(null));if(r.commentBefore&&(e.key.commentBefore=e.key.commentBefore?`${r.commentBefore}\n${e.key.commentBefore}`:r.commentBefore),r.comment){let t=e.value??e.key;t.comment=t.comment?`${r.comment}\n${t.comment}`:r.comment}r=e}e.items[n]=Y(r)?r:new ao(r)}}else t(`Expected a sequence for this tag`);return e}function Lo(e,t,n){let{replacer:r}=n,i=new mo(e);i.tag=`tag:yaml.org,2002:pairs`;let a=0;if(t&&Symbol.iterator in Object(t))for(let e of t){typeof r==`function`&&(e=r.call(t,String(a++),e));let o,s;if(Array.isArray(e)){if(e.length===2)o=e[0],s=e[1];else throw TypeError(`Expected [key, value] tuple: ${e}`)}else if(e&&e instanceof Object){let t=Object.keys(e);if(t.length===1)o=t[0],s=e[o];else throw TypeError(`Expected tuple with one key, not ${t.length} keys`)}else o=e;i.items.push(io(o,s,n))}return i}var Ro={collection:`seq`,default:!1,tag:`tag:yaml.org,2002:pairs`,resolve:Io,createNode:Lo},zo=class e extends mo{constructor(){super(),this.add=fo.prototype.add.bind(this),this.delete=fo.prototype.delete.bind(this),this.get=fo.prototype.get.bind(this),this.has=fo.prototype.has.bind(this),this.set=fo.prototype.set.bind(this),this.tag=e.tag}toJSON(e,t){if(!t)return super.toJSON(e);let n=new Map;t!=null&&t.onCreate&&t.onCreate(n);for(let e of this.items){let r,i;if(Y(e)?(r=ha(e.key,``,t),i=ha(e.value,r,t)):r=ha(e,``,t),n.has(r))throw Error(`Ordered maps must not include duplicate keys`);n.set(r,i)}return n}static from(e,t,n){let r=Lo(e,t,n),i=new this;return i.items=r.items,i}};zo.tag=`tag:yaml.org,2002:omap`;var Bo={collection:`seq`,identify:e=>e instanceof Map,nodeClass:zo,default:!1,tag:`tag:yaml.org,2002:omap`,resolve(e,t){let n=Io(e,t),r=[];for(let{key:e}of n.items)X(e)&&(r.includes(e.value)?t(`Ordered maps must not include duplicate keys: ${e.value}`):r.push(e.value));return Object.assign(new zo,n)},createNode:(e,t,n)=>zo.from(e,t,n)};function Vo({value:e,source:t},n){return t&&(e?Ho:Uo).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}var Ho={identify:e=>e===!0,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new $(!0),stringify:Vo},Uo={identify:e=>e===!1,default:!0,tag:`tag:yaml.org,2002:bool`,test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new $(!1),stringify:Vo},Wo={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()===`nan`?NaN:e[0]===`-`?-1/0:1/0,stringify:bo},Go={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`EXP`,test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,``)),stringify(e){let t=Number(e.value);return isFinite(t)?t.toExponential():bo(e)}},Ko={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){let t=new $(parseFloat(e.replace(/_/g,``))),n=e.indexOf(`.`);if(n!==-1){let r=e.substring(n+1).replace(/_/g,``);r[r.length-1]===`0`&&(t.minFractionDigits=r.length)}return t},stringify:bo},qo=e=>typeof e==`bigint`||Number.isInteger(e);function Jo(e,t,n,{intAsBigInt:r}){let i=e[0];if((i===`-`||i===`+`)&&(t+=1),e=e.substring(t).replace(/_/g,``),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`}let t=BigInt(e);return i===`-`?BigInt(-1)*t:t}let a=parseInt(e,n);return i===`-`?-1*a:a}function Yo(e,t,n){let{value:r}=e;if(qo(r)){let e=r.toString(t);return r<0?`-`+n+e.substr(1):n+e}return bo(e)}var Xo={identify:qo,default:!0,tag:`tag:yaml.org,2002:int`,format:`BIN`,test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Jo(e,2,2,n),stringify:e=>Yo(e,2,`0b`)},Zo={identify:qo,default:!0,tag:`tag:yaml.org,2002:int`,format:`OCT`,test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Jo(e,1,8,n),stringify:e=>Yo(e,8,`0`)},Qo={identify:qo,default:!0,tag:`tag:yaml.org,2002:int`,test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Jo(e,0,10,n),stringify:bo},$o={identify:qo,default:!0,tag:`tag:yaml.org,2002:int`,format:`HEX`,test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Jo(e,2,16,n),stringify:e=>Yo(e,16,`0x`)},es=class e extends fo{constructor(t){super(t),this.tag=e.tag}add(e){let t;t=Y(e)?e:e&&typeof e==`object`&&`key`in e&&`value`in e&&e.value===null?new ao(e.key,null):new ao(e,null),uo(this.items,t.key)||this.items.push(t)}get(e,t){let n=uo(this.items,e);return!t&&Y(n)?X(n.key)?n.key.value:n.key:n}set(e,t){if(typeof t!=`boolean`)throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);let n=uo(this.items,e);n&&!t?this.items.splice(this.items.indexOf(n),1):!n&&t&&this.items.push(new ao(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,n){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,n);throw Error(`Set items must all have null values`)}static from(e,t,n){let{replacer:r}=n,i=new this(e);if(t&&Symbol.iterator in Object(t))for(let e of t)typeof r==`function`&&(e=r.call(t,e,e)),i.items.push(io(e,null,n));return i}};es.tag=`tag:yaml.org,2002:set`;var ts={collection:`map`,identify:e=>e instanceof Set,nodeClass:es,default:!1,tag:`tag:yaml.org,2002:set`,createNode:(e,t,n)=>es.from(e,t,n),resolve(e,t){if(Xi(e)){if(e.hasAllNullValues(!0))return Object.assign(new es,e);t(`Set items must all have null values`)}else t(`Expected a mapping for this tag`);return e}};function ns(e,t){let n=e[0],r=n===`-`||n===`+`?e.substring(1):e,i=e=>t?BigInt(e):Number(e),a=r.replace(/_/g,``).split(`:`).reduce((e,t)=>e*i(60)+i(t),i(0));return n===`-`?i(-1)*a:a}function rs(e){let{value:t}=e,n=e=>e;if(typeof t==`bigint`)n=e=>BigInt(e);else if(isNaN(t)||!isFinite(t))return bo(e);let r=``;t<0&&(r=`-`,t*=n(-1));let i=n(60),a=[t%i];return t<60?a.unshift(0):(t=(t-a[0])/i,a.unshift(t%i),t>=60&&(t=(t-a[0])/i,a.unshift(t))),r+a.map(e=>String(e).padStart(2,`0`)).join(`:`).replace(/000000\d*$/,``)}var is={identify:e=>typeof e==`bigint`||Number.isInteger(e),default:!0,tag:`tag:yaml.org,2002:int`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>ns(e,n),stringify:rs},as={identify:e=>typeof e==`number`,default:!0,tag:`tag:yaml.org,2002:float`,format:`TIME`,test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>ns(e,!1),stringify:rs},os={identify:e=>e instanceof Date,default:!0,tag:`tag:yaml.org,2002:timestamp`,test:RegExp(`^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$`),resolve(e){let t=e.match(os.test);if(!t)throw Error(`!!timestamp expects a date, starting with yyyy-mm-dd`);let[,n,r,i,a,o,s]=t.map(Number),c=t[7]?Number((t[7]+`00`).substr(1,3)):0,l=Date.UTC(n,r-1,i,a||0,o||0,s||0,c),u=t[8];if(u&&u!==`Z`){let e=ns(u,!1);Math.abs(e)<30&&(e*=60),l-=6e4*e}return new Date(l)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,``))??``},ss=[po,go,_o,vo,Ho,Uo,Xo,Zo,Qo,$o,Wo,Go,Ko,Fo,Za,Bo,Ro,ts,is,as,os],cs=new Map([[`core`,Ao],[`failsafe`,[po,go,_o]],[`json`,Po],[`yaml11`,ss],[`yaml-1.1`,ss]]),ls={binary:Fo,bool:yo,float:Co,floatExp:So,floatNaN:xo,floatTime:as,int:Oo,intHex:ko,intOct:Do,intTime:is,map:po,merge:Za,null:vo,omap:Bo,pairs:Ro,seq:go,set:ts,timestamp:os},us={"tag:yaml.org,2002:binary":Fo,"tag:yaml.org,2002:merge":Za,"tag:yaml.org,2002:omap":Bo,"tag:yaml.org,2002:pairs":Ro,"tag:yaml.org,2002:set":ts,"tag:yaml.org,2002:timestamp":os};function ds(e,t,n){let r=cs.get(t);if(r&&!e)return n&&!r.includes(Za)?r.concat(Za):r.slice();let i=r;if(!i){if(Array.isArray(e))i=[];else{let e=Array.from(cs.keys()).filter(e=>e!==`yaml11`).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`)}}if(Array.isArray(e))for(let t of e)i=i.concat(t);else typeof e==`function`&&(i=e(i.slice()));return n&&(i=i.concat(Za)),i.reduce((e,t)=>{let n=typeof t==`string`?ls[t]:t;if(!n){let e=JSON.stringify(t),n=Object.keys(ls).map(e=>JSON.stringify(e)).join(`, `);throw Error(`Unknown custom tag ${e}; use one of ${n}`)}return e.includes(n)||e.push(n),e},[])}var fs=(e,t)=>e.key<t.key?-1:+(e.key>t.key),ps=class e{constructor({compat:e,customTags:t,merge:n,resolveKnownTags:r,schema:i,sortMapEntries:a,toStringDefaults:o}){this.compat=Array.isArray(e)?ds(e,`compat`):e?ds(null,e):null,this.name=typeof i==`string`&&i||`core`,this.knownTags=r?us:{},this.tags=ds(t,this.name,n),this.toStringOptions=o??null,Object.defineProperty(this,Ui,{value:po}),Object.defineProperty(this,Gi,{value:_o}),Object.defineProperty(this,Ki,{value:go}),this.sortMapEntries=typeof a==`function`?a:a===!0?fs:null}clone(){let t=Object.create(e.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function ms(e,t){var n;let r=[],i=t.directives===!0;if(t.directives!==!1&&e.directives){let t=e.directives.toString(e);t?(r.push(t),i=!0):e.directives.docStart&&(i=!0)}i&&r.push(`---`);let a=Wa(e,t),{commentString:o}=a.options;if(e.commentBefore){r.length!==1&&r.unshift(``);let t=o(e.commentBefore);r.unshift(Da(t,``))}let s=!1,c=null;if(e.contents){if(Q(e.contents)){if(e.contents.spaceBefore&&i&&r.push(``),e.contents.commentBefore){let t=o(e.contents.commentBefore);r.push(Da(t,``))}a.forceBlockIndent=!!e.comment,c=e.contents.comment}let t=c?void 0:()=>s=!0,n=qa(e.contents,a,()=>c=null,t);c&&(n+=Oa(n,``,o(c))),(n[0]===`|`||n[0]===`>`)&&r[r.length-1]===`---`?r[r.length-1]=`--- ${n}`:r.push(n)}else r.push(qa(e.contents,a));if((n=e.directives)!=null&&n.docEnd){if(e.comment){let t=o(e.comment);t.includes(`
|
|
56
|
-
`)?(r.push(`...`),r.push(Da(t,``))):r.push(`... ${t}`)}else r.push(`...`)}else{let t=e.comment;t&&s&&(t=t.replace(/^\n+/,``)),t&&((!s||c)&&r[r.length-1]!==``&&r.push(``),r.push(Da(o(t),``)))}return r.join(`
|
|
57
|
-
`)+`
|
|
58
|
-
`}var hs=class e{constructor(e,t,n){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,qi,{value:Hi});let r=null;typeof t==`function`||Array.isArray(t)?r=t:n===void 0&&t&&(n=t,t=void 0);let i=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:`warn`,prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:`1.2`},n);this.options=i;let{version:a}=i;n!=null&&n._directives?(this.directives=n._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new la({version:a}),this.setSchema(a,n),this.contents=e===void 0?null:this.createNode(e,r,n)}clone(){let t=Object.create(e.prototype,{[qi]:{value:Hi}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=Q(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(e){gs(this.contents)&&this.contents.add(e)}addIn(e,t){gs(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){let n=da(this);e.anchor=!t||n.has(t)?fa(t||`a`,n):t}return new _a(e.anchor)}createNode(e,t,n){let r;if(typeof t==`function`)e=t.call({"":e},``,e),r=t;else if(Array.isArray(t)){let e=t.filter(e=>typeof e==`number`||e instanceof String||e instanceof Number).map(String);e.length>0&&(t=t.concat(e)),r=t}else n===void 0&&t&&(n=t,t=void 0);let{aliasDuplicateObjects:i,anchorPrefix:a,flow:o,keepUndefined:s,onTagObj:c,tag:l}=n??{},{onAnchor:u,setAnchors:d,sourceObjects:f}=pa(this,a||`a`),p={aliasDuplicateObjects:i??!0,keepUndefined:s??!1,onAnchor:u,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:f},m=Sa(e,l,p);return o&&Z(m)&&(m.flow=!0),d(),m}createPair(e,t,n={}){return new ao(this.createNode(e,null,n),this.createNode(t,null,n))}delete(e){return gs(this.contents)?this.contents.delete(e):!1}deleteIn(e){return wa(e)?this.contents!=null&&(this.contents=null,!0):gs(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Z(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return wa(e)?!t&&X(this.contents)?this.contents.value:this.contents:Z(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Z(this.contents)?this.contents.has(e):!1}hasIn(e){return wa(e)?this.contents!==void 0:Z(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ca(this.schema,[e],t):gs(this.contents)&&this.contents.set(e,t)}setIn(e,t){wa(e)?this.contents=t:this.contents==null?this.contents=Ca(this.schema,Array.from(e),t):gs(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e==`number`&&(e=String(e));let n;switch(e){case`1.1`:this.directives?this.directives.yaml.version=`1.1`:this.directives=new la({version:`1.1`}),n={resolveKnownTags:!1,schema:`yaml-1.1`};break;case`1.2`:case`next`:this.directives?this.directives.yaml.version=e:this.directives=new la({version:e}),n={resolveKnownTags:!0,schema:`core`};break;case null:this.directives&&delete this.directives,n=null;break;default:{let t=JSON.stringify(e);throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(n)this.schema=new ps(Object.assign(n,t));else throw Error(`With a null YAML version, the { schema: Schema } option is required`)}toJS({json:e,jsonArg:t,mapAsMap:n,maxAliasCount:r,onAnchor:i,reviver:a}={}){let o={anchors:new Map,doc:this,keep:!e,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r==`number`?r:100},s=ha(this.contents,t??``,o);if(typeof i==`function`)for(let{count:e,res:t}of o.anchors.values())i(t,e);return typeof a==`function`?ma(a,{"":s},``,s):s}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw Error(`Document with errors cannot be stringified`);if(`indent`in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){let t=JSON.stringify(e.indent);throw Error(`"indent" option must be a positive integer, not ${t}`)}return ms(this,e)}};function gs(e){if(Z(e))return!0;throw Error(`Expected a YAML collection as document contents`)}var _s=class extends Error{constructor(e,t,n,r){super(),this.name=e,this.code=n,this.message=r,this.pos=t}},vs=class extends _s{constructor(e,t,n){super(`YAMLParseError`,e,t,n)}},ys=class extends _s{constructor(e,t,n){super(`YAMLWarning`,e,t,n)}},bs=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(e=>t.linePos(e));let{line:r,col:i}=n.linePos[0];n.message+=` at line ${r}, column ${i}`;let a=i-1,o=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,``);if(a>=60&&o.length>80){let e=Math.min(a-39,o.length-79);o=`…`+o.substring(e),a-=e-1}if(o.length>80&&(o=o.substring(0,79)+`…`),r>1&&/^ *$/.test(o.substring(0,a))){let n=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);n.length>80&&(n=n.substring(0,79)+`…
|
|
59
|
-
`),o=n+o}if(/[^ ]/.test(o)){let e=1,t=n.linePos[1];(t==null?void 0:t.line)===r&&t.col>i&&(e=Math.max(1,Math.min(t.col-i,80-a)));let s=` `.repeat(a)+`^`.repeat(e);n.message+=`:\n\n${o}\n${s}\n`}};function xs(e,{flow:t,indicator:n,next:r,offset:i,onError:a,parentIndent:o,startOnNewline:s}){let c=!1,l=s,u=s,d=``,f=``,p=!1,m=!1,h=null,g=null,_=null,v=null,y=null,ee=null,b=null;for(let i of e)switch(m&&=(i.type!==`space`&&i.type!==`newline`&&i.type!==`comma`&&a(i.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),!1),h&&=(l&&i.type!==`comment`&&i.type!==`newline`&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),null),i.type){case`space`:!t&&(n!==`doc-start`||(r==null?void 0:r.type)!==`flow-collection`)&&i.source.includes(` `)&&(h=i),u=!0;break;case`comment`:{u||a(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let e=i.source.substring(1)||` `;d?d+=f+e:d=e,f=``,l=!1;break}case`newline`:l?d?d+=i.source:(!ee||n!==`seq-item-ind`)&&(c=!0):f+=i.source,l=!0,p=!0,(g||_)&&(v=i),u=!0;break;case`anchor`:g&&a(i,`MULTIPLE_ANCHORS`,`A node can have at most one anchor`),i.source.endsWith(`:`)&&a(i.offset+i.source.length-1,`BAD_ALIAS`,`Anchor ending in : is ambiguous`,!0),g=i,b??=i.offset,l=!1,u=!1,m=!0;break;case`tag`:_&&a(i,`MULTIPLE_TAGS`,`A node can have at most one tag`),_=i,b??=i.offset,l=!1,u=!1,m=!0;break;case n:(g||_)&&a(i,`BAD_PROP_ORDER`,`Anchors and tags must be after the ${i.source} indicator`),ee&&a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.source} in ${t??`collection`}`),ee=i,l=n===`seq-item-ind`||n===`explicit-key-ind`,u=!1;break;case`comma`:if(t){y&&a(i,`UNEXPECTED_TOKEN`,`Unexpected , in ${t}`),y=i,l=!1,u=!1;break}default:a(i,`UNEXPECTED_TOKEN`,`Unexpected ${i.type} token`),l=!1,u=!1}let x=e[e.length-1],te=x?x.offset+x.source.length:i;return m&&r&&r.type!==`space`&&r.type!==`newline`&&r.type!==`comma`&&(r.type!==`scalar`||r.source!==``)&&a(r.offset,`MISSING_CHAR`,`Tags and anchors must be separated from the next token by white space`),h&&(l&&h.indent<=o||(r==null?void 0:r.type)===`block-map`||(r==null?void 0:r.type)===`block-seq`)&&a(h,`TAB_AS_INDENT`,`Tabs are not allowed as indentation`),{comma:y,found:ee,spaceBefore:c,comment:d,hasNewline:p,anchor:g,tag:_,newlineAfterProp:v,end:te,start:b??te}}function Ss(e){if(!e)return null;switch(e.type){case`alias`:case`scalar`:case`double-quoted-scalar`:case`single-quoted-scalar`:if(e.source.includes(`
|
|
60
|
-
`))return!0;if(e.end){for(let t of e.end)if(t.type===`newline`)return!0}return!1;case`flow-collection`:for(let t of e.items){for(let e of t.start)if(e.type===`newline`)return!0;if(t.sep){for(let e of t.sep)if(e.type===`newline`)return!0}if(Ss(t.key)||Ss(t.value))return!0}return!1;default:return!0}}function Cs(e,t,n){if((t==null?void 0:t.type)===`flow-collection`){let r=t.end[0];r.indent===e&&(r.source===`]`||r.source===`}`)&&Ss(t)&&n(r,`BAD_INDENT`,`Flow end indicator should be more indented than parent`,!0)}}function ws(e,t,n){let{uniqueKeys:r}=e.options;if(r===!1)return!1;let i=typeof r==`function`?r:(e,t)=>e===t||X(e)&&X(t)&&e.value===t.value;return t.some(e=>i(e.key,n))}var Ts=`All mapping items must start at the same column`;function Es({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a==null?void 0:a.nodeClass)??fo)(n.schema);n.atRoot&&=!1;let s=r.offset,c=null;for(let a of r.items){var l;let{start:u,key:d,sep:f,value:p}=a,m=xs(u,{indicator:`explicit-key-ind`,next:d??(f==null?void 0:f[0]),offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0}),h=!m.found;if(h){if(d&&(d.type===`block-seq`?i(s,`BLOCK_AS_IMPLICIT_KEY`,`A block sequence may not be used as an implicit map key`):`indent`in d&&d.indent!==r.indent&&i(s,`BAD_INDENT`,Ts)),!m.anchor&&!m.tag&&!f){c=m.end,m.comment&&(o.comment?o.comment+=`
|
|
61
|
-
`+m.comment:o.comment=m.comment);continue}(m.newlineAfterProp||Ss(d))&&i(d??u[u.length-1],`MULTILINE_IMPLICIT_KEY`,`Implicit keys need to be on a single line`)}else((l=m.found)==null?void 0:l.indent)!==r.indent&&i(s,`BAD_INDENT`,Ts);n.atKey=!0;let g=m.end,_=d?e(n,d,m,i):t(n,g,u,null,m,i);n.schema.compat&&Cs(r.indent,d,i),n.atKey=!1,ws(n,o.items,_)&&i(g,`DUPLICATE_KEY`,`Map keys must be unique`);let v=xs(f??[],{indicator:`map-value-ind`,next:p,offset:_.range[2],onError:i,parentIndent:r.indent,startOnNewline:!d||d.type===`block-scalar`});if(s=v.end,v.found){h&&((p==null?void 0:p.type)===`block-map`&&!v.hasNewline&&i(s,`BLOCK_AS_IMPLICIT_KEY`,`Nested mappings are not allowed in compact mappings`),n.options.strict&&m.start<v.found.offset-1024&&i(_.range,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit block mapping key`));let c=p?e(n,p,v,i):t(n,s,f,null,v,i);n.schema.compat&&Cs(r.indent,p,i),s=c.range[2];let l=new ao(_,c);n.options.keepSourceTokens&&(l.srcToken=a),o.items.push(l)}else{h&&i(_.range,`MISSING_CHAR`,`Implicit map keys need to be followed by map values`),v.comment&&(_.comment?_.comment+=`
|
|
62
|
-
`+v.comment:_.comment=v.comment);let e=new ao(_);n.options.keepSourceTokens&&(e.srcToken=a),o.items.push(e)}}return c&&c<s&&i(c,`IMPOSSIBLE`,`Map comment with trailing content`),o.range=[r.offset,s,c??s],o}function Ds({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=new((a==null?void 0:a.nodeClass)??mo)(n.schema);n.atRoot&&=!1,n.atKey&&=!1;let s=r.offset,c=null;for(let{start:a,value:l}of r.items){let u=xs(a,{indicator:`seq-item-ind`,next:l,offset:s,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!u.found){if(u.anchor||u.tag||l)(l==null?void 0:l.type)===`block-seq`?i(u.end,`BAD_INDENT`,`All sequence items must start at the same column`):i(s,`MISSING_CHAR`,`Sequence item without - indicator`);else{c=u.end,u.comment&&(o.comment=u.comment);continue}}let d=l?e(n,l,u,i):t(n,u.end,a,null,u,i);n.schema.compat&&Cs(r.indent,l,i),s=d.range[2],o.items.push(d)}return o.range=[r.offset,s,c??s],o}function Os(e,t,n,r){let i=``;if(e){let a=!1,o=``;for(let s of e){let{source:e,type:c}=s;switch(c){case`space`:a=!0;break;case`comment`:{n&&!a&&r(s,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`);let t=e.substring(1)||` `;i?i+=o+t:i=t,o=``;break}case`newline`:i&&(o+=e),a=!0;break;default:r(s,`UNEXPECTED_TOKEN`,`Unexpected ${c} at node end`)}t+=e.length}}return{comment:i,offset:t}}var ks=`Block collections are not allowed within flow collections`,As=e=>e&&(e.type===`block-map`||e.type===`block-seq`);function js({composeNode:e,composeEmptyNode:t},n,r,i,a){let o=r.start.source===`{`,s=o?`flow map`:`flow sequence`,c=new((a==null?void 0:a.nodeClass)??(o?fo:mo))(n.schema);c.flow=!0;let l=n.atRoot;l&&(n.atRoot=!1),n.atKey&&=!1;let u=r.offset+r.start.source.length;for(let a=0;a<r.items.length;++a){let l=r.items[a],{start:f,key:p,sep:m,value:h}=l,g=xs(f,{flow:s,indicator:`explicit-key-ind`,next:p??(m==null?void 0:m[0]),offset:u,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!g.found){if(!g.anchor&&!g.tag&&!m&&!h){a===0&&g.comma?i(g.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`):a<r.items.length-1&&i(g.start,`UNEXPECTED_TOKEN`,`Unexpected empty item in ${s}`),g.comment&&(c.comment?c.comment+=`
|
|
63
|
-
`+g.comment:c.comment=g.comment),u=g.end;continue}!o&&n.options.strict&&Ss(p)&&i(p,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`)}if(a===0)g.comma&&i(g.comma,`UNEXPECTED_TOKEN`,`Unexpected , in ${s}`);else if(g.comma||i(g.start,`MISSING_CHAR`,`Missing , between ${s} items`),g.comment){let e=``;loop:for(let t of f)switch(t.type){case`comma`:case`space`:break;case`comment`:e=t.source.substring(1);break loop;default:break loop}if(e){let t=c.items[c.items.length-1];Y(t)&&(t=t.value??t.key),t.comment?t.comment+=`
|
|
64
|
-
`+e:t.comment=e,g.comment=g.comment.substring(e.length+1)}}if(!o&&!m&&!g.found){let r=h?e(n,h,g,i):t(n,g.end,m,null,g,i);c.items.push(r),u=r.range[2],As(h)&&i(r.range,`BLOCK_IN_FLOW`,ks)}else{n.atKey=!0;let a=g.end,_=p?e(n,p,g,i):t(n,a,f,null,g,i);As(p)&&i(_.range,`BLOCK_IN_FLOW`,ks),n.atKey=!1;let v=xs(m??[],{flow:s,indicator:`map-value-ind`,next:h,offset:_.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(v.found){if(!o&&!g.found&&n.options.strict){if(m)for(let e of m){if(e===v.found)break;if(e.type===`newline`){i(e,`MULTILINE_IMPLICIT_KEY`,`Implicit keys of flow sequence pairs need to be on a single line`);break}}g.start<v.found.offset-1024&&i(v.found,`KEY_OVER_1024_CHARS`,`The : indicator must be at most 1024 chars after the start of an implicit flow sequence key`)}}else if(h){var d;`source`in h&&((d=h.source)==null?void 0:d[0])===`:`?i(h,`MISSING_CHAR`,`Missing space after : in ${s}`):i(v.start,`MISSING_CHAR`,`Missing , or : between ${s} items`)}let y=h?e(n,h,v,i):v.found?t(n,v.end,m,null,v,i):null;y?As(h)&&i(y.range,`BLOCK_IN_FLOW`,ks):v.comment&&(_.comment?_.comment+=`
|
|
65
|
-
`+v.comment:_.comment=v.comment);let ee=new ao(_,y);if(n.options.keepSourceTokens&&(ee.srcToken=l),o){let e=c;ws(n,e.items,_)&&i(a,`DUPLICATE_KEY`,`Map keys must be unique`),e.items.push(ee)}else{let e=new fo(n.schema);e.flow=!0,e.items.push(ee);let t=(y??_).range;e.range=[_.range[0],t[1],t[2]],c.items.push(e)}u=y?y.range[2]:v.end}}let f=o?`}`:`]`,[p,...m]=r.end,h=u;if((p==null?void 0:p.source)===f)h=p.offset+p.source.length;else{let e=s[0].toUpperCase()+s.substring(1),t=l?`${e} must end with a ${f}`:`${e} in block collection must be sufficiently indented and end with a ${f}`;i(u,l?`MISSING_CHAR`:`BAD_INDENT`,t),p&&p.source.length!==1&&m.unshift(p)}if(m.length>0){let e=Os(m,h,n.options.strict,i);e.comment&&(c.comment?c.comment+=`
|
|
66
|
-
`+e.comment:c.comment=e.comment),c.range=[r.offset,h,e.offset]}else c.range=[r.offset,h,h];return c}function Ms(e,t,n,r,i,a){let o=n.type===`block-map`?Es(e,t,n,r,a):n.type===`block-seq`?Ds(e,t,n,r,a):js(e,t,n,r,a),s=o.constructor;return i===`!`||i===s.tagName?(o.tag=s.tagName,o):(i&&(o.tag=i),o)}function Ns(e,t,n,r,i){var a;let o=r.tag,s=o?t.directives.tagName(o.source,e=>i(o,`TAG_RESOLVE_FAILED`,e)):null;if(n.type===`block-seq`){let{anchor:e,newlineAfterProp:t}=r,n=e&&o?e.offset>o.offset?e:o:e??o;n&&(!t||t.offset<n.offset)&&i(n,`MISSING_CHAR`,`Missing newline after block sequence props`)}let c=n.type===`block-map`?`map`:n.type===`block-seq`?`seq`:n.start.source===`{`?`map`:`seq`;if(!o||!s||s===`!`||s===fo.tagName&&c===`map`||s===mo.tagName&&c===`seq`)return Ms(e,t,n,i,s);let l=t.schema.tags.find(e=>e.tag===s&&e.collection===c);if(!l){let r=t.schema.knownTags[s];if((r==null?void 0:r.collection)===c)t.schema.tags.push(Object.assign({},r,{default:!1})),l=r;else return r?i(o,`BAD_COLLECTION_TYPE`,`${r.tag} used for ${c} collection, but expects ${r.collection??`scalar`}`,!0):i(o,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${s}`,!0),Ms(e,t,n,i,s)}let u=Ms(e,t,n,i,s,l),d=((a=l.resolve)==null?void 0:a.call(l,u,e=>i(o,`TAG_RESOLVE_FAILED`,e),t.options))??u,f=Q(d)?d:new $(d);return f.range=u.range,f.tag=s,l!=null&&l.format&&(f.format=l.format),f}function Ps(e,t,n){let r=t.offset,i=Fs(t,e.options.strict,n);if(!i)return{value:``,type:null,comment:``,range:[r,r,r]};let a=i.mode===`>`?$.BLOCK_FOLDED:$.BLOCK_LITERAL,o=t.source?Is(t.source):[],s=o.length;for(let e=o.length-1;e>=0;--e){let t=o[e][1];if(t===``||t===`\r`)s=e;else break}if(s===0){let e=i.chomp===`+`&&o.length>0?`
|
|
67
|
-
`.repeat(Math.max(1,o.length-1)):``,n=r+i.length;return t.source&&(n+=t.source.length),{value:e,type:a,comment:i.comment,range:[r,n,n]}}let c=t.indent+i.indent,l=t.offset+i.length,u=0;for(let t=0;t<s;++t){let[r,a]=o[t];if(a===``||a===`\r`)i.indent===0&&r.length>c&&(c=r.length);else{r.length<c&&n(l+r.length,`MISSING_CHAR`,`Block scalars with more-indented leading empty lines must use an explicit indentation indicator`),i.indent===0&&(c=r.length),u=t,c===0&&!e.atRoot&&n(l,`BAD_INDENT`,`Block scalar values in collections must be indented`);break}l+=r.length+a.length+1}for(let e=o.length-1;e>=s;--e)o[e][0].length>c&&(s=e+1);let d=``,f=``,p=!1;for(let e=0;e<u;++e)d+=o[e][0].slice(c)+`
|
|
68
|
-
`;for(let e=u;e<s;++e){let[t,r]=o[e];l+=t.length+r.length+1;let s=r[r.length-1]===`\r`;if(s&&(r=r.slice(0,-1)),r&&t.length<c){let e=`Block scalar lines must not be less indented than their ${i.indent?`explicit indentation indicator`:`first line`}`;n(l-r.length-(s?2:1),`BAD_INDENT`,e),t=``}a===$.BLOCK_LITERAL?(d+=f+t.slice(c)+r,f=`
|
|
69
|
-
`):t.length>c||r[0]===` `?(f===` `?f=`
|
|
70
|
-
`:!p&&f===`
|
|
71
|
-
`&&(f=`
|
|
72
|
-
|
|
73
|
-
`),d+=f+t.slice(c)+r,f=`
|
|
74
|
-
`,p=!0):r===``?f===`
|
|
75
|
-
`?d+=`
|
|
76
|
-
`:f=`
|
|
77
|
-
`:(d+=f+r,f=` `,p=!1)}switch(i.chomp){case`-`:break;case`+`:for(let e=s;e<o.length;++e)d+=`
|
|
78
|
-
`+o[e][0].slice(c);d[d.length-1]!==`
|
|
79
|
-
`&&(d+=`
|
|
80
|
-
`);break;default:d+=`
|
|
81
|
-
`}let m=r+i.length+t.source.length;return{value:d,type:a,comment:i.comment,range:[r,m,m]}}function Fs({offset:e,props:t},n,r){if(t[0].type!==`block-scalar-header`)return r(t[0],`IMPOSSIBLE`,`Block scalar header not found`),null;let{source:i}=t[0],a=i[0],o=0,s=``,c=-1;for(let t=1;t<i.length;++t){let n=i[t];if(!s&&(n===`-`||n===`+`))s=n;else{let r=Number(n);!o&&r?o=r:c===-1&&(c=e+t)}}c!==-1&&r(c,`UNEXPECTED_TOKEN`,`Block scalar header includes extra characters: ${i}`);let l=!1,u=``,d=i.length;for(let e=1;e<t.length;++e){let i=t[e];switch(i.type){case`space`:l=!0;case`newline`:d+=i.source.length;break;case`comment`:n&&!l&&r(i,`MISSING_CHAR`,`Comments must be separated from other tokens by white space characters`),d+=i.source.length,u=i.source.substring(1);break;case`error`:r(i,`UNEXPECTED_TOKEN`,i.message),d+=i.source.length;break;default:{r(i,`UNEXPECTED_TOKEN`,`Unexpected token in block scalar header: ${i.type}`);let e=i.source;e&&typeof e==`string`&&(d+=e.length)}}}return{mode:a,indent:o,chomp:s,comment:u,length:d}}function Is(e){let t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),i=[r!=null&&r[1]?[r[1],n.slice(r[1].length)]:[``,n]];for(let e=1;e<t.length;e+=2)i.push([t[e],t[e+1]]);return i}function Ls(e,t,n){let{offset:r,type:i,source:a,end:o}=e,s,c,l=(e,t,i)=>n(r+e,t,i);switch(i){case`scalar`:s=$.PLAIN,c=Rs(a,l);break;case`single-quoted-scalar`:s=$.QUOTE_SINGLE,c=zs(a,l);break;case`double-quoted-scalar`:s=$.QUOTE_DOUBLE,c=Vs(a,l);break;default:return n(e,`UNEXPECTED_TOKEN`,`Expected a flow scalar value, but found: ${i}`),{value:``,type:null,comment:``,range:[r,r+a.length,r+a.length]}}let u=r+a.length,d=Os(o,u,t,n);return{value:c,type:s,comment:d.comment,range:[r,u,d.offset]}}function Rs(e,t){let n=``;switch(e[0]){case` `:n=`a tab character`;break;case`,`:n=`flow indicator character ,`;break;case`%`:n=`directive indicator character %`;break;case`|`:case`>`:n=`block scalar indicator ${e[0]}`;break;case`@`:case"`":n=`reserved character ${e[0]}`}return n&&t(0,`BAD_SCALAR_START`,`Plain value cannot start with ${n}`),Bs(e)}function zs(e,t){return(e[e.length-1]!==`'`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing 'quote`),Bs(e.slice(1,-1)).replace(/''/g,`'`)}function Bs(e){let t=/(.*?)\r?\n/sy,n=t.exec(e);if(!n)return e;let r,i;try{r=RegExp(`(?<![ ])[ ]+$`),i=RegExp(`^[ ]+|(?<![ ])[ ]+$`,`g`)}catch{r=/[ \t]+$/,i=/^[ \t]+|[ \t]+$/g}let a=n[1].replace(r,``),o=` `,s=t.lastIndex;for(;n=t.exec(e);){let e=n[1].replace(i,``);e===``?o===`
|
|
82
|
-
`?a+=o:o=`
|
|
83
|
-
`:(a+=o+e,o=` `),s=t.lastIndex}let c=/[ \t]*(.*)/sy;return c.lastIndex=s,n=c.exec(e),a+o+((n==null?void 0:n[1])??``)}function Vs(e,t){let n=``;for(let r=1;r<e.length-1;++r){let i=e[r];if(i!==`\r`||e[r+1]!==`
|
|
84
|
-
`){if(i===`
|
|
85
|
-
`){let{fold:t,offset:i}=Hs(e,r);n+=t,r=i}else if(i===`\\`){let i=e[++r],a=Us[i];if(a)n+=a;else if(i===`
|
|
86
|
-
`)for(i=e[r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`\r`&&e[r+1]===`
|
|
87
|
-
`)for(i=e[++r+1];i===` `||i===` `;)i=e[++r+1];else if(i===`x`||i===`u`||i===`U`){let a=i===`x`?2:i===`u`?4:8;n+=Ws(e,r+1,a,t),r+=a}else{let i=e.substr(r-1,2);t(r-1,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),n+=i}}else if(i===` `||i===` `){let t=r,a=e[r+1];for(;a===` `||a===` `;)a=e[++r+1];a!==`
|
|
88
|
-
`&&(a!==`\r`||e[r+2]!==`
|
|
89
|
-
`)&&(n+=r>t?e.slice(t,r+1):i)}else n+=i}}return(e[e.length-1]!==`"`||e.length===1)&&t(e.length,`MISSING_CHAR`,`Missing closing "quote`),n}function Hs(e,t){let n=``,r=e[t+1];for(;(r===` `||r===` `||r===`
|
|
90
|
-
`||r===`\r`)&&(r!==`\r`||e[t+2]===`
|
|
91
|
-
`);)r===`
|
|
92
|
-
`&&(n+=`
|
|
93
|
-
`),t+=1,r=e[t+1];return n||=` `,{fold:n,offset:t}}var Us={0:`\0`,a:`\x07`,b:`\b`,e:`\x1B`,f:`\f`,n:`
|
|
94
|
-
`,r:`\r`,t:` `,v:`\v`,N:`
`,_:`\xA0`,L:`\u2028`,P:`\u2029`," ":` `,'"':`"`,"/":`/`,"\\":`\\`," ":` `};function Ws(e,t,n,r){let i=e.substr(t,n),a=i.length===n&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;try{return String.fromCodePoint(a)}catch{let i=e.substr(t-2,n+2);return r(t-2,`BAD_DQ_ESCAPE`,`Invalid escape sequence ${i}`),i}}function Gs(e,t,n,r){let{value:i,type:a,comment:o,range:s}=t.type===`block-scalar`?Ps(e,t,r):Ls(t,e.options.strict,r),c=n?e.directives.tagName(n.source,e=>r(n,`TAG_RESOLVE_FAILED`,e)):null,l;l=e.options.stringKeys&&e.atKey?e.schema[Gi]:c?Ks(e.schema,i,c,n,r):t.type===`scalar`?qs(e,i,t,r):e.schema[Gi];let u;try{let a=l.resolve(i,e=>r(n??t,`TAG_RESOLVE_FAILED`,e),e.options);u=X(a)?a:new $(a)}catch(e){let a=e instanceof Error?e.message:String(e);r(n??t,`TAG_RESOLVE_FAILED`,a),u=new $(i)}return u.range=s,u.source=i,a&&(u.type=a),c&&(u.tag=c),l.format&&(u.format=l.format),o&&(u.comment=o),u}function Ks(e,t,n,r,i){var a;if(n===`!`)return e[Gi];let o=[];for(let t of e.tags)if(!t.collection&&t.tag===n){if(t.default&&t.test)o.push(t);else return t}for(let e of o)if((a=e.test)!=null&&a.test(t))return e;let s=e.knownTags[n];return s&&!s.collection?(e.tags.push(Object.assign({},s,{default:!1,test:void 0})),s):(i(r,`TAG_RESOLVE_FAILED`,`Unresolved tag: ${n}`,n!==`tag:yaml.org,2002:str`),e[Gi])}function qs({atKey:e,directives:t,schema:n},r,i,a){let o=n.tags.find(t=>{var n;return(t.default===!0||e&&t.default===`key`)&&((n=t.test)==null?void 0:n.test(r))})||n[Gi];if(n.compat){let e=n.compat.find(e=>{var t;return e.default&&((t=e.test)==null?void 0:t.test(r))})??n[Gi];o.tag!==e.tag&&a(i,`TAG_RESOLVE_FAILED`,`Value may be parsed as either ${t.tagString(o.tag)} or ${t.tagString(e.tag)}`,!0)}return o}function Js(e,t,n){if(t){n??=t.length;for(let r=n-1;r>=0;--r){let n=t[r];switch(n.type){case`space`:case`comment`:case`newline`:e-=n.source.length;continue}for(n=t[++r];(n==null?void 0:n.type)===`space`;)e+=n.source.length,n=t[++r];break}}return e}var Ys={composeNode:Xs,composeEmptyNode:Zs};function Xs(e,t,n,r){let i=e.atKey,{spaceBefore:a,comment:o,anchor:s,tag:c}=n,l,u=!0;switch(t.type){case`alias`:l=Qs(e,t,r),(s||c)&&r(t,`ALIAS_PROPS`,`An alias node must not specify any properties`);break;case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`block-scalar`:l=Gs(e,t,c,r),s&&(l.anchor=s.source.substring(1));break;case`block-map`:case`block-seq`:case`flow-collection`:try{l=Ns(Ys,e,t,n,r),s&&(l.anchor=s.source.substring(1))}catch(e){r(t,`RESOURCE_EXHAUSTION`,e instanceof Error?e.message:String(e))}break;default:r(t,`UNEXPECTED_TOKEN`,t.type===`error`?t.message:`Unsupported token (type: ${t.type})`),u=!1}return l??=Zs(e,t.offset,void 0,null,n,r),s&&l.anchor===``&&r(s,`BAD_ALIAS`,`Anchor cannot be an empty string`),i&&e.options.stringKeys&&(!X(l)||typeof l.value!=`string`||l.tag&&l.tag!==`tag:yaml.org,2002:str`)&&r(c??t,`NON_STRING_KEY`,`With stringKeys, all keys must be strings`),a&&(l.spaceBefore=!0),o&&(t.type===`scalar`&&t.source===``?l.comment=o:l.commentBefore=o),e.options.keepSourceTokens&&u&&(l.srcToken=t),l}function Zs(e,t,n,r,{spaceBefore:i,comment:a,anchor:o,tag:s,end:c},l){let u=Gs(e,{type:`scalar`,offset:Js(t,n,r),indent:-1,source:``},s,l);return o&&(u.anchor=o.source.substring(1),u.anchor===``&&l(o,`BAD_ALIAS`,`Anchor cannot be an empty string`)),i&&(u.spaceBefore=!0),a&&(u.comment=a,u.range[2]=c),u}function Qs({options:e},{offset:t,source:n,end:r},i){let a=new _a(n.substring(1));a.source===``&&i(t,`BAD_ALIAS`,`Alias cannot be an empty string`),a.source.endsWith(`:`)&&i(t+n.length-1,`BAD_ALIAS`,`Alias ending in : is ambiguous`,!0);let o=t+n.length,s=Os(r,o,e.strict,i);return a.range=[t,o,s.offset],s.comment&&(a.comment=s.comment),a}function $s(e,t,{offset:n,start:r,value:i,end:a},o){let s=new hs(void 0,Object.assign({_directives:t},e)),c={atKey:!1,atRoot:!0,directives:s.directives,options:s.options,schema:s.schema},l=xs(r,{indicator:`doc-start`,next:i??(a==null?void 0:a[0]),offset:n,onError:o,parentIndent:0,startOnNewline:!0});l.found&&(s.directives.docStart=!0,i&&(i.type===`block-map`||i.type===`block-seq`)&&!l.hasNewline&&o(l.end,`MISSING_CHAR`,`Block collection cannot start on same line with directives-end marker`)),s.contents=i?Xs(c,i,l,o):Zs(c,l.end,r,null,l,o);let u=s.contents.range[2],d=Os(a,u,!1,o);return d.comment&&(s.comment=d.comment),s.range=[n,u,d.offset],s}function ec(e){if(typeof e==`number`)return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];let{offset:t,source:n}=e;return[t,t+(typeof n==`string`?n.length:1)]}function tc(e){let t=``,n=!1,r=!1;for(let a=0;a<e.length;++a){let o=e[a];switch(o[0]){case`#`:t+=(t===``?``:r?`
|
|
95
|
-
|
|
96
|
-
`:`
|
|
97
|
-
`)+(o.substring(1)||` `),n=!0,r=!1;break;case`%`:var i;((i=e[a+1])==null?void 0:i[0])!==`#`&&(a+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}var nc=class{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(e,t,n,r)=>{let i=ec(e);r?this.warnings.push(new ys(i,t,n)):this.errors.push(new vs(i,t,n))},this.directives=new la({version:e.version||`1.2`}),this.options=e}decorate(e,t){let{comment:n,afterEmptyLine:r}=tc(this.prelude);if(n){let i=e.contents;if(t)e.comment=e.comment?`${e.comment}\n${n}`:n;else if(r||e.directives.docStart||!i)e.commentBefore=n;else if(Z(i)&&!i.flow&&i.items.length>0){let e=i.items[0];Y(e)&&(e=e.key);let t=e.commentBefore;e.commentBefore=t?`${n}\n${t}`:n}else{let e=i.commentBefore;i.commentBefore=e?`${n}\n${e}`:n}}if(t){for(let t=0;t<this.errors.length;++t)e.errors.push(this.errors[t]);for(let t=0;t<this.warnings.length;++t)e.warnings.push(this.warnings[t])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:tc(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,n=-1){for(let t of e)yield*this.next(t);yield*this.end(t,n)}*next(e){switch(e.type){case`directive`:this.directives.add(e.source,(t,n,r)=>{let i=ec(e);i[0]+=t,this.onError(i,`BAD_DIRECTIVE`,n,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case`document`:{let t=$s(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,`MISSING_CHAR`,`Missing directives-end/doc-start indicator line`),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case`byte-order-mark`:case`space`:break;case`comment`:case`newline`:this.prelude.push(e.source);break;case`error`:{let t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,n=new vs(ec(e),`UNEXPECTED_TOKEN`,t);this.atDirectives||!this.doc?this.errors.push(n):this.doc.errors.push(n);break}case`doc-end`:{if(!this.doc){this.errors.push(new vs(ec(e),`UNEXPECTED_TOKEN`,`Unexpected doc-end without preceding document`));break}this.doc.directives.docEnd=!0;let t=Os(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){let e=this.doc.comment;this.doc.comment=e?`${e}\n${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new vs(ec(e),`UNEXPECTED_TOKEN`,`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){let e=new hs(void 0,Object.assign({_directives:this.directives},this.options));this.atDirectives&&this.onError(t,`MISSING_CHAR`,`Missing directives-end indicator line`),e.range=[0,t,t],this.decorate(e,!1),yield e}}},rc=Symbol(`break visit`),ic=Symbol(`skip children`),ac=Symbol(`remove item`);function oc(e,t){`type`in e&&e.type===`document`&&(e={start:e.start,value:e.value}),sc(Object.freeze([]),e,t)}oc.BREAK=rc,oc.SKIP=ic,oc.REMOVE=ac,oc.itemAtPath=(e,t)=>{let n=e;for(let[e,r]of t){let t=n==null?void 0:n[e];if(t&&`items`in t)n=t.items[r];else return}return n},oc.parentCollection=(e,t)=>{let n=oc.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],i=n==null?void 0:n[r];if(i&&`items`in i)return i;throw Error(`Parent collection not found`)};function sc(e,t,n){let r=n(t,e);if(typeof r==`symbol`)return r;for(let i of[`key`,`value`]){let a=t[i];if(a&&`items`in a){for(let t=0;t<a.items.length;++t){let r=sc(Object.freeze(e.concat([[i,t]])),a.items[t],n);if(typeof r==`number`)t=r-1;else if(r===rc)return rc;else r===ac&&(a.items.splice(t,1),--t)}typeof r==`function`&&i===`key`&&(r=r(t,e))}}return typeof r==`function`?r(t,e):r}function cc(e){switch(e){case``:return`byte-order-mark`;case``:return`doc-mode`;case``:return`flow-error-end`;case``:return`scalar`;case`---`:return`doc-start`;case`...`:return`doc-end`;case``:case`
|
|
98
|
-
`:case`\r
|
|
99
|
-
`:return`newline`;case`-`:return`seq-item-ind`;case`?`:return`explicit-key-ind`;case`:`:return`map-value-ind`;case`{`:return`flow-map-start`;case`}`:return`flow-map-end`;case`[`:return`flow-seq-start`;case`]`:return`flow-seq-end`;case`,`:return`comma`}switch(e[0]){case` `:case` `:return`space`;case`#`:return`comment`;case`%`:return`directive-line`;case`*`:return`alias`;case`&`:return`anchor`;case`!`:return`tag`;case`'`:return`single-quoted-scalar`;case`"`:return`double-quoted-scalar`;case`|`:case`>`:return`block-scalar-header`}return null}function lc(e){switch(e){case void 0:case` `:case`
|
|
100
|
-
`:case`\r`:case` `:return!0;default:return!1}}var uc=new Set(`0123456789ABCDEFabcdef`),dc=new Set(`0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()`),fc=new Set(`,[]{}`),pc=new Set(` ,[]{}
|
|
101
|
-
\r `),mc=e=>!e||pc.has(e),hc=class{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer=``,this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!=`string`)throw TypeError(`source is not a string`);this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let n=this.next??`stream`;for(;n&&(t||this.hasChars(1));)n=yield*this.parseNext(n)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===` `||t===` `;)t=this.buffer[++e];return!t||t===`#`||t===`
|
|
102
|
-
`||t===`\r`&&this.buffer[e+1]===`
|
|
103
|
-
`}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let n=0;for(;t===` `;)t=this.buffer[++n+e];if(t===`\r`){let t=this.buffer[n+e+1];if(t===`
|
|
104
|
-
`||!t&&!this.atEnd)return e+n+1}return t===`
|
|
105
|
-
`||n>=this.indentNext||!t&&!this.atEnd?e+n:-1}if(t===`-`||t===`.`){let t=this.buffer.substr(e,3);if((t===`---`||t===`...`)&&lc(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!=`number`||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
106
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]===`\r`&&--e,this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case`stream`:return yield*this.parseStream();case`line-start`:return yield*this.parseLineStart();case`block-start`:return yield*this.parseBlockStart();case`doc`:return yield*this.parseDocument();case`flow`:return yield*this.parseFlowCollection();case`quoted-scalar`:return yield*this.parseQuotedScalar();case`block-scalar`:return yield*this.parseBlockScalar();case`plain-scalar`:return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext(`stream`);if(e[0]===``&&(yield*this.pushCount(1),e=e.substring(1)),e[0]===`%`){let t=e.length,n=e.indexOf(`#`);for(;n!==-1;){let r=e[n-1];if(r===` `||r===` `){t=n-1;break}n=e.indexOf(`#`,n+1)}for(;;){let n=e[t-1];if(n===` `||n===` `)--t;else break}let r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),`stream`}if(this.atLineEnd()){let t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),`stream`}return yield``,yield*this.parseLineStart()}*parseLineStart(){let e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext(`line-start`);if(e===`-`||e===`.`){if(!this.atEnd&&!this.hasChars(4))return this.setNext(`line-start`);let e=this.peek(3);if((e===`---`||e===`...`)&&lc(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,e===`---`?`doc`:`stream`}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!lc(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){let[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext(`block-start`);if((e===`-`||e===`?`||e===`:`)&&lc(t)){let e=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=e,`block-start`}return`doc`}*parseDocument(){yield*this.pushSpaces(!0);let e=this.getLine();if(e===null)return this.setNext(`doc`);let t=yield*this.pushIndicators();switch(e[t]){case`#`:yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),`doc`;case`*`:return yield*this.pushUntil(mc),`doc`;case`"`:case`'`:return yield*this.parseQuotedScalar();case`|`:case`>`:return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,n=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=n=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);let r=this.getLine();if(r===null)return this.setNext(`flow`);if((n!==-1&&n<this.indentNext&&r[0]!==`#`||n===0&&(r.startsWith(`---`)||r.startsWith(`...`))&&lc(r[3]))&&(n!==this.indentNext-1||this.flowLevel!==1||r[0]!==`]`&&r[0]!==`}`))return this.flowLevel=0,yield``,yield*this.parseLineStart();let i=0;for(;r[i]===`,`;)i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(i+=yield*this.pushIndicators(),r[i]){case void 0:return`flow`;case`#`:return yield*this.pushCount(r.length-i),`flow`;case`{`:case`[`:return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,`flow`;case`}`:case`]`:return yield*this.pushCount(1),this.flowKey=!0,--this.flowLevel,this.flowLevel?`flow`:`doc`;case`*`:return yield*this.pushUntil(mc),`flow`;case`"`:case`'`:return this.flowKey=!0,yield*this.parseQuotedScalar();case`:`:{let e=this.charAt(1);if(this.flowKey||lc(e)||e===`,`)return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),`flow`}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){let e=this.charAt(0),t=this.buffer.indexOf(e,this.pos+1);if(e===`'`)for(;t!==-1&&this.buffer[t+1]===`'`;)t=this.buffer.indexOf(`'`,t+2);else for(;t!==-1;){let e=0;for(;this.buffer[t-1-e]===`\\`;)e+=1;if(e%2==0)break;t=this.buffer.indexOf(`"`,t+1)}let n=this.buffer.substring(0,t),r=n.indexOf(`
|
|
107
|
-
`,this.pos);if(r!==-1){for(;r!==-1;){let e=this.continueScalar(r+1);if(e===-1)break;r=n.indexOf(`
|
|
108
|
-
`,e)}r!==-1&&(t=r-(n[r-1]===`\r`?2:1))}if(t===-1){if(!this.atEnd)return this.setNext(`quoted-scalar`);t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?`flow`:`doc`}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){let t=this.buffer[++e];if(t===`+`)this.blockScalarKeep=!0;else if(t>`0`&&t<=`9`)this.blockScalarIndent=Number(t)-1;else if(t!==`-`)break}return yield*this.pushUntil(e=>lc(e)||e===`#`)}*parseBlockScalar(){let e=this.pos-1,t=0,n;loop:for(let r=this.pos;n=this.buffer[r];++r)switch(n){case` `:t+=1;break;case`
|
|
109
|
-
`:e=r,t=0;break;case`\r`:{let e=this.buffer[r+1];if(!e&&!this.atEnd)return this.setNext(`block-scalar`);if(e===`
|
|
110
|
-
`)break}default:break loop}if(!n&&!this.atEnd)return this.setNext(`block-scalar`);if(t>=this.indentNext){this.indentNext=this.blockScalarIndent===-1?t:this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{let t=this.continueScalar(e+1);if(t===-1)break;e=this.buffer.indexOf(`
|
|
111
|
-
`,t)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext(`block-scalar`);e=this.buffer.length}}let r=e+1;for(n=this.buffer[r];n===` `;)n=this.buffer[++r];if(n===` `){for(;n===` `||n===` `||n===`\r`||n===`
|
|
112
|
-
`;)n=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let n=e-1,r=this.buffer[n];r===`\r`&&(r=this.buffer[--n]);let i=n;for(;r===` `;)r=this.buffer[--n];if(r===`
|
|
113
|
-
`&&n>=this.pos&&n+1+t>i)e=n;else break}while(1);return yield``,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){let e=this.flowLevel>0,t=this.pos-1,n=this.pos-1,r;for(;r=this.buffer[++n];)if(r===`:`){let r=this.buffer[n+1];if(lc(r)||e&&fc.has(r))break;t=n}else if(lc(r)){let i=this.buffer[n+1];if(r===`\r`&&(i===`
|
|
114
|
-
`?(n+=1,r=`
|
|
115
|
-
`,i=this.buffer[n+1]):t=n),i===`#`||e&&fc.has(i))break;if(r===`
|
|
116
|
-
`){let e=this.continueScalar(n+1);if(e===-1)break;n=Math.max(n,e-2)}}else{if(e&&fc.has(r))break;t=n}return!r&&!this.atEnd?this.setNext(`plain-scalar`):(yield``,yield*this.pushToIndex(t+1,!0),e?`flow`:`doc`)}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){let n=this.buffer.slice(this.pos,e);return n?(yield n,this.pos+=n.length,n.length):(t&&(yield``),0)}*pushIndicators(){let e=0;loop:for(;;){switch(this.charAt(0)){case`!`:e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue loop;case`&`:e+=yield*this.pushUntil(mc),e+=yield*this.pushSpaces(!0);continue loop;case`-`:case`?`:case`:`:{let t=this.flowLevel>0,n=this.charAt(1);if(lc(n)||t&&fc.has(n)){t?this.flowKey&&=!1:this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue loop}}}break loop}return e}*pushTag(){if(this.charAt(1)===`<`){let e=this.pos+2,t=this.buffer[e];for(;!lc(t)&&t!==`>`;)t=this.buffer[++e];return yield*this.pushToIndex(t===`>`?e+1:e,!1)}{let e=this.pos+1,t=this.buffer[e];for(;t;)if(dc.has(t))t=this.buffer[++e];else if(t===`%`&&uc.has(this.buffer[e+1])&&uc.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){let e=this.buffer[this.pos];return e===`
|
|
117
|
-
`?yield*this.pushCount(1):e===`\r`&&this.charAt(1)===`
|
|
118
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,n;do n=this.buffer[++t];while(n===` `||e&&n===` `);let r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,n=this.buffer[t];for(;!e(n);)n=this.buffer[++t];return yield*this.pushToIndex(t,!1)}},gc=class{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,n=this.lineStarts.length;for(;t<n;){let r=t+n>>1;this.lineStarts[r]<e?t=r+1:n=r}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};let r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}};function _c(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function vc(e){for(let t=0;t<e.length;++t)switch(e[t].type){case`space`:case`comment`:case`newline`:break;default:return t}return-1}function yc(e){switch(e==null?void 0:e.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:case`flow-collection`:return!0;default:return!1}}function bc(e){switch(e.type){case`document`:return e.start;case`block-map`:{let t=e.items[e.items.length-1];return t.sep??t.start}case`block-seq`:return e.items[e.items.length-1].start;default:return[]}}function xc(e){var t;if(e.length===0)return[];let n=e.length;loop:for(;--n>=0;)switch(e[n].type){case`doc-start`:case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:case`newline`:break loop}for(;((t=e[++n])==null?void 0:t.type)===`space`;);return e.splice(n,e.length)}function Sc(e,t){if(t.length<1e5)Array.prototype.push.apply(e,t);else for(let n=0;n<t.length;++n)e.push(t[n])}function Cc(e){if(e.start.type===`flow-seq-start`)for(let t of e.items)t.sep&&!t.value&&!_c(t.start,`explicit-key-ind`)&&!_c(t.sep,`map-value-ind`)&&(t.key&&(t.value=t.key),delete t.key,yc(t.value)?t.value.end?Sc(t.value.end,t.sep):t.value.end=t.sep:Sc(t.start,t.sep),delete t.sep)}var wc=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source=``,this.type=``,this.lexer=new hc,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(let n of this.lexer.lex(e,t))yield*this.next(n);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}let t=cc(e);if(!t){let t=`Not a YAML token: ${e}`;yield*this.pop({type:`error`,offset:this.offset,message:t,source:e}),this.offset+=e.length}else if(t===`scalar`)this.atNewLine=!1,this.atScalar=!0,this.type=`scalar`;else{switch(this.type=t,yield*this.step(),t){case`newline`:this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case`space`:this.atNewLine&&e[0]===` `&&(this.indent+=e.length);break;case`explicit-key-ind`:case`map-value-ind`:case`seq-item-ind`:this.atNewLine&&(this.indent+=e.length);break;case`doc-mode`:case`flow-error-end`:return;default:this.atNewLine=!1}this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){let e=this.peek(1);if(this.type===`doc-end`&&(e==null?void 0:e.type)!==`doc-end`){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:`doc-end`,offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case`document`:return yield*this.document(e);case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return yield*this.scalar(e);case`block-scalar`:return yield*this.blockScalar(e);case`block-map`:return yield*this.blockMap(e);case`block-seq`:return yield*this.blockSequence(e);case`flow-collection`:return yield*this.flowCollection(e);case`doc-end`:return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){let t=e??this.stack.pop();if(!t)yield{type:`error`,offset:this.offset,source:``,message:`Tried to pop an empty stack`};else if(this.stack.length===0)yield t;else{let e=this.peek(1);switch(t.type===`block-scalar`?t.indent=`indent`in e?e.indent:0:t.type===`flow-collection`&&e.type===`document`&&(t.indent=0),t.type===`flow-collection`&&Cc(t),e.type){case`document`:e.value=t;break;case`block-scalar`:e.props.push(t);break;case`block-map`:{let n=e.items[e.items.length-1];if(n.value){e.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}if(n.sep)n.value=t;else{Object.assign(n,{key:t,sep:[]}),this.onKeyLine=!n.explicitKey;return}break}case`block-seq`:{let n=e.items[e.items.length-1];n.value?e.items.push({start:[],value:t}):n.value=t;break}case`flow-collection`:{let n=e.items[e.items.length-1];!n||n.value?e.items.push({start:[],key:t,sep:[]}):n.sep?n.value=t:Object.assign(n,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((e.type===`document`||e.type===`block-map`||e.type===`block-seq`)&&(t.type===`block-map`||t.type===`block-seq`)){let n=t.items[t.items.length-1];n&&!n.sep&&!n.value&&n.start.length>0&&vc(n.start)===-1&&(t.indent===0||n.start.every(e=>e.type!==`comment`||e.indent<t.indent))&&(e.type===`document`?e.end=n.start:e.items.push({start:n.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case`directive-line`:yield{type:`directive`,offset:this.offset,source:this.source};return;case`byte-order-mark`:case`space`:case`comment`:case`newline`:yield this.sourceToken;return;case`doc-mode`:case`doc-start`:{let e={type:`document`,offset:this.offset,start:[]};this.type===`doc-start`&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case`doc-start`:vc(e.start)===-1?e.start.push(this.sourceToken):(yield*this.pop(),yield*this.step());return;case`anchor`:case`tag`:case`space`:case`comment`:case`newline`:e.start.push(this.sourceToken);return}let t=this.startBlockValue(e);t?this.stack.push(t):yield{type:`error`,offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type===`map-value-ind`){let t=xc(bc(this.peek(2))),n;e.end?(n=e.end,n.push(this.sourceToken),delete e.end):n=[this.sourceToken];let r={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:t,key:e,sep:n}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=r}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case`space`:case`comment`:case`newline`:e.props.push(this.sourceToken);return;case`scalar`:if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let e=this.source.indexOf(`
|
|
119
|
-
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
120
|
-
`,e)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(this.onKeyLine=!1,t.value){let n=`end`in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;(r==null?void 0:r.type)===`comment`?n==null||n.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){var n;let r=e.items[e.items.length-2],i=r==null||(n=r.value)==null?void 0:n.end;if(Array.isArray(i)){Sc(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){let n=!this.onKeyLine&&this.indent===e.indent,r=n&&(t.sep||t.explicitKey)&&this.type!==`seq-item-ind`,i=[];if(r&&t.sep&&!t.value){let n=[];for(let r=0;r<t.sep.length;++r){let i=t.sep[r];switch(i.type){case`newline`:n.push(r);break;case`space`:break;case`comment`:i.indent>e.indent&&(n.length=0);break;default:n.length=0}}n.length>=2&&(i=t.sep.splice(n[1]))}switch(this.type){case`anchor`:case`tag`:r||t.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`explicit-key-ind`:!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case`map-value-ind`:if(t.explicitKey){if(!t.sep){if(_c(t.start,`newline`))Object.assign(t,{key:null,sep:[this.sourceToken]});else{let e=xc(t.start);this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:null,sep:[this.sourceToken]}]})}}else if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(_c(t.sep,`map-value-ind`))this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(yc(t.key)&&!_c(t.sep,`newline`)){let e=xc(t.start),n=t.key,r=t.sep;r.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:e,key:n,sep:r}]})}else i.length>0?t.sep=t.sep.concat(i,this.sourceToken):t.sep.push(this.sourceToken)}else t.sep?t.value||r?e.items.push({start:i,key:null,sep:[this.sourceToken]}):_c(t.sep,`map-value-ind`)?this.stack.push({type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);r||t.value?(e.items.push({start:i,key:n,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(n):(Object.assign(t,{key:n,sep:[]}),this.onKeyLine=!0);return}default:{let r=this.startBlockValue(e);if(r){if(r.type===`block-seq`){if(!t.explicitKey&&t.sep&&!_c(t.sep,`newline`)){yield*this.pop({type:`error`,offset:this.offset,message:`Unexpected block-seq-ind on same line with key`,source:this.source});return}}else n&&e.items.push({start:i});this.stack.push(r);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){let t=e.items[e.items.length-1];switch(this.type){case`newline`:if(t.value){let n=`end`in t.value?t.value.end:void 0,r=Array.isArray(n)?n[n.length-1]:void 0;(r==null?void 0:r.type)===`comment`?n==null||n.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case`space`:case`comment`:if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){var n;let r=e.items[e.items.length-2],i=r==null||(n=r.value)==null?void 0:n.end;if(Array.isArray(i)){Sc(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case`anchor`:case`tag`:if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case`seq-item-ind`:if(this.indent!==e.indent)break;t.value||_c(t.start,`seq-item-ind`)?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){let t=this.startBlockValue(e);if(t){this.stack.push(t);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){let t=e.items[e.items.length-1];if(this.type===`flow-error-end`){let e;do yield*this.pop(),e=this.peek(1);while((e==null?void 0:e.type)===`flow-collection`)}else if(e.end.length===0){switch(this.type){case`comma`:case`explicit-key-ind`:!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case`map-value-ind`:!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case`space`:case`comment`:case`newline`:case`anchor`:case`tag`:!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:{let n=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:n,sep:[]}):t.sep?this.stack.push(n):Object.assign(t,{key:n,sep:[]});return}case`flow-map-end`:case`flow-seq-end`:e.end.push(this.sourceToken);return}let n=this.startBlockValue(e);n?this.stack.push(n):(yield*this.pop(),yield*this.step())}else{let t=this.peek(2);if(t.type===`block-map`&&(this.type===`map-value-ind`&&t.indent===e.indent||this.type===`newline`&&!t.items[t.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type===`map-value-ind`&&t.type!==`flow-collection`){let n=xc(bc(t));Cc(e);let r=e.end.splice(1,e.end.length);r.push(this.sourceToken);let i={type:`block-map`,offset:e.offset,indent:e.indent,items:[{start:n,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=i}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let e=this.source.indexOf(`
|
|
121
|
-
`)+1;for(;e!==0;)this.onNewLine(this.offset+e),e=this.source.indexOf(`
|
|
122
|
-
`,e)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case`alias`:case`scalar`:case`single-quoted-scalar`:case`double-quoted-scalar`:return this.flowScalar(this.type);case`block-scalar-header`:return{type:`block-scalar`,offset:this.offset,indent:this.indent,props:[this.sourceToken],source:``};case`flow-map-start`:case`flow-seq-start`:return{type:`flow-collection`,offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case`seq-item-ind`:return{type:`block-seq`,offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case`explicit-key-ind`:{this.onKeyLine=!0;let t=xc(bc(e));return t.push(this.sourceToken),{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,explicitKey:!0}]}}case`map-value-ind`:{this.onKeyLine=!0;let t=xc(bc(e));return{type:`block-map`,offset:this.offset,indent:this.indent,items:[{start:t,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!==`comment`||this.indent<=t?!1:e.every(e=>e.type===`newline`||e.type===`space`)}*documentEnd(e){this.type!==`doc-mode`&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case`comma`:case`doc-start`:case`doc-end`:case`flow-seq-end`:case`flow-map-end`:case`map-value-ind`:yield*this.pop(),yield*this.step();break;case`newline`:this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type===`newline`&&(yield*this.pop())}}};function Tc(e){let t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new gc||null,prettyErrors:t}}function Ec(e,t={}){let{lineCounter:n,prettyErrors:r}=Tc(t),i=new wc(n==null?void 0:n.addNewLine),a=new nc(t),o=null;for(let t of a.compose(i.parse(e),!0,e.length))if(!o)o=t;else if(o.options.logLevel!==`silent`){o.errors.push(new vs(t.range.slice(0,2),`MULTIPLE_DOCS`,`Source contains multiple documents; please use YAML.parseAllDocuments()`));break}return r&&n&&(o.errors.forEach(bs(e,n)),o.warnings.forEach(bs(e,n))),o}function Dc(e,t,n){let r;typeof t==`function`?r=t:n===void 0&&t&&typeof t==`object`&&(n=t);let i=Ec(e,n);if(!i)return null;if(i.warnings.forEach(e=>Ya(i.options.logLevel,e)),i.errors.length>0){if(i.options.logLevel!==`silent`)throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},n))}f();var Oc={fullWidth:{width:`100%`},flex:{display:`flex`},button:{height:48,minWidth:48},wrapper:{width:`calc(100vw - 40px)`,height:`calc(100vh - 188px)`}},kc=class extends q{async componentDidMount(){await super.componentDidMount();let{data:e,attr:t}=this.props,n=q.getValue(e,t)||``;this.setState({value:n,initialized:!0,yamlError:this.validateYaml(n)})}validateYaml(e){let t=!1;if(this.props.schema.validateYaml!==!1&&typeof e==`string`&&(e||!this.props.schema.allowEmpty))try{Dc(e)}catch(e){console.log(`Error in YAML`,e),t=!0}return t}renderItem(e,t){if(!this.state.initialized)return null;let{schema:n,data:r,attr:i}=this.props,{value:a,showSelectId:o}=this.state,s=n.readOnly===!0||t;return p.createElement(U,{fullWidth:!0,variant:`standard`},p.createElement(`div`,{style:Oc.flex},p.createElement(h,{color:`grey`,style:Oc.button,size:`small`,variant:`outlined`,onClick:()=>this.setState({showSelectId:!0})},W.t(`jc_YAML editor`))),o?p.createElement(Mr,{title:this.getText(n.label),overflowHidden:!0,applyDisabled:this.state.yamlError&&this.props.schema.doNotApplyWithError||s,onClose:()=>{s?this.setState({showSelectId:!1}):this.setState({showSelectId:!1,value:q.getValue(r,i)||``})},onApply:s?void 0:()=>this.setState({showSelectId:!1},()=>i&&this.onChange(i,a))},p.createElement(`div`,{style:{...Oc.wrapper,border:this.state.yamlError?`2px solid red`:`2px solid transparent`}},p.createElement(Pr,{mode:`yaml`,value:typeof a==`object`?JSON.stringify(a):a,onChange:s?void 0:e=>this.setState({value:e,yamlError:this.validateYaml(e)}),name:`ConfigYamlEditor`,themeType:this.props.oContext.themeType,AceEditor:this.props.oContext.AceEditor}))):null,n.help||this.state.yamlError?p.createElement(V,null,this.state.yamlError?W.t(`jc_Invalid YAML`):this.renderHelp(this.props.schema.help,this.props.schema.helpLink,this.props.schema.noTranslation)):null)}};f();var Ac=class extends q{async componentDidMount(){await super.componentDidMount();let e=await i(()=>import(`./lib-DDU2Oe48.js`),__vite__mapDeps([0]),import.meta.url);this.setState({QRCode:e.default})}renderItem(){let e=this.state.QRCode;if(!e)return null;let t=Math.max(32,Math.round((this.props.schema.size||256)*.15));return p.createElement(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,backgroundColor:this.props.schema.bgColor||`white`,padding:t,width:`100%`,height:`100%`,boxSizing:`border-box`}},p.createElement(e,{title:this.getText(this.props.schema.tooltip),value:this.props.schema.data,size:this.props.schema.size,fgColor:this.props.schema.fgColor,bgColor:this.props.schema.bgColor,level:this.props.schema.level}))}};f();var jc=class extends q{constructor(...e){super(...e),G(this,`initialized`,!1),G(this,`localContext`,void 0)}async componentDidMount(){await super.componentDidMount();let e=await i(()=>import(`./lib-DDU2Oe48.js`),__vite__mapDeps([0]),import.meta.url);this.setState({QRCode:e.default}),this.props.schema.sendFirstByClick||await this.askInstance()}async askInstance(){if(this.props.alive){let e=this.props.schema.data;if(e===void 0&&this.props.schema.jsonData){let t=await this.getPatternAsync(this.props.schema.jsonData,null,!0);if(t)try{e=JSON.parse(t)}catch{console.error(`Cannot parse json data: ${JSON.stringify(e)}`)}}e??=null;let t=await this.getPatternAsync(this.props.schema.instance||`${this.props.oContext.adapterName}.${this.props.oContext.instance}`);if(t!==`${this.props.oContext.adapterName}.${this.props.oContext.instance}`){let e=await this.props.oContext.socket.getState(`system.adapter.${t}.alive`);if(!(e!=null&&e.val)){window.alert(W.t(`jc_Instance %s is not alive`,t));return}}this.setState({loading:!0},()=>this.props.oContext.socket.sendTo(t,this.props.schema.command||`send`,e).then(e=>this.setState({qrData:e||``,loading:!1})))}}getContext(){let e={};return Array.isArray(this.props.schema.alsoDependsOn)&&this.props.schema.alsoDependsOn.forEach(t=>e[t]=q.getValue(this.props.data,t)),JSON.stringify(e)}renderItem(){if(this.props.alive){let e=this.getContext();(e!==this.localContext||!this.initialized)&&(this.localContext=e,(!this.props.schema.sendFirstByClick||this.state.qrData!==void 0)&&setTimeout(()=>this.askInstance(),this.initialized?300:50),this.initialized=!0)}if(!this.state.qrData&&this.props.schema.sendFirstByClick)return this.props.alive?p.createElement(`div`,{style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:this.state.loading?`default`:`pointer`},onClick:()=>!this.state.loading&&this.askInstance()},this.state.loading?p.createElement(Nt,null):typeof this.props.schema.sendFirstByClick==`boolean`?W.t(`jc_Click to show`):this.getText(this.props.schema.sendFirstByClick,this.props.schema.noTranslation)):p.createElement(`div`,{style:{width:`100%`,display:`flex`,alignItems:`center`,justifyContent:`center`,cursor:this.state.loading?`default`:`pointer`},onClick:()=>!this.state.loading&&this.askInstance()},W.t(`jc_Instance %s is not alive`,this.props.oContext.instance.toString()));let e=this.state.QRCode;if(!e||this.state.qrData===void 0)return null;let t=Math.max(32,Math.round((this.props.schema.size||256)*.15));return p.createElement(`div`,{style:{display:`flex`,justifyContent:`center`,alignItems:`center`,backgroundColor:this.props.schema.bgColor||`white`,padding:t,width:`100%`,height:`100%`,boxSizing:`border-box`}},p.createElement(e,{title:this.getText(this.props.schema.tooltip),value:this.state.qrData,size:this.props.schema.size,fgColor:this.props.schema.fgColor,bgColor:this.props.schema.bgColor,level:this.props.schema.level}))}};f();var Mc={accordion:mn,alive:gn,autocomplete:_n,autocompleteSendTo:vn,certCollection:wn,certificate:xn,certificates:Cn,checkbox:zn,checkDocker:Tn,checkLicense:Rn,chip:Gn,chips:Gn,color:Kn,coordinates:Jn,credential:In,cron:bn,custom:rr,datePicker:ir,deviceManager:ar,divider:mi,file:yr,fileSelector:fr,func:br,header:gi,iframe:xr,iframeSendTo:Sr,image:Tr,imageSendTo:wr,infoBox:Er,instance:Or,interface:Ar,ip:Cr,jsonEditor:Ir,language:Rr,license:zr,number:Vr,oauth2:Hr,objectId:Wr,password:qr,pattern:Jr,port:Xr,qrCode:Ac,qrCodeSendTo:jc,room:Zr,select:$r,selectSendTo:ti,sendto:ai,sendTo:ai,setState:si,slider:li,state:fi,staticImage:_i,staticInfo:xi,staticLink:wi,staticText:wi,table:Ai,text:Mi,textSendTo:Pi,timePicker:Fi,topic:Li,uuid:Ri,user:Bi,yamlEditor:kc},Nc={fullWidth:{width:`100%`},paper:{margin:1,width:`auto !important`,overflowY:`auto`,paddingBottom:1,flex:`1 1 auto`,minHeight:0},padding:{padding:`10px`},heading:{},primary:e=>({backgroundColor:e.palette.primary.main,color:e.palette.mode===`dark`?`inherit`:`#FFF`}),secondary:e=>({backgroundColor:e.palette.secondary.main})},Pc=class e extends q{async componentDidMount(){var e;await super.componentDidMount(),(e=this.props.schema)!=null&&e.collapsable&&this.setState({expanded:(window._localStorage||window.localStorage).getItem(`${this.props.oContext.adapterName}.${this.props.attr}`)===`true`})}renderItems(t,n){return t?Object.keys(t).map(r=>{if(this.props.oContext.multiEdit&&t[r].noMultiEdit||!q.isHostAllowed(t[r],this.props.oContext.hostInfo))return null;let i=t[r].type||`panel`,a,o=`Use this.props.oContext.socket!`;if(i===`custom`)t[r].url?a=rr:this.props.oContext.customs&&this.props.oContext.customs[t[r].component]?a=this.props.oContext.customs[t[r].component]:(console.error(`Cannot find custom component: ${t[r].component}`),a=q),o=this.props.oContext.socket;else if(i===`component`){var s;let e=t[r].subType;if(e&&(s=this.props.customComponents)!=null&&s[e])a=this.props.customComponents[e];else return p.createElement(`div`,{key:`${r}_${this.props.index??``}`},`Component ${e} not provided`)}else a=i===`panel`?e:Mc[i]||q;return p.createElement(a,{socket:o,globalData:this.props.globalData,oContext:this.props.oContext,key:`${r}_${this.props.index??``}`,index:this.props.index,changed:this.props.changed,arrayIndex:this.props.arrayIndex,expertMode:this.props.expertMode,commandRunning:this.props.commandRunning,style:Nc.panel,common:this.props.common,alive:this.props.alive,themeName:this.props.themeName,data:this.props.data,originalData:this.props.originalData,onError:this.props.onError,onHiddenChanged:this.props.onHiddenChanged,onFilterLabelUpdate:this.props.onFilterLabelUpdate,onChange:this.props.onChange,disabled:n,customObj:this.props.customObj,custom:this.props.custom,schema:t[r],attr:r,table:this.props.table,customComponents:this.props.customComponents})}):null}render(){let e=this.props.schema;if(!e||(this.updateCalculatedValues(),!this.state.calculatedValues))return null;let t=this.props.schema.items,n=this.props.schema.style||{};if(this.state.calculatedValues.hidden){if(e.hideOnlyControl){let t=p.createElement(Wt,{size:{xs:e.xs||void 0,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0},sx:z.getStyle(this.props.oContext.theme,{marginBottom:0,textAlign:`left`},n,this.props.oContext.themeType===`dark`?e.darkStyle:void 0)});return e.newLine?p.createElement(p.Fragment,null,p.createElement(`div`,{style:{flexBasis:`100%`,height:0}}),t):t}return null}if(this.props.table)return this.renderItems(t,this.state.calculatedValues.disabled);if(this.props.custom)return p.createElement(Wt,{key:`${this.props.attr}_${this.props.index}`,container:!0,style:Nc.fullWidth,columnSpacing:2,rowSpacing:1,sx:n},this.renderItems(t,this.state.calculatedValues.disabled));let r;if(e.collapsable)r=p.createElement(xe,{key:`${this.props.attr}_${this.props.index}`,style:Nc.fullWidth,expanded:!!this.state.expanded,onChange:()=>{(window._localStorage||window.localStorage).setItem(`${this.props.oContext.adapterName}.${this.props.attr}`,this.state.expanded?`false`:`true`),this.setState({expanded:!this.state.expanded})}},p.createElement(Xe,{expandIcon:p.createElement(je,null),sx:z.getStyle(this.props.oContext.theme,n,this.props.oContext.themeType&&e.darkStyle,e.color===`primary`?Nc.primary:e.color===`secondary`&&Nc.secondary,{width:`100%`})},p.createElement(Re,{style:Nc.heading},this.getText(e.label))),p.createElement(lt,null,p.createElement(Wt,{container:!0,columnSpacing:2,rowSpacing:1,sx:{...n,width:`100%`,padding:`10px`}},this.renderItems(t,this.state.calculatedValues.disabled))));else{let e=z.getStyle(this.props.oContext.theme,this.props.style,n,{width:`100%`},this.props.isParentTab&&Nc.paper);r=p.createElement(R,{component:`div`,key:`${this.props.attr}_${this.props.index}`,className:this.props.className,sx:e},p.createElement(Wt,{container:!0,columnSpacing:2,rowSpacing:1,sx:z.getStyle(this.props.oContext.theme,{width:`100%`},this.props.isParentTab&&Nc.padding,this.props.schema.innerStyle)},this.renderItems(t,this.state.calculatedValues.disabled)))}if(!this.props.isParentTab){let t=p.createElement(Wt,{title:this.getText(e.tooltip),size:{xs:e.xs||void 0,sm:e.sm||void 0,md:e.md||void 0,lg:e.lg||void 0,xl:e.xl||void 0},sx:{marginBottom:0,textAlign:`left`,...n}},r);return e.newLine?p.createElement(p.Fragment,null,p.createElement(`div`,{style:{flexBasis:`100%`,height:0}}),t):t}return r}};f();var Fc={tabs:{height:`100%`,width:`100%`,display:`flex`,flexDirection:`column`},tabsBar:{flex:`0 0 auto`},panel:{width:`100%`,display:`block`,flex:`1 1 auto`,minHeight:0}},Ic=class e extends q{constructor(t){super(t),G(this,`resizeObserver`,null),G(this,`resizeRaf`,null),G(this,`calculateTimeoutTable`,null),G(this,`pinTimeout`,null),G(this,`tabStateAliases`,{}),G(this,`refDiv`,void 0),G(this,`onTabError`,(e,t)=>{let n=this.state.tab;if(!n&&e){this.props.onError(e,t);return}let r={...this.state.tabErrors};n&&(r[n]||={}),n&&e&&(t?r[n][e]=t:(delete r[n][e],Object.keys(r[n]).length===0&&delete r[n])),this.setState({tabErrors:r}),this.props.onError(e,t)}),G(this,`hasTabErrors`,e=>!!this.state.tabErrors[e]&&Object.keys(this.state.tabErrors[e]).length>0),G(this,`measureWidth`,()=>{var t;let n=(t=this.refDiv.current)==null?void 0:t.clientWidth;if(!n)return;let r=this.state.useMenu;!r&&n<e.MENU_WIDTH?r=!0:r&&n>e.MENU_WIDTH+e.MENU_HYSTERESIS&&(r=!1),r!==this.state.useMenu&&this.setState({useMenu:r})}),G(this,`onHashTabsChanged`,()=>{let e=(window.location.hash||``).replace(/^#/,``).split(`/`);if(e.length>3&&e[1]===`config`){let t=e[3],n=parseInt(t,10),r;n.toString()===t?n>=0&&n<Object.keys(this.props.schema.items).length&&(r=Object.keys(this.props.schema.items)[n]):Object.keys(this.props.schema.items).includes(t)&&(r=t),r!==void 0&&r!==this.state.tab&&((window._localStorage||window.localStorage).setItem(`${this.props.dialogName||`App`}.${this.props.oContext.adapterName}`,r),this.pinWidthForTransition(),this.setState({tab:r}))}});let n;if(this.props.root){let e=(window.location.hash||``).replace(/^#/,``).split(`/`);if(e.length>=3&&e[1]===`config`){let t=e[3],r=parseInt(t,10);t&&r.toString()===t?r>=0&&r<Object.keys(this.props.schema.items).length&&(n=Object.keys(this.props.schema.items)[r]):t&&Object.keys(this.props.schema.items).includes(t)&&(n=t),window.addEventListener(`hashchange`,this.onHashTabsChanged,!1)}}n===void 0&&(n=(window._localStorage||window.localStorage).getItem(`${this.props.dialogName||`App`}.${this.props.oContext.adapterName}`)||Object.keys(this.props.schema.items)[0],Object.keys(this.props.schema.items).includes(n)||(n=Object.keys(this.props.schema.items)[0])),this.refDiv=p.createRef(),Object.assign(this.state,{tab:n,useMenu:!1,openMenu:null,tabErrors:{}})}async componentDidMount(){await super.componentDidMount(),this.measureWidth(),this.refDiv.current&&typeof ResizeObserver<`u`&&(this.resizeObserver=new ResizeObserver(()=>{this.resizeRaf===null&&(this.resizeRaf=window.requestAnimationFrame(()=>{this.resizeRaf=null,this.measureWidth()}))}),this.resizeObserver.observe(this.refDiv.current))}componentWillUnmount(){this.resizeRaf!==null&&(window.cancelAnimationFrame(this.resizeRaf),this.resizeRaf=null),this.resizeObserver&&=(this.resizeObserver.disconnect(),null),this.calculateTimeoutTable&&=(clearTimeout(this.calculateTimeoutTable),null),this.pinTimeout&&=(clearTimeout(this.pinTimeout),null),window.removeEventListener(`hashchange`,this.onHashTabsChanged,!1),super.componentWillUnmount()}pinWidthForTransition(){var e;let t=(e=this.refDiv.current)==null?void 0:e.clientWidth;t&&(this.pinTimeout&&clearTimeout(this.pinTimeout),this.state.contentMinWidth!==t&&this.setState({contentMinWidth:t}),this.pinTimeout=setTimeout(()=>{this.pinTimeout=null,this.setState({contentMinWidth:void 0})},500))}onMenuChange(e){(window._localStorage||window.localStorage).setItem(`${this.props.dialogName||`App`}.${this.props.oContext.adapterName}`,e),this.pinWidthForTransition(),this.setState({tab:e},()=>{if(this.props.root){let e=(window.location.hash||``).split(`/`);e.length>=3&&e[1]===`config`&&(e[3]=this.state.tab||``,window.location.hash=e.join(`/`))}})}usesDependsOnStates(){let e=this.props.schema.items;return super.usesDependsOnStates()||Object.keys(e||{}).some(t=>!!e[t].dependsOnStates)}async updateStateSubscriptions(){var e;this.stateAliases=await this.resolveDependsOnStates((e=this.props.schema)==null?void 0:e.dependsOnStates);let t=Object.values(this.stateAliases),n=this.props.schema.items,r={};for(let e of Object.keys(n||{}))if(n[e].dependsOnStates){let i=await this.resolveDependsOnStates(n[e].dependsOnStates);r[e]=i,t.push(...Object.values(i))}this.tabStateAliases=r,await this.subscribeOnStateIds(t)}updateCalculatedValuesForTable(){this.calculateTimeoutTable&&clearTimeout(this.calculateTimeoutTable),this.calculateTimeoutTable=setTimeout(async()=>{this.calculateTimeoutTable=null,this.usesDependsOnStates()&&await this.updateStateSubscriptions();let e=this.props.schema.items,t={};for(let n in e){let r;if(e[n].expertMode&&!this.props.expertMode){t[n]={hidden:!0,disabled:!1};continue}if(!q.isHostAllowed(e[n],this.props.oContext.hostInfo)){t[n]={hidden:!0,disabled:!1};continue}let i=this.getStateValues(this.tabStateAliases[n]||null);if(this.props.custom){let a=!!await this.executeCustom(e[n].hidden,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.index,this.props.globalData,`hidden`,i);if(a){t[n]={hidden:!0,disabled:!1};continue}r=!!await this.executeCustom(e[n].disabled,this.props.data,this.props.customObj,this.props.oContext.instanceObj,this.props.index,this.props.globalData,`disabled`,i),t[n]={hidden:a,disabled:r}}else{if(await this.execute(e[n].hidden,!1,this.props.data,this.props.index,this.props.globalData,`hidden`,i)){t[n]={hidden:!0,disabled:!1};continue}r=!!await this.execute(e[n].disabled,!1,this.props.data,this.props.index,this.props.globalData,`disabled`,i),t[n]={hidden:!1,disabled:r}}}JSON.stringify(t)!==JSON.stringify(this.state.calculatedValuesTable)&&this.setState({calculatedValuesTable:t})},50)}render(){let e=this.props.schema.items,t=!1;if(this.updateCalculatedValuesForTable(),!this.state.calculatedValuesTable)return null;let n=[];Object.keys(e).filter(e=>{var t;return!((t=this.state.calculatedValuesTable)!=null&&(t=t[e])!=null&&t.hidden)}).map(r=>{var i;let a=this.getIcon(e[r].icon);t||=!!a,n.push({icon:a,disabled:!!((i=this.state.calculatedValuesTable)!=null&&(i=i[r])!=null&&i.disabled),label:this.getText(e[r].label,void 0,this.getStateValues(this.tabStateAliases[r]||null)),name:r})}),n.find(e=>e.name===this.state.tab)||setTimeout(()=>this.setState({tab:n[0].name}),50);let r;return r=this.state.useMenu&&n.length>2?p.createElement(jt,{style:{...Fc.tabsBar,top:2,backgroundColor:this.props.oContext.themeType===`dark`?`#222`:`#DDD`},variant:`dense`},p.createElement(B,{onClick:e=>this.setState({openMenu:e.currentTarget})},p.createElement(Je,null)),this.state.openMenu?p.createElement(N,{open:!0,anchorEl:this.state.openMenu,onClose:()=>this.setState({openMenu:null})},n.map(e=>{let n=this.hasTabErrors(e.name);return p.createElement(H,{disabled:e.disabled,key:e.name,onClick:()=>{this.setState({openMenu:null},()=>this.onMenuChange(e.name))},selected:e.name===this.state.tab,sx:n?{color:`error.main`}:void 0},t?p.createElement(Oe,null,e.icon):null,p.createElement(R,{sx:{display:`flex`,alignItems:`center`,gap:.5,width:`100%`}},e.label,n&&p.createElement(y,{sx:{fontSize:16,color:`error.main`}})))})):null):p.createElement(Pe,{variant:`scrollable`,scrollButtons:`auto`,style:{...Fc.tabsBar,...this.props.schema.tabsStyle},value:this.state.tab,onChange:(e,t)=>this.onMenuChange(t)},n.map(e=>{let t=this.hasTabErrors(e.name),n=t?p.createElement(R,{sx:{display:`flex`,alignItems:`center`,gap:.5}},e.label,p.createElement(y,{sx:{fontSize:16,color:`error.main`}})):e.label;return p.createElement(k,{id:e.name,wrapped:!0,disabled:e.disabled,key:e.name,value:e.name,iconPosition:this.props.schema.iconPosition||`start`,icon:e.icon||void 0,label:n,sx:t?{"& .MuiTab-wrapper":{color:`error.main`}}:void 0})})),this.state.tab?p.createElement(`div`,{style:this.state.contentMinWidth===void 0?Fc.tabs:{...Fc.tabs,minWidth:this.state.contentMinWidth},ref:this.refDiv},r,p.createElement(Pc,{oContext:this.props.oContext,withoutSaveButtons:this.props.withoutSaveButtons,isParentTab:!0,changed:this.props.changed,key:this.state.tab,expertMode:this.props.expertMode,index:1001,arrayIndex:this.props.arrayIndex,globalData:this.props.globalData,commandRunning:this.props.commandRunning,style:Fc.panel,common:this.props.common,alive:this.props.alive,themeName:this.props.themeName,data:this.props.data,originalData:this.props.originalData,onChange:this.props.onChange,onError:this.onTabError,customObj:this.props.customObj,custom:this.props.custom,schema:e[this.state.tab],table:this.props.table,withIcons:t,customComponents:this.props.customComponents})):null}};G(Ic,`MENU_WIDTH`,600),G(Ic,`MENU_HYSTERESIS`,40);var Lc=class{constructor(e){G(this,`socket`,void 0),G(this,`states`,new Map),G(this,`owners`,new Map),G(this,`destroyed`,!1),G(this,`subscribe`,async(e,t,n)=>{if(this.destroyed)return;let r=[...new Set(t.filter(e=>e))],i=this.owners.get(e);if(i&&i.ids.length===r.length&&i.ids.every(e=>r.includes(e)))i.onChange=n;else{this.owners.set(e,{ids:r,onChange:n}),i==null||i.ids.filter(e=>!r.includes(e)).forEach(t=>this.releaseId(e,t));let t=[];if(r.forEach(n=>{let r=this.states.get(n);r?r.owners.add(e):(this.states.set(n,{owners:new Set([e]),value:null,loaded:!1}),t.push(n))}),t.length){let e=this.requestStates(t);t.forEach(t=>{let n=this.states.get(t);n&&(n.pending=e)})}}let a=r.map(e=>{var t;return(t=this.states.get(e))==null?void 0:t.pending}).filter(e=>!!e);a.length&&await Promise.all(a)}),G(this,`unsubscribe`,e=>{let t=this.owners.get(e);t&&(this.owners.delete(e),t.ids.forEach(t=>this.releaseId(e,t)))}),G(this,`getValue`,e=>{let t=this.states.get(e);if(t!=null&&t.loaded)return t.value}),G(this,`onStateChanged`,(e,t)=>{var n,r,i;let a=this.states.get(e);if(!a)return;let o=t??null,s=!a.loaded||((n=a.value)==null?void 0:n.val)!==(o==null?void 0:o.val)||((r=a.value)==null?void 0:r.ack)!==(o==null?void 0:o.ack)||((i=a.value)==null?void 0:i.q)!==(o==null?void 0:o.q);a.value=o,a.loaded=!0,s&&a.owners.forEach(t=>{try{var n;(n=this.owners.get(t))==null||n.onChange()}catch(t){console.error(`[JsonConfigComponent] Cannot process the change of ${e}: ${t}`)}})}),this.socket=e}destroy(){this.destroyed=!0;let e=[...this.states.keys()];if(this.states.clear(),this.owners.clear(),e.length)try{this.socket.unsubscribeState(e,this.onStateChanged)}catch(t){console.error(`[JsonConfigComponent] Cannot unsubscribe from ${e.join(`, `)}: ${t}`)}}async requestStates(e){try{await this.socket.subscribeState(e,this.onStateChanged)}catch(t){console.error(`[JsonConfigComponent] Cannot subscribe on ${e.join(`, `)}: ${t}`)}e.forEach(e=>{let t=this.states.get(e);t&&(t.pending=void 0,t.loaded=!0)})}releaseId(e,t){let n=this.states.get(t);if(n&&(n.owners.delete(e),!n.owners.size)){this.states.delete(t);try{this.socket.unsubscribeState(t,this.onStateChanged)}catch(e){console.error(`[JsonConfigComponent] Cannot unsubscribe from ${t}: ${e}`)}}}};f(),W.extendTranslations({en:{"jc_A credential with this name already exists":`A credential with this name already exists`,"jc_A unique name is required":`A unique name is required`,"jc_Accept license":`Accept license`,jc_Actions:`Actions`,"jc_Add credential":`Add credential`,"jc_Add row":`Add row`,"jc_All items are filtered out":`All items are filtered out`,jc_Append:`Append`,"jc_Append %s entries or replace existing?":`Append %s entries or replace existing?`,"jc_Append or replace?":`Append or replace?`,"jc_Are you sure?":`Are you sure?`,jc_Cancel:`Cancel`,"jc_Cannot add items with set filter":`Cannot add items with set filter`,"jc_Cannot create credential: %s":`Cannot create credential: %s`,"jc_Cannot decode license":`Cannot decode license`,"jc_Cannot determine position: System settings are empty and GPS detection is disabled in browser":`Cannot determine position: System settings are empty and GPS detection is disabled in browser`,'jc_Cannot display the custom component "%s"':`Cannot display the custom component "%s"`,"jc_Cannot read licenses: %s":`Cannot read licenses: %s`,"jc_Cannot retrieve options, as instance is offline":`Cannot retrieve options, as instance is offline`,"jc_Cannot save configuration because of error in configuration":`Cannot save configuration because of error in configuration`,"jc_Cannot upload":`Cannot upload`,"jc_Chained certificate":`Chained certificate`,jc_Checked:`Checked`,"jc_Click to see in full size":`Click to see in full size`,"jc_Click to show":`Click to show`,"jc_Clone current row":`Clone current row`,jc_Close:`Close`,jc_Commercial:`Commercial`,jc_Copied:`Copied`,"jc_Copied %s":`Copied "%s"`,"jc_Copy content":`Copy content`,jc_Create:`Create`,"jc_Credential type":`Credential type`,'jc_Custom component "%s" was not started':`Custom component "%s" was not started`,"jc_Define schedule":`Define schedule`,jc_Delete:`Delete`,"jc_Delete current row":`Delete current row`,"jc_Disable/Enable translation":`Disable/Enable translation`,jc_Discard:`Discard`,"jc_Do not use let's encrypt":`Do not use let's encrypt`,"jc_Docker is not available":`Docker is not available`,"jc_Docker is not installed or not running":`Docker is not installed or not running`,"jc_Drop file here":`Drop file here`,"jc_Enter the code from that page here":`Enter the code from that page here`,jc_Error:`Error`,"jc_Expand/Collapse card":`Expand/Collapse card`,"jc_Export configuration section":`Export configuration section`,"jc_Export data to %s file":`Export data to %s file`,"jc_Export setting to JSON file":`Export setting to JSON file`,"jc_Fallback custom certificates":`Fallback custom certificates`,"jc_File is too big. Max %sk allowed. Try use SVG.":`File is too big. Max %sk allowed. Try use SVG.`,"jc_File will be deleted":`File will be deleted`,"jc_Filter and Data Actions":`Filter and Data Actions`,"jc_Get %s access":`Get %s access`,"jc_If the button above does not work, you can authorize manually this app by visiting this url":`If the button above does not work, you can authorize manually this app by visiting this url`,"jc_Import and add configuration section":`Import and add configuration section`,"jc_Import and replace configuration section":`Import and replace configuration section`,"jc_Import data from %s file":`Import data from %s file`,"jc_Import from %s":`Import from %s`,"jc_Import settings from JSON file":`Import settings from JSON file`,"jc_Instance %s is alive":`Instance %s is alive`,"jc_Instance %s is not alive":`Instance %s is not alive`,"jc_Invalid JSON":`Invalid JSON`,"jc_Invalid JSON file.":`Invalid JSON file.`,"jc_Invalid JSON format. Expected an array.":`Invalid JSON format. Expected an array.`,"jc_Invalid YAML":`Invalid YAML`,"jc_It requires GUI API generation %s, but this admin provides generation %s. Please update the admin.":`It requires GUI API generation %s, but this admin provides generation %s. Please update the admin.`,"jc_It was built for GUI API generation %s, but this admin provides generation %s. Please update the adapter.":`It was built for GUI API generation %s, but this admin provides generation %s. Please update the adapter.`,"jc_It was probably built for an older admin version. Please update the adapter.":`It was probably built for an older admin version. Please update the adapter.`,"jc_JSON editor":`JSON editor`,jc_Latitude:`Latitude`,"jc_License %s":`License %s`,"jc_License agreement":`License agreement`,"jc_License does not exist":`License does not exist`,"jc_License expired on %s":`License expired on %s`,'jc_License for other product "%s"':`License for other product "%s"`,"jc_License is for version %s, but required version is %s":`License is for version %s, but required version is %s`,"jc_License must be converted":`License must be converted to newer version. You can do it in your iobroker.net profile.`,"jc_License not found in license manager. Do you want to read licenses from iobroker.net?":`License not found in the license manager. Do you want to update licenses from iobroker.net?`,"jc_Listen on all IPs":`Listen on all IPs`,jc_Longitude:`Longitude`,"jc_Move down":`Move down`,"jc_Move up":`Move up`,jc_Name:`Name`,"jc_No one license found in license manager":`No one license found in license manager`,"jc_No response from admin":`No response from admin`,'jc_Non-allowed duplicate entry "%s" in column "%s"':`Non-allowed duplicate entry "%s" in column "%s"`,"jc_OAuth Client ID":`OAuth Client ID`,"jc_OAuth Client secret":`OAuth Client secret`,jc_Ok:`Ok`,"jc_Passwords are not equal!":`Passwords are not equal!`,"jc_Place your files here or click here to open the browse dialog":`Place your files here or click here to open the browse dialog`,"jc_Please allow popups in your browser for this page!":`Please allow popups in your browser for this page!`,"jc_Please confirm":`Please confirm`,"jc_Please create license":`Please create license`,"jc_Please enter the license":`Please enter the license`,"jc_Please fill in all required fields":`Please fill in all required fields`,"jc_Port could be used by %s":`Port could be used by %s`,"jc_Port is already used by %s":`Port is already used by %s`,"jc_Press ENTER Key to add new item":`Press ENTER Key to add new item`,"jc_Private certificate":`Private certificate`,jc_Product:`Product`,"jc_Public certificate":`Public certificate`,"jc_Renew %s access":`Renew %s access`,jc_Replace:`Replace`,"jc_Request data by instance":`Request data by instance`,"jc_Request timed out":`Request timed out`,jc_Result:`Result`,jc_Save:`Save`,"jc_Save configuration?":`Save configuration?`,"jc_Serial number (UUID)":`Serial number (UUID)`,'jc_Serial number (UUID) "%s" in license is for other device.':`Serial number (UUID) "%s" in license is for other device.`,"jc_Show/hide filter input":`Show/hide filter input`,"jc_Some data are not stored. Discard?":`Some data are not stored. Discard?`,"jc_Successfully authorized. Token valid till %s and will be automatically renewed.":`Successfully authorized. Token valid till %s and will be automatically renewed.`,"jc_Successfully authorized. Token valid till %s but it can expire as the instance is not running.":`Successfully authorized. Token valid till %s but it can expire as the instance is not running.`,"jc_Suitable license not found in license manager":`Suitable license not found in license manager`,"jc_System language":`System language`,"jc_Take browser position":`Take position from browser`,"jc_Take position from system settings":`Take position from system settings`,jc_Template:`Template`,"jc_Use all available let's encrypt certificates":`Use all available let's encrypt certificates`,"jc_Use system settings for position":`Use system settings for position`,"jc_Used system settings":`Used system settings`,jc_ValidTill:`Valid till`,jc_Version:`Version`,"jc_YAML editor":`YAML editor`,jc_Yes:`Yes`,"jc_You can filter entries by entering here some text":`You can filter entries by entering here some text`,"jc_[JsonConfig] Failed to open JSON File":`[JsonConfig] Failed to open JSON File`,"jc_[JsonConfig] Failed to parse JSON file":`[JsonConfig] Failed to parse JSON file`,jc___different__:`different`,jc_false:`FALSE`,jc_locally:`locally`,jc_none:`none`,jc_repeat:`repeat`,jc_true:`TRUE`,"jc_via internet":`via internet`,sch_all:`all`},de:{"jc_A credential with this name already exists":`Es existiert bereits eine Berechtigung mit diesem Namen.`,"jc_A unique name is required":`Ein eindeutiger Name ist erforderlich.`,"jc_Accept license":`Lizenz akzeptieren`,jc_Actions:`Aktionen`,"jc_Add credential":`Anmeldeinformationen hinzufügen`,"jc_Add row":`Zeile hinzufügen`,"jc_All items are filtered out":`Alle Elemente sind herausgefiltert`,jc_Append:`Anhängen`,"jc_Append %s entries or replace existing?":`%s Einträge anhängen oder vorhandene ersetzen?`,"jc_Append or replace?":`Anhängen oder ersetzen?`,"jc_Are you sure?":`Bist du sicher?`,jc_Cancel:`Abbrechen`,"jc_Cannot add items with set filter":`Elemente mit festgelegtem Filter können nicht hinzugefügt werden`,"jc_Cannot create credential: %s":`Anmeldeinformationen konnten nicht erstellt werden: %s`,"jc_Cannot decode license":`Lizenz kann nicht entschlüsselt werden`,"jc_Cannot determine position: System settings are empty and GPS detection is disabled in browser":`Position kann nicht bestimmt werden: Die Systemeinstellungen sind leer und die GPS-Erkennung ist im Browser deaktiviert`,'jc_Cannot display the custom component "%s"':`Die benutzerdefinierte Komponente "%s" kann nicht angezeigt werden`,"jc_Cannot read licenses: %s":`Lizenzen können nicht gelesen werden: %s`,"jc_Cannot retrieve options, as instance is offline":`Optionen können nicht abgerufen werden, da die Instanz offline ist`,"jc_Cannot save configuration because of error in configuration":`Die Konfiguration konnte aufgrund eines Fehlers nicht gespeichert werden.`,"jc_Cannot upload":`Kann nicht hochladen`,"jc_Chained certificate":`Chained Zertifikat`,jc_Checked:`Geprüft`,"jc_Click to see in full size":`Klicken Sie hier, um die Vollbildansicht zu öffnen.`,"jc_Click to show":`Zum Anzeigen klicken`,"jc_Clone current row":`Aktuelle Zeile klonen`,jc_Close:`Schließen`,jc_Commercial:`Kommerziell`,jc_Copied:`Kopiert`,"jc_Copied %s":`"%s" kopiert`,"jc_Copy content":`Inhalte kopieren`,jc_Create:`Erstellen`,"jc_Credential type":`Anmeldeinformationstyp`,'jc_Custom component "%s" was not started':`Die benutzerdefinierte Komponente "%s" wurde nicht gestartet`,"jc_Define schedule":`Zeitplan definieren`,jc_Delete:`Löschen`,"jc_Delete current row":`Aktuelle Zeile löschen`,"jc_Disable/Enable translation":`Übersetzung deaktivieren/aktivieren`,jc_Discard:`Verwerfen`,"jc_Do not use let's encrypt":`Let's encrypt nicht verwenden`,"jc_Docker is not available":`Docker ist nicht verfügbar`,"jc_Docker is not installed or not running":`Docker ist nicht installiert oder läuft nicht`,"jc_Drop file here":`Datei hier ablegen`,"jc_Enter the code from that page here":`Geben Sie den Code von dieser Seite hier ein`,jc_Error:`Fehler`,"jc_Expand/Collapse card":`Karte ein-/ausklappen`,"jc_Export configuration section":`Konfigurationsabschnitt exportieren`,"jc_Export data to %s file":`Daten in %s-Datei exportieren`,"jc_Export setting to JSON file":`Einstellungen in eine JSON-Datei exportieren`,"jc_Fallback custom certificates":`Benutzerdefinierte Fallback-Zertifikate`,"jc_File is too big. Max %sk allowed. Try use SVG.":`Datei ist zu groß. Max %sk erlaubt. Versuchen Sie, SVG zu verwenden.`,"jc_File will be deleted":`Die Datei wird gelöscht`,"jc_Filter and Data Actions":`Filter- und Datenaktionen`,"jc_Get %s access":`%s Zugriff erhalten`,"jc_If the button above does not work, you can authorize manually this app by visiting this url":`Wenn die Schaltfläche oben nicht funktioniert, können Sie diese App manuell autorisieren, indem Sie diese URL besuchen`,"jc_Import and add configuration section":`Konfigurationsabschnitt importieren und hinzufügen`,"jc_Import and replace configuration section":`Konfigurationsabschnitt importieren und ersetzen`,"jc_Import data from %s file":`Daten aus %s-Datei importieren`,"jc_Import from %s":`Von %s importieren`,"jc_Import settings from JSON file":`Einstellungen aus einer JSON-Datei importieren`,"jc_Instance %s is alive":`Instanz %s ist aktiv`,"jc_Instance %s is not alive":`Instanz %s ist nicht aktiv`,"jc_Invalid JSON":`Ungültiges JSON`,"jc_Invalid JSON file.":`Ungültige JSON-Datei.`,"jc_Invalid JSON format. Expected an array.":`Ungültiges JSON-Format. Array erwartet.`,"jc_Invalid YAML":`Ungültiges YAML`,"jc_It requires GUI API generation %s, but this admin provides generation %s. Please update the admin.":`Sie benötigt GUI-API-Generation %s, dieser Admin stellt aber Generation %s bereit. Bitte den Admin aktualisieren.`,"jc_It was built for GUI API generation %s, but this admin provides generation %s. Please update the adapter.":`Sie wurde für GUI-API-Generation %s erstellt, dieser Admin stellt aber Generation %s bereit. Bitte den Adapter aktualisieren.`,"jc_It was probably built for an older admin version. Please update the adapter.":`Sie wurde vermutlich für eine ältere Admin-Version erstellt. Bitte den Adapter aktualisieren.`,"jc_JSON editor":`JSON-Editor`,jc_Latitude:`Breite`,"jc_License %s":`Lizenz %s`,"jc_License agreement":`Lizenzvereinbarung`,"jc_License does not exist":`Lizenz existiert nicht`,"jc_License expired on %s":`Lizenz am %s abgelaufen`,'jc_License for other product "%s"':`Lizenz für anderes Produkt „%s“`,"jc_License is for version %s, but required version is %s":`Die Lizenz gilt für Version %s, benötigt wird jedoch Version %s.`,"jc_License must be converted":`Die Lizenz muss auf eine neuere Version konvertiert werden. Sie können dies in Ihrem iobroker.net-Profil tun.`,"jc_License not found in license manager. Do you want to read licenses from iobroker.net?":`Lizenz im Lizenzmanager nicht gefunden. Möchten Sie Lizenzen von iobroker.net aktualisieren?`,"jc_Listen on all IPs":`Zugriff von allen IPs zulassen`,jc_Longitude:`Längengrad`,"jc_Move down":`Nach unten`,"jc_Move up":`Nach oben`,jc_Name:`Name`,"jc_No one license found in license manager":`Im Lizenzmanager wurde keine Lizenz gefunden`,"jc_No response from admin":`Keine Antwort vom Administrator`,'jc_Non-allowed duplicate entry "%s" in column "%s"':`Nicht zulässiger doppelter Eintrag "%s" in Spalte "%s"`,"jc_OAuth Client ID":`OAuth-Client-ID`,"jc_OAuth Client secret":`OAuth-Client-Secret`,jc_Ok:`OK`,"jc_Passwords are not equal!":`Passwörter sind nicht gleich!`,"jc_Place your files here or click here to open the browse dialog":`Die Dateien hier platzieren oder hier klicken, um den Suchdialog zu öffnen`,"jc_Please allow popups in your browser for this page!":`Bitte lassen Sie Popups für diese Seite in Ihrem Browser zu!`,"jc_Please confirm":`Bitte bestätigen`,"jc_Please create license":`Bitte erstellen Sie eine Lizenz`,"jc_Please enter the license":`Bitte die Lizenz eingeben`,"jc_Please fill in all required fields":`Bitte füllen Sie alle Pflichtfelder aus.`,"jc_Port could be used by %s":`Port könnte von %s verwendet werden`,"jc_Port is already used by %s":`Port wird bereits von %s verwendet`,"jc_Press ENTER Key to add new item":`Die Eingabetaste drücken, um ein neues Element hinzuzufügen`,"jc_Private certificate":`Privates Zertifikat`,jc_Product:`Produkt`,"jc_Public certificate":`Öffentliches Zertifikat`,"jc_Renew %s access":`%s Zugriff erneuern`,jc_Replace:`Ersetzen`,"jc_Request data by instance":`Daten pro Instanz anfordern`,"jc_Request timed out":`Zeitüberschreitung der Anforderung`,jc_Result:`Ergebnis`,jc_Save:`Speichern`,"jc_Save configuration?":`Konfiguration speichern?`,"jc_Serial number (UUID)":`Seriennummer (UUID)`,'jc_Serial number (UUID) "%s" in license is for other device.':`Seriennummer (UUID) „%s“ in der Lizenz gilt für ein anderes Gerät.`,"jc_Show/hide filter input":`Filtereingabe ein-/ausblenden`,"jc_Some data are not stored. Discard?":`Einige Daten werden nicht gespeichert. Verwerfen?`,"jc_Successfully authorized. Token valid till %s and will be automatically renewed.":`Erfolgreich autorisiert. Token gültig bis %s und wird automatisch erneuert.`,"jc_Successfully authorized. Token valid till %s but it can expire as the instance is not running.":`Erfolgreich autorisiert. Token gültig bis %s, kann aber ablaufen, da die Instanz nicht ausgeführt wird.`,"jc_Suitable license not found in license manager":`Passende Lizenz im Lizenzmanager nicht gefunden`,"jc_System language":`Systemsprache`,"jc_Take browser position":`Position vom Browser einnehmen`,"jc_Take position from system settings":`Position aus den Systemeinstellungen übernehmen`,jc_Template:`Vorlage`,"jc_Use all available let's encrypt certificates":`Alle verfügbaren Zertifikate von Let's encrypt benutzen`,"jc_Use system settings for position":`Systemeinstellungen für die Position verwenden`,"jc_Used system settings":`Systemeinstellungen`,jc_ValidTill:`Gültig bis`,jc_Version:`Ausführung`,"jc_YAML editor":`YAML-Editor`,jc_Yes:`Ja`,"jc_You can filter entries by entering here some text":`Sie können Einträge filtern, indem Sie hier Text eingeben`,"jc_[JsonConfig] Failed to open JSON File":`[JsonConfig] Fehler beim Öffnen der JSON-Datei`,"jc_[JsonConfig] Failed to parse JSON file":`[JsonConfig] Fehler beim Parsen der JSON-Datei`,jc___different__:`unterschiedlich`,jc_false:`FALSCH`,jc_locally:`örtlich`,jc_none:`kein`,jc_repeat:`wiederholen`,jc_true:`WAHR`,"jc_via internet":`übers Internet`,sch_all:`alle`},ru:{"jc_A credential with this name already exists":`Учетные данные с таким именем уже существуют.`,"jc_A unique name is required":`Требуется уникальное имя.`,"jc_Accept license":`Принять лицензию`,jc_Actions:`Действия`,"jc_Add credential":`Добавить учетные данные`,"jc_Add row":`Добавить ряд`,"jc_All items are filtered out":`Все элементы отфильтрованы`,jc_Append:`Добавить`,"jc_Append %s entries or replace existing?":`Добавить записи %s или заменить существующие?`,"jc_Append or replace?":`Дополнить или заменить?`,"jc_Are you sure?":`Вы уверены?`,jc_Cancel:`Отмена`,"jc_Cannot add items with set filter":`Невозможно добавить элементы с установленным фильтром`,"jc_Cannot create credential: %s":`Не удалось создать учетные данные: %s`,"jc_Cannot decode license":`Не могу декодировать лицензию`,"jc_Cannot determine position: System settings are empty and GPS detection is disabled in browser":`Невозможно определить местоположение: системные настройки пусты, а обнаружение GPS отключено в браузере.`,'jc_Cannot display the custom component "%s"':`Не удается отобразить пользовательский компонент "%s"`,"jc_Cannot read licenses: %s":`Невозможно прочитать лицензии: %s`,"jc_Cannot retrieve options, as instance is offline":`Невозможно получить параметры, так как экземпляр находится в автономном режиме.`,"jc_Cannot save configuration because of error in configuration":`Невозможно сохранить конфигурацию из-за ошибки в конфигурации.`,"jc_Cannot upload":`Невозможно загрузить`,"jc_Chained certificate":`Chained сертификат`,jc_Checked:`Проверено`,"jc_Click to see in full size":`Нажмите, чтобы посмотреть в полном размере`,"jc_Click to show":`Нажмите, чтобы показать`,"jc_Clone current row":`Клонировать текущую строку`,jc_Close:`Закрыть`,jc_Commercial:`Коммерческая`,jc_Copied:`скопировано`,"jc_Copied %s":`Скопировано "%s"`,"jc_Copy content":`Копировать содержимое`,jc_Create:`Создать`,"jc_Credential type":`Тип учетных данных`,'jc_Custom component "%s" was not started':`Пользовательский компонент "%s" не был запущен.`,"jc_Define schedule":`Задать расписание`,jc_Delete:`Удалить`,"jc_Delete current row":`Удалить текущую строку`,"jc_Disable/Enable translation":`Включить/отключить перевод`,jc_Discard:`Отказаться`,"jc_Do not use let's encrypt":`Не использовать Let’s Encrypt`,"jc_Docker is not available":`Докер недоступен`,"jc_Docker is not installed or not running":`Docker не установлен или не запущен`,"jc_Drop file here":`Перетащите файл сюда`,"jc_Enter the code from that page here":`Введите код с этой страницы здесь`,jc_Error:`Ошибка`,"jc_Expand/Collapse card":`Развернуть/Свернуть карточку`,"jc_Export configuration section":`Раздел конфигурации экспорта`,"jc_Export data to %s file":`Экспорт данных в файл %s`,"jc_Export setting to JSON file":`Экспорт настроек в JSON-файл`,"jc_Fallback custom certificates":`Резервные пользовательские сертификаты`,"jc_File is too big. Max %sk allowed. Try use SVG.":`Файл слишком большой. Разрешено максимальное количество %sk. Попробуйте использовать SVG.`,"jc_File will be deleted":`Файл будет удалён`,"jc_Filter and Data Actions":`Фильтрация и действия с данными`,"jc_Get %s access":`Получить %s доступ`,"jc_If the button above does not work, you can authorize manually this app by visiting this url":`Если кнопка выше не работает, вы можете вручную авторизовать это приложение, перейдя по этой ссылке.`,"jc_Import and add configuration section":`Импорт и добавление раздела конфигурации`,"jc_Import and replace configuration section":`Импорт и замена раздела конфигурации`,"jc_Import data from %s file":`Импорт данных из файла %s`,"jc_Import from %s":`Импорт из %s`,"jc_Import settings from JSON file":`Импорт настроек из JSON-файла`,"jc_Instance %s is alive":`Экземпляр %s работает`,"jc_Instance %s is not alive":`Экземпляр %s не работает`,"jc_Invalid JSON":`Неверный JSON`,"jc_Invalid JSON file.":`Неверный файл JSON.`,"jc_Invalid JSON format. Expected an array.":`Недопустимый формат JSON. Ожидается массив.`,"jc_Invalid YAML":`Недопустимый YAML-файл`,"jc_It requires GUI API generation %s, but this admin provides generation %s. Please update the admin.":`Для этого требуется генерация API графического интерфейса пользователя %s, но администратор предоставляет генерацию %s. Пожалуйста, обновите администратора.`,"jc_It was built for GUI API generation %s, but this admin provides generation %s. Please update the adapter.":`Он был создан для генерации API графического интерфейса пользователя %s, но этот администратор предоставляет генерацию %s. Пожалуйста, обновите адаптер.`,"jc_It was probably built for an older admin version. Please update the adapter.":`Вероятно, он был создан для более старой версии административной панели. Пожалуйста, обновите адаптер.`,"jc_JSON editor":`Редактор JSON`,jc_Latitude:`Широта`,"jc_License %s":`Лицензия %s`,"jc_License agreement":`Лицензионное соглашение`,"jc_License does not exist":`Лицензия не существует`,"jc_License expired on %s":`Срок действия лицензии истек %s`,'jc_License for other product "%s"':`Лицензия на другой продукт "%s"`,"jc_License is for version %s, but required version is %s":`Лицензия распространяется на версию %s, но требуемая версия — %s.`,"jc_License must be converted":`Лицензия должна быть преобразована в более новую версию. Вы можете сделать это в своем профиле на iobroker.net.`,"jc_License not found in license manager. Do you want to read licenses from iobroker.net?":`Лицензия не найдена в диспетчере лицензий. Вы хотите обновить лицензии от iobroker.net?`,"jc_Listen on all IPs":`Слушать на всех IP`,jc_Longitude:`Долгота`,"jc_Move down":`Вниз`,"jc_Move up":`Вверх`,jc_Name:`Имя`,"jc_No one license found in license manager":`В менеджере лицензий не найдена ни одна лицензия`,"jc_No response from admin":`Нет ответа от администратора`,'jc_Non-allowed duplicate entry "%s" in column "%s"':`Недопустимая повторяющаяся запись "%s" в столбце "%s"`,"jc_OAuth Client ID":`Идентификатор клиента OAuth`,"jc_OAuth Client secret":`Секрет клиента OAuth`,jc_Ok:`Ok`,"jc_Passwords are not equal!":`Пароли не равны!`,"jc_Place your files here or click here to open the browse dialog":`Поместите свои файлы сюда или щелкните здесь, чтобы открыть диалоговое окно выбора`,"jc_Please allow popups in your browser for this page!":`Пожалуйста, разрешите всплывающие окна в вашем браузере для этой страницы!`,"jc_Please confirm":`Пожалуйста подтвердите`,"jc_Please create license":`Пожалуйста, создайте лицензию`,"jc_Please enter the license":`Пожалуйста, введите лицензию`,"jc_Please fill in all required fields":`Пожалуйста, заполните все обязательные поля.`,"jc_Port could be used by %s":`Порт может использоваться %s`,"jc_Port is already used by %s":`Порт уже используется %s`,"jc_Press ENTER Key to add new item":`Нажмите клавишу ENTER, чтобы добавить новый элемент.`,"jc_Private certificate":`Частный сертификат`,jc_Product:`Продукт`,"jc_Public certificate":`Публичный сертификат`,"jc_Renew %s access":`Продлить доступ %s`,jc_Replace:`Заменять`,"jc_Request data by instance":`Запрос данных по экземпляру`,"jc_Request timed out":`Истекло время запроса`,jc_Result:`Результат`,jc_Save:`Сохранить`,"jc_Save configuration?":`Сохранить конфигурацию?`,"jc_Serial number (UUID)":`Серийный номер (UUID)`,'jc_Serial number (UUID) "%s" in license is for other device.':`Серийный номер (UUID) «%s» в лицензии предназначен для другого устройства.`,"jc_Show/hide filter input":`Показать/скрыть ввод фильтра`,"jc_Some data are not stored. Discard?":`Некоторые данные не сохранились. Отказаться?`,"jc_Successfully authorized. Token valid till %s and will be automatically renewed.":`Авторизация выполнена успешно. Токен действителен до %s и будет автоматически продлен.`,"jc_Successfully authorized. Token valid till %s but it can expire as the instance is not running.":`Авторизация выполнена успешно. Токен действителен до %s, но его срок действия может истечь, так как экземпляр не запущен.`,"jc_Suitable license not found in license manager":`Подходящая лицензия не найдена в менеджере лицензий`,"jc_System language":`Язык системы`,"jc_Take browser position":`Взять позицию из браузера`,"jc_Take position from system settings":`Занять позицию из системных настроек`,jc_Template:`Шаблон`,"jc_Use all available let's encrypt certificates":`Использовать все доступные сертификаты Let’s encrypt`,"jc_Use system settings for position":`Использовать системные настройки для позиции`,"jc_Used system settings":`Системные настройки`,jc_ValidTill:`Годен до`,jc_Version:`Версия`,"jc_YAML editor":`Редактор YAML`,jc_Yes:`Да`,"jc_You can filter entries by entering here some text":`Вы можете отфильтровать записи, введя здесь текст`,"jc_[JsonConfig] Failed to open JSON File":`[JsonConfig] Не удалось открыть JSON-файл`,"jc_[JsonConfig] Failed to parse JSON file":`[JsonConfig] Не удалось разобрать JSON-файл`,jc___different__:`разное`,jc_false:`ЛОЖЬ`,jc_locally:`локально`,jc_none:`ничего`,jc_repeat:`повтор`,jc_true:`истинный`,"jc_via internet":`через интернет`,sch_all:`все`},pt:{"jc_A credential with this name already exists":`Já existe uma credencial com este nome.`,"jc_A unique name is required":`É necessário um nome único.`,"jc_Accept license":`Aceitar licença`,jc_Actions:`Ações`,"jc_Add credential":`Adicionar credencial`,"jc_Add row":`Adicionar linha`,"jc_All items are filtered out":`Todos os itens são filtrados`,jc_Append:`Acrescentar`,"jc_Append %s entries or replace existing?":`Acrescentar %s entradas ou substituir as existentes?`,"jc_Append or replace?":`Acrescentar ou substituir?`,"jc_Are you sure?":`Você tem certeza?`,jc_Cancel:`Cancelar`,"jc_Cannot add items with set filter":`Não é possível adicionar itens com filtro definido`,"jc_Cannot create credential: %s":`Não foi possível criar a credencial: %s`,"jc_Cannot decode license":`Não é possível decodificar a licença`,"jc_Cannot determine position: System settings are empty and GPS detection is disabled in browser":`Não é possível determinar a posição: as configurações do sistema estão vazias e a detecção de GPS está desativada no navegador`,'jc_Cannot display the custom component "%s"':`Não é possível exibir o componente personalizado "%s"`,"jc_Cannot read licenses: %s":`Não é possível ler licenças: %s`,"jc_Cannot retrieve options, as instance is offline":`Não é possível recuperar opções, pois a instância está off-line`,"jc_Cannot save configuration because of error in configuration":`Não foi possível salvar a configuração devido a um erro na configuração.`,"jc_Cannot upload":`Não é possível fazer upload`,"jc_Chained certificate":`certificado encadeado`,jc_Checked:`Verificado`,"jc_Click to see in full size":`Clique para ver em tamanho real.`,"jc_Click to show":`Clique para mostrar`,"jc_Clone current row":`Clonar linha atual`,jc_Close:`Perto`,jc_Commercial:`Comercial`,jc_Copied:`Copiado`,"jc_Copied %s":`"%s" copiado`,"jc_Copy content":`Copiar conteúdo`,jc_Create:`Crio`,"jc_Credential type":`Tipo de credencial`,'jc_Custom component "%s" was not started':`O componente personalizado "%s" não foi iniciado.`,"jc_Define schedule":`Definir cronograma`,jc_Delete:`Excluir`,"jc_Delete current row":`Excluir linha atual`,"jc_Disable/Enable translation":`Desativar/Ativar tradução`,jc_Discard:`Descartar`,"jc_Do not use let's encrypt":`Não use vamos criptografar`,"jc_Docker is not available":`O Docker não está disponível`,"jc_Docker is not installed or not running":`O Docker não está instalado ou não está em execução`,"jc_Drop file here":`Solte o arquivo aqui`,"jc_Enter the code from that page here":`Digite o código dessa página aqui`,jc_Error:`Erro`,"jc_Expand/Collapse card":`Expandir/Recolher cartão`,"jc_Export configuration section":`Seção de configuração de exportação`,"jc_Export data to %s file":`Exportar dados para o arquivo %s`,"jc_Export setting to JSON file":`Exportar configurações para arquivo JSON`,"jc_Fallback custom certificates":`Certificados personalizados alternativos`,"jc_File is too big. Max %sk allowed. Try use SVG.":`O arquivo é muito grande. Max %sk permitido. Tente usar SVG.`,"jc_File will be deleted":`O arquivo será excluído.`,"jc_Filter and Data Actions":`Ações de filtro e dados`,"jc_Get %s access":`Obtenha acesso %s`,"jc_If the button above does not work, you can authorize manually this app by visiting this url":`Se o botão acima não funcionar, você pode autorizar manualmente este aplicativo visitando esta url`,"jc_Import and add configuration section":`Seção de importação e adição de configuração`,"jc_Import and replace configuration section":`Seção de configuração de importação e substituição`,"jc_Import data from %s file":`Importar dados do arquivo %s`,"jc_Import from %s":`Importar de %s`,"jc_Import settings from JSON file":`Importar configurações de um arquivo JSON`,"jc_Instance %s is alive":`O %s da instância está ativo`,"jc_Instance %s is not alive":`O %s da instância não está ativo`,"jc_Invalid JSON":`JSON inválido`,"jc_Invalid JSON file.":`Arquivo JSON inválido.`,"jc_Invalid JSON format. Expected an array.":`Formato JSON inválido. Esperava-se uma matriz.`,"jc_Invalid YAML":`YAML inválido`,"jc_It requires GUI API generation %s, but this admin provides generation %s. Please update the admin.":`É necessário gerar %s da API da GUI, mas este painel de administração já fornece a geração %s. Por favor, atualize o painel de administração.`,"jc_It was built for GUI API generation %s, but this admin provides generation %s. Please update the adapter.":`Foi desenvolvido para geração de API GUI %s, mas este painel de administração fornece geração %s. Por favor, atualize o adaptador.`,"jc_It was probably built for an older admin version. Please update the adapter.":`Provavelmente foi desenvolvido para uma versão administrativa mais antiga. Por favor, atualize o adaptador.`,"jc_JSON editor":`Editor JSON`,jc_Latitude:`Latitude`,"jc_License %s":`Licença %s`,"jc_License agreement":`Contrato de licença`,"jc_License does not exist":`A licença não existe`,"jc_License expired on %s":`A licença expirou em %s`,'jc_License for other product "%s"':`Licença para outro produto "%s"`,"jc_License is for version %s, but required version is %s":`A licença é para a versão %s, mas a versão necessária é %s.`,"jc_License must be converted":`A licença deve ser convertida para uma versão mais recente. Você pode fazê-lo em seu perfil iobroker.net.`,"jc_License not found in license manager. Do you want to read licenses from iobroker.net?":`Licença não encontrada no gerenciador de licenças. Deseja atualizar as licenças do iobroker.net?`,"jc_Listen on all IPs":`Ouça em todos os IPs`,jc_Longitude:`Longitude`,"jc_Move down":`Mover para baixo`,"jc_Move up":`Subir`,jc_Name:`Nome`,"jc_No one license found in license manager":`Nenhuma licença encontrada no gerenciador de licenças`,"jc_No response from admin":`Nenhuma resposta do administrador`,'jc_Non-allowed duplicate entry "%s" in column "%s"':`Entrada duplicada não permitida "%s" na coluna "%s"`,"jc_OAuth Client ID":`ID do cliente OAuth`,"jc_OAuth Client secret":`Segredo do cliente OAuth`,jc_Ok:`Está bem`,"jc_Passwords are not equal!":`As senhas não são iguais!`,"jc_Place your files here or click here to open the browse dialog":`Coloque seus arquivos aqui ou clique aqui para abrir a janela de navegação`,"jc_Please allow popups in your browser for this page!":`Por favor, permita pop-ups no seu navegador para esta página!`,"jc_Please confirm":`Por favor confirme`,"jc_Please create license":`Crie uma licença`,"jc_Please enter the license":`Por favor, insira a licença`,"jc_Please fill in all required fields":`Por favor, preencha todos os campos obrigatórios.`,"jc_Port could be used by %s":`A porta pode ser usada por %s`,"jc_Port is already used by %s":`A porta já está sendo usada por %s`,"jc_Press ENTER Key to add new item":`Pressione a tecla ENTER para adicionar um novo item`,"jc_Private certificate":`certificado privado`,jc_Product:`produtos`,"jc_Public certificate":`certificado público`,"jc_Renew %s access":`Renovar acesso %s`,jc_Replace:`Substituir`,"jc_Request data by instance":`Solicitar dados por instância`,"jc_Request timed out":`Solicitação expirou`,jc_Result:`Resultado`,jc_Save:`Salve `,"jc_Save configuration?":`Salvar configuração?`,"jc_Serial number (UUID)":`Número de série (UUID)`,'jc_Serial number (UUID) "%s" in license is for other device.':`O número de série (UUID) "%s" na licença é para outro dispositivo.`,"jc_Show/hide filter input":`Mostrar/ocultar entrada de filtro`,"jc_Some data are not stored. Discard?":`Alguns dados não são armazenados. Descartar?`,"jc_Successfully authorized. Token valid till %s and will be automatically renewed.":`Autorizado com sucesso. Token válido até %s e será renovado automaticamente.`,"jc_Successfully authorized. Token valid till %s but it can expire as the instance is not running.":`Autorizado com sucesso. Token válido até %s, mas pode expirar, pois a instância não está em execução.`,"jc_Suitable license not found in license manager":`Licença adequada não encontrada no gerenciador de licenças`,"jc_System language":`Idioma do sistema`,"jc_Take browser position":`Tomar posição do navegador`,"jc_Take position from system settings":`Tomar posição a partir das configurações do sistema`,jc_Template:`Modelo`,"jc_Use all available let's encrypt certificates":`Use todos os certificados disponíveis vamos criptografar`,"jc_Use system settings for position":`Use as configurações do sistema para a posição`,"jc_Used system settings":`Configurações do sistema usadas`,jc_ValidTill:`Válida até`,jc_Version:`Versão`,"jc_YAML editor":`Editor YAML`,jc_Yes:`Sim`,"jc_You can filter entries by entering here some text":`Você pode filtrar as entradas digitando aqui algum texto`,"jc_[JsonConfig] Failed to open JSON File":`[JsonConfig] Falha ao abrir o arquivo JSON`,"jc_[JsonConfig] Failed to parse JSON file":`[JsonConfig] Falha ao analisar o arquivo JSON`,jc___different__:`diferente`,jc_false:`FALSO`,jc_locally:`localmente`,jc_none:`Nenhum`,jc_repeat:`repetir`,jc_true:`verdadeiro`,"jc_via internet":`via internet`,sch_all:`tudo`},nl:{"jc_A credential with this name already exists":`Er bestaat al een legitimatiebewijs met deze naam.`,"jc_A unique name is required":`Een unieke naam is vereist.`,"jc_Accept license":`Accepteer licentie`,jc_Actions:`Acties`,"jc_Add credential":`Voeg inloggegevens toe`,"jc_Add row":`Voeg een rij toe`,"jc_All items are filtered out":`Alle items zijn uitgefilterd`,jc_Append:`toevoegen`,"jc_Append %s entries or replace existing?":`%s ingangen toevoegen of bestaande vervangen?`,"jc_Append or replace?":`Toevoegen of vervangen?`,"jc_Are you sure?":`Weet je het zeker?`,jc_Cancel:`Annuleer`,"jc_Cannot add items with set filter":`Kan geen items toevoegen met ingestelde filter`,"jc_Cannot create credential: %s":`Kan geen inloggegevens aanmaken: %s`,"jc_Cannot decode license":`Kan licentie niet decoderen`,"jc_Cannot determine position: System settings are empty and GPS detection is disabled in browser":`Kan positie niet bepalen: systeeminstellingen zijn leeg en GPS-detectie is uitgeschakeld in browser`,'jc_Cannot display the custom component "%s"':`Kan het aangepaste component "%s" niet weergeven.`,"jc_Cannot read licenses: %s":`Kan licenties niet lezen: %s`,"jc_Cannot retrieve options, as instance is offline":`Kan opties niet ophalen, omdat instantie offline is`,"jc_Cannot save configuration because of error in configuration":`Configuratie kan niet worden opgeslagen vanwege een configuratiefout.`,"jc_Cannot upload":`Kan niet uploaden`,"jc_Chained certificate":`Geketend certificaat`,jc_Checked:`Gecontroleerd`,"jc_Click to see in full size":`Klik om de afbeelding op volledige grootte te bekijken.`,"jc_Click to show":`Klik om te tonen`,"jc_Clone current row":`Kloon de huidige rij`,jc_Close:`Dichtbij`,jc_Commercial:`Reclame`,jc_Copied:`Gekopieerd`,"jc_Copied %s":`"%s" gekopieerd`,"jc_Copy content":`Inhoud kopiëren`,jc_Create:`Creëer`,"jc_Credential type":`Referentietype`,'jc_Custom component "%s" was not started':`Aangepaste component "%s" is niet gestart.`,"jc_Define schedule":`Definieer schema`,jc_Delete:`Verwijderen`,"jc_Delete current row":`Huidige rij verwijderen`,"jc_Disable/Enable translation":`Vertaling uitschakelen/inschakelen`,jc_Discard:`Weggooien`,"jc_Do not use let's encrypt":`Gebruik geen let's encrypt`,"jc_Docker is not available":`Docker is niet beschikbaar`,"jc_Docker is not installed or not running":`Docker is niet geïnstalleerd of draait niet`,"jc_Drop file here":`Zet het bestand hier neer`,"jc_Enter the code from that page here":`Voer hier de code van die pagina in`,jc_Error:`Fout`,"jc_Expand/Collapse card":`Kaart uit-/inklappen`,"jc_Export configuration section":`Sectie Exportconfiguratie`,"jc_Export data to %s file":`Exporteer gegevens naar %s bestand`,"jc_Export setting to JSON file":`Exporteer instellingen naar een JSON-bestand.`,"jc_Fallback custom certificates":`Fallback aangepaste certificaten`,"jc_File is too big. Max %sk allowed. Try use SVG.":`Bestand is te groot. Max. %sk toegestaan. Probeer SVG te gebruiken.`,"jc_File will be deleted":`Het bestand wordt verwijderd.`,"jc_Filter and Data Actions":`Filter- en gegevensacties`,"jc_Get %s access":`Krijg %s toegang`,"jc_If the button above does not work, you can authorize manually this app by visiting this url":`Als de bovenstaande knop niet werkt, kunt u deze app handmatig autoriseren door deze url te bezoeken`,"jc_Import and add configuration section":`Configuratiesectie importeren en toevoegen`,"jc_Import and replace configuration section":`Configuratiesectie importeren en vervangen`,"jc_Import data from %s file":`Importeer gegevens uit %s bestand`,"jc_Import from %s":`Importeren uit %s`,"jc_Import settings from JSON file":`Instellingen importeren vanuit een JSON-bestand`,"jc_Instance %s is alive":`Instantie %s leeft`,"jc_Instance %s is not alive":`Instantie %s is niet actief`,"jc_Invalid JSON":`Ongeldige JSON`,"jc_Invalid JSON file.":`Ongeldig JSON-bestand.`,"jc_Invalid JSON format. Expected an array.":`Ongeldige JSON-indeling. Er werd een array verwacht.`,"jc_Invalid YAML":`Ongeldige YAML`,"jc_It requires GUI API generation %s, but this admin provides generation %s. Please update the admin.":`Het vereist GUI API-generatie %s, maar deze beheerder levert generatie %s. Graag de beheerder bijwerken.`,"jc_It was built for GUI API generation %s, but this admin provides generation %s. Please update the adapter.":`Het is gebouwd voor GUI API-generatie %s, maar deze beheerder levert generatie %s. Update de adapter.`,"jc_It was probably built for an older admin version. Please update the adapter.":`Het is waarschijnlijk ontwikkeld voor een oudere beheerdersversie. Update de adapter.`,"jc_JSON editor":`JSON-editor`,jc_Latitude:`Breedtegraad`,"jc_License %s":`Licentie %s`,"jc_License agreement":`Licentieovereenkomst`,"jc_License does not exist":`Licentie bestaat niet`,"jc_License expired on %s":`Licentie verlopen op %s`,'jc_License for other product "%s"':`Licentie voor ander product "%s"`,"jc_License is for version %s, but required version is %s":`De licentie is voor versie %s, maar de vereiste versie is %s.`,"jc_License must be converted":`Licentie moet worden omgezet naar nieuwere versie. U kunt dit doen in uw iobroker.net-profiel.`,"jc_License not found in license manager. Do you want to read licenses from iobroker.net?":`Licentie niet gevonden in licentiebeheer. Wilt u licenties van iobroker.net bijwerken?`,"jc_Listen on all IPs":`Luister op alle IP's`,jc_Longitude:`Lengtegraad`,"jc_Move down":`Naar beneden verplaatsen`,"jc_Move up":`Omhoog gaan`,jc_Name:`Naam`,"jc_No one license found in license manager":`Geen enkele licentie gevonden in licentiebeheer`,"jc_No response from admin":`Geen reactie van de beheerder`,'jc_Non-allowed duplicate entry "%s" in column "%s"':`Niet-toegestane dubbele invoer "%s" in kolom "%s"`,"jc_OAuth Client ID":`OAuth-client-ID`,"jc_OAuth Client secret":`OAuth-clientgeheim`,jc_Ok:`OK`,"jc_Passwords are not equal!":`Wachtwoorden zijn niet gelijk!`,"jc_Place your files here or click here to open the browse dialog":`Plaats uw bestanden hier of klik hier om het bladervenster te openen`,"jc_Please allow popups in your browser for this page!":`Sta pop-ups toe in uw browser voor deze pagina!`,"jc_Please confirm":`Bevestig alstublieft`,"jc_Please create license":`Maak een licentie aan`,"jc_Please enter the license":`Voer de licentie in`,"jc_Please fill in all required fields":`Vul alle verplichte velden in.`,"jc_Port could be used by %s":`Poort kan worden gebruikt door %s`,"jc_Port is already used by %s":`Poort wordt al gebruikt door %s`,"jc_Press ENTER Key to add new item":`Druk op de ENTER-toets om een nieuw item toe te voegen`,"jc_Private certificate":`Privé certificaat`,jc_Product:`Product`,"jc_Public certificate":`Openbaar certificaat`,"jc_Renew %s access":`%s toegang verlengen`,jc_Replace:`Vervangen`,"jc_Request data by instance":`Gegevens opvragen per instantie`,"jc_Request timed out":`Verzoek verlopen`,jc_Result:`Resultaat`,jc_Save:`Sparen`,"jc_Save configuration?":`Configuratie opslaan?`,"jc_Serial number (UUID)":`Serienummer (UUID)`,'jc_Serial number (UUID) "%s" in license is for other device.':`Serienummer (UUID) "%s" in licentie is voor ander apparaat.`,"jc_Show/hide filter input":`Filterinvoer weergeven/verbergen`,"jc_Some data are not stored. Discard?":`Sommige gegevens worden niet opgeslagen. Weggooien?`,"jc_Successfully authorized. Token valid till %s and will be automatically renewed.":`Succesvol geautoriseerd. Token geldig tot %s en wordt automatisch verlengd.`,"jc_Successfully authorized. Token valid till %s but it can expire as the instance is not running.":`Succesvol geautoriseerd. Token geldig tot %s, maar kan verlopen omdat de instantie niet actief is.`,"jc_Suitable license not found in license manager":`Geschikte licentie niet gevonden in licentiebeheer`,"jc_System language":`Systeemtaal`,"jc_Take browser position":`Positie innemen vanuit de browser`,"jc_Take position from system settings":`Neem positie over van systeeminstellingen`,jc_Template:`Sjabloon`,"jc_Use all available let's encrypt certificates":`Gebruik alle beschikbare Let's Encrypt-certificaten`,"jc_Use system settings for position":`Gebruik systeeminstellingen voor positie`,"jc_Used system settings":`Gebruikte systeeminstellingen`,jc_ValidTill:`Geldig tot`,jc_Version:`Versie`,"jc_YAML editor":`YAML-editor`,jc_Yes:`Ja`,"jc_You can filter entries by entering here some text":`U kunt items filteren door hier wat tekst in te voeren`,"jc_[JsonConfig] Failed to open JSON File":`[JsonConfig] Het openen van het JSON-bestand is mislukt.`,"jc_[JsonConfig] Failed to parse JSON file":`[JsonConfig] Het parseren van het JSON-bestand is mislukt.`,jc___different__:`verschillend`,jc_false:`ONWAAR`,jc_locally:`plaatselijk`,jc_none:`geen`,jc_repeat:`herhalen`,jc_true:`WAAR`,"jc_via internet":`via internet`,sch_all:`allemaal`},fr:{"jc_A credential with this name already exists":`Un certificat portant ce nom existe déjà.`,"jc_A unique name is required":`Un nom unique est requis.`,"jc_Accept license":`Accepter la licence`,jc_Actions:`Actes`,"jc_Add credential":`Ajouter un identifiant`,"jc_Add row":`Ajouter une rangée`,"jc_All items are filtered out":`Tous les éléments sont filtrés`,jc_Append:`Ajouter`,"jc_Append %s entries or replace existing?":`Ajouter %s entrées ou remplacer l'existant\xA0?`,"jc_Append or replace?":`Ajouter ou remplacer\xA0?`,"jc_Are you sure?":`Êtes-vous sûr?`,jc_Cancel:`Annuler`,"jc_Cannot add items with set filter":`Impossible d'ajouter des éléments avec le filtre défini`,"jc_Cannot create credential: %s":`Impossible de créer les informations d'identification\xA0: %s`,"jc_Cannot decode license":`Impossible de décoder la licence`,"jc_Cannot determine position: System settings are empty and GPS detection is disabled in browser":`Impossible de déterminer la position\xA0: les paramètres système sont vides et la détection GPS est désactivée dans le navigateur`,'jc_Cannot display the custom component "%s"':`Impossible d'afficher le composant personnalisé « %s »`,"jc_Cannot read licenses: %s":`Impossible de lire les licences\xA0: %s`,"jc_Cannot retrieve options, as instance is offline":`Impossible de récupérer les options, car l'instance est hors ligne`,"jc_Cannot save configuration because of error in configuration":`Impossible d'enregistrer la configuration en raison d'une erreur de configuration.`,"jc_Cannot upload":`Impossible de télécharger`,"jc_Chained certificate":`Certificat chaîné`,jc_Checked:`Vérifié`,"jc_Click to see in full size":`Cliquez pour afficher en taille réelle`,"jc_Click to show":`Cliquez pour afficher`,"jc_Clone current row":`Cloner la ligne actuelle`,jc_Close:`Fermer`,jc_Commercial:`Commercial`,jc_Copied:`Copié`,"jc_Copied %s":`"%s" copié`,"jc_Copy content":`Copier le contenu`,jc_Create:`Créer`,"jc_Credential type":`Type de justificatif d'identité`,'jc_Custom component "%s" was not started':`Le composant personnalisé « %s » n'a pas été démarré.`,"jc_Define schedule":`Définir le calendrier`,jc_Delete:`Supprimer`,"jc_Delete current row":`Supprimer la ligne actuelle`,"jc_Disable/Enable translation":`Activer/Désactiver la traduction`,jc_Discard:`Jeter`,"jc_Do not use let's encrypt":`Ne pas utiliser let's encrypt`,"jc_Docker is not available":`Docker n'est pas disponible`,"jc_Docker is not installed or not running":`Docker n'est pas installé ou n'est pas en cours d'exécution`,"jc_Drop file here":`Déposer le fichier ici`,"jc_Enter the code from that page here":`Entrez le code de cette page ici`,jc_Error:`Erreur`,"jc_Expand/Collapse card":`Carte Développer/Réduire`,"jc_Export configuration section":`Exporter la section de configuration`,"jc_Export data to %s file":`Exporter les données vers le fichier %s`,"jc_Export setting to JSON file":`Paramètres d'exportation vers un fichier JSON`,"jc_Fallback custom certificates":`Certificats personnalisés de secours`,"jc_File is too big. Max %sk allowed. Try use SVG.":`Le fichier est trop volumineux. Max %sk autorisé. Essayez d'utiliser SVG.`,"jc_File will be deleted":`Le fichier sera supprimé`,"jc_Filter and Data Actions":`Actions sur les filtres et les données`,"jc_Get %s access":`Obtenir l'accès %s`,"jc_If the button above does not work, you can authorize manually this app by visiting this url":`Si le bouton ci-dessus ne fonctionne pas, vous pouvez autoriser manuellement cette application en visitant cette URL`,"jc_Import and add configuration section":`Importer et ajouter la section de configuration`,"jc_Import and replace configuration section":`Importer et remplacer la section de configuration`,"jc_Import data from %s file":`Importer des données à partir du fichier %s`,"jc_Import from %s":`Importer depuis %s`,"jc_Import settings from JSON file":`Importer les paramètres à partir d'un fichier JSON`,"jc_Instance %s is alive":`L'instance %s est active`,"jc_Instance %s is not alive":`L'instance %s n'est pas active`,"jc_Invalid JSON":`JSON invalide`,"jc_Invalid JSON file.":`Fichier JSON invalide.`,"jc_Invalid JSON format. Expected an array.":`Format JSON invalide. Tableau attendu.`,"jc_Invalid YAML":`YAML invalide`,"jc_It requires GUI API generation %s, but this admin provides generation %s. Please update the admin.":`Cela nécessite la génération de l'API GUI %s, mais cet administrateur fournit la génération %s. Veuillez mettre à jour l'administrateur.`,"jc_It was built for GUI API generation %s, but this admin provides generation %s. Please update the adapter.":`Il a été conçu pour la génération d'API GUI %s, mais cet administrateur fournit la génération %s. Veuillez mettre à jour l'adaptateur.`,"jc_It was probably built for an older admin version. Please update the adapter.":`Il a probablement été conçu pour une version d'administration plus ancienne. Veuillez mettre à jour l'adaptateur.`,"jc_JSON editor":`Éditeur JSON`,jc_Latitude:`Latitude`,"jc_License %s":`Licence %s`,"jc_License agreement":`Accord de licence`,"jc_License does not exist":`La licence n'existe pas`,"jc_License expired on %s":`Licence expirée le %s`,'jc_License for other product "%s"':`Licence pour un autre produit "%s"`,"jc_License is for version %s, but required version is %s":`La licence concerne la version %s, mais la version requise est %s`,"jc_License must be converted":`La licence doit être convertie en une version plus récente. Vous pouvez le faire dans votre profil iobroker.net.`,"jc_License not found in license manager. Do you want to read licenses from iobroker.net?":`Licence introuvable dans le gestionnaire de licences. Voulez-vous mettre à jour les licences depuis iobroker.net\xA0?`,"jc_Listen on all IPs":`Écoutez sur toutes les adresses IP`,jc_Longitude:`Longitude`,"jc_Move down":`Descendre`,"jc_Move up":`Déplacer vers le haut`,jc_Name:`Nom`,"jc_No one license found in license manager":`Aucune licence trouvée dans le gestionnaire de licences`,"jc_No response from admin":`Aucune réponse de l'administrateur`,'jc_Non-allowed duplicate entry "%s" in column "%s"':`Entrée en double non autorisée « %s » dans la colonne « %s »`,"jc_OAuth Client ID":`ID client OAuth`,"jc_OAuth Client secret":`Secret client OAuth`,jc_Ok:`D'accord`,"jc_Passwords are not equal!":`Les mots de passe ne sont pas égaux !`,"jc_Place your files here or click here to open the browse dialog":`Placez vos fichiers ici ou cliquez ici pour ouvrir la boîte de dialogue de navigation`,"jc_Please allow popups in your browser for this page!":`Veuillez autoriser les popups dans votre navigateur pour cette page\xA0!`,"jc_Please confirm":`Veuillez confirmer`,"jc_Please create license":`Veuillez créer une licence`,"jc_Please enter the license":`Veuillez entrer la licence`,"jc_Please fill in all required fields":`Veuillez remplir tous les champs obligatoires.`,"jc_Port could be used by %s":`Le port pourrait être utilisé par %s`,"jc_Port is already used by %s":`Le port est déjà utilisé par %s`,"jc_Press ENTER Key to add new item":`Appuyez sur la touche ENTRÉE pour ajouter un nouvel élément`,"jc_Private certificate":`Certificat privé`,jc_Product:`Produit`,"jc_Public certificate":`Certificat public`,"jc_Renew %s access":`Renouveler l'accès %s`,jc_Replace:`Remplacer`,"jc_Request data by instance":`Demander des données par instance`,"jc_Request timed out":`La demande a expiré`,jc_Result:`Résultat`,jc_Save:`sauver`,"jc_Save configuration?":`Enregistrer la configuration\xA0?`,"jc_Serial number (UUID)":`Numéro de série (UUID)`,'jc_Serial number (UUID) "%s" in license is for other device.':`Le numéro de série (UUID) "%s" dans la licence est pour un autre appareil.`,"jc_Show/hide filter input":`Afficher/masquer l'entrée de filtre`,"jc_Some data are not stored. Discard?":`Certaines données ne sont pas stockées. Jeter?`,"jc_Successfully authorized. Token valid till %s and will be automatically renewed.":`Autorisation réussie. Jeton valide jusqu'au %s et sera automatiquement renouvelé.`,"jc_Successfully authorized. Token valid till %s but it can expire as the instance is not running.":`Autorisation réussie. Jeton valide jusqu'à %s, mais il peut expirer car l'instance n'est pas en cours d'exécution.`,"jc_Suitable license not found in license manager":`Licence appropriée introuvable dans le gestionnaire de licences`,"jc_System language":`Langue du système`,"jc_Take browser position":`Prendre position depuis le navigateur`,"jc_Take position from system settings":`Prendre position à partir des paramètres système`,jc_Template:`Modèle`,"jc_Use all available let's encrypt certificates":`Utilisez tous les certificats let's encrypt disponibles`,"jc_Use system settings for position":`Utiliser les paramètres système pour la position`,"jc_Used system settings":`Paramètres système utilisés`,jc_ValidTill:`Valable jusqu'au`,jc_Version:`Version`,"jc_YAML editor":`Éditeur YAML`,jc_Yes:`Oui`,"jc_You can filter entries by entering here some text":`Vous pouvez filtrer les entrées en saisissant ici du texte`,"jc_[JsonConfig] Failed to open JSON File":`[JsonConfig] Impossible d'ouvrir le fichier JSON`,"jc_[JsonConfig] Failed to parse JSON file":`[JsonConfig] Échec de l'analyse du fichier JSON`,jc___different__:`différent`,jc_false:`FAUX`,jc_locally:`localement`,jc_none:`rien`,jc_repeat:`répéter`,jc_true:`VRAI`,"jc_via internet":`par Internet`,sch_all:`tout`},it:{"jc_A credential with this name already exists":`Esiste già una credenziale con questo nome`,"jc_A unique name is required":`È richiesto un nome univoco`,"jc_Accept license":`Accetta licenza`,jc_Actions:`Azioni`,"jc_Add credential":`Aggiungi credenziali`,"jc_Add row":`Aggiungi riga`,"jc_All items are filtered out":`Tutti gli elementi vengono filtrati`,jc_Append:`Aggiungere`,"jc_Append %s entries or replace existing?":`Aggiungi %s voci o sostituisci quelle esistenti?`,"jc_Append or replace?":`Aggiungere o sostituire?`,"jc_Are you sure?":`Sei sicuro?`,jc_Cancel:`Annulla`,"jc_Cannot add items with set filter":`Impossibile aggiungere elementi con il filtro impostato`,"jc_Cannot create credential: %s":`Impossibile creare le credenziali: %s`,"jc_Cannot decode license":`Impossibile decodificare la licenza`,"jc_Cannot determine position: System settings are empty and GPS detection is disabled in browser":`Impossibile determinare la posizione: le impostazioni di sistema sono vuote e il rilevamento GPS è disabilitato nel browser`,'jc_Cannot display the custom component "%s"':`Impossibile visualizzare il componente personalizzato "%s"`,"jc_Cannot read licenses: %s":`Impossibile leggere le licenze: %s`,"jc_Cannot retrieve options, as instance is offline":`Impossibile recuperare le opzioni, poiché l'istanza è offline`,"jc_Cannot save configuration because of error in configuration":`Impossibile salvare la configurazione a causa di un errore nella configurazione`,"jc_Cannot upload":`Impossibile caricare`,"jc_Chained certificate":`Certificato incatenato`,jc_Checked:`Controllato`,"jc_Click to see in full size":`Clicca per visualizzare l'immagine a dimensioni intere`,"jc_Click to show":`Clicca per mostrare`,"jc_Clone current row":`Clona riga corrente`,jc_Close:`Vicino`,jc_Commercial:`Commerciale`,jc_Copied:`Copiato`,"jc_Copied %s":`"%s" copiato`,"jc_Copy content":`Copia contenuto`,jc_Create:`Creare`,"jc_Credential type":`Tipo di credenziale`,'jc_Custom component "%s" was not started':`Il componente personalizzato "%s" non è stato avviato`,"jc_Define schedule":`Definisci programma`,jc_Delete:`Elimina`,"jc_Delete current row":`Elimina la riga corrente`,"jc_Disable/Enable translation":`Disabilita/Abilita la traduzione`,jc_Discard:`Scartare`,"jc_Do not use let's encrypt":`Non utilizzare crittografiamo`,"jc_Docker is not available":`Docker non è disponibile`,"jc_Docker is not installed or not running":`Docker non è installato o non è in esecuzione`,"jc_Drop file here":`Trascina il file qui`,"jc_Enter the code from that page here":`Inserisci qui il codice da quella pagina`,jc_Error:`Errore`,"jc_Expand/Collapse card":`Espandi/Comprimi scheda`,"jc_Export configuration section":`Sezione di configurazione dell'esportazione`,"jc_Export data to %s file":`Esporta i dati nel file %s`,"jc_Export setting to JSON file":`Esporta le impostazioni in un file JSON`,"jc_Fallback custom certificates":`Certificati personalizzati di fallback`,"jc_File is too big. Max %sk allowed. Try use SVG.":`Il file è troppo grande. Max %sk consentito. Prova a usare SVG.`,"jc_File will be deleted":`Il file verrà eliminato`,"jc_Filter and Data Actions":`Azioni sui filtri e sui dati`,"jc_Get %s access":`Ottieni l'accesso %s`,"jc_If the button above does not work, you can authorize manually this app by visiting this url":`Se il pulsante sopra non funziona, puoi autorizzare manualmente questa app visitando questo URL`,"jc_Import and add configuration section":`Importa e aggiungi la sezione di configurazione`,"jc_Import and replace configuration section":`Importa e sostituisci la sezione di configurazione`,"jc_Import data from %s file":`Importa i dati dal file %s`,"jc_Import from %s":`Importa da %s`,"jc_Import settings from JSON file":`Importa le impostazioni dal file JSON`,"jc_Instance %s is alive":`Il %s dell'istanza è vivo`,"jc_Instance %s is not alive":`Il TESTO dell'istanza non è vivo`,"jc_Invalid JSON":`JSON non valido`,"jc_Invalid JSON file.":`File JSON non valido.`,"jc_Invalid JSON format. Expected an array.":`Formato JSON non valido. È previsto un array.`,"jc_Invalid YAML":`YAML non valido`,"jc_It requires GUI API generation %s, but this admin provides generation %s. Please update the admin.":`Richiede la generazione dell'API GUI %s, ma questo amministratore fornisce la generazione %s. Si prega di aggiornare l'amministratore.`,"jc_It was built for GUI API generation %s, but this admin provides generation %s. Please update the adapter.":`È stato creato per la generazione dell'API GUI %s, ma questo amministratore fornisce la generazione %s. Si prega di aggiornare l'adattatore.`,"jc_It was probably built for an older admin version. Please update the adapter.":`Probabilmente è stato creato per una versione di amministrazione precedente. Si prega di aggiornare l'adattatore.`,"jc_JSON editor":`Editor JSON`,jc_Latitude:`Latitudine`,"jc_License %s":`Licenza %s`,"jc_License agreement":`Contratto di licenza`,"jc_License does not exist":`La licenza non esiste`,"jc_License expired on %s":`Licenza scaduta il %s`,'jc_License for other product "%s"':`Licenza per altro prodotto "%s"`,"jc_License is for version %s, but required version is %s":`La licenza è per la versione %s, ma la versione richiesta è %s`,"jc_License must be converted":`La licenza deve essere convertita in una versione più recente. Puoi farlo nel tuo profilo iobroker.net.`,"jc_License not found in license manager. Do you want to read licenses from iobroker.net?":`Licenza non trovata nel gestore delle licenze. Vuoi aggiornare le licenze da iobroker.net?`,"jc_Listen on all IPs":`Ascolta su tutti gli IP`,jc_Longitude:`Longitudine`,"jc_Move down":`Abbassati`,"jc_Move up":`Andare avanti`,jc_Name:`Nome`,"jc_No one license found in license manager":`Nessuna licenza trovata nel gestore delle licenze`,"jc_No response from admin":`Nessuna risposta dall'amministratore`,'jc_Non-allowed duplicate entry "%s" in column "%s"':`Voce duplicata non consentita "%s" nella colonna "%s"`,"jc_OAuth Client ID":`ID client OAuth`,"jc_OAuth Client secret":`Segreto del client OAuth`,jc_Ok:`Ok`,"jc_Passwords are not equal!":`Le password non sono uguali!`,"jc_Place your files here or click here to open the browse dialog":`Posiziona i file qui o fai clic qui per aprire la finestra di dialogo Sfoglia`,"jc_Please allow popups in your browser for this page!":`Si prega di abilitare i popup nel browser per questa pagina!`,"jc_Please confirm":`Si prega di confermare`,"jc_Please create license":`Si prega di creare la licenza`,"jc_Please enter the license":`Inserisci la licenza`,"jc_Please fill in all required fields":`Si prega di compilare tutti i campi obbligatori.`,"jc_Port could be used by %s":`La porta potrebbe essere utilizzata da %s`,"jc_Port is already used by %s":`La porta è già utilizzata da %s`,"jc_Press ENTER Key to add new item":`Premere il tasto INVIO per aggiungere un nuovo elemento`,"jc_Private certificate":`Certificato privato`,jc_Product:`Prodotto`,"jc_Public certificate":`Certificato pubblico`,"jc_Renew %s access":`Rinnova l'accesso %s`,jc_Replace:`Sostituire`,"jc_Request data by instance":`Richiedi dati per istanza`,"jc_Request timed out":`Tempo scaduto per la richiesta`,jc_Result:`Risultato`,jc_Save:`Salva`,"jc_Save configuration?":`Salvare la configurazione?`,"jc_Serial number (UUID)":`Numero di serie (UUID)`,'jc_Serial number (UUID) "%s" in license is for other device.':`Il numero di serie (UUID) "%s" nella licenza è per un altro dispositivo.`,"jc_Show/hide filter input":`Mostra/nascondi input filtro`,"jc_Some data are not stored. Discard?":`Alcuni dati non vengono memorizzati. Scartare?`,"jc_Successfully authorized. Token valid till %s and will be automatically renewed.":`Autorizzazione completata. Il token è valido fino al %s e verrà rinnovato automaticamente.`,"jc_Successfully authorized. Token valid till %s but it can expire as the instance is not running.":`Autorizzazione completata. Il token è valido fino al %s, ma potrebbe scadere perché l'istanza non è in esecuzione.`,"jc_Suitable license not found in license manager":`Licenza adatta non trovata nel gestore delle licenze`,"jc_System language":`Linguaggio di sistema`,"jc_Take browser position":`Prendi posizione dal browser`,"jc_Take position from system settings":`Prendi posizione dalle impostazioni di sistema`,jc_Template:`Modello`,"jc_Use all available let's encrypt certificates":`Usa tutti i certificati Let's Encrypt disponibili`,"jc_Use system settings for position":`Usa le impostazioni di sistema per la posizione`,"jc_Used system settings":`Impostazioni di sistema utilizzate`,jc_ValidTill:`Valido fino a`,jc_Version:`Versione`,"jc_YAML editor":`Editor YAML`,jc_Yes:`SÌ`,"jc_You can filter entries by entering here some text":`Puoi filtrare le voci inserendo qui del testo`,"jc_[JsonConfig] Failed to open JSON File":`[JsonConfig] Impossibile aprire il file JSON`,"jc_[JsonConfig] Failed to parse JSON file":`[JsonConfig] Impossibile analizzare il file JSON`,jc___different__:`diverso`,jc_false:`FALSO`,jc_locally:`localmente`,jc_none:`nessuna`,jc_repeat:`ripetere`,jc_true:`VERO`,"jc_via internet":`attraverso internet`,sch_all:`tutti`},es:{"jc_A credential with this name already exists":`Ya existe una credencial con ese nombre.`,"jc_A unique name is required":`Se requiere un nombre único.`,"jc_Accept license":`Aceptar licencia`,jc_Actions:`Comportamiento`,"jc_Add credential":`Agregar credencial`,"jc_Add row":`Añadir fila`,"jc_All items are filtered out":`Todos los elementos se filtran`,jc_Append:`Adjuntar`,"jc_Append %s entries or replace existing?":`¿Agregar %s entradas o reemplazar las existentes?`,"jc_Append or replace?":`¿Agregar o reemplazar?`,"jc_Are you sure?":`¿Estás seguro?`,jc_Cancel:`Cancelar`,"jc_Cannot add items with set filter":`No se pueden agregar elementos con el filtro establecido`,"jc_Cannot create credential: %s":`No se puede crear la credencial: %s`,"jc_Cannot decode license":`No se puede decodificar la licencia`,"jc_Cannot determine position: System settings are empty and GPS detection is disabled in browser":`No se puede determinar la posición: la configuración del sistema está vacía y la detección de GPS está deshabilitada en el navegador`,'jc_Cannot display the custom component "%s"':`No se puede mostrar el componente personalizado "%s"`,"jc_Cannot read licenses: %s":`No se pueden leer licencias: %s`,"jc_Cannot retrieve options, as instance is offline":`No se pueden recuperar las opciones, ya que la instancia está fuera de línea`,"jc_Cannot save configuration because of error in configuration":`No se puede guardar la configuración debido a un error en la configuración.`,"jc_Cannot upload":`no se puede cargar`,"jc_Chained certificate":`certificado encadenado`,jc_Checked:`Comprobado`,"jc_Click to see in full size":`Haz clic para ver en tamaño completo.`,"jc_Click to show":`Haga clic para mostrar`,"jc_Clone current row":`Clonar fila actual`,jc_Close:`Cerca`,jc_Commercial:`Comercial`,jc_Copied:`Copiado`,"jc_Copied %s":`Copiado "%s"`,"jc_Copy content":`Copiar contenido`,jc_Create:`Crear`,"jc_Credential type":`Tipo de credencial`,'jc_Custom component "%s" was not started':`El componente personalizado "%s" no se inició.`,"jc_Define schedule":`Definir horario`,jc_Delete:`Eliminar`,"jc_Delete current row":`Eliminar fila actual`,"jc_Disable/Enable translation":`Desactivar/Activar traducción`,jc_Discard:`Desechar`,"jc_Do not use let's encrypt":`No use vamos a cifrar`,"jc_Docker is not available":`Docker no está disponible`,"jc_Docker is not installed or not running":`Docker no está instalado o no se está ejecutando`,"jc_Drop file here":`Suelta el archivo aquí`,"jc_Enter the code from that page here":`Introduzca el código de esa página aquí`,jc_Error:`Error`,"jc_Expand/Collapse card":`Expandir/Contraer tarjeta`,"jc_Export configuration section":`Exportar sección de configuración`,"jc_Export data to %s file":`Exportar datos al archivo %s`,"jc_Export setting to JSON file":`Exportar configuración a un archivo JSON`,"jc_Fallback custom certificates":`Certificados personalizados alternativos`,"jc_File is too big. Max %sk allowed. Try use SVG.":`El archivo es demasiado grande. Máximo de %sk permitido. Intenta usar SVG.`,"jc_File will be deleted":`El archivo será eliminado`,"jc_Filter and Data Actions":`Acciones de filtrado y datos`,"jc_Get %s access":`Obtener %s acceso`,"jc_If the button above does not work, you can authorize manually this app by visiting this url":`Si el botón de arriba no funciona, puedes autorizar manualmente esta aplicación visitando esta URL`,"jc_Import and add configuration section":`Importar y agregar sección de configuración`,"jc_Import and replace configuration section":`Importar y reemplazar sección de configuración`,"jc_Import data from %s file":`Importar datos del archivo %s`,"jc_Import from %s":`Importar desde %s`,"jc_Import settings from JSON file":`Importar configuración desde un archivo JSON`,"jc_Instance %s is alive":`Instancia %s está vivo`,"jc_Instance %s is not alive":`Instancia %s no está vivo`,"jc_Invalid JSON":`JSON no válido`,"jc_Invalid JSON file.":`Archivo JSON inválido.`,"jc_Invalid JSON format. Expected an array.":`Formato JSON inválido. Se esperaba un array.`,"jc_Invalid YAML":`YAML no válido`,"jc_It requires GUI API generation %s, but this admin provides generation %s. Please update the admin.":`Requiere la generación de la API de la GUI %s, pero este administrador proporciona la generación %s. Por favor, actualice el administrador.`,"jc_It was built for GUI API generation %s, but this admin provides generation %s. Please update the adapter.":`Fue diseñado para la generación de API GUI %s, pero este administrador proporciona la generación %s. Por favor, actualice el adaptador.`,"jc_It was probably built for an older admin version. Please update the adapter.":`Probablemente se diseñó para una versión de administración anterior. Por favor, actualice el adaptador.`,"jc_JSON editor":`editor JSON`,jc_Latitude:`Latitud`,"jc_License %s":`Licencia %s`,"jc_License agreement":`Acuerdo de licencia`,"jc_License does not exist":`La licencia no existe`,"jc_License expired on %s":`La licencia venció el %s`,'jc_License for other product "%s"':`Licencia para otro producto "%s"`,"jc_License is for version %s, but required version is %s":`La licencia es para la versión %s, pero la versión requerida es %s.`,"jc_License must be converted":`La licencia debe convertirse a una versión más reciente. Puedes hacerlo en tu perfil de iobroker.net.`,"jc_License not found in license manager. Do you want to read licenses from iobroker.net?":`Licencia no encontrada en el administrador de licencias. ¿Quieres actualizar las licencias de iobroker.net?`,"jc_Listen on all IPs":`Escuche en todas las IP`,jc_Longitude:`Longitud`,"jc_Move down":`Mover hacia abajo`,"jc_Move up":`Ascender`,jc_Name:`Nombre`,"jc_No one license found in license manager":`No se encontró ninguna licencia en el administrador de licencias`,"jc_No response from admin":`No hay respuesta del administrador`,'jc_Non-allowed duplicate entry "%s" in column "%s"':`Entrada duplicada no permitida "%s" en la columna "%s"`,"jc_OAuth Client ID":`ID de cliente OAuth`,"jc_OAuth Client secret":`Secreto de cliente OAuth`,jc_Ok:`Okay`,"jc_Passwords are not equal!":`¡Las contraseñas no son iguales!`,"jc_Place your files here or click here to open the browse dialog":`Coloque sus archivos aquí o haga clic aquí para abrir el cuadro de diálogo de exploración`,"jc_Please allow popups in your browser for this page!":`¡Permita ventanas emergentes en su navegador para esta página!`,"jc_Please confirm":`Por favor confirmar`,"jc_Please create license":`Por favor cree una licencia`,"jc_Please enter the license":`Por favor ingrese la licencia`,"jc_Please fill in all required fields":`Por favor, rellene todos los campos obligatorios.`,"jc_Port could be used by %s":`El puerto podría ser utilizado por %s`,"jc_Port is already used by %s":`El puerto ya está en uso por %s`,"jc_Press ENTER Key to add new item":`Presione la tecla ENTER para agregar un nuevo elemento`,"jc_Private certificate":`certificado privado`,jc_Product:`Producto`,"jc_Public certificate":`Certificado público`,"jc_Renew %s access":`Renovar el acceso a %s`,jc_Replace:`Reemplazar`,"jc_Request data by instance":`Solicitar datos por instancia`,"jc_Request timed out":`Tiempo de espera agotado`,jc_Result:`Resultado`,jc_Save:`Salvar`,"jc_Save configuration?":`¿Guardar configuración?`,"jc_Serial number (UUID)":`Número de serie (UUID)`,'jc_Serial number (UUID) "%s" in license is for other device.':`El número de serie (UUID) "%s" en la licencia es para otro dispositivo.`,"jc_Show/hide filter input":`Mostrar/ocultar entrada de filtro`,"jc_Some data are not stored. Discard?":`Algunos datos no se almacenan. ¿Desechar?`,"jc_Successfully authorized. Token valid till %s and will be automatically renewed.":`Autorizado correctamente. El token es válido hasta el %s y se renovará automáticamente.`,"jc_Successfully authorized. Token valid till %s but it can expire as the instance is not running.":`Autorizado correctamente. El token es válido hasta %s, pero puede caducar porque la instancia no está en ejecución.`,"jc_Suitable license not found in license manager":`Licencia adecuada no encontrada en el administrador de licencias`,"jc_System language":`Lenguaje del sistema`,"jc_Take browser position":`Tomar posición desde el navegador`,"jc_Take position from system settings":`Tomar posición desde la configuración del sistema`,jc_Template:`Plantilla`,"jc_Use all available let's encrypt certificates":`Utilice todos los certificados let's encrypt disponibles`,"jc_Use system settings for position":`Usar la configuración del sistema para la posición`,"jc_Used system settings":`Configuraciones del sistema usadas`,jc_ValidTill:`Válida hasta`,jc_Version:`Versión`,"jc_YAML editor":`Editor YAML`,jc_Yes:`Sí`,"jc_You can filter entries by entering here some text":`Puede filtrar las entradas ingresando aquí algún texto`,"jc_[JsonConfig] Failed to open JSON File":`[JsonConfig] Error al abrir el archivo JSON`,"jc_[JsonConfig] Failed to parse JSON file":`[JsonConfig] Error al analizar el archivo JSON`,jc___different__:`diferente`,jc_false:`FALSO`,jc_locally:`en la zona`,jc_none:`ninguno`,jc_repeat:`repetir`,jc_true:`VERDADERO`,"jc_via internet":`vía Internet`,sch_all:`todas`},pl:{"jc_A credential with this name already exists":`Poświadczenie o tej nazwie już istnieje`,"jc_A unique name is required":`Wymagana jest unikalna nazwa`,"jc_Accept license":`Zaakceptuj licencję`,jc_Actions:`Akcje`,"jc_Add credential":`Dodaj poświadczenie`,"jc_Add row":`Dodaj wiersz`,"jc_All items are filtered out":`Wszystkie pozycje są odfiltrowane`,jc_Append:`Dodać`,"jc_Append %s entries or replace existing?":`Dołączyć wpisy %s czy zastąpić istniejące?`,"jc_Append or replace?":`Dołączyć czy zastąpić?`,"jc_Are you sure?":`Jesteś pewny?`,jc_Cancel:`Anuluj`,"jc_Cannot add items with set filter":`Nie można dodać elementów z ustawionym filtrem`,"jc_Cannot create credential: %s":`Nie można utworzyć poświadczeń: %s`,"jc_Cannot decode license":`Nie można zdekodować licencji`,"jc_Cannot determine position: System settings are empty and GPS detection is disabled in browser":`Nie można określić pozycji: ustawienia systemu są puste, a wykrywanie GPS jest wyłączone w przeglądarce`,'jc_Cannot display the custom component "%s"':`Nie można wyświetlić niestandardowego komponentu „%s”`,"jc_Cannot read licenses: %s":`Nie można odczytać licencji: %s`,"jc_Cannot retrieve options, as instance is offline":`Nie można pobrać opcji, ponieważ instancja jest w trybie offline`,"jc_Cannot save configuration because of error in configuration":`Nie można zapisać konfiguracji z powodu błędu w konfiguracji`,"jc_Cannot upload":`Nie można przesłać`,"jc_Chained certificate":`Certyfikat łańcuchowy`,jc_Checked:`Sprawdzony`,"jc_Click to see in full size":`Kliknij, aby zobaczyć w pełnym rozmiarze`,"jc_Click to show":`Kliknij, aby pokazać`,"jc_Clone current row":`Sklonuj bieżący wiersz`,jc_Close:`Blisko`,jc_Commercial:`Handlowy`,jc_Copied:`Skopiowano`,"jc_Copied %s":`Skopiowano "%s"`,"jc_Copy content":`Kopiuj zawartość`,jc_Create:`Stwórz`,"jc_Credential type":`Typ poświadczenia`,'jc_Custom component "%s" was not started':`Komponent niestandardowy „%s” nie został uruchomiony`,"jc_Define schedule":`Zdefiniuj harmonogram`,jc_Delete:`Usunąć`,"jc_Delete current row":`Usuń bieżący wiersz`,"jc_Disable/Enable translation":`Wyłącz/Włącz tłumaczenie`,jc_Discard:`Wyrzucać`,"jc_Do not use let's encrypt":`Nie używaj zaszyfrujmy`,"jc_Docker is not available":`Docker nie jest dostępny`,"jc_Docker is not installed or not running":`Docker nie jest zainstalowany lub nie działa`,"jc_Drop file here":`Upuść plik tutaj`,"jc_Enter the code from that page here":`Wpisz kod z tej strony tutaj`,jc_Error:`Błąd`,"jc_Expand/Collapse card":`Rozwiń/Zwiń kartę`,"jc_Export configuration section":`Sekcja konfiguracji eksportu`,"jc_Export data to %s file":`Eksportuj dane do pliku %s`,"jc_Export setting to JSON file":`Eksportuj ustawienia do pliku JSON`,"jc_Fallback custom certificates":`Niestandardowe certyfikaty zastępcze`,"jc_File is too big. Max %sk allowed. Try use SVG.":`Plik jest za duży. Maksymalna dozwolona liczba %sk. Spróbuj użyć SVG.`,"jc_File will be deleted":`Plik zostanie usunięty`,"jc_Filter and Data Actions":`Akcje filtrów i danych`,"jc_Get %s access":`Uzyskaj dostęp %s`,"jc_If the button above does not work, you can authorize manually this app by visiting this url":`Jeśli przycisk powyżej nie działa, możesz autoryzować tę aplikację ręcznie, odwiedzając ten adres URL`,"jc_Import and add configuration section":`Importuj i dodaj sekcję konfiguracji`,"jc_Import and replace configuration section":`Importuj i zastąp sekcję konfiguracji`,"jc_Import data from %s file":`Importuj dane z pliku %s`,"jc_Import from %s":`Importuj z %s`,"jc_Import settings from JSON file":`Importuj ustawienia z pliku JSON`,"jc_Instance %s is alive":`Instancja %s jest aktywna`,"jc_Instance %s is not alive":`Instancja TEKST nie jest aktywna`,"jc_Invalid JSON":`Nieprawidłowy JSON`,"jc_Invalid JSON file.":`Nieprawidłowy plik JSON.`,"jc_Invalid JSON format. Expected an array.":`Nieprawidłowy format JSON. Oczekiwano tablicy.`,"jc_Invalid YAML":`Nieprawidłowy plik YAML`,"jc_It requires GUI API generation %s, but this admin provides generation %s. Please update the admin.":`Wymaga generacji interfejsu API GUI %s, ale ten administrator zapewnia generację %s. Zaktualizuj administratora.`,"jc_It was built for GUI API generation %s, but this admin provides generation %s. Please update the adapter.":`Został stworzony do generowania interfejsu API GUI %s, ale ten administrator zapewnia generowanie %s. Proszę zaktualizować adapter.`,"jc_It was probably built for an older admin version. Please update the adapter.":`Prawdopodobnie został stworzony dla starszej wersji administratora. Proszę zaktualizować adapter.`,"jc_JSON editor":`Edytor JSON`,jc_Latitude:`Szerokość`,"jc_License %s":`Licencja %s`,"jc_License agreement":`Umowa licencyjna`,"jc_License does not exist":`Licencja nie istnieje`,"jc_License expired on %s":`Licencja wygasła w dniu %s`,'jc_License for other product "%s"':`Licencja na inny produkt „%s”`,"jc_License is for version %s, but required version is %s":`Licencja jest przeznaczona dla wersji %s, ale wymagana jest wersja %s`,"jc_License must be converted":`Licencja musi zostać przekonwertowana na nowszą wersję. Możesz to zrobić w swoim profilu iobroker.net.`,"jc_License not found in license manager. Do you want to read licenses from iobroker.net?":`Nie znaleziono licencji w menedżerze licencji. Chcesz zaktualizować licencje z iobroker.net?`,"jc_Listen on all IPs":`Słuchaj na wszystkich adresach IP`,jc_Longitude:`Długość geograficzna`,"jc_Move down":`Padnij`,"jc_Move up":`Podnieść`,jc_Name:`Nazwa`,"jc_No one license found in license manager":`Nie znaleziono licencji w menedżerze licencji`,"jc_No response from admin":`Brak odpowiedzi od administratora`,'jc_Non-allowed duplicate entry "%s" in column "%s"':`Niedozwolony duplikat wpisu „%s” w kolumnie „%s”`,"jc_OAuth Client ID":`Identyfikator klienta OAuth`,"jc_OAuth Client secret":`Tajny klucz klienta OAuth`,jc_Ok:`Dobrze`,"jc_Passwords are not equal!":`Hasła nie są równe!`,"jc_Place your files here or click here to open the browse dialog":`Umieść swoje pliki tutaj lub kliknij tutaj, aby otworzyć okno dialogowe przeglądania`,"jc_Please allow popups in your browser for this page!":`Proszę zezwolić na wyświetlanie wyskakujących okienek w przeglądarce dla tej strony!`,"jc_Please confirm":`Proszę potwierdzić`,"jc_Please create license":`Utwórz licencję`,"jc_Please enter the license":`Proszę wprowadzić licencję`,"jc_Please fill in all required fields":`Proszę wypełnić wszystkie wymagane pola`,"jc_Port could be used by %s":`Port może być używany przez %s`,"jc_Port is already used by %s":`Port jest już używany przez %s`,"jc_Press ENTER Key to add new item":`Naciśnij klawisz ENTER, aby dodać nowy element`,"jc_Private certificate":`Prywatny certyfikat`,jc_Product:`Produkt`,"jc_Public certificate":`Certyfikat publiczny`,"jc_Renew %s access":`Odnów dostęp %s`,jc_Replace:`Zastępować`,"jc_Request data by instance":`Żądanie danych według instancji`,"jc_Request timed out":`Upłynął limit czasu żądania`,jc_Result:`Wynik`,jc_Save:`Zapisać`,"jc_Save configuration?":`Zapisać konfigurację?`,"jc_Serial number (UUID)":`Numer seryjny (UUID)`,'jc_Serial number (UUID) "%s" in license is for other device.':`Numer seryjny (UUID) „%s” w licencji dotyczy innego urządzenia.`,"jc_Show/hide filter input":`Pokaż/ukryj wejście filtra`,"jc_Some data are not stored. Discard?":`Niektóre dane nie są przechowywane. Wyrzucać?`,"jc_Successfully authorized. Token valid till %s and will be automatically renewed.":`Pomyślnie autoryzowano. Token ważny do %s i zostanie automatycznie odnowiony.`,"jc_Successfully authorized. Token valid till %s but it can expire as the instance is not running.":`Pomyślnie autoryzowano. Token ważny do %s, ale może wygasnąć, ponieważ instancja nie jest uruchomiona.`,"jc_Suitable license not found in license manager":`Nie znaleziono odpowiedniej licencji w menedżerze licencji`,"jc_System language":`Język systemu`,"jc_Take browser position":`Zajmij pozycję z przeglądarki`,"jc_Take position from system settings":`Zajmij pozycję z ustawień systemowych`,jc_Template:`Szablon`,"jc_Use all available let's encrypt certificates":`Użyj wszystkich dostępnych certyfikatów Let's Encrypt`,"jc_Use system settings for position":`Użyj ustawień systemowych dla pozycji`,"jc_Used system settings":`Używane ustawienia systemowe`,jc_ValidTill:`Obowiązuje do`,jc_Version:`Wersja`,"jc_YAML editor":`Edytor YAML`,jc_Yes:`Tak`,"jc_You can filter entries by entering here some text":`Możesz filtrować wpisy, wpisując tutaj jakiś tekst`,"jc_[JsonConfig] Failed to open JSON File":`[JsonConfig] Nie udało się otworzyć pliku JSON`,"jc_[JsonConfig] Failed to parse JSON file":`[JsonConfig] Nie udało się przeanalizować pliku JSON`,jc___different__:`różne`,jc_false:`FAŁSZ`,jc_locally:`lokalnie`,jc_none:`Żaden`,jc_repeat:`powtarzać`,jc_true:`PRAWDA`,"jc_via internet":`przez internet`,sch_all:`wszystko`},uk:{"jc_A credential with this name already exists":`Облікові дані з таким ім'ям вже існують`,"jc_A unique name is required":`Потрібне унікальне ім'я`,"jc_Accept license":`Прийняти ліцензію`,jc_Actions:`Дії`,"jc_Add credential":`Додати облікові дані`,"jc_Add row":`Додати рядок`,"jc_All items are filtered out":`Усі елементи відфільтровано`,jc_Append:`Додайте`,"jc_Append %s entries or replace existing?":`Додати %s записів чи замінити наявні?`,"jc_Append or replace?":`Додати чи замінити?`,"jc_Are you sure?":`Ти впевнений?`,jc_Cancel:`Скасувати`,"jc_Cannot add items with set filter":`Неможливо додати елементи зі встановленим фільтром`,"jc_Cannot create credential: %s":`Не вдається створити облікові дані: %s`,"jc_Cannot decode license":`Неможливо розшифрувати ліцензію`,"jc_Cannot determine position: System settings are empty and GPS detection is disabled in browser":`Неможливо визначити положення: системні налаштування порожні, а визначення GPS вимкнено в браузері`,'jc_Cannot display the custom component "%s"':`Не вдається відобразити користувацький компонент "%s"`,"jc_Cannot read licenses: %s":`Неможливо прочитати ліцензії: %s`,"jc_Cannot retrieve options, as instance is offline":`Неможливо отримати параметри, оскільки екземпляр офлайн`,"jc_Cannot save configuration because of error in configuration":`Не вдалося зберегти конфігурацію через помилку в конфігурації`,"jc_Cannot upload":`Неможливо завантажити`,"jc_Chained certificate":`Прикутий сертифікат`,jc_Checked:`Перевірено`,"jc_Click to see in full size":`Натисніть, щоб побачити в повному розмірі`,"jc_Click to show":`Натисніть, щоб показати`,"jc_Clone current row":`Клонувати поточний рядок`,jc_Close:`Закрити`,jc_Commercial:`Комерційний`,jc_Copied:`Скопійовано`,"jc_Copied %s":`Скопійовано "%s"`,"jc_Copy content":`Скопіюйте вміст`,jc_Create:`Створити`,"jc_Credential type":`Тип облікових даних`,'jc_Custom component "%s" was not started':`Користувацький компонент "%s" не запущено`,"jc_Define schedule":`Визначити розклад`,jc_Delete:`Видалити`,"jc_Delete current row":`Видалити поточний рядок`,"jc_Disable/Enable translation":`Вимкнути/Увімкнути переклад`,jc_Discard:`Відкинути`,"jc_Do not use let's encrypt":`Не використовуйте let's encrypt`,"jc_Docker is not available":`Докер недоступний`,"jc_Docker is not installed or not running":`Docker не встановлено або не працює`,"jc_Drop file here":`Перетягніть файл сюди`,"jc_Enter the code from that page here":`Введіть тут код з цієї сторінки`,jc_Error:`Помилка`,"jc_Expand/Collapse card":`Розгорнути/Згорнути картку`,"jc_Export configuration section":`Розділ конфігурації експорту`,"jc_Export data to %s file":`Експортувати дані у файл %s`,"jc_Export setting to JSON file":`Експорт налаштувань у файл JSON`,"jc_Fallback custom certificates":`Запасні спеціальні сертифікати`,"jc_File is too big. Max %sk allowed. Try use SVG.":`Файл завеликий. Максимально дозволено %sk. Спробуйте використовувати SVG.`,"jc_File will be deleted":`Файл буде видалено`,"jc_Filter and Data Actions":`Фільтр і дії з даними`,"jc_Get %s access":`Отримайте доступ %s`,"jc_If the button above does not work, you can authorize manually this app by visiting this url":`Якщо кнопка вище не працює, ви можете авторизувати цю програму вручну, перейшовши за цим посиланням`,"jc_Import and add configuration section":`Розділ імпорту та додавання конфігурації`,"jc_Import and replace configuration section":`Розділ імпорту та заміни конфігурації`,"jc_Import data from %s file":`Імпортувати дані з файлу %s`,"jc_Import from %s":`Імпортувати з %s`,"jc_Import settings from JSON file":`Імпорт налаштувань з JSON-файлу`,"jc_Instance %s is alive":`Примірник %s живий`,"jc_Instance %s is not alive":`Примірник %s не живий`,"jc_Invalid JSON":`Недійсний JSON`,"jc_Invalid JSON file.":`Недійсний JSON-файл.`,"jc_Invalid JSON format. Expected an array.":`Недійсний формат JSON. Очікується масив.`,"jc_Invalid YAML":`Недійсний YAML`,"jc_It requires GUI API generation %s, but this admin provides generation %s. Please update the admin.":`Потрібна генерація API графічного інтерфейсу %s, але цей адміністратор надає генерацію %s. Будь ласка, оновіть адміністраторську версію.`,"jc_It was built for GUI API generation %s, but this admin provides generation %s. Please update the adapter.":`Його було створено для покоління GUI API %s, але цей адміністратор надає покоління %s. Будь ласка, оновіть адаптер.`,"jc_It was probably built for an older admin version. Please update the adapter.":`Ймовірно, його було створено для старішої версії адміністратора. Будь ласка, оновіть адаптер.`,"jc_JSON editor":`Редактор JSON`,jc_Latitude:`Широта`,"jc_License %s":`Ліцензія %s`,"jc_License agreement":`Ліцензійна угода`,"jc_License does not exist":`Ліцензії не існує`,"jc_License expired on %s":`Термін дії ліцензії закінчився %s`,'jc_License for other product "%s"':`Ліцензія на інший продукт "%s"`,"jc_License is for version %s, but required version is %s":`Ліцензія для версії %s, але потрібна версія %s`,"jc_License must be converted":`Ліцензію необхідно конвертувати до новішої версії. Ви можете зробити це у своєму профілі на iobroker.net.`,"jc_License not found in license manager. Do you want to read licenses from iobroker.net?":`Ліцензія не знайдена в менеджері ліцензій. Хочете оновити ліцензії з iobroker.net?`,"jc_Listen on all IPs":`Прослуховування на всіх IP`,jc_Longitude:`Довгота`,"jc_Move down":`Рухатися вниз`,"jc_Move up":`Рухатися вгору`,jc_Name:`Ім'я`,"jc_No one license found in license manager":`У менеджері ліцензій не знайдено жодної ліцензії`,"jc_No response from admin":`Немає відповіді від адміністратора`,'jc_Non-allowed duplicate entry "%s" in column "%s"':`Недозволений дублікат запису "%s" у стовпці "%s"`,"jc_OAuth Client ID":`Ідентифікатор клієнта OAuth`,"jc_OAuth Client secret":`Секрет клієнта OAuth`,jc_Ok:`В порядку`,"jc_Passwords are not equal!":`Паролі не бувають рівними!`,"jc_Place your files here or click here to open the browse dialog":`Розмістіть свої файли тут або натисніть тут, щоб відкрити діалогове вікно перегляду`,"jc_Please allow popups in your browser for this page!":`Будь ласка, дозвольте спливаючі вікна у вашому браузері для цієї сторінки!`,"jc_Please confirm":`Будь-ласка підтвердіть`,"jc_Please create license":`Будь ласка, створіть ліцензію`,"jc_Please enter the license":`Будь ласка, введіть ліцензію`,"jc_Please fill in all required fields":`Будь ласка, заповніть усі обов'язкові поля`,"jc_Port could be used by %s":`Порт може використовуватися %s`,"jc_Port is already used by %s":`Порт уже використовується %s`,"jc_Press ENTER Key to add new item":`Натисніть клавішу ENTER, щоб додати новий елемент`,"jc_Private certificate":`Приватний сертифікат`,jc_Product:`Продукт`,"jc_Public certificate":`Публічний сертифікат`,"jc_Renew %s access":`Поновити доступ %s`,jc_Replace:`Замінити`,"jc_Request data by instance":`Запит даних за екземпляром`,"jc_Request timed out":`Час запиту вичерпано`,jc_Result:`Результат`,jc_Save:`зберегти`,"jc_Save configuration?":`Зберегти конфігурацію?`,"jc_Serial number (UUID)":`Серійний номер (UUID)`,'jc_Serial number (UUID) "%s" in license is for other device.':`Серійний номер (UUID) "%s" у ліцензії призначений для іншого пристрою.`,"jc_Show/hide filter input":`Показати/сховати введення фільтра`,"jc_Some data are not stored. Discard?":`Деякі дані не зберігаються. Відкинути?`,"jc_Successfully authorized. Token valid till %s and will be automatically renewed.":`Авторизацію успішно пройшло. Токен дійсний до %s та буде автоматично поновлено.`,"jc_Successfully authorized. Token valid till %s but it can expire as the instance is not running.":`Авторизацію успішно виконано. Токен дійсний до %s, але його термін дії може закінчитися, оскільки екземпляр не запущено.`,"jc_Suitable license not found in license manager":`Відповідна ліцензія не знайдена в менеджері ліцензій`,"jc_System language":`Системна мова`,"jc_Take browser position":`Займіть позицію з браузера`,"jc_Take position from system settings":`Займіть позицію в налаштуваннях системи`,jc_Template:`Шаблон`,"jc_Use all available let's encrypt certificates":`Використовуйте всі доступні сертифікати let's encrypt`,"jc_Use system settings for position":`Використовуйте системні налаштування для позиції`,"jc_Used system settings":`Використані системні налаштування`,jc_ValidTill:`Дійсний до`,jc_Version:`Версія`,"jc_YAML editor":`Редактор YAML`,jc_Yes:`Так`,"jc_You can filter entries by entering here some text":`Ви можете фільтрувати записи, ввівши тут певний текст`,"jc_[JsonConfig] Failed to open JSON File":`[JsonConfig] Не вдалося відкрити JSON-файл`,"jc_[JsonConfig] Failed to parse JSON file":`[JsonConfig] Не вдалося проаналізувати JSON-файл`,jc___different__:`інший`,jc_false:`НЕПРАВДА`,jc_locally:`локально`,jc_none:`немає`,jc_repeat:`повторити`,jc_true:`ПРАВДА`,"jc_via internet":`через інтернет`,sch_all:`все`},"zh-cn":{"jc_A credential with this name already exists":`已存在同名凭证`,"jc_A unique name is required":`需要一个唯一的名称。`,"jc_Accept license":`接受许可`,jc_Actions:`操作`,"jc_Add credential":`添加凭据`,"jc_Add row":`添加行`,"jc_All items are filtered out":`所有项目都被过滤掉`,jc_Append:`附加`,"jc_Append %s entries or replace existing?":`追加 %s 条目还是替换现有条目?`,"jc_Append or replace?":`追加还是替换?`,"jc_Are you sure?":`你确定吗?`,jc_Cancel:`取消`,"jc_Cannot add items with set filter":`无法使用设置过滤器添加项目`,"jc_Cannot create credential: %s":`无法创建凭证:%s`,"jc_Cannot decode license":`无法解码许可证`,"jc_Cannot determine position: System settings are empty and GPS detection is disabled in browser":`无法确定位置:系统设置为空且浏览器中禁用了 GPS 检测`,'jc_Cannot display the custom component "%s"':`无法显示自定义组件“%s”`,"jc_Cannot read licenses: %s":`无法读取许可证:%s`,"jc_Cannot retrieve options, as instance is offline":`无法检索选项,因为实例处于脱机状态`,"jc_Cannot save configuration because of error in configuration":`由于配置错误,无法保存配置。`,"jc_Cannot upload":`无法上传`,"jc_Chained certificate":`链式证书`,jc_Checked:`勾选`,"jc_Click to see in full size":`点击查看完整尺寸`,"jc_Click to show":`点击显示`,"jc_Clone current row":`克隆当前行`,jc_Close:`关`,jc_Commercial:`商业的`,jc_Copied:`复制的`,"jc_Copied %s":`复制的"%s"`,"jc_Copy content":`复制内容`,jc_Create:`创建`,"jc_Credential type":`凭证类型`,'jc_Custom component "%s" was not started':`自定义组件“%s”未启动`,"jc_Define schedule":`定义时间表`,jc_Delete:`删除`,"jc_Delete current row":`删除当前行`,"jc_Disable/Enable translation":`禁用/启用翻译`,jc_Discard:`丢弃`,"jc_Do not use let's encrypt":`不要使用让我们加密`,"jc_Docker is not available":`Docker 不可用`,"jc_Docker is not installed or not running":`Docker 未安装或未运行`,"jc_Drop file here":`将档案放在这里`,"jc_Enter the code from that page here":`在此处输入该页面的代码`,jc_Error:`错误`,"jc_Expand/Collapse card":`展开/折叠卡`,"jc_Export configuration section":`导出配置部分`,"jc_Export data to %s file":`将数据导出到 %s 文件`,"jc_Export setting to JSON file":`将设置导出到 JSON 文件`,"jc_Fallback custom certificates":`后备自定义证书`,"jc_File is too big. Max %sk allowed. Try use SVG.":`文件太大。允许的最大字节%s数。尝试使用 SVG。`,"jc_File will be deleted":`文件将被删除`,"jc_Filter and Data Actions":`过滤和数据操作`,"jc_Get %s access":`获取 %s 访问权限`,"jc_If the button above does not work, you can authorize manually this app by visiting this url":`如果上面的按钮不起作用,您可以通过访问此网址手动授权此应用`,"jc_Import and add configuration section":`导入并添加配置部分`,"jc_Import and replace configuration section":`导入和替换配置部分`,"jc_Import data from %s file":`从 %s 文件导入数据`,"jc_Import from %s":`从 %s 导入`,"jc_Import settings from JSON file":`从 JSON 文件导入设置`,"jc_Instance %s is alive":`实例 %s 是活动的`,"jc_Instance %s is not alive":`实例 %s 不存在`,"jc_Invalid JSON":`JSON 无效`,"jc_Invalid JSON file.":`无效的JSON文件。`,"jc_Invalid JSON format. Expected an array.":`JSON格式无效。应为数组。`,"jc_Invalid YAML":`无效的 YAML`,"jc_It requires GUI API generation %s, but this admin provides generation %s. Please update the admin.":`它需要生成 GUI API,但此管理员提供的是生成功能。请更新管理员。`,"jc_It was built for GUI API generation %s, but this admin provides generation %s. Please update the adapter.":`它原本是为 GUI API 生成 %s 而设计的,但此管理员提供了生成 %s 的功能。请更新适配器。`,"jc_It was probably built for an older admin version. Please update the adapter.":`这可能是为旧版管理后台构建的。请更新适配器。`,"jc_JSON editor":`JSON 编辑器`,jc_Latitude:`纬度`,"jc_License %s":`许可证 %s`,"jc_License agreement":`许可协议`,"jc_License does not exist":`许可证不存在`,"jc_License expired on %s":`许可证已于 %s 过期`,'jc_License for other product "%s"':`其他产品“%s”的许可证`,"jc_License is for version %s, but required version is %s":`许可证适用于版本 %s,但所需版本为 %s。`,"jc_License must be converted":`许可证必须转换为更新版本。您可以在 iobroker.net 个人资料中执行此操作。`,"jc_License not found in license manager. Do you want to read licenses from iobroker.net?":`在许可证管理器中找不到许可证。您要从 iobroker.net 更新许可证吗?`,"jc_Listen on all IPs":`监听所有IP`,jc_Longitude:`经度`,"jc_Move down":`下移`,"jc_Move up":`提升`,jc_Name:`姓名`,"jc_No one license found in license manager":`许可证管理器中未找到任何许可证`,"jc_No response from admin":`管理员没有回应`,'jc_Non-allowed duplicate entry "%s" in column "%s"':`列“%s”中存在不允许的重复条目“%s”。`,"jc_OAuth Client ID":`OAuth客户端ID`,"jc_OAuth Client secret":`OAuth 客户端密钥`,jc_Ok:`好`,"jc_Passwords are not equal!":`密码不相等!`,"jc_Place your files here or click here to open the browse dialog":`将文件放在此处或单击此处打开浏览对话框`,"jc_Please allow popups in your browser for this page!":`请允许浏览器弹出此页面!`,"jc_Please confirm":`请确认`,"jc_Please create license":`请创建许可证`,"jc_Please enter the license":`请输入许可证`,"jc_Please fill in all required fields":`请填写所有必填字段`,"jc_Port could be used by %s":`%s 可以使用端口`,"jc_Port is already used by %s":`端口已被 %s 使用`,"jc_Press ENTER Key to add new item":`按 ENTER 键添加新项目`,"jc_Private certificate":`私有证书`,jc_Product:`产品`,"jc_Public certificate":`公共证书`,"jc_Renew %s access":`续订 %s 访问权限`,jc_Replace:`代替`,"jc_Request data by instance":`按实例请求数据`,"jc_Request timed out":`请求超时`,jc_Result:`结果`,jc_Save:`保存`,"jc_Save configuration?":`保存配置?`,"jc_Serial number (UUID)":`序列号 (UUID)`,'jc_Serial number (UUID) "%s" in license is for other device.':`许可证中的序列号 (UUID)“%s”用于其他设备。`,"jc_Show/hide filter input":`显示/隐藏过滤器输入`,"jc_Some data are not stored. Discard?":`部分数据未存储。丢弃?`,"jc_Successfully authorized. Token valid till %s and will be automatically renewed.":`授权成功。令牌有效期至 %s,并将自动续订。`,"jc_Successfully authorized. Token valid till %s but it can expire as the instance is not running.":`授权成功。令牌有效期至 %s,但由于实例未运行,令牌可能会过期。`,"jc_Suitable license not found in license manager":`在许可证管理器中找不到合适的许可证`,"jc_System language":`系统语言`,"jc_Take browser position":`从浏览器获取位置`,"jc_Take position from system settings":`从系统设置中获取位置`,jc_Template:`模板`,"jc_Use all available let's encrypt certificates":`使用所有可用的让我们加密证书`,"jc_Use system settings for position":`使用系统设置定位`,"jc_Used system settings":`使用的系统设置`,jc_ValidTill:`有效期至`,jc_Version:`版本`,"jc_YAML editor":`YAML 编辑器`,jc_Yes:`是的`,"jc_You can filter entries by entering here some text":`您可以通过在此处输入一些文本来过滤条目`,"jc_[JsonConfig] Failed to open JSON File":`[JsonConfig] 打开 JSON 文件失败`,"jc_[JsonConfig] Failed to parse JSON file":`[JsonConfig] 解析 JSON 文件失败`,jc___different__:`不同的`,jc_false:`错误的`,jc_locally:`本地`,jc_none:`没有任何`,jc_repeat:`重复`,jc_true:`真的`,"jc_via internet":`通过互联网`,sch_all:`全选`}});var Rc=3e3,zc={root:{width:`100%`,height:`100%`,display:`flex`,flexDirection:`column`}},Bc=class e extends l{constructor(e){super(e),G(this,`forceUpdateHandlers`,void 0),G(this,`errorTimeout`,null),G(this,`errorCached`,null),G(this,`oContext`,void 0),G(this,`cachedObjects`,{}),G(this,`statePool`,void 0),G(this,`onCommandRunning`,e=>this.setState({commandRunning:e})),G(this,`onAlive`,(e,t)=>{!!(t!=null&&t.val)!==this.state.alive&&this.setState({alive:!!(t!=null&&t.val)})}),G(this,`onChange`,(e,t,n,r)=>{if(this.props.onValueChange)this.props.onValueChange(e,t,!!r),n==null||n();else if(e&&this.props.onChange){let t={changed:JSON.stringify(e)!==this.state.originalData};this.setState(t,()=>{var i,a;(i=(a=this.props).onChange)==null||i.call(a,e,!!t.changed,!!r),n==null||n()})}else if(r){var i,a;(i=(a=this.props).onChange)==null||i.call(a,null,void 0,r)}}),G(this,`onError`,(e,t)=>{this.errorCached=this.errorCached||JSON.parse(JSON.stringify(this.state.errors));let n=this.errorCached;n&&e&&(t?n[e]=t:delete n[e]),this.errorTimeout&&=(clearTimeout(this.errorTimeout),null),JSON.stringify(n)===JSON.stringify(this.state.errors)?this.errorCached=null:this.errorTimeout=setTimeout(()=>this.setState({errors:this.errorCached||{}},()=>{this.errorTimeout=null,this.errorCached=null,this.props.onError(!!Object.keys(this.state.errors).length)}),50)}),G(this,`getCachedObject`,async e=>{if(this.cachedObjects[e]!==void 0)return this.cachedObjects[e];try{this.cachedObjects[e]=await this.props.socket.getObject(e)??null}catch(t){console.error(t),this.cachedObjects[e]=null}return this.cachedObjects[e]}),G(this,`changeLanguage`,()=>{this.forceUpdate()}),G(this,`forceAttrUpdate`,(e,t)=>{Array.isArray(e)?e.forEach(e=>this.forceUpdateHandlers[e]&&this.forceUpdateHandlers[e](t)):this.forceUpdateHandlers[e]&&this.forceUpdateHandlers[e](t)}),G(this,`registerOnForceUpdate`,(e,t)=>{t?this.forceUpdateHandlers[e]=t:this.forceUpdateHandlers[e]&&delete this.forceUpdateHandlers[e]}),this.statePool=new Lc(e.socket),this.state={originalData:JSON.stringify(this.props.data),changed:!1,errors:{},updateData:this.props.updateData||0,systemConfig:null,hostInfo:null,alive:!1,commandRunning:!1,schema:JSON.parse(JSON.stringify(this.props.schema))},this.forceUpdateHandlers={},this.buildDependencies(this.state.schema),this.readData().catch(e=>console.error(`Cannot read data: ${e}`))}static getDerivedStateFromProps(e,t){return e.updateData===t.updateData?null:{updateData:e.updateData,originalData:JSON.stringify(e.data),schema:JSON.parse(JSON.stringify(e.schema))}}static async loadI18n(e,t,n){if(t===!0||t&&typeof t==`string`){let r=W.getLanguage(),i=typeof t==`string`?t:`i18n`,a=await e.fileExists(`${n}.admin`,`${i}/${r}.json`),o;if(a?o=`${i}/${r}.json`:(a=await e.fileExists(`${n}.admin`,`${i}/${r}/translations.json`),a?o=`${i}/${r}/translations.json`:r!==`en`&&(a=await e.fileExists(`${n}.admin`,`${i}/en.json`),a?o=`${i}/en.json`:(a=await e.fileExists(`${n}.admin`,`${i}/en/translations.json`),a&&(o=`${i}/en/translations.json`)))),o){let t=await e.readFile(`${n}.admin`,o),i;i=t.file===void 0?t:t.file;try{let e=JSON.parse(i);W.extendTranslations(e,r)}catch(e){return console.error(`Cannot parse language file "${n}.admin/${o}: ${e}`),``}return o}return console.warn(`Cannot find i18n for ${n} / ${o}`),``}return t&&typeof t==`object`&&W.extendTranslations(t),``}componentWillUnmount(){this.statePool.destroy()}async readData(){let e;try{e=this.props.socket.getCompactSystemConfig?await this.props.socket.getCompactSystemConfig():await this.getCachedObject(`system.config`)||void 0;let t=await this.props.socket.getState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`);this.setState({systemConfig:(e==null?void 0:e.common)||{},hostInfo:await this.readHostInfo(),alive:!!(t!=null&&t.val)},()=>{this.updateContext(!0),this.props.custom||this.props.socket.subscribeState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`,this.onAlive)})}catch(e){console.error(`Cannot read system config: ${e}`)}}async readHostInfo(){var t,n,r,i,a,o,s,c;let l=((t=this.props.common)==null?void 0:t.host)||((n=this.props.instanceObj)==null||(n=n.common)==null?void 0:n.host),u=l?await this.getCachedObject(`system.host.${l}`):null,d={id:l||``,os:(u==null||(r=u.native)==null||(r=r.os)==null?void 0:r.platform)||``,osType:(u==null||(i=u.native)==null||(i=i.os)==null?void 0:i.type)||``,arch:(u==null||(a=u.native)==null||(a=a.os)==null?void 0:a.arch)||``,release:(u==null||(o=u.native)==null||(o=o.os)==null?void 0:o.release)||``,nodeVersion:(u==null||(s=u.native)==null||(s=s.process)==null||(s=s.versions)==null?void 0:s.node)||``,controllerVersion:(u==null||(c=u.common)==null?void 0:c.installedVersion)||``};if(l&&e.usesDocker(this.props.schema))try{let e=await this.props.socket.getState(`system.host.${l}.alive`);if((e==null?void 0:e.val)!==!1){let e=await this.props.socket.getHostInfoShort(l,!1,Rc);if(e){var f,p;d.docker=((f=e.dockerInformation)==null?void 0:f.isDocker)??e.Platform===`docker`,(p=e.dockerInformation)!=null&&p.isOfficial&&(d.dockerVersion=e.dockerInformation.officialVersion)}}}catch(e){console.warn(`Cannot read the docker information of ${l}: ${e}`)}return d}static usesDocker(e){let t=JSON.stringify(e);return t.includes(`"docker":`)||t.includes(`_host.docker`)}flatten(e,t){return t||={},e.items&&Object.keys(e.items).forEach(n=>{t[n]=e.items[n],this.flatten(e.items[n],t)}),t}buildDependencies(e){let t=this.flatten(e);Object.keys(t).forEach(e=>{var n,r,i,a,o;if((n=t[e].confirm)!=null&&n.alsoDependsOn){var s;(s=t[e].confirm)==null||s.alsoDependsOn.forEach(n=>{if(!t[n])console.error(`[JsonConfigComponent] Attribute ${n} does not exist!`),n.startsWith(`data.`)&&console.warn(`[JsonConfigComponent] please use "${n.replace(/^data\./,``)}" instead of "${n}"`);else{t[n].confirmDependsOn=t[n].confirmDependsOn||[];let r={...t[e],attr:e};r.confirm&&(r.confirm.cancel=`Undo`),t[n].confirmDependsOn.push(r)}})}if((r=t[e].onChange)!=null&&r.alsoDependsOn){var c;(c=t[e].onChange)==null||c.alsoDependsOn.forEach(n=>{if(!t[n])console.error(`[JsonConfigComponent] Attribute ${n} does not exist!`),n.startsWith(`data.`)&&console.warn(`[JsonConfigComponent] please use "${n.replace(/^data\./,``)}" instead of "${n}"`);else{t[n].onChangeDependsOn=t[n].onChangeDependsOn||[];let r={...t[e],attr:e};t[n].onChangeDependsOn.push(r)}})}if((i=t[e].hidden)!=null&&i.alsoDependsOn){var l;(l=t[e].hidden)==null||l.alsoDependsOn.forEach(n=>{if(!t[n])console.error(`[JsonConfigComponent] Attribute ${n} does not exist!`),n.startsWith(`data.`)&&console.warn(`[JsonConfigComponent] please use "${n.replace(/^data\./,``)}" instead of "${n}"`);else{t[n].hiddenDependsOn=t[n].hiddenDependsOn||[];let r={...t[e],attr:e};t[n].hiddenDependsOn.push(r)}})}if((a=t[e].label)!=null&&a.alsoDependsOn){var u;(u=t[e].label)==null||u.alsoDependsOn.forEach(n=>{if(!t[n])console.error(`[JsonConfigComponent] Attribute ${n} does not exist!`),n.startsWith(`data.`)&&console.warn(`[JsonConfigComponent] please use "${n.replace(/^data\./,``)}" instead of "${n}"`);else{t[n].labelDependsOn=t[n].labelDependsOn||[];let r={...t[e],attr:e};t[n].labelDependsOn.push(r)}})}if((o=t[e].help)!=null&&o.alsoDependsOn){var d;(d=t[e].help)==null||d.alsoDependsOn.forEach(n=>{if(!t[n])console.error(`[JsonConfigComponent] Attribute ${n} does not exist!`),n.startsWith(`data.`)&&console.warn(`[JsonConfigComponent] please use "${n.replace(/^data\./,``)}" instead of "${n}"`);else{t[n].helpDependsOn=t[n].helpDependsOn||[];let r={...t[e],attr:e};t[n].helpDependsOn.push(r)}})}})}updateContext(e){this.oContext={DeviceManager:this.props.DeviceManager,AceEditor:this.props.AceEditor,adapterName:this.props.adapterName,changeLanguage:this.changeLanguage,common:this.props.common,customs:this.props.customs,dateFormat:this.props.dateFormat,embedded:this.props.embedded,forceUpdate:this.forceAttrUpdate,imagePrefix:this.props.imagePrefix,instance:this.props.instance,instanceObj:this.props.instanceObj,isFloatComma:this.props.isFloatComma,multiEdit:this.props.multiEdit,onBackEndCommand:this.props.onBackEndCommand,onCommandRunning:this.onCommandRunning,onValueChange:this.props.onValueChange,registerOnForceUpdate:this.registerOnForceUpdate,socket:this.props.socket,systemConfig:this.state.systemConfig,theme:this.props.theme,themeType:this.props.themeType,_themeName:this.props.themeName,updateData:this.state.updateData,getCachedObject:this.getCachedObject,hostInfo:this.state.hostInfo||void 0,subscribeStates:this.statePool.subscribe,unsubscribeStates:this.statePool.unsubscribe,getStateValue:this.statePool.getValue},e&&this.forceUpdate()}renderItem(e){return this.oContext?e.type===`tabs`?p.createElement(Ic,{withoutSaveButtons:this.props.withoutSaveButtons,oContext:this.oContext,alive:this.state.alive,changed:this.state.changed,commandRunning:this.state.commandRunning,common:this.props.common,custom:this.props.custom,customObj:this.props.customObj,data:this.props.data,onChange:this.onChange,onError:(e,t)=>this.onError(e,t),originalData:JSON.parse(this.state.originalData),root:!0,schema:e,expertMode:this.props.expertMode,themeName:this.props.themeName,customComponents:this.props.customComponents}):e.type===`panel`||!e.type?p.createElement(Pc,{withoutSaveButtons:this.props.withoutSaveButtons,oContext:this.oContext,alive:this.state.alive,changed:this.state.changed,commandRunning:this.state.commandRunning,common:this.props.common,custom:this.props.custom,customObj:this.props.customObj,data:this.props.data,expertMode:this.props.expertMode,index:1e3,isParentTab:!this.props.embedded&&!this.props.withoutSaveButtons,onChange:this.onChange,onError:(e,t)=>this.onError(e,t),originalData:JSON.parse(this.state.originalData),root:!0,schema:e,themeName:this.props.themeName,customComponents:this.props.customComponents}):(console.error(`Unknown item type in root: ${JSON.stringify(e)}`),null):null}render(){return!this.state.systemConfig||!this.oContext?p.createElement(qt,null):(this.oContext._themeName!==this.props.themeName&&(this.oContext._themeName=this.props.themeName,setTimeout(()=>this.updateContext(!0),0)),p.createElement(`div`,{style:{...!this.props.embedded||this.props.withoutSaveButtons?zc.root:void 0,...this.props.style,...this.state.schema.style}},this.renderItem(this.state.schema)))}};f();var Vc={root:{width:`100%`,height:`100%`,overflow:`hidden`,position:`relative`},scroll:{height:`calc(100% - 48px)`,overflowY:`auto`},exportImportButtons:{position:`absolute`,top:5,right:0,zIndex:3},button:{marginRight:`5px`},tooltip:{pointerEvents:`none`}};function Hc(e,t){let n=``;for(let r=0;r<t.length;r++)n+=String.fromCharCode(e[r%e.length].charCodeAt(0)^t.charCodeAt(r));return n}function Uc(e,t){let n=``;for(let r=0;r<t.length;r++)n+=String.fromCharCode(e[r%e.length].charCodeAt(0)^t.charCodeAt(r));return n}function Wc(e,t){if(typeof t!=`string`)return t;if(!t.startsWith(`$/aes-192-cbc:`)||!/^[0-9a-f]{48}$/.test(e))return Hc(e,t);let n=t.split(`:`,3),r=window.CryptoJS.enc.Hex.parse(e),i=window.CryptoJS.enc.Hex.parse(n[1]),a=window.CryptoJS.lib.CipherParams.create({ciphertext:window.CryptoJS.enc.Hex.parse(n[2])}),o=window.CryptoJS.AES.decrypt(a,r,{iv:i});return window.CryptoJS.enc.Utf8.stringify(o)}function Gc(e,t,n){if(typeof t!=`string`)return t;if(!/^[0-9a-f]{48}$/.test(e))return Uc(e,t);let r;r=n?window.CryptoJS.enc.Hex.parse(n):window.CryptoJS.lib.WordArray.random(16);let i=window.CryptoJS.enc.Hex.parse(e),a=window.CryptoJS.AES.encrypt(t,i,{iv:r}).ciphertext;return`$/aes-192-cbc:${window.CryptoJS.enc.Hex.stringify(r)}:${a}`}function Kc(e,t){var n;return!t||!document.getElementById(t)?new Promise(n=>{let r=document.createElement(`script`);r.setAttribute(`id`,t),r.onload=n,r.src=e,document.getElementsByTagName(`head`)[0].appendChild(r)}):(n=document.getElementById(t))==null?void 0:n.onload}var qc=class extends et{constructor(e){super(e),G(this,`fileSubscribed`,[]),G(this,`fileLangSubscribed`,``),G(this,`secret`,void 0),G(this,`handleFileSelect`,e=>{let t=e.target.files[0];if(t){let e=new FileReader;e.onload=e=>{if(!e.target)return;let t=e.target.result;try{let e=JSON.parse(t);this.setState({data:e,changed:JSON.stringify(e)!==JSON.stringify(this.state.originalData)})}catch{window.alert(W.t(`jc_[JsonConfig] Failed to parse JSON file`))}},e.readAsText(t)}else window.alert(W.t(`jc_[JsonConfig] Failed to open JSON File`))}),G(this,`onFileChange`,async(e,t,n)=>{if(e===`${this.props.adapterName}.admin`&&n){if(t===this.fileLangSubscribed)try{var r;await Bc.loadI18n(this.props.socket,(r=this.state.schema)==null?void 0:r.i18n,this.props.adapterName),this.setState({hash:`${this.state.hash}1`})}catch{}else if(this.fileSubscribed.includes(t))try{let e=await this.getConfigFile(this.fileSubscribed[0]);this.setState({schema:e||void 0,hash:(0,ln.default)(JSON.stringify(e)).toString()})}catch{}}}),this.state={updateData:0,changed:!1,confirmDialog:!1,theme:Rt(e.themeName),saveConfigDialog:!1,hash:`_`},this.secret=e.secret||``,this.getInstanceObject().then(e=>this.getConfigFile().then(t=>Bc.loadI18n(this.props.socket,t==null?void 0:t.i18n,this.props.adapterName).then(n=>{n&&(this.fileLangSubscribed||(this.fileLangSubscribed=n,this.props.socket.subscribeFiles(`${this.props.adapterName}.admin`,this.fileLangSubscribed,this.onFileChange))),e?this.setState({schema:t||void 0,data:e.native,common:e.common,hash:(0,ln.default)(JSON.stringify(t)).toString()}):window.alert(`Instance system.adapter.${this.props.adapterName}.${this.props.instance} not found!`)})))}componentWillUnmount(){super.componentWillUnmount(),this.fileSubscribed.length&&(this.props.socket.unsubscribeFiles(`${this.props.adapterName}.admin`,this.fileSubscribed,this.onFileChange),this.fileSubscribed=[]),this.fileLangSubscribed&&=(this.props.socket.unsubscribeFiles(`${this.props.adapterName}.admin`,this.fileLangSubscribed,this.onFileChange),``)}getExportImportButtons(){return p.createElement(R,{sx:{...Vc.exportImportButtons,display:{xs:`none`,sm:`block`}}},p.createElement(A,{title:this.props.t(`jc_Import settings from JSON file`),slotProps:{popper:{sx:Vc.tooltip}}},p.createElement(tt,{size:`small`,sx:{"&.MuiFab-root":Vc.button},onClick:()=>{let e=document.createElement(`input`);e.setAttribute(`type`,`file`),e.setAttribute(`id`,`files`),e.setAttribute(`opacity`,0),e.addEventListener(`change`,e=>this.handleFileSelect(e),!1),e.click()}},p.createElement(Ge,null))),p.createElement(A,{title:this.props.t(`jc_Export setting to JSON file`),slotProps:{popper:{sx:Vc.tooltip}}},p.createElement(tt,{size:`small`,sx:{"&.MuiFab-root":Vc.button},onClick:()=>{this.state.data&&z.generateFile(`${this.props.adapterName}.${this.props.instance}.json`,this.state.data)}},p.createElement(Ge,{style:{transform:`rotate(180deg)`}}))))}async getInstanceObject(){try{let t=await this.props.socket.getObject(`system.adapter.${this.props.adapterName}.${this.props.instance}`);if(Array.isArray(t==null?void 0:t.encryptedNative)){var e;if(!this.secret){let e=await this.props.socket.getSystemConfig();await Kc(`../../lib/js/crypto-js/crypto-js.js`,`crypto-js`),this.secret=e.native.secret}return(e=t.encryptedNative)==null||e.forEach(e=>{t.native[e]&&(t.native[e]=Wc(this.secret,t.native[e]))}),t}return t||null}catch(e){window.alert(`[JsonConfig] Cannot read instance object: ${e}`)}return null}renderDialogConfirm(){return this.state.confirmDialog?p.createElement(xt,{title:W.t(`jc_Please confirm`),text:W.t(`jc_Some data are not stored. Discard?`),ok:W.t(`jc_Discard`),cancel:W.t(`jc_Cancel`),onClose:e=>this.setState({confirmDialog:!1},()=>e&&et.doNavigate(null))}):null}async scanForInclude(e,t){if(typeof e[`#include`]==`string`){let n=await this._getConfigFile(e[`#include`],[...t]);return delete e[`#include`],n&&(e={...e,...n}),e}let n=Object.keys(e);for(let r=0;r<n.length;r++)e[n[r]]&&typeof e[n[r]]==`object`&&(e[n[r]]=await this.scanForInclude(e[n[r]],t));return e}async getConfigFile(e){return this._getConfigFile(e)}async _getConfigFile(e,t){if(e||=`jsonConfig.json5`,t||=[],t.includes(e))return window.alert(`[JsonConfig] Circular reference in file: ${e} => ${t.join(` => `)}`),null;t.push(e);try{await this.props.socket.fileExists(`${this.props.adapterName}.admin`,e)||(e=`jsonConfig.json`);let n=await this.props.socket.readFile(`${this.props.adapterName}.admin`,e),r=``,i=``;if(n.file!==void 0&&(i=n.file),typeof i==`string`)r=i;else if(i.type===`Buffer`){let e=``,t=new Uint8Array(i.data),n=t.byteLength;for(let r=0;r<n;r++)e+=String.fromCharCode(t[r]);r=e}this.fileSubscribed.includes(e)||(this.fileSubscribed.push(e),await this.props.socket.subscribeFiles(`${this.props.adapterName}.admin`,e,this.onFileChange));try{return await this.scanForInclude(cn.default.parse(r),t)}catch(e){window.alert(`[JsonConfig] Cannot parse json5 config!`),console.log(e)}}catch(t){this.state.schema||window.alert(`[JsonConfig] Cannot read file "${e}: ${t}`)}return null}renderSaveConfigDialog(){return this.state.saveConfigDialog?p.createElement(xt,{title:W.t(`jc_Please confirm`),text:W.t(`jc_Save configuration?`),ok:W.t(`jc_Save`),cancel:W.t(`jc_Cancel`),onClose:e=>this.setState({saveConfigDialog:!1},()=>e&&this.onSave(!0))}):null}findAttr(e,t){if(t||=this.state.schema,t!=null&&t.items){if(e in t.items)return t.items[e];for(let n of Object.values(t.items)){let t=this.findAttr(e,n);if(t)return t}}return null}postProcessing(e,t,n){if(n||=this.state.schema,!e){console.error(`Data is empty in postProcessing: ${t}, ${JSON.stringify(n)}`);return}let r=e[t];if(n.items){if(n.type===`table`){let e=r;if(!Array.isArray(e))return;for(let t of e)if(n.items)for(let e of n.items)e.attr&&this.postProcessing(t,e.attr,e)}else for(let[t,r]of Object.entries(n.items)){if(r.type===`panel`||r.type===`tabs`||r.type===`accordion`)return;this.postProcessing(e,t,r)}}else if(t&&typeof r==`string`){if(n.type===`text`)n.trim!==!1&&(e[t]=r.trim());else if(n.type===`ip`)e[t]=r.trim();else if(n.type===`number`){let i=parseFloat(r.toString().replace(`,`,`.`));e[t]=n.min!==void 0&&i<n.min?n.min:n.max!==void 0&&i>n.max?n.max:i}else if(n.type===`port`){let i=parseInt(r.toString(),10);n.min!==void 0&&i<n.min?e[t]=n.min:n.max!==void 0&&i>n.max&&(e[t]=n.max),e[t]=e[t]!==0&&i<20?20:i>65535?65535:i}else n.type===`checkbox`&&(e[t]=e[t]===!0||e[t]===`true`||e[t]===`on`||e[t]===1||e[t]===`1`)}}async onSave(e,t){if(e){let e=await this.getInstanceObject();if(!e){console.error(`Something went wrong: may be no connection?`),window.alert(`Something went wrong: may be no connection?`);return}if(!this.state.data||!this.state.schema)return;let n={};for(let t of Object.keys(this.state.data)){let r=this.findAttr(t);(!r||!r.doNotSave||r.type===`state`)&&!t.startsWith(`_`)?q.setValue(e.native,t,this.state.data[t]):(q.setValue(e.native,t,null),n[t]=this.state.data[t])}try{let t=JSON.parse(JSON.stringify(e));if(Array.isArray(t.encryptedNative)){await Kc(`../../lib/js/crypto-js/crypto-js.js`,`crypto-js`);for(let e of t.encryptedNative)t.native[e]&&(t.native[e]=Gc(this.secret,t.native[e]))}await this.props.socket.setObject(t._id,t)}catch(e){window.alert(`[JsonConfig] Cannot set object: ${e}`)}let r={...e.native,...n};console.log(r),this.setState({changed:!1,data:r,updateData:this.state.updateData+1,originalData:r},()=>t&&et.doNavigate(null))}else this.state.changed?this.setState({confirmDialog:!0}):et.doNavigate(null)}componentDidUpdate(e,t){t.changed!==this.state.changed&&this.props.configStored(!this.state.changed)}async componentDidMount(){let e=`${window.location.protocol}//${window.location.host}${window.location.pathname}validate_config/${this.props.adapterName}`;console.log(`fetch ${e}`),await fetch(e)}render(){return!this.state.data||!this.state.schema?p.createElement(qt,null):p.createElement(`div`,{style:Vc.root},this.renderDialogConfirm(),this.getExportImportButtons(),this.renderSaveConfigDialog(),p.createElement(Bc,{key:this.state.hash,style:Vc.scroll,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,adapterName:this.props.adapterName,instance:this.props.instance,isFloatComma:this.props.isFloatComma,dateFormat:this.props.dateFormat,schema:this.state.schema,common:this.state.common,expertMode:this.props.expertMode,data:this.state.data,updateData:this.state.updateData,onError:e=>this.setState({error:e}),onChange:(e,t,n)=>{n&&this.state.error&&(window.alert(W.t(`jc_Cannot save configuration because of error in configuration`)),n=!1),n&&!this.state.changed&&!t&&(n=!1),e?this.setState({data:e,changed:!!t,saveConfigDialog:n}):n!==void 0&&this.setState({saveConfigDialog:n})},DeviceManager:this.props.DeviceManager,AceEditor:this.props.AceEditor,theme:this.state.theme,customComponents:this.props.customComponents,imagePrefix:`.`}),p.createElement(Dt,{isIFrame:!1,dense:!0,paddingLeft:0,newReact:!0,theme:this.state.theme,noTextOnButtons:this.props.width===`xs`||this.props.width===`sm`||this.props.width===`md`,changed:!!(this.state.error||this.state.changed),error:!!this.state.error,onSave:e=>this.onSave(!0,e),onClose:()=>this.onSave(!1)}))}},Jc=t({ConfigGeneric:()=>q,ConfigPanel:()=>Pc,GUI_API_GENERATION:()=>2,JsonConfig:()=>qc,JsonConfigComponent:()=>Bc,checkGuiApiCompatibility:()=>nr}),Yc=Jc,Xc=Yc.GUI_API_GENERATION,Zc=Yc.checkGuiApiCompatibility,Qc=Yc.JsonConfig,$c=Yc.JsonConfigComponent,el=Yc.ConfigPanel,tl=Yc.ConfigGeneric,nl=Reflect.get(Jc,`default`)??Jc;export{tl as ConfigGeneric,el as ConfigPanel,Xc as GUI_API_GENERATION,Qc as JsonConfig,$c as JsonConfigComponent,Zc as checkGuiApiCompatibility,nl as default};
|