iobroker.eos-admin 7.9.66 → 7.9.68
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/adminWww/assets/AdapterUpdateDialog-BMg84Hpf-v67.js +2 -0
- package/adminWww/assets/Adapters-B5_jQ7DE-v67.js +9 -0
- package/adminWww/assets/Config-hHK2UzGP-v67.js +1 -0
- package/adminWww/assets/CustomTab-B0wqoazH-v67.js +1 -0
- package/adminWww/assets/DeviceManager-BFmQeYQ1-v67.js +1 -0
- package/adminWww/assets/EasyMode-B1d9Vdc4-v67.js +1 -0
- package/adminWww/assets/Enums-DbWYxKOo-v67.js +91 -0
- package/adminWww/assets/Fields-CX3rKuWb-v67.js +1 -0
- package/adminWww/assets/Files-Cd2HOzIE-v67.js +1 -0
- package/adminWww/assets/Hosts-Bg8QzW5i-v67.js +121 -0
- package/adminWww/assets/Instances-YdaGnS5a-v67.js +2 -0
- package/adminWww/assets/Intro-DkwRiz1n-v67.js +2 -0
- package/adminWww/assets/Logs-CsVPSLJH-v67.js +1 -0
- package/adminWww/assets/Objects-DPan0bzw-v67.js +878 -0
- package/adminWww/assets/Users-BgnBRgwU-v67.js +1 -0
- package/adminWww/assets/bootstrap-COulQZax-v54.js +1 -2
- package/adminWww/assets/bootstrap-COulQZax-v55.js +1 -2
- package/adminWww/assets/bootstrap-COulQZax-v56.js +1 -2
- package/adminWww/assets/bootstrap-COulQZax-v57.js +1 -2
- package/adminWww/assets/bootstrap-COulQZax-v58.js +1 -2
- package/adminWww/assets/bootstrap-COulQZax-v59.js +1 -2
- package/adminWww/assets/bootstrap-COulQZax-v60.js +1 -2
- package/adminWww/assets/bootstrap-COulQZax-v61.js +1 -317
- package/adminWww/assets/bootstrap-COulQZax-v67.js +1 -0
- package/adminWww/assets/bootstrap-COulQZax-v68.js +317 -0
- package/adminWww/assets/bootstrap-COulQZax.js +1 -2
- package/adminWww/assets/index-CQZugZ1z-v67.js +1 -0
- package/adminWww/assets/index-CQZugZ1z-v68.js +2 -0
- package/adminWww/css/eos-branding.css +67 -14
- package/adminWww/index.html +10 -10
- package/adminWww/js/eos-branding.js +104 -37
- package/io-package.json +5 -5
- package/package.json +1 -1
- package/tools/nexowatt-validate-package.cjs +27 -15
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import{j as s}from"./DefaultPropsProvider-BiXBMQYQ.js";import{i as I}from"./iobroker_admin__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-LFZoiUTt.js";import{i as O,a as k}from"./iobroker_admin__loadShare__react__loadShare__-LM7uyL45.js";import{e as ke,u as Ee,g as De,b as H,_ as Ge,D as Me,T as Je,h as Ue}from"./bootstrap-COulQZax-v67.js";import{I as se,a as Ke,b as qe}from"./Fields-CX3rKuWb-v67.js";import{i as c,a as b}from"./iobroker_admin__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-CJO5yP3h.js";import{g as ze,h as Ae}from"./index-BmNcalFW.js";import{_ as o}from"./preload-helper-BDBacUwf.js";import Se from"./list-C2A06nPE.js";import"./_commonjsHelpers-CE1G-McA.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-g2X2zhAf.js";import"./emotion-serialize.esm-Q4o_CgeF.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-BywLg1Xe.js";import"./ace-DEUjyTIn.js";import"./iobroker_admin__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__-CpA7pnS5.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-CNUAG3AH.js";import"./ext-language_tools-ylAoucDh.js";import"./iobroker_admin__loadShare__react_mf_2_dropzone__loadShare__-CwjnV48g.js";import"./iobroker_admin__loadShare__react_mf_2_dom__loadShare__-CVeAXnkk.js";import"./sdk-C-e-e2gd.js";import"./extends-CF3RwP-h.js";import"./assertThisInitialized-B0aQ9eG_.js";import"./useTheme-Bl-M1DYp.js";import"./createTheme-DFX8CY6F.js";import"./blue-CagzI6CQ.js";import"./index-DcK0RDrH.js";import"./ThemeProvider-BOFFjWAF.js";import"./emotion-cache.browser.esm-BgJfNZJN.js";import"./setYear-3ufv5yRD.js";import"./en-US-DBFJNIH6.js";import"./iconBase-2IlPecPg.js";var Ve={exports:{}},x={};var ce=60103,de=60106,U=60107,K=60108,q=60114,Z=60109,Y=60110,X=60112,Q=60113,ye=60120,ee=60115,te=60116,Be=60121,Ne=60122,We=60117,Fe=60129,$e=60131;if(typeof Symbol=="function"&&Symbol.for){var j=Symbol.for;ce=j("react.element"),de=j("react.portal"),U=j("react.fragment"),K=j("react.strict_mode"),q=j("react.profiler"),Z=j("react.provider"),Y=j("react.context"),X=j("react.forward_ref"),Q=j("react.suspense"),ye=j("react.suspense_list"),ee=j("react.memo"),te=j("react.lazy"),Be=j("react.block"),Ne=j("react.server.block"),We=j("react.fundamental"),Fe=j("react.debug_trace_mode"),$e=j("react.legacy_hidden")}function W(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case ce:switch(e=e.type,e){case U:case q:case K:case Q:case ye:return e;default:switch(e=e&&e.$$typeof,e){case Y:case X:case te:case ee:case Z:return e;default:return t}}case de:return t}}}var Ze=Z,Ye=ce,Xe=X,Qe=U,et=te,tt=ee,it=de,rt=q,st=K,nt=Q;x.ContextConsumer=Y;x.ContextProvider=Ze;x.Element=Ye;x.ForwardRef=Xe;x.Fragment=Qe;x.Lazy=et;x.Memo=tt;x.Portal=it;x.Profiler=rt;x.StrictMode=st;x.Suspense=nt;x.isAsyncMode=function(){return!1};x.isConcurrentMode=function(){return!1};x.isContextConsumer=function(e){return W(e)===Y};x.isContextProvider=function(e){return W(e)===Z};x.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===ce};x.isForwardRef=function(e){return W(e)===X};x.isFragment=function(e){return W(e)===U};x.isLazy=function(e){return W(e)===te};x.isMemo=function(e){return W(e)===ee};x.isPortal=function(e){return W(e)===de};x.isProfiler=function(e){return W(e)===q};x.isStrictMode=function(e){return W(e)===K};x.isSuspense=function(e){return W(e)===Q};x.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===U||e===q||e===Fe||e===K||e===Q||e===ye||e===$e||typeof e=="object"&&e!==null&&(e.$$typeof===te||e.$$typeof===ee||e.$$typeof===Z||e.$$typeof===Y||e.$$typeof===X||e.$$typeof===We||e.$$typeof===Be||e[0]===Ne)};x.typeOf=W;Ve.exports=x;var ot=Ve.exports;function le(e,t){const i=getComputedStyle(t);if(!i)return;let r=e===w.Horizontal?t.clientWidth:t.clientHeight;return r!==0?(e===w.Horizontal?r-=parseFloat(i.paddingLeft)+parseFloat(i.paddingRight):r-=parseFloat(i.paddingTop)+parseFloat(i.paddingBottom),r):void 0}function ne(e,t,i=[],r={condition:!0}){const{condition:n}=r,a=(function(m,p){var g={};for(var h in m)Object.prototype.hasOwnProperty.call(m,h)&&p.indexOf(h)<0&&(g[h]=m[h]);if(m!=null&&typeof Object.getOwnPropertySymbols=="function"){var u=0;for(h=Object.getOwnPropertySymbols(m);u<h.length;u++)p.indexOf(h[u])<0&&Object.prototype.propertyIsEnumerable.call(m,h[u])&&(g[h[u]]=m[h[u]])}return g})(r,["condition"]);O.useEffect((()=>(n&&window.addEventListener(e,t,a),()=>{n&&window.removeEventListener(e,t)})),[e,t,n,...i])}(function(e,t){t===void 0&&(t={});var i=t.insertAt;if(typeof document<"u"){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",i==="top"&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}})(`/* === Main Container === */
|
|
2
|
+
.__dbk__container {
|
|
3
|
+
height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
|
|
6
|
+
display: flex;
|
|
7
|
+
overflow: hidden;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.__dbk__container.Horizontal {
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.__dbk__container.Vertical {
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
}
|
|
17
|
+
/* ====== */
|
|
18
|
+
|
|
19
|
+
/* === Wrapper for each child element === */
|
|
20
|
+
.__dbk__child-wrapper {
|
|
21
|
+
height: 100%;
|
|
22
|
+
width: 100%;
|
|
23
|
+
}
|
|
24
|
+
/* ====== */
|
|
25
|
+
|
|
26
|
+
/* === Gutter === */
|
|
27
|
+
.__dbk__gutter {
|
|
28
|
+
display: flex;
|
|
29
|
+
align-items: center;
|
|
30
|
+
justify-content: center;
|
|
31
|
+
}
|
|
32
|
+
/* .__dbk__gutter > div {
|
|
33
|
+
background: red;
|
|
34
|
+
} */
|
|
35
|
+
.__dbk__gutter.Horizontal {
|
|
36
|
+
height: 100%;
|
|
37
|
+
padding: 0 2px;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
}
|
|
40
|
+
.__dbk__gutter.Horizontal:hover {
|
|
41
|
+
cursor: col-resize;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.__dbk__gutter.Vertical {
|
|
45
|
+
width: 100%;
|
|
46
|
+
padding: 2px 0;
|
|
47
|
+
flex-direction: row;
|
|
48
|
+
}
|
|
49
|
+
.__dbk__gutter.Vertical:hover {
|
|
50
|
+
cursor: row-resize;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.__dbk__gutter.Light {
|
|
54
|
+
background: #EDF0EF;
|
|
55
|
+
}
|
|
56
|
+
.__dbk__gutter.Light:hover > .__dbk__dragger {
|
|
57
|
+
background: #76747B;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.__dbk__gutter.Dark {
|
|
61
|
+
background: #020203;
|
|
62
|
+
}
|
|
63
|
+
.__dbk__gutter.Dark:hover > .__dbk__dragger {
|
|
64
|
+
background: #9995A3;
|
|
65
|
+
}
|
|
66
|
+
/* ====== */
|
|
67
|
+
|
|
68
|
+
/* === Gutter's Dragger === */
|
|
69
|
+
.__dbk__dragger {
|
|
70
|
+
border-radius: 2px;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.__dbk__dragger.Horizontal {
|
|
74
|
+
width: 4px;
|
|
75
|
+
height: 24px;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.__dbk__dragger.Vertical {
|
|
79
|
+
width: 24px;
|
|
80
|
+
height: 4px;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.__dbk__dragger.Light {
|
|
84
|
+
background: #A6ACB5;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.__dbk__dragger.Dark {
|
|
88
|
+
background: #434252;
|
|
89
|
+
}
|
|
90
|
+
/* ====== */`);const at=k.forwardRef((({className:e,theme:t,draggerClassName:i,direction:r=w.Vertical,onDragging:n},a)=>{const m=`__dbk__gutter ${r} ${e||t}`,p=`__dbk__dragger ${r} ${i||t}`;return s.jsx("div",Object.assign({className:m,ref:a,dir:r,onMouseDown:n,onTouchStart:ae?n:void 0},{children:s.jsx("div",{className:p},void 0)}),void 0)}));var B;function ve(e,t,i){let r,n;return t?(r=e/2,n=e):i?(r=e,n=e/2):(r=e,n=e),{aGutterSize:r,bGutterSize:n}}function lt(e,t){switch(t.type){case B.SetIsReadyToCompute:return Object.assign(Object.assign({},e),{isReady:t.payload.isReady});case B.CreatePairs:{const{direction:i,children:r,gutters:n}=t.payload,a=r[0].parentNode;if(!a)throw new Error("Cannot create pairs - parent is undefined.");const m=le(i,a);if(m===void 0)throw new Error(`Cannot create pairs - parent has undefined or zero size: ${m}.`);const p=[];return r.forEach(((g,h)=>{if(h>0){const u=r[h-1],d=r[h],l=n[h-1],_=i===w.Horizontal?u.getBoundingClientRect().left:u.getBoundingClientRect().top,D=i===w.Horizontal?d.getBoundingClientRect().right:d.getBoundingClientRect().bottom,C=i===w.Horizontal?u.getBoundingClientRect().width+l.getBoundingClientRect().width+d.getBoundingClientRect().width:u.getBoundingClientRect().height+l.getBoundingClientRect().height+d.getBoundingClientRect().height,z=i===w.Horizontal?l.getBoundingClientRect().width:l.getBoundingClientRect().height,P={idx:h-1,a:u,b:d,gutter:l,parent:a,start:_,end:D,size:C,gutterSize:z,aSizePct:100/r.length,bSizePct:100/r.length};p.push(P)}})),Object.assign(Object.assign({},e),{pairs:p})}case B.StartDragging:{const{gutterIdx:i}=t.payload;return Object.assign(Object.assign({},e),{isDragging:!0,draggingIdx:i})}case B.StopDragging:return Object.assign(Object.assign({},e),{isDragging:!1});case B.CalculateSizes:{const{direction:i,gutterIdx:r}=t.payload,n=e.pairs[r],a=le(i,n.parent);if(!a)throw new Error("Cannot calculate sizes - 'pair.parent' has undefined or zero size.");const m=n.gutter[i===w.Horizontal?"clientWidth":"clientHeight"],p=r===0,g=r===e.pairs.length-1,{aGutterSize:h,bGutterSize:u}=ve(m,p,g);let d,l,_,D,C;return i===w.Horizontal?(d=n.a.getBoundingClientRect().left,l=n.b.getBoundingClientRect().right,D=(n.a.getBoundingClientRect().width+h)/a*100,C=(n.b.getBoundingClientRect().width+u)/a*100,_=n.a.getBoundingClientRect().width+h+u+n.b.getBoundingClientRect().width):(d=n.a.getBoundingClientRect().top,l=n.b.getBoundingClientRect().bottom,D=(n.a.getBoundingClientRect().height+h)/a*100,C=(n.b.getBoundingClientRect().height+u)/a*100,_=n.a.getBoundingClientRect().height+h+u+n.b.getBoundingClientRect().height),e.pairs[r]=Object.assign(Object.assign({},n),{start:d,end:l,size:_,aSizePct:D,bSizePct:C,gutterSize:m}),Object.assign({},e)}default:return e}}function He(e,t=0,i=[]){return O.Children.toArray(e).reduce(((r,n,a)=>(ot.isFragment(n)?r.push.apply(r,He(n.props.children,t+1,i.concat(n.key||a))):O.isValidElement(n)?r.push(O.cloneElement(n,{key:i.concat(String(n.key)).join(".")})):typeof n!="string"&&typeof n!="number"||r.push(n),r)),[])}(function(e){e[e.SetIsReadyToCompute=0]="SetIsReadyToCompute",e[e.CreatePairs=1]="CreatePairs",e[e.CalculateSizes=2]="CalculateSizes",e[e.StartDragging=3]="StartDragging",e[e.StopDragging=4]="StopDragging"})(B||(B={}));const Oe=e=>"changedTouches"in e;var w,fe;(function(e){e.Horizontal="Horizontal",e.Vertical="Vertical"})(w||(w={})),(function(e){e.Light="Light",e.Dark="Dark"})(fe||(fe={}));const ae=typeof window<"u"&&"ontouchstart"in window;function ge(e){return e===w.Horizontal?"col-resize":"row-resize"}const mt={isReady:!1,isDragging:!1,pairs:[]};function ct({direction:e=w.Horizontal,minWidths:t=[],minHeights:i=[],initialSizes:r,gutterTheme:n=fe.Dark,gutterClassName:a,draggerClassName:m,children:p,onResizeStarted:g,onResizeFinished:h,classes:u=[]}){const d=He(p),[l,_]=O.useReducer(lt,mt),D=O.useRef(null),C=O.useRef([]),z=O.useRef([]);C.current=[],z.current=[];const P=k.useCallback((f=>{_({type:B.SetIsReadyToCompute,payload:{isReady:f}})}),[]),ie=k.useCallback(((f,E)=>{_({type:B.StartDragging,payload:{gutterIdx:E}});const v=l.pairs[E];g==null||g(v.idx),v.a.style.userSelect="none",v.b.style.userSelect="none",v.gutter.style.cursor=ge(f),v.parent.style.cursor=ge(f),document.body.style.cursor=ge(f)}),[l.pairs]),J=k.useCallback((()=>{_({type:B.StopDragging});const f=[];for(let v=0;v<l.pairs.length;v++){const T=l.pairs[v],R=le(e,T.parent);if(R===void 0)throw new Error("Cannot call the 'onResizeFinished' callback - parentSize is undefined");if(T.gutterSize===void 0)throw new Error("Cannot call 'onResizeFinished' callback - gutterSize is undefined");const V=v===0,L=v===l.pairs.length-1,G=T.a.getBoundingClientRect()[e===w.Horizontal?"width":"height"],{aGutterSize:F,bGutterSize:$}=ve(T.gutterSize,V,L),N=(G+F)/R*100;if(f.push(N),L){const re=(T.b.getBoundingClientRect()[e===w.Horizontal?"width":"height"]+$)/R*100;f.push(re)}}if(l.draggingIdx===void 0)throw new Error("Could not reset cursor and user-select because 'state.draggingIdx' is undefined");const E=l.pairs[l.draggingIdx];h==null||h(E.idx,f),E.a.style.userSelect="",E.b.style.userSelect="",E.gutter.style.cursor="",E.parent.style.cursor="",document.body.style.cursor=""}),[l.draggingIdx,l.pairs,e]),be=k.useCallback(((f,E)=>{_({type:B.CalculateSizes,payload:{direction:f,gutterIdx:E}})}),[]),Ce=k.useCallback(((f,E,v)=>{_({type:B.CreatePairs,payload:{direction:f,children:E,gutters:v}})}),[]),ue=k.useCallback(((f,E,v,T)=>{const R=E[0].parentNode;if(!R)throw new Error("Cannot set initial sizes - parent is undefined");if(le(f,R)===void 0)throw new Error("Cannot set initial sizes - parent has undefined size");E.forEach(((V,L)=>{const G=L===0,F=L===E.length-1;let $,N=0;E.length>1&&(N=v[F?L-1:L].getBoundingClientRect()[f===w.Horizontal?"width":"height"],N=G||F?N/2:N),$=T&&L<T.length?`calc(${T[L]}% - ${N}px)`:`calc(${100/E.length}% - ${N}px)`,f===w.Horizontal?(V.style.width=$,V.style.height="100%"):(V.style.height=$,V.style.width="100%")}))}),[]),xe=k.useCallback(((f,E)=>{if(l.draggingIdx===void 0)throw new Error("Cannot adjust size - 'draggingIdx' is undefined");const v=l.pairs[l.draggingIdx];if(v.size===void 0)throw new Error("Cannot adjust size - 'pair.size' is undefined");if(v.gutterSize===void 0)throw new Error("Cannot adjust size - 'pair.gutterSize' is undefined");const T=v.aSizePct+v.bSizePct,R=E/v.size*T,V=T-E/v.size*T,L=l.draggingIdx===0,G=l.draggingIdx===l.pairs.length-1,{aGutterSize:F,bGutterSize:$}=ve(v.gutterSize,L,G),N=`calc(${R}% - ${F}px)`,re=`calc(${V}% - ${$}px)`;f===w.Horizontal?(v.a.style.width=N,v.b.style.width=re):(v.a.style.height=N,v.b.style.height=re)}),[l.draggingIdx,l.pairs,e]),pe=k.useCallback(((f,E,v)=>{if(!l.isDragging)return;if(l.draggingIdx===void 0)throw new Error("Cannot drag - 'draggingIdx' is undefined");const T=l.pairs[l.draggingIdx];if(T.start===void 0)throw new Error("Cannot drag - 'pair.start' is undefined");if(T.size===void 0)throw new Error("Cannot drag - 'pair.size' is undefined");if(T.gutterSize===void 0)throw new Error("Cannot drag - 'pair.gutterSize' is undefined");let R=(function(G,F){const $=Oe(F)?F.changedTouches[0]:F;return G===w.Horizontal?$.clientX:$.clientY})(E,f)-T.start,V=16,L=16;v.length>l.draggingIdx&&(V=v[l.draggingIdx]),v.length>=l.draggingIdx+1&&(L=v[l.draggingIdx+1]),R<T.gutterSize+V&&(R=T.gutterSize+V),R>=T.size-(T.gutterSize+L)&&(R=T.size-(T.gutterSize+L)),xe(E,R)}),[l.isDragging,l.draggingIdx,l.pairs,xe]),Te=()=>{if(l.isDragging){if(l.draggingIdx===void 0)throw new Error("Cannot calculate sizes after dragging = 'state.draggingIdx' is undefined");be(e,l.draggingIdx),J()}},we=f=>{l.isDragging&&(Oe(f)&&f.preventDefault(),pe(f,e,e===w.Horizontal?t:i))};function Ie(f,E){if(!f.current)throw new Error("Can't add element to ref object - ref isn't initialized");E&&!f.current.includes(E)&&f.current.push(E)}return ne("mouseup",Te,[l.isDragging,J]),ne("mousemove",we,[e,l.isDragging,pe,t,i]),ne("touchend",Te,[l.isDragging,J],{condition:ae}),ne("touchmove",we,[e,l.isDragging,pe,t,i],{condition:ae,passive:!ae}),O.useEffect((function(){if(!D.current)return;const f=D.current.parentElement;if(!f)return;const E=new ResizeObserver((()=>{const v=getComputedStyle(f),T=e===w.Horizontal?f.clientWidth:f.clientHeight;P(!!v&&!!T)}));return E.observe(f),()=>{E.disconnect()}}),[D.current,e]),O.useEffect((function(){if(l.isReady&&(!C.current||C.current[0].offsetParent)){if(!C.current||!z.current)throw new Error("Cannot create pairs - either variable 'childRefs' or 'gutterRefs' is undefined");d.length<=1?ue(e,C.current,z.current,r):(ue(e,C.current,z.current,r),Ce(e,C.current,z.current))}}),[p,l.isReady,e,ue,Ce,r]),s.jsx("div",Object.assign({className:`__dbk__container ${e}`,ref:D},{children:l.isReady&&d.map(((f,E)=>s.jsxs(k.Fragment,{children:[s.jsx("div",Object.assign({ref:v=>Ie(C,v),className:"__dbk__child-wrapper "+(E<u.length?u[E]:"")},{children:f}),void 0),E<d.length-1&&s.jsx(at,{ref:v=>Ie(z,v),className:a,theme:n,draggerClassName:m,direction:e,onDragging:()=>{return be(e,v=E),void ie(e,v);var v}},void 0)]},E)))}),void 0)}const dt="0 1px 1px 0 rgba(0, 0, 0, .4),0 6px 6px 0 rgba(0, 0, 0, .2)",y={enumGroupCard:e=>({border:"1px solid #FFF",borderColor:e.palette.divider,m:"10px",backgroundColor:e.palette.background.default,color:e.palette.text.primary,transition:"all 200ms ease-out",opacity:1,overflow:"hidden",position:"relative","&:hover":{overflowY:"auto",boxShadow:dt},minHeight:70}),enumGroupCardExpanded:{minHeight:140},enumUpdating:{opacity:.5,position:"relative","&:before":{content:'""',position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:100,opacity:".3 !important",background:"repeating-linear-gradient(135deg, #333, #333 10px, #888 10px, #888 20px)"}},enumCardContent:{height:"100%",opacity:1},right:{float:"right"},enumGroupTitle:{display:"inline-flex",alignItems:"center",cursor:"pointer"},icon:{height:32,width:32,marginRight:5,cursor:"grab",backgroundSize:"cover",backgroundPosition:"center",display:"inline-block"},enumGroupName:{marginLeft:5},enumGroupEnumName:{fontWeight:900},enumGroupEnumID:{opacity:.7,marginLeft:5,fontSize:12,fontStyle:"italic"},enumName:{fontSize:12,fontWeight:700,opacity:.7,marginTop:-4},enumGroupMember:e=>({display:"inline-flex",m:"4px",p:"4px",backgroundColor:"#00000010",border:"1px solid #FFF",borderColor:e.palette.text.primary,color:e.palette.text.primary,alignItems:"center",position:"relative"}),secondLine:{fontSize:9,fontStyle:"italic",whiteSpace:"nowrap",opacity:.5},context:{paddingTop:8,paddingLeft:8,paddingRight:8,paddingBottom:"0 !important"},folderDiv:{display:"inline-block",position:"relative",cursor:"pointer"},folder:{width:48,height:48},folderIcon:{position:"absolute",top:18,left:16,width:18,height:18,zIndex:2},folderIconExpanded:{transform:"skew(147deg, 183deg) scale(0.5) translate(6px, 7px)"},bottomButtons:{position:"absolute",right:0,bottom:0},membersNumber:{top:40,left:26,fontSize:18,position:"absolute"},memberNumberFolder:{top:46,left:26}};function he(e){var r,n;const t=((r=e.member.common)==null?void 0:r.name)&&e.getName((n=e.member.common)==null?void 0:n.name);let i=e.icon?s.jsx(I.Icon,{style:y.icon,src:e.icon}):e.member.type==="state"?s.jsx(I.IconState,{style:y.icon}):e.member.type==="channel"?s.jsx(I.IconChannel,{style:y.icon}):e.member.type==="device"?s.jsx(I.IconDevice,{style:y.icon}):s.jsx(b.List,{style:y.icon});return e.iconDragRef&&(i=s.jsx("span",{ref:e.iconDragRef,children:i})),s.jsxs(c.Card,{title:t?`${e.t("Name: %s",t)}
|
|
91
|
+
ID: ${e.member._id}`:e.member._id,variant:"outlined",sx:I.Utils.getStyle(e.theme,y.enumGroupMember,{".enum-member-button":{visibility:H.isTouchDevice()?"visible":"hidden"},"&:hover .enum-member-button":{visibility:"visible"}}),style:{color:e.textColor,borderColor:`${e.textColor}80`,opacity:e.isDragging?0:1},children:[i,s.jsxs("div",{children:[t||e.member._id,t?s.jsx("div",{style:y.secondLine,children:e.member._id}):null,e.preview?s.jsx("div",{style:{color:"#ff6947",whiteSpace:"nowrap"},children:e.t("Press ALT-key to copy")}):null]}),e.isDragging?null:s.jsx(c.IconButton,{className:"enum-member-button",size:"small",onClick:()=>e.removeMemberFromEnum(e.member._id,e.parentID),children:s.jsx(c.Tooltip,{title:e.t("Remove"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:s.jsx(b.Clear,{style:{color:e.textColor}})})})]},e.member._id)}function ut(e){const[{isDragging:t},i,r]=Ee({type:"enum-member",item:()=>({memberId:e.member._id,preview:s.jsx("div",{style:{width:100},children:s.jsx(he,{...e,preview:!0})})}),end:(n,a)=>{const m=a.getDropResult();m&&e.moveMember(n.memberId,m.enumId,m.dropEffect==="copy")},collect:n=>(console.log(n.getDropResult()),{isDragging:n.isDragging(),handlerId:n.getHandlerId()})});return O.useEffect(()=>{r(De(),{captureDraggingState:!0})},[r]),H.isTouchDevice()?s.jsx(he,{isDragging:t,iconDragRef:i,...e}):s.jsx("div",{ref:i,style:{display:"inline-flex"},children:s.jsx(he,{isDragging:t,...e})})}class oe extends O.Component{constructor(t){var i,r;super(t),this.state={icons:(r=(i=t.enum)==null?void 0:i.common)!=null&&r.members?t.enum.common.members.map(n=>{var a,m;return((m=(a=t.members[n])==null?void 0:a.common)==null?void 0:m.icon)||""}):[]}}async componentDidMount(){var m,p,g,h;const t=[...this.state.icons];let i=!1;const r=(p=(m=this.props.enum)==null?void 0:m.common)==null?void 0:p.members,n=this.props.cachedIcons;try{if(r){for(let u=0;u<t.length;u++)if(!t[u]){const d=I.Utils.getParentId(r[u]);if(n[d]!==void 0){n[d]&&(t[u]=n[d],i=!0);continue}if(d&&d.split(".").length>2){const l=await this.props.socket.getObject(d);if(l&&(l.type==="channel"||l.type==="device")){if((g=l.common)!=null&&g.icon)n[d]=l.common.icon,t[u]=l.common.icon,i=!0;else{const _=I.Utils.getParentId(d);if(_&&_.split(".").length>2){const D=await this.props.socket.getObject(_);D&&(D.type==="channel"||D.type==="device")&&(h=D.common)!=null&&h.icon&&(n[_]=D.common.icon,n[d]=D.common.icon,t[u]=D.common.icon,i=!0),n[_]=n[_]||null}}n[d]=n[d]||null}}}}}catch(u){window.alert(`Cannot get icons: ${u}`)}const a=".";if(r){const u=this.props.members;for(let d=0;d<t.length;d++){const l=t[d],_=r[d];if(l&&!l.startsWith("data:image/")&&l.includes(".")){let D;u[_]&&(u[_].type==="instance"||u[_].type==="adapter")?t[d]=`${a}/adapter/${this.props.getName(u[_].common.name)}/${l}`:_&&_.startsWith("system.adapter.")?(D=_.split(".",3),l[0]==="/"?D[2]+=l:D[2]+=`/${l}`,t[d]=`${a}/adapter/${D[2]}`):(D=_.split(".",2),l[0]==="/"?D[0]+=l:D[0]+=`/${l}`,t[d]=`${a}/adapter/${D[0]}`),i=!0}}}i&&this.setState({icons:t})}renderUpperButtons(t,i){const r=this.props;return s.jsxs("div",{style:y.right,children:[r.enum?s.jsx(c.IconButton,{className:"enum-block-button",size:"small",onClick:()=>r.showEnumEditDialog(r.enum,!1),children:s.jsx(c.Tooltip,{title:r.t("Edit"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:s.jsx(b.Edit,{style:{color:t}})})}):null,r.enum?s.jsx(c.IconButton,{className:"enum-block-button",size:"small",onClick:()=>r.copyEnum(r.id),children:s.jsx(c.Tooltip,{title:r.t("Clone"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:s.jsx(b.FileCopy,{style:{color:t}})})}):null,s.jsx(c.IconButton,{className:"enum-block-button",size:"small",onClick:()=>r.showEnumDeleteDialog(r.enum),disabled:i==null?void 0:i.dontDelete,children:s.jsx(c.Tooltip,{title:r.t("Delete"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:s.jsx(b.Delete,{style:i!=null&&i.dontDelete?null:{color:t}})})})]})}renderBottomButtons(t){const i=this.props;return s.jsxs("div",{style:y.bottomButtons,children:[s.jsx(c.IconButton,{className:"enum-block-button",size:"small",onClick:()=>{["functions","rooms"].includes(i.currentCategory)?i.showEnumTemplateDialog(i.id):i.showEnumEditDialog(i.getEnumTemplate(i.id),!0)},children:s.jsx(c.Tooltip,{title:i.t("Add child"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:s.jsx(b.Add,{style:{color:t}})})}),s.jsx(c.IconButton,{size:"small",onClick:()=>i.onCollapse(i.id),children:s.jsx(c.Tooltip,{title:i.collapsed?i.t("Show members"):i.t("Hide members"),placement:"top",children:i.collapsed?s.jsx(b.KeyboardArrowDown,{style:{color:t}}):s.jsx(b.KeyboardArrowUp,{style:{color:t}})})})]})}render(){var m,p,g;const t=this.props,i=(m=t.enum)==null?void 0:m.common,r=I.Utils.getInvertedColor(i==null?void 0:i.color,t.themeType,!0),n={opacity:this.props.isDragging?0:1,color:r};i!=null&&i.color&&(n.backgroundColor=i.color);let a=i!=null&&i.icon?s.jsx(I.Icon,{style:{...y.icon,...t.childrenCount?y.folderIcon:void 0,...t.childrenCount&&!t.closed?y.folderIconExpanded:void 0},src:i.icon}):s.jsx(b.List,{style:{...y.icon,...t.childrenCount?y.folderIcon:void 0,...t.childrenCount&&!t.closed?y.folderIconExpanded:void 0}});return a=t.childrenCount?s.jsx("div",{style:y.folderDiv,onClick:()=>t.toggleEnum(t.id),children:t.closed?[s.jsx(ze,{style:y.folder},1),s.jsx("div",{children:a},2)]:[s.jsx(Ae,{style:y.folder},1),s.jsx("div",{children:a},2)]}):a,this.props.iconDragRef&&(a=s.jsx("span",{ref:this.props.iconDragRef,children:a})),s.jsxs(c.Card,{style:n,sx:I.Utils.getStyle(this.props.theme,y.enumGroupCard,this.props.updating&&y.enumUpdating,!t.collapsed&&y.enumGroupCardExpanded,{".enum-block-button":{visibility:H.isTouchDevice()?"visible":"hidden"},"&:hover .enum-block-button":{visibility:"visible"}}),id:t.id,children:[s.jsxs("div",{style:y.enumCardContent,children:[this.renderUpperButtons(r,i),s.jsxs(c.CardContent,{style:y.context,children:[s.jsxs(c.Typography,{gutterBottom:!t.collapsed,component:"div",style:y.enumGroupTitle,onClick:()=>t.onCollapse(t.id),children:[a,s.jsxs("div",{style:y.enumGroupName,children:[s.jsx("span",{style:y.enumGroupEnumName,children:t.name||t.getName(i==null?void 0:i.name)||t.id.split(".").pop()}),s.jsx("span",{style:y.enumGroupEnumID,children:t.idText||t.id}),i!=null&&i.desc?s.jsx("div",{style:y.enumName,children:t.getName(i.desc)}):null]})]}),s.jsx("div",{children:!t.collapsed&&(i!=null&&i.members)?i.members.map((h,u)=>{const d=t.members[h];return d?s.jsx(ut,{getName:t.getName,member:d,t:t.t,theme:t.theme,textColor:r,icon:this.state.icons[u],parentID:t.id,removeMemberFromEnum:t.removeMemberFromEnum,moveMember:async(l,_,D)=>{var z;const C=await t.socket.getObject(_);if(!D){const P=await t.socket.getObject(t.id);if((z=P==null?void 0:P.common)!=null&&z.members){const ie=P.common.members.indexOf(l);ie!==-1&&(P.common.members.splice(ie,1),await t.socket.setObject(P._id,P).catch(J=>window.alert(`Cannot move member: ${J}`)))}}C.common||={},C.common.members||=[],C.common.members.includes(l)||(C.common.members.push(l),C.common.members.sort(),await t.socket.setObject(C._id,C).catch(P=>window.alert(`Cannot clone member: ${P}`)))}},d._id):null}):(p=i==null?void 0:i.members)!=null&&p.length?s.jsx("div",{style:{...y.membersNumber,...t.childrenCount?y.memberNumberFolder:void 0},children:(g=i==null?void 0:i.members)==null?void 0:g.length}):""})]})]}),this.renderBottomButtons(r)]})}}function pt(e,t){var n,a,m,p;const i=e.getItem(),r=i==null?void 0:i.memberId;return r?!((a=(n=t==null?void 0:t.common)==null?void 0:n.members)!=null&&a.includes(r)):i!=null&&i.data?t?!((p=(m=t.common)==null?void 0:m.members)!=null&&p.includes(i.data.id)):!1:!0}function gt(e){var g,h;const[{canDrop:t,isOver:i},r]=ke(()=>({accept:["object","enum","enum-member"],drop:()=>({enumId:e.id}),canDrop:(u,d)=>pt(d,e.enum),collect:u=>({isOver:u.isOver(),canDrop:u.canDrop()})}),[(h=(g=e.enum)==null?void 0:g.common)==null?void 0:h.members]),n=O.useRef(null),[{isDragging:a},m,p]=Ee({type:"enum",item:()=>{var u;return{enumId:e.id,preview:s.jsx("div",{style:{width:((u=n.current)==null?void 0:u.offsetWidth)||50},children:s.jsx(oe,{...e})})}},end:(u,d)=>{const l=d.getDropResult();if(l)e.moveEnum(u.enumId,l.enumId);else{const _=u.enumId.split(".");e.moveEnum(u.enumId,`${_[0]}.${_[1]}`)}},collect:u=>({isDragging:u.isDragging(),handlerId:u.getHandlerId()})});return O.useEffect(()=>{p(De(),{captureDraggingState:!0})},[p]),e.enum?H.isTouchDevice()?s.jsx("div",{ref:r,style:{opacity:t&&i?.5:1},children:s.jsx("div",{ref:n,children:s.jsx(oe,{isDragging:a,iconDragRef:m,...e})})}):s.jsx("div",{ref:r,style:{opacity:t&&i?.5:1},children:s.jsx("div",{ref:m,children:s.jsx("div",{ref:n,children:s.jsx(oe,{isDragging:a,...e})})})}):s.jsx(oe,{isDragging:a,...e})}function ht(e){const[,t]=ke(()=>({accept:["enum"],drop:()=>({enumId:e.categoryData._id}),collect:r=>({isOver:r.isOver(),canDrop:r.canDrop()})})),i=I.Utils.getInvertedColor(e.categoryData.common.color,e.themeType,!0);return s.jsxs(c.Box,{component:"span",ref:t,style:{...e.styles.categoryTitle,color:i},sx:{".enum-button":{visibility:H.isTouchDevice()?"visible":"hidden"},"&:hover .enum-button":{visibility:"visible"}},children:[e.categoryData.common.icon?s.jsx(I.Icon,{style:e.styles.icon,src:e.categoryData.common.icon}):null,typeof e.categoryData.common.name=="string"?e.categoryData.common.name:e.categoryData.common.name[e.lang]||e.categoryData.common.name.en,s.jsx(c.IconButton,{className:"enum-button",size:"small",style:{color:i},onClick:()=>{e.showEnumEditDialog(e.categoryData,!1)},children:s.jsx(c.Tooltip,{title:e.t("Edit"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:s.jsx(b.Edit,{})})}),e.categoryData.common.dontDelete?null:s.jsx(c.IconButton,{className:"enum-button",size:"small",style:{color:i},onClick:()=>e.showEnumDeleteDialog(e.categoryData),children:s.jsx(c.Tooltip,{title:e.t("Delete"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:s.jsx(b.Delete,{})})})]})}const A={contentRoot:{padding:"16px 24px"},dialogTitle:{borderBottom:"1px solid #00000020",padding:0,width:"100%"},dialogActions:{borderTop:"1px solid #00000020",width:"100%"},dialog:{},iconPreview:{height:32,width:32},colorPicker:{},formIcon:{margin:10,opacity:.6},formContainer:{display:"flex",justifyContent:"center",alignItems:"center"},formControl:{display:"flex",padding:"0 0 24px 0",flexGrow:1e3}},_e=e=>e.replace(I.Utils.FORBIDDEN_CHARS,"_").replace(/\s/g,"_").replace(/\./g,"_").replace(/,/g,"_").replace(/__/g,"_").replace(/__/g,"_").toLowerCase(),je=e=>e.split(".").pop(),_t=(e,t)=>e&&typeof e=="object"?e[t]||e.en:e||"",Pe=(e,t)=>{const i=e.split(".");return i[i.length-1]=t,i.join(".")};function vt(e){const t=e.enums.find(r=>r._id===e.enum._id);let i=!!je(e.enum._id)&&!!e.getName(e.enum.common.name);return e.isNew&&t&&i&&(i=!1),s.jsxs(c.Dialog,{fullWidth:e.innerWidth<500,open:!0,onClose:(r,n)=>{n!=="backdropClick"&&n!=="escapeKeyDown"&&e.onClose()},children:[s.jsx(c.DialogTitle,{style:{...A.dialogTitle,padding:12},children:e.t("Enum parameters")}),s.jsx(c.DialogContent,{sx:{"&.MuiDialogContent-root":A.contentRoot},children:s.jsxs(c.Grid2,{container:!0,spacing:2,style:A.dialog,children:[s.jsx(c.Grid2,{size:{xs:12,md:6},children:s.jsx(se,{label:"Name",t:e.t,value:e.getName(e.enum.common.name),onChange:r=>{const n=JSON.parse(JSON.stringify(e.enum));!e.enum.common.dontDelete&&_e(e.getName(n.common.name))===je(n._id)&&(n._id=Pe(n._id,_e(r))),n.common.name=r,e.onChange(n)},autoComplete:"off",icon:b.TextFields,styles:A})}),s.jsx(c.Grid2,{size:{xs:12,md:6},children:s.jsx(se,{label:"ID edit",t:e.t,disabled:e.enum.common.dontDelete,value:e.enum._id.split(".")[e.enum._id.split(".").length-1],onChange:r=>{const n=JSON.parse(JSON.stringify(e.enum));n._id=Pe(n._id,_e(r)),e.onChange(n)},icon:b.LocalOffer,styles:A})}),s.jsx(c.Grid2,{size:{xs:12,md:6},children:s.jsx(se,{label:"ID preview",t:e.t,disabled:!0,value:e.enum._id,icon:b.Pageview,styles:A})}),s.jsx(c.Grid2,{size:{xs:12,md:6},children:s.jsx(se,{label:"Description",t:e.t,value:_t(e.enum.common.desc,e.lang),onChange:r=>{const n=e.enum;n.common.desc=r,e.onChange(n)},icon:b.Description,styles:A})}),s.jsx(c.Grid2,{size:{xs:12,md:6},children:s.jsx(I.IconPicker,{label:"Icon",onlyDevices:e.enum._id.startsWith("enum.functions."),onlyRooms:e.enum._id.startsWith("enum.rooms."),value:e.enum.common.icon,onChange:r=>{const n=e.enum;n.common.icon=r,e.onChange(n)},previewStyle:A.iconPreview,icon:b.Image,customStyles:A})}),s.jsx(c.Grid2,{size:{xs:12,md:6},children:s.jsx(Ke,{label:"Color",value:e.enum.common.color,previewStyle:A.iconPreview,onChange:r=>{const n=e.enum;n.common.color=r,e.onChange(n)},icon:b.ColorLens,style:A.colorPicker,styles:A,t:e.t})})]})}),s.jsxs(c.DialogActions,{style:A.dialogActions,children:[s.jsx(c.Button,{variant:"contained",color:"primary",autoFocus:!0,onClick:()=>e.saveData(),disabled:!i||!e.changed,startIcon:s.jsx(b.Check,{}),children:e.t("Save")}),s.jsx(c.Button,{variant:"contained",color:"grey",onClick:e.onClose,startIcon:s.jsx(b.Close,{}),children:e.t("Cancel")})]})]})}const Le=JSON.parse(`[{"_id":"hood","name":{"en":"Hood","ru":"Вытяжка","de":"Abzugshaube","fr":"Capot","it":"Cappe","nl":"Hood","pl":"Okapy","pt":"Hood","es":"Campana","zh-cn":"抽油烟机"},"icon":"Hoods"},{"_id":"alarm_system","name":{"en":"Alarm System","ru":"Сигнализация","de":"Alarmanlage","fr":"Systèmes D'Alarme","it":"Sistemi Di Allarme","nl":"Alarm Systems","pl":"Systemy Alarmowe","pt":"Sistemas De Alarme","es":"Sistemas De Alarma","zh-cn":"报警系统"},"icon":"Alarm Systems"},{"_id":"battery_status","name":{"en":"Battery Status","ru":"Заряд батареи","de":"Batteriestatus","fr":"État De La Batterie","it":"Stato Della Batteria","nl":"Batterij Status","pl":"Stan Baterii","pt":"Estado Da Bateria","es":"Estado De La Batería","zh-cn":"电池状态"},"icon":"Battery Status"},{"_id":"lighting","name":{"en":"Lighting","ru":"Светильник","de":"Beleuchtung","fr":"Éclairages","it":"Illuminazione","nl":"Verlichting","pl":"Oprawy Oświetleniowe","pt":"Iluminações","es":"Iluminaciones","zh-cn":"照明"},"icon":"Lightings"},{"_id":"shading","name":{"en":"Shading","ru":"Затенение","de":"Beschattungen","fr":"Ombres","it":"Ombreggiatura","nl":"Shading","pl":"Zacienienie","pt":"Shading","es":"Sombreado","zh-cn":"底纹"},"icon":"Shading"},{"_id":"irrigation","name":{"en":"Irrigation","ru":"Орошение","de":"Bewässerung","fr":"Irrigation","it":"Irrigazione","nl":"Irrigatie","pl":"Nawadnianie","pt":"Irrigação","es":"Irrigación","zh-cn":"灌溉"},"icon":"Irrigation"},{"_id":"iron","name":{"en":"Iron","ru":"Утюг","de":"Bügeleisen","fr":"Le Fer","it":"Ferro","nl":"Ijzer","pl":"Żelazo","pt":"Ferro","es":"Hierro","zh-cn":"铁"},"icon":"Iron"},{"_id":"computer","name":{"en":"Computer","ru":"Компьютер","de":"Rechner","fr":"L'Ordinateur","it":"Computer","nl":"Computer","pl":"Komputer","pt":"Computador","es":"Ordenador","zh-cn":"电脑"},"icon":"Computer"},{"_id":"ceiling_spotlight","name":{"en":"Ceiling Spotlight","ru":"Потолочный прожектор","de":"Deckenspot","fr":"Plafond Spotlight","it":"Faretti A Soffitto","nl":"Plafond Spotlight","pl":"Reflektory Sufitowe","pt":"Tecto Foco","es":"Focos De Techo","zh-cn":"天花射灯"},"icon":"Ceiling Spotlights"},{"_id":"printer","name":{"en":"Printer","de":"Drucker","ru":"Принтер","pt":"Impressora","nl":"Printer","fr":"Imprimante","it":"Stampante","es":"Impresora","pl":"Drukarka","zh-cn":"打印机"},"icon":"Printer"},{"_id":"power_consumption","name":{"en":"Power Consumption","ru":"Потребляемая мощность","de":"Stromverbrauch","fr":"Consommation D'Énergie","it":"Consumo Di Energia","nl":"Energieverbruik","pl":"Pobór Energii","pt":"Consumo De Energia","es":"El Consumo De Energía","zh-cn":"能量消耗"},"icon":"Power Consumption"},{"_id":"window","name":{"en":"Window","ru":"Окно","de":"Fenster","fr":"La Fenêtre","it":"Finestra","nl":"Venster","pl":"Okno","pt":"Janela","es":"Ventana","zh-cn":"窗户"},"icon":"Window"},{"_id":"garage_door","name":{"en":"Garage Door","ru":"Гаражные Ворота","de":"Garagentor","fr":"Portes De Garage","it":"Garage Door","nl":"Garage Door","pl":"Bramy Garażowe","pt":"Portas De Garagem","es":"Las Puertas De Garaje","zh-cn":"车库门"},"icon":"Garage Doors"},{"_id":"hairdryer","name":{"en":"Hairdryer","ru":"Фен","de":"Haartrockner","fr":"Sèche-Cheveux","it":"Asciugacapelli","nl":"Haardroger","pl":"Suszarka Do Włosów","pt":"Secador De Cabelo","es":"Secador De Pelo","zh-cn":"电吹风"},"icon":"Hairdryer"},{"_id":"hanging_lamp","name":{"en":"Hanging Lamp","ru":"Подвесной светильник","de":"Hängelampe","fr":"Lampes Suspendues","it":"Lampade A Sospensione","nl":"Opknoping Lampen","pl":"Lampy Wiszące","pt":"Lâmpadas De Suspensão","es":"Lámparas Colgantes","zh-cn":"挂灯"},"icon":"Hanging Lamps"},{"_id":"doorstep","name":{"en":"Enterance","ru":"Входная дверь","de":"Haustür","fr":"Seuil De Porte","it":"Gradino Della Porta","nl":"Drempel","pl":"Próg","pt":"Porta","es":"Peldaño","zh-cn":"门阶"},"icon":"Doorstep"},{"_id":"hot_water","name":{"en":"Hot Water","ru":"Горячая вода","de":"Heißwasser","fr":"Eau Chaude","it":"Acqua Calda","nl":"Heet Water","pl":"Gorąca Woda","pt":"Água Quente","es":"Agua Caliente","zh-cn":"热水"},"icon":"Hot Water"},{"_id":"heating","name":{"en":"Heating","ru":"Отопление","de":"Heizung","fr":"Chauffe-Eau","it":"Riscaldatore","nl":"Verwarmer","pl":"Podgrzewacz","pt":"Aquecedor","es":"Calentador","zh-cn":"加热器"},"icon":"Heater"},{"_id":"stove","name":{"en":"Stove","ru":"Печь","de":"Herd","fr":"Le Fourneau","it":"Stufa","nl":"Fornuis","pl":"Kuchenka","pt":"Forno","es":"Cocina","zh-cn":"火炉"},"icon":"Stove"},{"_id":"louvre","name":{"en":"Louvres","ru":"Жалюзи","de":"Jalousie","fr":"Persienne","it":"Persiana Di Ventilazione","nl":"Louvre","pl":"Żaluzja","pt":"Trapeira","es":"Lumbrera","zh-cn":"卢浮宫"},"icon":"Louvre"},{"_id":"coffee_maker","name":{"en":"Coffee Maker","ru":"Кофеварка","de":"Kaffeemaschine","fr":"Cafetière","it":"Macchine Da Caffè","nl":"Koffie Maker","pl":"Ekspresy Do Kawy","pt":"Cafeteira","es":"Cafetera","zh-cn":"咖啡壶"},"icon":"Coffee Makers"},{"_id":"cold_water","name":{"en":"Cold Water","ru":"Холодная вода","de":"Kaltwasser","fr":"Eau Froide","it":"Acqua Fredda","nl":"Koud Water","pl":"Zimna Woda","pt":"Água Fria","es":"Agua Fría","zh-cn":"冷水"},"icon":"Cold Water"},{"_id":"climate","name":{"en":"Climate","ru":"Климат","de":"Klima","fr":"Climat","it":"Clima","nl":"Klimaat","pl":"Klimat","pt":"Clima","es":"Clima","zh-cn":"气候"},"icon":"Climate"},{"_id":"speaker","name":{"en":"Speaker","ru":"Звуковая система","de":"Lautsprecher","fr":"Orateur","it":"Altoparlante","nl":"Spreker","pl":"Głośnik","pt":"Palestrante","es":"Altavoz","zh-cn":"扬声器"},"icon":"Speaker"},{"_id":"led_strip","name":{"en":"Led Strip","ru":"Светодиодная лента","de":"LED Leiste","fr":"Led Strip","it":"Led Strip","nl":"Loden Strip","pl":"Pasek Ledowy","pt":"Led Faixa","es":"Tira Llevada","zh-cn":"灯带"},"icon":"Led Strip"},{"_id":"light","name":{"en":"Light","ru":"Свет","de":"Licht","fr":"Lumière","it":"Leggero","nl":"Licht","pl":"Lekki","pt":"Luz","es":"Luz","zh-cn":"光"},"icon":"Light"},{"_id":"fan","name":{"en":"Fan","ru":"Вентилятор","de":"Lüfter","fr":"Ventilateur","it":"Fan","nl":"Ventilator","pl":"Wentylator","pt":"Ventilador","es":"Ventilador","zh-cn":"扇子"},"icon":"Fan"},{"_id":"humidity","name":{"en":"Humidity","ru":"Влажность","de":"Luftfeuchtigkeit","fr":"Humidité","it":"Umidità","nl":"Vochtigheid","pl":"Wilgotność","pt":"Umidade","es":"Humedad","zh-cn":"湿度"},"icon":"Humidity"},{"_id":"ventilation","name":{"en":"Ventilation","ru":"Вентиляция","de":"Lüftung","fr":"Ventilation","it":"Ventilazione","nl":"Ventilatie","pl":"Wentylacja","pt":"Ventilação","es":"Ventilación","zh-cn":"通风"},"icon":"Ventilation"},{"_id":"chandelier","name":{"en":"Chandelier","ru":"Люстра","de":"Kronleuchter","fr":"Lustre","it":"Lampadario","nl":"Kroonluchter","pl":"Żyrandol","pt":"Lustre","es":"Candelabro","zh-cn":"枝形吊灯"},"icon":"Chandelier"},{"_id":"awning","name":{"en":"Awning","ru":"Маркиза","de":"Markise","fr":"Auvents","it":"Tende","nl":"Luifels","pl":"Okrycia","pt":"Toldos","es":"Toldos","zh-cn":"遮阳篷"},"icon":"Awnings"},{"_id":"music","name":{"en":"Music","ru":"Музыка","de":"Musik","fr":"Musique","it":"Musica","nl":"Muziek","pl":"Muzyka","pt":"Música","es":"Música","zh-cn":"音乐"},"icon":"Music"},{"_id":"people","name":{"en":"People","ru":"Люди","de":"Personen","fr":"Gens","it":"Persone","nl":"Mensen","pl":"Ludzie","pt":"Pessoas","es":"Personas","zh-cn":"人们"},"icon":"People"},{"_id":"pool","name":{"en":"Pool","ru":"Бассейн","de":"Pool","fr":"Piscine","it":"Piscina","nl":"Zwembad","pl":"Basen","pt":"Piscina","es":"Piscina","zh-cn":"水池"},"icon":"Pool"},{"_id":"pump","name":{"en":"Pump","ru":"Насос","de":"Pumpe","fr":"Pompe","it":"Pompa","nl":"Pomp","pl":"Pompa","pt":"Bombear","es":"Bomba","zh-cn":"泵"},"icon":"Pump"},{"_id":"outdoor_blinds","name":{"en":"Outdoor Blinds","ru":"Внещгте жалюзи","de":"Raffstore","fr":"Volets","it":"Tende Da Esterni","nl":"Outdoor Blinds","pl":"Rolety Zewnętrzne","pt":"Estores Exteriores","es":"Persianas Exteriores","zh-cn":"室外百叶窗"},"icon":"Outdoor Blinds"},{"_id":"mowing_machine","name":{"en":"Mowing Machine","ru":"Газонокосилка","de":"Rasenmäher","fr":"Machine De Fauchage","it":"Macchina Di Falciatura","nl":"Maaimachine","pl":"Kosiarka","pt":"Roçada Máquina","es":"Segadora","zh-cn":"割草机"},"icon":"Mowing Machine"},{"_id":"receiver","name":{"en":"Receiver","ru":"Приставка","de":"Receiver","fr":"Destinataire","it":"Ricevitore","nl":"Ontvanger","pl":"Odbiorca","pt":"Recebedor","es":"Receptor","zh-cn":"接收者"},"icon":"Receiver"},{"_id":"shutters","name":{"en":"Shutters","ru":"Ставни","de":"Rollladen","fr":"Volets","it":"Persiane","nl":"Shutters","pl":"Żaluzje","pt":"Persianas","es":"Persianas","zh-cn":"百叶窗"},"icon":"Shutters"},{"_id":"smoke_detector","name":{"en":"Smoke detector","de":"Rauchmelder","ru":"Детектор дыма","pt":"Detector de fumaça","nl":"Rookdetector","fr":"Détecteur de fumée","it":"Rilevatore di fumo","es":"Detector de humo","pl":"Wykrywacz dymu","zh-cn":"烟雾探测器"},"icon":"SmokeDetector"},{"_id":"lock","name":{"en":"Lock","ru":"Замок","de":"Schloß","fr":"Fermer À Clé","it":"Serratura","nl":"Slot","pl":"Zamek","pt":"Trancar","es":"Cerrar Con Llave","zh-cn":"锁"},"icon":"Lock"},{"_id":"security","name":{"en":"Security","ru":"Безопасность","de":"Sicherheit","fr":"Sécurité","it":"Sicurezza","nl":"Veiligheid","pl":"Bezpieczeństwo","pt":"Segurança","es":"Seguridad","zh-cn":"安全"},"icon":"Security"},{"_id":"dishwasher","name":{"en":"Dishwasher","ru":"Посудомоечная машина","de":"Spülmaschine","fr":"Lave-Vaisselles","it":"Lavastoviglie","nl":"Vaatwassers","pl":"Zmywarki","pt":"Máquinas De Lavar Louça","es":"Lavaplatos","zh-cn":"洗碗机"},"icon":"Dishwashers"},{"_id":"vacuum_cleaner","name":{"en":"Vacuum Cleaner","ru":"Пылесос","de":"Staubsauger","fr":"Aspirateur","it":"Aspirapolvere","nl":"Stofzuiger","pl":"Odkurzacz","pt":"Aspirador De Pó","es":"Aspiradora","zh-cn":"吸尘器"},"icon":"Vacuum Cleaner"},{"_id":"socket","name":{"en":"Socket","ru":"Розетка","de":"Steckdose","fr":"Prise","it":"Socket","nl":"Socket","pl":"Gniazdka","pt":"Tomada","es":"Zócalo","zh-cn":"套接字"},"icon":"Sockets"},{"_id":"floor_lamp","name":{"en":"Floor Lamp","ru":"Торшер","de":"Stehlampe","fr":"Lampes Pour Plancher","it":"Lampade A Stelo","nl":"Vloerlampen","pl":"Lampy Podłogowe","pt":"Lâmpadas Chão","es":"Lámparas De Pie","zh-cn":"落地灯"},"icon":"Floor Lamps"},{"_id":"power_consumption","name":{"en":"Power Consumption","ru":"Потребляемая мощность","de":"Stromverbrauch","fr":"Consommation D'Énergie","it":"Consumo Di Energia","nl":"Energieverbruik","pl":"Pobór Energii","pt":"Consumo De Energia","es":"El Consumo De Energía","zh-cn":"能量消耗"},"icon":"Power Consumption"},{"_id":"temperature_sensor","name":{"en":"Temperature Sensor","ru":"Температурный датчик","de":"Temperatur-Sensor","fr":"Capteur De Température","it":"Sensori Di Temperatura","nl":"Temperatuursensor","pl":"Czujniki Temperatury","pt":"Sensores De Temperatura","es":"Sensores De Temperatura","zh-cn":"温度传感器"},"icon":"Temperature Sensors"},{"_id":"table_lamp","name":{"en":"Table Lamp","ru":"Настольная лампа","de":"Tischlampe","fr":"Lampe De Chevet","it":"Lampade Da Tavolo","nl":"Tafellampen","pl":"Lampy Stołowe","pt":"Lâmpadas De Mesa","es":"Lámparas De Mesa","zh-cn":"台灯"},"icon":"Table Lamps"},{"_id":"gate","name":{"en":"Gate","ru":"Ворота","de":"Tor","fr":"Porte","it":"Gate","nl":"Gate","pl":"Bramy","pt":"Portões","es":"Puertas","zh-cn":"盖茨"},"icon":"Gates"},{"_id":"dryer","name":{"en":"Dryer","ru":"Сушилка","de":"Trockner","fr":"Séchoir","it":"Asciugatrice","nl":"Droger","pl":"Suszarka","pt":"Secador","es":"Secadora","zh-cn":"烘干机"},"icon":"Dryer"},{"_id":"door","name":{"en":"Door","ru":"Дверь","de":"Tür","fr":"Des Portes","it":"Porte","nl":"Deuren","pl":"Drzwi","pt":"Portas","es":"Puertas","zh-cn":"门"},"icon":"Doors"},{"_id":"tv","name":{"en":"Tv","ru":"Телевизор","de":"TV","fr":"La Télé","it":"Tv","nl":"Tv","pl":"Telewizja","pt":"Televisão","es":"Televisor","zh-cn":"电视"},"icon":"Tv"},{"_id":"consumption","name":{"en":"Consumption","ru":"Потребление","de":"Verbrauch","fr":"Consommation","it":"Consumo","nl":"Consumptie","pl":"Konsumpcja","pt":"Consumo","es":"Consumo","zh-cn":"消费"},"icon":"Consumption"},{"_id":"amplifier","name":{"en":"Amplifier","ru":"Усилитель звука","de":"Verstärker","fr":"Amplificateur","it":"Amplificatore","nl":"Versterker","pl":"Wzmacniacz","pt":"Amplificador","es":"Amplificador","zh-cn":"放大器"},"icon":"Amplifier"},{"_id":"curtains","name":{"en":"Curtains","ru":"Шторы","de":"Vorhänge","fr":"Des Rideaux","it":"Le Tende","nl":"Gordijnen","pl":"Zasłony","pt":"Cortinas","es":"Cortinas","zh-cn":"窗帘"},"icon":"Curtains"},{"_id":"sconce","name":{"en":"Sconce","ru":"Настенный светильник","de":"Wandlampe","fr":"Sconce","it":"Sconce","nl":"Sconce","pl":"Kinkiety","pt":"Arandelas","es":"Los Apliques","zh-cn":"壁灯"},"icon":"Sconces"},{"_id":"washing_machine","name":{"en":"Washing Machine","ru":"Стиральная машина","de":"Waschmaschine","fr":"Machines À Laver","it":"Lavatrici","nl":"Wasmachines","pl":"Pralki","pt":"Máquinas De Lavar Roupas","es":"Lavadoras","zh-cn":"洗衣机"},"icon":"Washing Machines"},{"_id":"water","name":{"en":"Water","ru":"Вода","de":"Wasser","fr":"L'Eau","it":"Acqua","nl":"Water","pl":"Woda","pt":"Água","es":"Agua","zh-cn":"水"},"icon":"Water"},{"_id":"water_heater","name":{"en":"Water Heater","ru":"Нагреватель воды","de":"Wasserkocher","fr":"Chauffe-Eau","it":"Scaldabagno","nl":"Waterkoker","pl":"Podgrzewacz Wody","pt":"Aquecedor De Água","es":"Calentador De Agua","zh-cn":"热水器"},"icon":"Water Heater"},{"_id":"water_consumption","name":{"en":"Water Consumption","ru":"Потребление воды","de":"Wasserverbrauch","fr":"Consommation D'Eau","it":"Consumo D'Acqua","nl":"Waterverbruik","pl":"Konsumpcja Wody","pt":"Consumo De Água","es":"Consumo De Agua","zh-cn":"耗水量"},"icon":"Water Consumption"},{"_id":"weather","name":{"en":"Weather","ru":"Погода","de":"Wetter","fr":"La Météo","it":"Tempo Metereologico","nl":"Weer","pl":"Pogoda","pt":"Clima","es":"Tiempo","zh-cn":"天气"},"icon":"Weather"}]`),M={icon:{width:32,height:32},customGroupButton:{},enumTemplateButton:{justifyContent:"end",margin:4,padding:"4px 8px"},enumTemplateLabel:{textAlign:"right",opacity:.4,overflow:"hidden",textOverflow:"ellipsis",flexGrow:1},fullHeight:{height:"calc(100% - 32px)",maxHeight:900},filter:{marginLeft:16,marginTop:0,marginBottom:0},content:{display:"grid",width:"100%",gridTemplateColumns:"repeat(4,1fr)"}};class ft extends O.Component{constructor(t){super(t),this.state={icons:[],loading:!0,filter:""}}componentDidMount(){this.setState({loading:!0},()=>{const t=this.props.prefix.startsWith("enum.functions")?Le:Se,i=[],r=t.map(async(n,a)=>{try{const p=await Ge(Object.assign({"../../assets/building-types/Apartment Building.svg":()=>o(()=>import("./Apartment Building-HW0f75vl.js"),[],import.meta.url),"../../assets/building-types/Flat.svg":()=>o(()=>import("./Flat-DIm-i9rK.js"),[],import.meta.url),"../../assets/devices/Alarm Systems.svg":()=>o(()=>import("./Alarm Systems-gR7dS0A2.js"),[],import.meta.url),"../../assets/devices/Amplifier.svg":()=>o(()=>import("./Amplifier-25Guwmsj.js"),[],import.meta.url),"../../assets/devices/Awnings.svg":()=>o(()=>import("./Awnings-Co-hmfUH.js"),[],import.meta.url),"../../assets/devices/Battery Status.svg":()=>o(()=>import("./Battery Status-B87Kvv-I.js"),[],import.meta.url),"../../assets/devices/Ceiling Spotlights.svg":()=>o(()=>import("./Ceiling Spotlights-DtqldpdR.js"),[],import.meta.url),"../../assets/devices/Chandelier.svg":()=>o(()=>import("./Chandelier-Cd8E2Wtu.js"),[],import.meta.url),"../../assets/devices/Climate.svg":()=>o(()=>import("./Climate-D413u9id.js"),[],import.meta.url),"../../assets/devices/Coffee Makers.svg":()=>o(()=>import("./Coffee Makers-KF4ZcNxS.js"),[],import.meta.url),"../../assets/devices/Cold Water.svg":()=>o(()=>import("./Cold Water-CkeFWerW.js"),[],import.meta.url),"../../assets/devices/Computer.svg":()=>o(()=>import("./Computer-BTE1qsMK.js"),[],import.meta.url),"../../assets/devices/Consumption.svg":()=>o(()=>import("./Consumption-kn0jqZNL.js"),[],import.meta.url),"../../assets/devices/Curtains.svg":()=>o(()=>import("./Curtains-CHoQr379.js"),[],import.meta.url),"../../assets/devices/Dishwashers.svg":()=>o(()=>import("./Dishwashers-B-Sw8Agt.js"),[],import.meta.url),"../../assets/devices/Doors.svg":()=>o(()=>import("./Doors-CGplwj0G.js"),[],import.meta.url),"../../assets/devices/Doorstep.svg":()=>o(()=>import("./Doorstep-CDxK6WGU.js"),[],import.meta.url),"../../assets/devices/Dryer.svg":()=>o(()=>import("./Dryer-Cq6roMKB.js"),[],import.meta.url),"../../assets/devices/Fan.svg":()=>o(()=>import("./Fan-JaXmdymA.js"),[],import.meta.url),"../../assets/devices/Floor Lamps.svg":()=>o(()=>import("./Floor Lamps-CRZ476zt.js"),[],import.meta.url),"../../assets/devices/Garage Doors.svg":()=>o(()=>import("./Garage Doors-CkWxHxVX.js"),[],import.meta.url),"../../assets/devices/Gates.svg":()=>o(()=>import("./Gates-C78n8Uvq.js"),[],import.meta.url),"../../assets/devices/Hairdryer.svg":()=>o(()=>import("./Hairdryer-CWFjS2Ij.js"),[],import.meta.url),"../../assets/devices/Handle.svg":()=>o(()=>import("./Handle-wHYWJ26z.js"),[],import.meta.url),"../../assets/devices/Hanging Lamps.svg":()=>o(()=>import("./Hanging Lamps-MotocLIk.js"),[],import.meta.url),"../../assets/devices/Heater.svg":()=>o(()=>import("./Heater-ceSMUh-t.js"),[],import.meta.url),"../../assets/devices/Hoods.svg":()=>o(()=>import("./Hoods-Bz4IVHgt.js"),[],import.meta.url),"../../assets/devices/Hot Water.svg":()=>o(()=>import("./Hot Water-HJAmxfSV.js"),[],import.meta.url),"../../assets/devices/Humidity.svg":()=>o(()=>import("./Humidity-CVLTW-gm.js"),[],import.meta.url),"../../assets/devices/Iron.svg":()=>o(()=>import("./Iron-BmVcdQDM.js"),[],import.meta.url),"../../assets/devices/Irrigation.svg":()=>o(()=>import("./Irrigation-BhJPKg6k.js"),[],import.meta.url),"../../assets/devices/Led Strip.svg":()=>o(()=>import("./Led Strip-BcmH_zbj.js"),[],import.meta.url),"../../assets/devices/Light.svg":()=>o(()=>import("./Light-ChIiCfYD.js"),[],import.meta.url),"../../assets/devices/Lightings.svg":()=>o(()=>import("./Lightings-C0WZ69yF.js"),[],import.meta.url),"../../assets/devices/Lock.svg":()=>o(()=>import("./Lock-BMJY64TO.js"),[],import.meta.url),"../../assets/devices/Louvre.svg":()=>o(()=>import("./Louvre-C5YcNLVm.js"),[],import.meta.url),"../../assets/devices/Mowing Machine.svg":()=>o(()=>import("./Mowing Machine-8EOTsqgg.js"),[],import.meta.url),"../../assets/devices/Music.svg":()=>o(()=>import("./Music-GTFyD3_A.js"),[],import.meta.url),"../../assets/devices/Outdoor Blinds.svg":()=>o(()=>import("./Outdoor Blinds-CXkkQc7j.js"),[],import.meta.url),"../../assets/devices/People.svg":()=>o(()=>import("./People-D60rnvXq.js"),[],import.meta.url),"../../assets/devices/Pool.svg":()=>o(()=>import("./Pool-DLG0SZJN.js"),[],import.meta.url),"../../assets/devices/Power Consumption.svg":()=>o(()=>import("./Power Consumption-CKf-DuPt.js"),[],import.meta.url),"../../assets/devices/Printer.svg":()=>o(()=>import("./Printer-BBdg5KQ0.js"),[],import.meta.url),"../../assets/devices/Pump.svg":()=>o(()=>import("./Pump-qElQ0u4I.js"),[],import.meta.url),"../../assets/devices/Receiver.svg":()=>o(()=>import("./Receiver-CM3as5YE.js"),[],import.meta.url),"../../assets/devices/Sconces.svg":()=>o(()=>import("./Sconces-C-gkKtaK.js"),[],import.meta.url),"../../assets/devices/Security.svg":()=>o(()=>import("./Security-BD-3hOtV.js"),[],import.meta.url),"../../assets/devices/Shading.svg":()=>o(()=>import("./Shading-BYTX3uGs.js"),[],import.meta.url),"../../assets/devices/Shutters.svg":()=>o(()=>import("./Shutters-C0RWQwOf.js"),[],import.meta.url),"../../assets/devices/SmokeDetector.svg":()=>o(()=>import("./SmokeDetector-BI7HtY1L.js"),[],import.meta.url),"../../assets/devices/Sockets.svg":()=>o(()=>import("./Sockets-DGwEYIEX.js"),[],import.meta.url),"../../assets/devices/Speaker.svg":()=>o(()=>import("./Speaker-DYDUjQxp.js"),[],import.meta.url),"../../assets/devices/Stove.svg":()=>o(()=>import("./Stove-C_JAiJBF.js"),[],import.meta.url),"../../assets/devices/Table Lamps.svg":()=>o(()=>import("./Table Lamps-G4idrhKm.js"),[],import.meta.url),"../../assets/devices/Temperature Sensors.svg":()=>o(()=>import("./Temperature Sensors-BzDeIhhc.js"),[],import.meta.url),"../../assets/devices/Tv.svg":()=>o(()=>import("./Tv-GicrNRwV.js"),[],import.meta.url),"../../assets/devices/Vacuum Cleaner.svg":()=>o(()=>import("./Vacuum Cleaner-BazNfd2m.js"),[],import.meta.url),"../../assets/devices/Ventilation.svg":()=>o(()=>import("./Ventilation-D7F0rbZK.js"),[],import.meta.url),"../../assets/devices/Washing Machines.svg":()=>o(()=>import("./Washing Machines-DyIMTxKc.js"),[],import.meta.url),"../../assets/devices/Water Consumption.svg":()=>o(()=>import("./Water Consumption-C0sLvwRF.js"),[],import.meta.url),"../../assets/devices/Water Heater.svg":()=>o(()=>import("./Water Heater-Byq4Q86V.js"),[],import.meta.url),"../../assets/devices/Water.svg":()=>o(()=>import("./Water-Dcu-ZixL.js"),[],import.meta.url),"../../assets/devices/Weather.svg":()=>o(()=>import("./Weather-pQkhBG6o.js"),[],import.meta.url),"../../assets/devices/Window.svg":()=>o(()=>import("./Window-B0emTnKi.js"),[],import.meta.url),"../../assets/groups/group1.svg":()=>o(()=>import("./group1-DBYxcyxq.js"),[],import.meta.url),"../../assets/groups/group10.svg":()=>o(()=>import("./group10-BIcZMfE3.js"),[],import.meta.url),"../../assets/groups/group2.svg":()=>o(()=>import("./group2-BUQSell7.js"),[],import.meta.url),"../../assets/groups/group3.svg":()=>o(()=>import("./group3-B0AdMrOp.js"),[],import.meta.url),"../../assets/groups/group4.svg":()=>o(()=>import("./group4-TeCgDok7.js"),[],import.meta.url),"../../assets/groups/group5.svg":()=>o(()=>import("./group5-CJ_-VPxg.js"),[],import.meta.url),"../../assets/groups/group6.svg":()=>o(()=>import("./group6-JW-nEhw_.js"),[],import.meta.url),"../../assets/groups/group7.svg":()=>o(()=>import("./group7-CWpVuR4T.js"),[],import.meta.url),"../../assets/groups/group8.svg":()=>o(()=>import("./group8-CRGBxCwd.js"),[],import.meta.url),"../../assets/groups/group9.svg":()=>o(()=>import("./group9-BXRQchYG.js"),[],import.meta.url),"../../assets/rooms/Anteroom.svg":()=>o(()=>import("./Anteroom-DPbAOJ_i.js"),[],import.meta.url),"../../assets/rooms/Attic.svg":()=>o(()=>import("./Attic-CGXtMIdp.js"),[],import.meta.url),"../../assets/rooms/Balcony.svg":()=>o(()=>import("./Balcony-DfK6N3aX.js"),[],import.meta.url),"../../assets/rooms/Barn.svg":()=>o(()=>import("./Barn-Lc8i72_q.js"),[],import.meta.url),"../../assets/rooms/Basement.svg":()=>o(()=>import("./Basement-DPN5xOB9.js"),[],import.meta.url),"../../assets/rooms/Bathroom.svg":()=>o(()=>import("./Bathroom-DzUiTIHs.js"),[],import.meta.url),"../../assets/rooms/Bedroom.svg":()=>o(()=>import("./Bedroom-xMBCTCFq.js"),[],import.meta.url),"../../assets/rooms/Boiler Room.svg":()=>o(()=>import("./Boiler Room-Bor2zD5L.js"),[],import.meta.url),"../../assets/rooms/Carport.svg":()=>o(()=>import("./Carport-C8HtrUXH.js"),[],import.meta.url),"../../assets/rooms/Cellar.svg":()=>o(()=>import("./Cellar-DRGc9D6m.js"),[],import.meta.url),"../../assets/rooms/Chamber.svg":()=>o(()=>import("./Chamber-D3f_uF0H.js"),[],import.meta.url),"../../assets/rooms/Corridor.svg":()=>o(()=>import("./Corridor-CasyPy4F.js"),[],import.meta.url),"../../assets/rooms/Dining Area.svg":()=>o(()=>import("./Dining Area-9890E2Je.js"),[],import.meta.url),"../../assets/rooms/Dining Room.svg":()=>o(()=>import("./Dining Room-9890E2Je.js"),[],import.meta.url),"../../assets/rooms/Dining.svg":()=>o(()=>import("./Dining-9890E2Je.js"),[],import.meta.url),"../../assets/rooms/Dressing Room.svg":()=>o(()=>import("./Dressing Room-Dr_mWZjM.js"),[],import.meta.url),"../../assets/rooms/Driveway.svg":()=>o(()=>import("./Driveway-BehcXrKD.js"),[],import.meta.url),"../../assets/rooms/Entrance.svg":()=>o(()=>import("./Entrance-BYqUyt1q.js"),[],import.meta.url),"../../assets/rooms/Equipment Room.svg":()=>o(()=>import("./Equipment Room-B5AsGJCs.js"),[],import.meta.url),"../../assets/rooms/Front Yard.svg":()=>o(()=>import("./Front Yard-CsV9sTio.js"),[],import.meta.url),"../../assets/rooms/Gallery.svg":()=>o(()=>import("./Gallery-Cz16BrQ3.js"),[],import.meta.url),"../../assets/rooms/Garage.svg":()=>o(()=>import("./Garage-BxcK0Mpu.js"),[],import.meta.url),"../../assets/rooms/Garden.svg":()=>o(()=>import("./Garden-C67u1ESp.js"),[],import.meta.url),"../../assets/rooms/Ground Floor.svg":()=>o(()=>import("./Ground Floor-0zPWVd6I.js"),[],import.meta.url),"../../assets/rooms/Guest Bathroom.svg":()=>o(()=>import("./Guest Bathroom-DSAlkwqV.js"),[],import.meta.url),"../../assets/rooms/Guest Room.svg":()=>o(()=>import("./Guest Room-DijMrEih.js"),[],import.meta.url),"../../assets/rooms/Gym.svg":()=>o(()=>import("./Gym-D5EhuzLI.js"),[],import.meta.url),"../../assets/rooms/Hall.svg":()=>o(()=>import("./Hall-BXwSgCh7.js"),[],import.meta.url),"../../assets/rooms/Home Theater.svg":()=>o(()=>import("./Home Theater-BcYqHMU1.js"),[],import.meta.url),"../../assets/rooms/Kitchen.svg":()=>o(()=>import("./Kitchen-CfzTeEPK.js"),[],import.meta.url),"../../assets/rooms/Laundry Room.svg":()=>o(()=>import("./Laundry Room-zhlszIKu.js"),[],import.meta.url),"../../assets/rooms/Living Area.svg":()=>o(()=>import("./Living Area-CqhYSGQI.js"),[],import.meta.url),"../../assets/rooms/Living Room.svg":()=>o(()=>import("./Living Room-C7AE21A_.js"),[],import.meta.url),"../../assets/rooms/Locker Room.svg":()=>o(()=>import("./Locker Room-CyyDtimo.js"),[],import.meta.url),"../../assets/rooms/Nursery.svg":()=>o(()=>import("./Nursery-Cxrv-xmv.js"),[],import.meta.url),"../../assets/rooms/Office.svg":()=>o(()=>import("./Office-CIXVNXkh.js"),[],import.meta.url),"../../assets/rooms/Outdoors.svg":()=>o(()=>import("./Outdoors-BL5-A5jB.js"),[],import.meta.url),"../../assets/rooms/Playroom.svg":()=>o(()=>import("./Playroom-Cq-XMXTL.js"),[],import.meta.url),"../../assets/rooms/Pool.svg":()=>o(()=>import("./Pool-DA49roJI.js"),[],import.meta.url),"../../assets/rooms/Rear Wall.svg":()=>o(()=>import("./Rear Wall-BNvjPc7z.js"),[],import.meta.url),"../../assets/rooms/Second Floor.svg":()=>o(()=>import("./Second Floor-V-mYDL2A.js"),[],import.meta.url),"../../assets/rooms/Shed.svg":()=>o(()=>import("./Shed-liUNwlvT.js"),[],import.meta.url),"../../assets/rooms/Sleeping Area.svg":()=>o(()=>import("./Sleeping Area-41NoHRj5.js"),[],import.meta.url),"../../assets/rooms/Stairway.svg":()=>o(()=>import("./Stairway-DlYPygtf.js"),[],import.meta.url),"../../assets/rooms/Stairwell.svg":()=>o(()=>import("./Stairwell-DbZPzEAa.js"),[],import.meta.url),"../../assets/rooms/Storeroom.svg":()=>o(()=>import("./Storeroom-DVXZ_Y0f.js"),[],import.meta.url),"../../assets/rooms/Summer House.svg":()=>o(()=>import("./Summer House-l_7dnk-K.js"),[],import.meta.url),"../../assets/rooms/Swimming Pool.svg":()=>o(()=>import("./Swimming Pool-CQBR5mIg.js"),[],import.meta.url),"../../assets/rooms/Terrace.svg":()=>o(()=>import("./Terrace-YmL9ugkA.js"),[],import.meta.url),"../../assets/rooms/Toilet.svg":()=>o(()=>import("./Toilet-BKoDvjLo.js"),[],import.meta.url),"../../assets/rooms/Upstairs.svg":()=>o(()=>import("./Upstairs-W8fYn1Q6.js"),[],import.meta.url),"../../assets/rooms/Wardrobe.svg":()=>o(()=>import("./Wardrobe-Bns8F0nU.js"),[],import.meta.url),"../../assets/rooms/Washroom.svg":()=>o(()=>import("./Washroom-BqiNyqrk.js"),[],import.meta.url),"../../assets/rooms/Wc.svg":()=>o(()=>import("./Wc-BKoDvjLo.js"),[],import.meta.url),"../../assets/rooms/Windscreen.svg":()=>o(()=>import("./Windscreen-x8wYPJWL.js"),[],import.meta.url),"../../assets/rooms/Workshop.svg":()=>o(()=>import("./Workshop-CKHcsro_.js"),[],import.meta.url),"../../assets/rooms/Workspace.svg":()=>o(()=>import("./Workspace-DS72Rvmo.js"),[],import.meta.url),"../../assets/users/user1.svg":()=>o(()=>import("./user1-BHHH0LIq.js"),[],import.meta.url),"../../assets/users/user10.svg":()=>o(()=>import("./user10-Dvmqf8l1.js"),[],import.meta.url),"../../assets/users/user11.svg":()=>o(()=>import("./user11-C8ly5pY7.js"),[],import.meta.url),"../../assets/users/user12.svg":()=>o(()=>import("./user12-CHtaF3qG.js"),[],import.meta.url),"../../assets/users/user2.svg":()=>o(()=>import("./user2-BN56rMPt.js"),[],import.meta.url),"../../assets/users/user3.svg":()=>o(()=>import("./user3-Mx6XZSLK.js"),[],import.meta.url),"../../assets/users/user4.svg":()=>o(()=>import("./user4-DpEs_YiD.js"),[],import.meta.url),"../../assets/users/user5.svg":()=>o(()=>import("./user5-CVfrnlXE.js"),[],import.meta.url),"../../assets/users/user6.svg":()=>o(()=>import("./user6-C7HkYnq4.js"),[],import.meta.url),"../../assets/users/user7.svg":()=>o(()=>import("./user7-VAQcubFn.js"),[],import.meta.url),"../../assets/users/user8.svg":()=>o(()=>import("./user8-CwACr_jq.js"),[],import.meta.url),"../../assets/users/user9.svg":()=>o(()=>import("./user9-Dk4Mlhcc.js"),[],import.meta.url)}),`../../assets/${this.props.prefix.startsWith("enum.functions")?"devices":"rooms"}/${n.icon}.svg`,5),g=await I.Utils.getSvg(p.default);return i[a]=g}catch{return null}});Promise.all(r).then(()=>this.setState({icons:i,loading:!1}))})}render(){const t=this.props.prefix.startsWith("enum.functions")?Le:Se;return s.jsxs(c.Dialog,{maxWidth:"md",fullWidth:!0,sx:{"& .MuiPaper-root":M.fullHeight},open:!0,onClose:this.props.onClose,children:[s.jsxs(c.DialogTitle,{children:[this.props.t(this.props.prefix.startsWith("enum.functions")?"Create new function":"Create new room"),s.jsx(c.TextField,{variant:"standard",style:M.filter,value:this.state.filter,onChange:i=>this.setState({filter:i.target.value.toLowerCase()}),placeholder:this.props.t("Filter"),margin:"dense",slotProps:{input:{endAdornment:this.state.filter?s.jsx(c.IconButton,{tabIndex:-1,size:"small",onClick:()=>this.setState({filter:""}),children:s.jsx(b.Clear,{})}):null}}})]}),s.jsxs(c.DialogContent,{style:{textAlign:"center"},children:[this.state.loading&&s.jsx(c.LinearProgress,{}),s.jsx("div",{style:M.content,children:t.map((i,r)=>{const n=H.getText(i.name,this.props.lang)||i._id;return this.props.enums[`${this.props.prefix}.${i._id}`]?null:!this.state.filter||n.toLowerCase().includes(this.state.filter)?s.jsx(c.Button,{color:"grey",variant:"outlined",onClick:()=>{this.props.onClose(),this.props.createEnumTemplate(this.props.prefix,{_id:`${this.props.prefix}.${i._id}`,type:"enum",common:{name:i.name,icon:this.state.icons[r]},native:{}})},style:M.enumTemplateButton,startIcon:s.jsx(I.Icon,{src:this.state.icons[r],style:M.icon}),children:s.jsx("span",{style:M.enumTemplateLabel,children:H.getText(i.name,this.props.lang)||i._id})},r):null})})]}),s.jsxs(c.DialogActions,{children:[s.jsx(c.Button,{variant:"contained",color:"primary",style:M.customGroupButton,onClick:()=>{this.props.onClose(),this.props.showEnumEditDialog(this.props.getEnumTemplate(this.props.prefix),!0)},startIcon:s.jsx(b.Brush,{}),children:this.props.prefix==="enum.rooms"?this.props.t("Custom room"):this.props.prefix==="enum.functions"?this.props.t("Custom function"):this.props.t("Custom enumeration")}),s.jsx(c.Button,{color:"grey",variant:"contained",onClick:this.props.onClose,startIcon:s.jsx(b.Close,{}),children:this.props.t("Cancel")})]})]})}}function Et(e){return s.jsxs(c.Dialog,{open:!0,onClose:e.onClose,children:[s.jsx(c.DialogTitle,{children:e.t("Please confirm")}),s.jsx(c.DialogContent,{children:s.jsx(c.DialogContentText,{children:e.t('Do you want to delete enum "%s"?',e.getName(e.enum.common.name))})}),s.jsxs(c.DialogActions,{children:[s.jsx(c.Button,{variant:"contained",autoFocus:!0,color:"primary",onClick:()=>e.deleteEnum(e.enum._id),startIcon:s.jsx(b.Delete,{}),children:e.t("Delete")}),s.jsx(c.Button,{variant:"contained",color:"grey",onClick:e.onClose,startIcon:s.jsx(b.Close,{}),children:e.t("Cancel")})]})]})}const Dt=e=>{const[t,i]=O.useState({DragWrapper:null}),r=k.useRef(null);return O.useEffect(()=>{i({DragWrapper:a=>{var d,l,_,D;const p={type:"object",end:(C,z)=>{const P=z.getDropResult();C.data&&P&&(C.data.obj?e.addItemToEnum(C.data.obj._id,P.enumId):window.alert(`TODO: Add all direct children of ${C.data.id}`))},item:{data:a.item.data,preview:a.item.data&&a.item.data.obj?s.jsxs(c.Card,{variant:"outlined",style:e.stylesParent.enumGroupMember,children:[(d=a.item.data.obj.common)!=null&&d.icon?s.jsx(I.Icon,{style:e.stylesParent.icon,src:r.current?I.getSelectIdIconFromObjects(r.current,a.item.data.obj._id,e.lang):a.item.data.obj.common.icon}):I.ITEM_IMAGES[a.item.data.obj.type]||s.jsx(b.List,{style:e.stylesParent.icon}),s.jsxs("div",{children:[s.jsx("div",{children:(l=a.item.data.obj.common)!=null&&l.name?e.getName((_=a.item.data.obj.common)==null?void 0:_.name):a.item.data.obj._id}),(D=a.item.data.obj.common)!=null&&D.name?s.jsx("div",{style:{fontStyle:"italic",fontSize:"smaller",opacity:.7},children:a.item.data.obj._id}):null]})]},a.item.data.obj._id):null},collect:C=>({isDragging:C.isDragging()})},[{isDragging:g},h,u]=Ee(p);return O.useEffect(()=>{u(De(),{captureDraggingState:!0})},[u]),s.jsx(c.Box,{sx:a.style,ref:h,style:{backgroundColor:g?"rgba(100,152,255,0.1)":void 0},children:a.children},a.item.data.id)}})},[e.stylesParent,e.addItemToEnum,e.getName]),t?s.jsx(I.ObjectBrowser,{t:e.t,socket:e.socket,types:["state","channel","device"],columns:["name","type","role","room","func"],lang:e.lang,dragEnabled:!0,theme:e.theme,DragWrapper:t.DragWrapper,setObjectsReference:n=>r.current=n,levelPadding:10}):null},S={mainGridCont:{height:"100%",overflowY:"auto"},childGridCont:{display:"flex",flexDirection:"column",height:"100%"},enumGroupMember:{display:"flex",gap:8,alignItems:"center",padding:"8px 16px"},childGridContWide:{height:"100%"},blocksContainer:{overflowY:"auto",overflowX:"hidden"},canDrop:e=>({backgroundColor:e.palette.background.default}),icon:{height:32,width:32,marginRight:5,backgroundSize:"cover",backgroundPosition:"center",display:"inline-block"},categoryTitle:{flexDirection:"row",alignItems:"center",display:"inline-flex"},enumTemplateDialog:{overflowY:"auto",textAlign:"center"},enumTemplate:{display:"inline-flex",padding:10,width:200},toolbarButton:{},filter:{width:"100%",paddingRight:20},topPanel:{display:"flex",flexDirection:"row",alignItems:"center",paddingLeft:20},topPanel2:{display:"flex",flexDirection:"row",alignItems:"center",padding:"4px 20px",justifyContent:"space-between"},searchText:{color:"orange"}},yt=()=>{const e=qe(),t=e.display,{item:i,style:r}=e;return t?s.jsx("div",{style:{...r,zIndex:1e3},children:i.preview}):null},bt={favorites:{_id:"enum.favorites",type:"enum",common:{name:{en:"Favorites",de:"Favoriten",ru:"Избранное",pt:"Favoritos",nl:"Favorieten",fr:"Favoris",it:"Preferiti",es:"Favoritos",pl:"Ulubione",uk:"Обране","zh-cn":"收藏夹"}},native:{}}};function Re(e,t){return(i,r)=>{var m,p,g,h;let n=t(((p=(m=e[i])==null?void 0:m.common)==null?void 0:p.name)||"")||i.split(".").pop(),a=t(((h=(g=e[r])==null?void 0:g.common)==null?void 0:h.name)||"")||r.split(".").pop();return n=n.toLowerCase(),a=a.toLowerCase(),n>a?1:n<a?-1:0}}const Ct={_id:"",type:"enum",common:{name:"",color:"",desc:"",members:[]},native:{}};class me extends O.Component{cachedIcons;fastUpdate;refFilter;refClearButton;updateTimeout=null;changeEnums;scrollToItem;searchTimer=null;constructor(t){super(t);const i=window._localStorage||window.localStorage;let r={};try{r=i.getItem("enumsClosed")?JSON.parse(i.getItem("enumsClosed")):{}}catch{}let n=[];try{n=i.getItem("enumsCollapsed")?JSON.parse(i.getItem("enumsCollapsed")):[]}catch{}const a=i.getItem("enumsSplitSizes");let m=[50,50];if(a){try{m=JSON.parse(a)}catch{}(!Array.isArray(m)||m.length!==2)&&(m=[50,50])}this.state={enums:null,enumsTree:null,currentCategory:i.getItem("enumCurrentCategory")||"",search:"",enumEditDialog:null,enumTemplateDialog:null,enumDeleteDialog:null,members:{},categoryPopoverOpen:!1,enumsClosed:r,updating:[],enumsCollapsed:n,innerWidth:0,splitSizes:m},this.cachedIcons={},this.fastUpdate=!1,this.refFilter=k.createRef(),this.refClearButton=k.createRef()}getEnumTemplate=t=>{const i=JSON.parse(JSON.stringify(Ct)),{_id:r,name:n}=me.findNewUniqueName(t,Object.values(this.state.enums),this.props.t("Enum"));return i._id=r,i.common.name=n,i};scrollToEnum(t){let i=t.split(".");i.pop();let r=!1;const n=JSON.parse(JSON.stringify(this.state.enumsClosed));for(;i.length>2;){const a=i.join(".");n[a]&&(delete n[a],r=!0),i=a.split("."),i.pop()}r?this.setState({enumsClosed:n},()=>{setTimeout(()=>{const a=document.getElementById(t);a==null||a.scrollIntoView(!0)},400)}):setTimeout(()=>{const a=document.getElementById(t);a==null||a.scrollIntoView(!0)},400)}addUpdating(t){if(!this.state.updating.includes(t)){const i=[...this.state.updating];return i.push(t),new Promise(r=>{this.setState({updating:i},()=>r())})}return Promise.resolve()}createEnumTemplate=(t,i)=>{const r=this.getEnumTemplate(t);r._id=i._id,r.common={...r.common,...i.common},this.scrollToItem=r._id,this.addUpdating(r._id).then(()=>this.props.socket.setObject(r._id,r)).catch(n=>window.alert(`Cannot create enum: ${n}`))};async componentDidMount(){await this.updateData(),await this.props.socket.subscribeObject("enum.*",this.onObjectChange)}componentWillUnmount(){this.props.socket.unsubscribeObject("enum.*",this.onObjectChange),this.updateTimeout&&(clearTimeout(this.updateTimeout),this.updateTimeout=null)}onObjectChange=(t,i)=>{let r;if(this.state.enums&&t.startsWith("enum."))if(i){const n=this.changeEnums&&this.changeEnums[t]||this.state.enums&&this.state.enums[t];(!n||n&&JSON.stringify(n)!==JSON.stringify(i))&&(this.changeEnums=this.changeEnums||JSON.parse(JSON.stringify(this.state.enums)),this.changeEnums[t]=i,r=!0)}else(this.changeEnums&&this.changeEnums[t]||!this.changeEnums&&this.state.enums&&this.state.enums[t])&&(this.changeEnums=this.changeEnums||JSON.parse(JSON.stringify(this.state.enums)),delete this.changeEnums[t],r=!0);r&&(this.updateTimeout&&clearTimeout(this.updateTimeout),this.updateTimeout=setTimeout(()=>{this.updateTimeout=null;const n=this.changeEnums;this.changeEnums=null,this.updateData(n).then(()=>{this.scrollToItem&&(this.scrollToEnum(this.scrollToItem),this.scrollToItem=null)}).catch(()=>{})},this.fastUpdate?0:200),this.fastUpdate=!1)};updateData=async t=>{var n;t=t||await this.props.socket.getForeignObjects("enum.*","enum");const i={},r=Object.keys(t);for(let a=0;a<r.length;a++){const m=r[a];if((n=t[m].common)!=null&&n.members)for(let p=0;p<t[m].common.members.length;p++){const g=t[m].common.members[p];if(!i[g])try{i[g]=await this.props.socket.getObject(g)}catch{window.alert(`Cannot read member "${g}"`)}}}this.setState({enums:t,members:i,updating:[]},()=>this.buildTree(t))};buildTree(t){const i={data:null,children:{},id:""},r=Object.keys(t).sort(Re(t,this.getName));for(let n=0;n<r.length;n++){const a=r[n],m=t[a],p=a.split(".");let g=i;const h=[];for(let u=0;u<p.length;u++){const d=p[u];h.push(d),g.children[d]||(g.children[d]={data:null,children:{},id:h.join(".")}),g=g.children[d]}g.data=m}this.setCurrentCategory(this.state.currentCategory&&i.children.enum.children[this.state.currentCategory]?this.state.currentCategory:Object.keys(i.children.enum.children)[0],()=>this.setState({enumsTree:i}))}setCurrentCategory=(t,i)=>{t!==this.state.currentCategory?(this.setState({currentCategory:t},()=>{i&&i()}),(window._localStorage||window.localStorage).setItem("enumCurrentCategory",t)):i&&i()};addItemToEnum=(t,i)=>{var a;const r=JSON.parse(JSON.stringify(this.state.enums[i]));(a=r.common)!=null&&a.members||(r.common=r.common||{},r.common.members=[]);const n=r.common.members;n.includes(t)||(n.push(t),this.fastUpdate=!0,this.props.socket.setObject(r._id,r).catch(m=>window.alert(`Cannot set enum: ${m}`)))};removeMemberFromEnum=(t,i)=>{const r=JSON.parse(JSON.stringify(this.state.enums[i])),n=r.common.members,a=n.indexOf(t);a!==-1&&(n.splice(a,1),this.fastUpdate=!0,this.props.socket.setObject(r._id,r).catch(m=>window.alert(`Cannot update enum: ${m}`)))};moveEnum=async(t,i)=>{if(i.startsWith(t))return;const r=t.split(".");r.pop();const n=r.join("."),a=i;if(n===a)return;const m=Object.keys(this.state.enums),p=[...this.state.updating];try{for(let g=0;g<m.length;g++){const h=this.state.enums[m[g]];if(m[g].startsWith(t)){const u=m[g].replace(n,a),d=JSON.parse(JSON.stringify(h));d._id=u,p.includes(m[g])||p.push(m[g]),await this.props.socket.setObject(u,h),await this.props.socket.delObject(m[g])}}}catch(g){window.alert(`Cannot move enum: ${g}`)}this.setState({updating:p})};renderTree(t,i,r){var h,u;let n=null;if(!this.state.enumsClosed[t.id]){n=Object.keys(t.children);const d={};for(let l=0;l<n.length;l++){const _=n[l];d[_]=t.children[_].data}n.sort(Re(d,this.getName))}const a=this.getName((u=(h=t.data)==null?void 0:h.common)==null?void 0:u.name),m=t.id;let p,g;if(this.state.search){const d=this.state.search,l=a.toLowerCase().indexOf(d),_=m.toLowerCase().indexOf(d);if(l===-1&&_===-1)return null;l!==-1&&(p=a?[s.jsx("span",{children:a.substring(0,l)},"0"),s.jsx("span",{style:S.searchText,children:a.substring(l,l+this.state.search.length)},"1"),s.jsx("span",{children:a.substring(l+this.state.search.length)},"2")]:null),_!==-1&&(g=a?[s.jsx("span",{children:m.substring(0,_)},"0"),s.jsx("span",{style:S.searchText,children:m.substring(_,_+this.state.search.length)},"1"),s.jsx("span",{children:m.substring(_+this.state.search.length)},"2")]:null)}return s.jsxs("div",{style:{paddingLeft:r?32:0},children:[s.jsx(gt,{cachedIcons:this.cachedIcons,stylesParent:S,closed:this.state.enumsClosed[t.id],collapsed:this.state.enumsCollapsed.includes(t.id),copyEnum:this.copyEnum,currentCategory:this.state.currentCategory,enum:t.data,getEnumTemplate:this.getEnumTemplate,getName:this.getName,id:t.id,idText:g,members:this.state.members,moveEnum:this.moveEnum,name:p,onCollapse:()=>{const d=[...this.state.enumsCollapsed],l=d.indexOf(t.id);l===-1?d.push(t.id):d.splice(l,1),this.setState({enumsCollapsed:d}),(window._localStorage||window.localStorage).setItem("enumsCollapsed",JSON.stringify(d))},removeMemberFromEnum:this.removeMemberFromEnum,showEnumDeleteDialog:this.showEnumDeleteDialog,showEnumEditDialog:this.showEnumEditDialog,showEnumTemplateDialog:this.showEnumTemplateDialog,socket:this.props.socket,t:this.props.t,themeType:this.props.themeType,theme:this.props.theme,toggleEnum:this.toggleEnum,updating:this.state.updating.includes(t.id),childrenCount:t.children?Object.keys(t.children).length:0}),n?n.map((d,l)=>s.jsx(k.Fragment,{children:this.renderTree(t.children[d],l,r+1)},l)):null]},t.id||i)}showEnumEditDialog=(t,i)=>{const r={changed:!1};r.newItem=JSON.parse(JSON.stringify(t)),r.originalItem=JSON.parse(JSON.stringify(t)),r.isNew=i,this.setState({enumEditDialog:r})};showEnumTemplateDialog=t=>this.setState({enumTemplateDialog:t});showEnumDeleteDialog=t=>this.setState({enumDeleteDialog:t});saveEnum=async()=>{const t=this.state.enumEditDialog.newItem,i=this.state.enumEditDialog.originalItem._id;this.state.enumEditDialog.isNew&&(this.scrollToItem=t._id);const r=[...this.state.updating];if(r.includes(i)||r.push(i),await this.props.socket.setObject(t._id,t),i!==t._id)try{await this.props.socket.delObject(i);const n=Object.keys(this.state.enums);for(let a=0;a<n.length;a++){const m=n[a];if(m.startsWith(`${i}.`)){const p=JSON.parse(JSON.stringify(this.state.enums[m]));p._id=p._id.replace(`${i}.`,`${t._id}.`),r.includes(m)||r.push(m),await this.props.socket.setObject(p._id,p),await this.props.socket.delObject(m)}}}catch(n){window.alert(`Cannot save enum: ${n}`)}this.setState({enumEditDialog:null,updating:r})};deleteEnum=async t=>{const i=[...this.state.updating];try{i.includes(t)||i.push(t),this.state.enums[t]&&await this.props.socket.delObject(t);const r=Object.keys(this.state.enums);for(let n=0;n<r.length;n++){const a=r[n];a.startsWith(`${t}.`)&&(i.includes(a)||i.push(a),this.state.enums[t]&&await this.props.socket.delObject(a))}}catch(r){window.alert(`Cannot delete enum: ${r}`)}this.setState({enumDeleteDialog:null,updating:i})};copyEnum=t=>{const i=JSON.parse(JSON.stringify(this.state.enums[t]));let r,n=1;do r=t+n.toString(),n++;while(this.state.enums[r]);i._id=r,this.props.socket.setObject(r,i).catch(a=>window.alert(`Cannot delete enum: ${a}`))};toggleEnum=t=>{const i=JSON.parse(JSON.stringify(this.state.enumsClosed));i[t]=!i[t],this.setState({enumsClosed:i}),(window._localStorage||window.localStorage).setItem("enumsClosed",JSON.stringify(i))};changeEnumFormData=t=>{const i=JSON.parse(JSON.stringify(this.state.enumEditDialog));i.newItem=JSON.parse(JSON.stringify(t)),i.changed=JSON.stringify(i.newItem)!==JSON.stringify(this.state.enums[i.originalItem]||{}),this.setState({enumEditDialog:i})};getName=t=>H.getText(t,this.props.lang);static _isUniqueName(t,i,r,n){return!i.find(a=>a._id===`${t}.${r.toLowerCase()}_${n}`)}static findNewUniqueName(t,i,r){let n=1;for(;!me._isUniqueName(t,i,r,n);)n++;return{_id:`${t}.${r.toLowerCase()}_${n}`,name:`${r} ${n}`}}onFilterChanged(t,i){this.refClearButton.current&&(t?this.refClearButton.current.style.display="block":this.refClearButton.current.style.display="none"),i&&this.refFilter.current&&(this.refFilter.current.value=""),this.searchTimer&&clearTimeout(this.searchTimer),this.searchTimer=setTimeout(r=>{this.searchTimer=null,this.setState({search:r.toLowerCase()})},i?0:300,t)}renderEditDialog(){return this.state.enumEditDialog?s.jsx(vt,{onClose:()=>this.setState({enumEditDialog:null}),enums:Object.values(this.state.enums),enum:this.state.enumEditDialog.newItem,getName:this.getName,isNew:this.state.enumEditDialog.isNew,t:this.props.t,lang:this.props.lang,changed:this.state.enumEditDialog.changed,onChange:this.changeEnumFormData,saveData:this.saveEnum,innerWidth:this.state.innerWidth}):null}renderDeleteDialog(){return this.state.enumDeleteDialog?s.jsx(Et,{onClose:()=>this.setState({enumDeleteDialog:null}),enum:this.state.enumDeleteDialog,getName:this.getName,t:this.props.t,deleteEnum:this.deleteEnum}):null}renderTemplateDialog(){return this.state.enumTemplateDialog?s.jsx(ft,{prefix:this.state.enumTemplateDialog,onClose:()=>this.setState({enumTemplateDialog:null}),t:this.props.t,lang:this.props.lang,createEnumTemplate:this.createEnumTemplate,showEnumEditDialog:this.showEnumEditDialog,enums:this.state.enums,getEnumTemplate:this.getEnumTemplate}):null}render(){if(!this.state.enumsTree)return s.jsx(c.LinearProgress,{});const t=Object.values(this.state.enumsTree.children.enum.children[this.state.currentCategory].children),i=!!t.find(r=>r.children&&Object.keys(r.children).length);return s.jsxs(s.Fragment,{children:[s.jsxs(Me,{backend:H.isTouchDevice()?Je:Ue,children:[s.jsx(yt,{}),s.jsxs(ct,{direction:w.Horizontal,initialSizes:this.state.splitSizes,minWidths:[450,450],onResizeFinished:(r,n)=>{this.setState({splitSizes:n}),(window._localStorage||window.localStorage).setItem("enumsSplitSizes",JSON.stringify(n))},gutterClassName:this.props.themeType==="dark"?"Dark visGutter":"Light visGutter",children:[s.jsxs("div",{style:{...S.childGridCont,...this.state.innerWidth>600?S.childGridContWide:void 0},children:[s.jsxs("div",{style:S.topPanel,children:[s.jsx(c.Tooltip,{title:this.props.t("Add enum"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:s.jsx(c.IconButton,{id:"categoryPopoverButton",size:"small",style:S.toolbarButton,onClick:()=>this.state.enumsTree.children.enum.children.favorites?this.showEnumEditDialog(this.getEnumTemplate("enum"),!0):this.setState({categoryPopoverOpen:!0}),children:s.jsx(b.Add,{})})}),s.jsx(c.Popover,{open:this.state.categoryPopoverOpen,onClose:()=>this.setState({categoryPopoverOpen:!1}),anchorEl:()=>document.getElementById("categoryPopoverButton"),anchorOrigin:{vertical:"bottom",horizontal:"right"},children:s.jsxs(c.MenuList,{children:[this.state.enumsTree.children.enum.children.favorites?null:s.jsx(c.MenuItem,{onClick:()=>this.createEnumTemplate("enum",bt.favorites),children:this.props.t("Favorites")}),s.jsx(c.MenuItem,{onClick:()=>this.showEnumEditDialog(this.getEnumTemplate("enum"),!0),children:this.props.t("Custom enum")})]})}),s.jsx(c.Tabs,{value:this.state.currentCategory,variant:"scrollable",scrollButtons:"auto",onChange:(r,n)=>this.setCurrentCategory(n),children:Object.keys(this.state.enumsTree.children.enum.children).map((r,n)=>{var m;let a=this.state.enumsTree.children.enum.children[r].data;return a=a||{_id:this.state.enumsTree.children.enum.children[r].id,common:{name:this.state.enumsTree.children.enum.children[r].id.split(".").pop()},type:"enum",native:{}},s.jsx(c.Tab,{component:"span",style:{backgroundColor:((m=a.common)==null?void 0:m.color)||void 0,borderRadius:4},label:s.jsx(ht,{themeType:this.props.themeType,categoryData:a,showEnumEditDialog:this.showEnumEditDialog,showEnumDeleteDialog:this.showEnumDeleteDialog,styles:S,...this.props}),value:r},n)})})]}),s.jsxs("div",{style:S.topPanel2,children:[s.jsx(c.TextField,{variant:"standard",inputRef:this.refFilter,placeholder:this.props.t("Filter"),style:S.filter,slotProps:{inputLabel:{shrink:!0},input:{endAdornment:s.jsx(c.IconButton,{tabIndex:-1,ref:this.refClearButton,style:{display:"none"},size:"small",onClick:()=>this.onFilterChanged("",!0),children:s.jsx(b.Clear,{})})}},onChange:r=>this.onFilterChanged(r.target.value)}),s.jsx(c.Tooltip,{title:this.props.t("Narrow all"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:s.jsx(c.IconButton,{size:"large",style:S.toolbarButton,onClick:()=>{const r=Object.keys(this.state.enums);this.setState({enumsCollapsed:r}),(window._localStorage||window.localStorage).setItem("enumsCollapsed",JSON.stringify(r))},children:s.jsx(b.UnfoldLess,{})})}),s.jsx(c.Tooltip,{title:this.props.t("Wide all"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:s.jsx(c.IconButton,{size:"large",style:S.toolbarButton,onClick:()=>{this.setState({enumsCollapsed:[]}),(window._localStorage||window.localStorage).setItem("enumsCollapsed","[]")},children:s.jsx(b.UnfoldMore,{})})}),i&&s.jsx(c.Tooltip,{title:this.props.t("Collapse all"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:s.jsx(c.IconButton,{size:"large",style:S.toolbarButton,onClick:()=>{const r={};Object.keys(this.state.enums).forEach(n=>r[n]=!0),this.setState({enumsClosed:r}),(window._localStorage||window.localStorage).setItem("enumsClosed",JSON.stringify(r))},children:s.jsx(ze,{})})}),i&&s.jsx(c.Tooltip,{title:this.props.t("Expand all"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:s.jsx(c.IconButton,{size:"large",style:S.toolbarButton,onClick:()=>{const r={};this.setState({enumsClosed:r}),(window._localStorage||window.localStorage).setItem("enumsClosed",JSON.stringify(r))},children:s.jsx(Ae,{})})}),s.jsx(c.Tooltip,{title:this.props.t("Add group"),placement:"top",slotProps:{popper:{sx:{pointerEvents:"none"}}},children:s.jsx(c.IconButton,{size:"large",onClick:()=>{["functions","rooms"].includes(this.state.currentCategory)?this.setState({enumTemplateDialog:`enum.${this.state.currentCategory}`}):this.showEnumEditDialog(this.getEnumTemplate(`enum.${this.state.currentCategory}`),!0)},children:s.jsx(b.Add,{})})})]}),s.jsx("div",{style:S.blocksContainer,children:t.map((r,n)=>this.renderTree(r,n,0))})]}),s.jsx("div",{style:{...S.childGridCont,...this.state.innerWidth>600?S.childGridContWide:void 0},children:s.jsx("div",{style:S.blocksContainer,children:s.jsx(Dt,{addItemToEnum:this.addItemToEnum,getName:this.getName,stylesParent:S,t:this.props.t,socket:this.props.socket,lang:this.props.lang,theme:this.props.theme})})})]})]}),this.renderEditDialog(),this.renderDeleteDialog(),this.renderTemplateDialog()]})}}function ti(e){return s.jsx(I.TabContainer,{children:s.jsx(I.TabContent,{style:{display:"flex",flexDirection:"column",overflow:"auto"},children:s.jsx(me,{socket:e.socket,t:e.t,lang:e.lang,themeType:e.themeType,theme:e.theme})})})}export{ti as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as _}from"./iobroker_admin__loadShare__react__loadShare__-LM7uyL45.js";import{j as r}from"./DefaultPropsProvider-BiXBMQYQ.js";import{j as d}from"./bootstrap-COulQZax-v67.js";import{i as l,a as u}from"./iobroker_admin__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-CJO5yP3h.js";import{i as c}from"./iobroker_admin__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-LFZoiUTt.js";_.createContext(void 0);var o=(e,t)=>({x:e.x-t.x,y:e.y-t.y}),f=(e,t)=>({x:e.x+t.x,y:e.y+t.y}),x=e=>{let t=e.getInitialClientOffset(),n=e.getInitialSourceClientOffset();return t===null||n===null?{x:0,y:0}:o(t,n)},y=(e,t)=>{switch(e){case"left":case"top-start":case"bottom-start":return 0;case"right":case"top-end":case"bottom-end":return t.width;default:return t.width/2}},h=(e,t)=>{switch(e){case"top":case"top-start":case"top-end":return 0;case"bottom":case"bottom-start":case"bottom-end":return t.height;default:return t.height/2}},g=(e,t,n="center",a={x:0,y:0})=>{let i=e.getClientOffset();if(i===null)return null;if(!t.current||!t.current.getBoundingClientRect)return o(i,x(e));let s=t.current.getBoundingClientRect(),m={x:y(n,s),y:h(n,s)};return f(o(i,m),a)},C=e=>{let t=`translate(${e.x.toFixed(1)}px, ${e.y.toFixed(1)}px)`;return{pointerEvents:"none",position:"fixed",top:0,left:0,transform:t,WebkitTransform:t}},S=e=>{let t=_.useRef(null),n=d(a=>({currentOffset:g(a,t,e==null?void 0:e.placement,e==null?void 0:e.padding),isDragging:a.isDragging(),itemType:a.getItemType(),item:a.getItem(),monitor:a}));return!n.isDragging||n.currentOffset===null?{display:!1}:{display:!0,itemType:n.itemType,item:n.item,style:C(n.currentOffset),monitor:n.monitor,ref:t}};function O(e){const t=e.icon;return r.jsxs("div",{style:e.styles.formContainer,children:[t?r.jsx(t,{style:e.styles.formIcon}):null,r.jsx(l.FormControl,{style:e.styles.formControl,variant:"standard",children:r.jsx(l.TextField,{variant:"standard",label:e.t(e.label),autoComplete:e.autoComplete,error:!!e.error,helperText:e.error||"",value:e.value,onChange:n=>e.onChange(n.target.value),disabled:e.disabled,type:e.type,slotProps:{inputLabel:{shrink:!0},input:{readOnly:!1,endAdornment:e.value?r.jsx(l.InputAdornment,{position:"end",children:r.jsx(l.IconButton,{tabIndex:-1,size:"small",onClick:()=>e.onChange(""),children:r.jsx(u.Close,{})})}):null}}})})]})}function T(e){const t=e.icon;return r.jsxs("div",{style:{width:"100%"},children:[t?r.jsx(t,{style:e.previewStyle||e.styles.formIcon}):null,r.jsx(c.ColorPicker,{style:{...e.style||void 0,width:t?"calc(100% - 45px)":"100%",display:"inline-block",verticalAlign:"top"},label:e.t(e.label),onChange:e.onChange,value:e.value||""})]})}export{O as I,T as a,S as b};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as B}from"./DefaultPropsProvider-BiXBMQYQ.js";import{i as M}from"./iobroker_admin__loadShare__react__loadShare__-LM7uyL45.js";import{i as Be}from"./iobroker_admin__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-CJO5yP3h.js";import{i as ee}from"./iobroker_admin__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-LFZoiUTt.js";import{a as Te}from"./ace-DEUjyTIn.js";import{E as Ge,b as Ne}from"./bootstrap-COulQZax-v67.js";import{C as ve}from"./CustomModal-CqDLqryN.js";import"./_commonjsHelpers-CE1G-McA.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-g2X2zhAf.js";import"./emotion-serialize.esm-Q4o_CgeF.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-BywLg1Xe.js";import"./iobroker_admin__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__-CpA7pnS5.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-CNUAG3AH.js";import"./ext-language_tools-ylAoucDh.js";import"./iobroker_admin__loadShare__react_mf_2_dropzone__loadShare__-CwjnV48g.js";import"./iobroker_admin__loadShare__react_mf_2_dom__loadShare__-CVeAXnkk.js";import"./preload-helper-BDBacUwf.js";import"./sdk-C-e-e2gd.js";import"./extends-CF3RwP-h.js";import"./assertThisInitialized-B0aQ9eG_.js";import"./useTheme-Bl-M1DYp.js";import"./createTheme-DFX8CY6F.js";import"./blue-CagzI6CQ.js";import"./index-DcK0RDrH.js";import"./ThemeProvider-BOFFjWAF.js";import"./emotion-cache.browser.esm-BgJfNZJN.js";import"./setYear-3ufv5yRD.js";import"./en-US-DBFJNIH6.js";var De={},Se={};Se.byteLength=He;Se.toByteArray=We;Se.fromByteArray=Qe;var te=[],K=[],$e=typeof Uint8Array<"u"?Uint8Array:Array,Le="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var me=0,qe=Le.length;me<qe;++me)te[me]=Le[me],K[Le.charCodeAt(me)]=me;K[45]=62;K[95]=63;function Oe(p){var c=p.length;if(c%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var u=p.indexOf("=");u===-1&&(u=c);var h=u===c?0:4-u%4;return[u,h]}function He(p){var c=Oe(p),u=c[0],h=c[1];return(u+h)*3/4-h}function Ve(p,c,u){return(c+u)*3/4-u}function We(p){var c,u=Oe(p),h=u[0],f=u[1],a=new $e(Ve(p,h,f)),d=0,o=f>0?h-4:h,m;for(m=0;m<o;m+=4)c=K[p.charCodeAt(m)]<<18|K[p.charCodeAt(m+1)]<<12|K[p.charCodeAt(m+2)]<<6|K[p.charCodeAt(m+3)],a[d++]=c>>16&255,a[d++]=c>>8&255,a[d++]=c&255;return f===2&&(c=K[p.charCodeAt(m)]<<2|K[p.charCodeAt(m+1)]>>4,a[d++]=c&255),f===1&&(c=K[p.charCodeAt(m)]<<10|K[p.charCodeAt(m+1)]<<4|K[p.charCodeAt(m+2)]>>2,a[d++]=c>>8&255,a[d++]=c&255),a}function Je(p){return te[p>>18&63]+te[p>>12&63]+te[p>>6&63]+te[p&63]}function ze(p,c,u){for(var h,f=[],a=c;a<u;a+=3)h=(p[a]<<16&16711680)+(p[a+1]<<8&65280)+(p[a+2]&255),f.push(Je(h));return f.join("")}function Qe(p){for(var c,u=p.length,h=u%3,f=[],a=16383,d=0,o=u-h;d<o;d+=a)f.push(ze(p,d,d+a>o?o:d+a));return h===1?(c=p[u-1],f.push(te[c>>2]+te[c<<4&63]+"==")):h===2&&(c=(p[u-2]<<8)+p[u-1],f.push(te[c>>10]+te[c>>4&63]+te[c<<2&63]+"=")),f.join("")}var ke={};ke.read=function(p,c,u,h,f){var a,d,o=f*8-h-1,m=(1<<o)-1,S=m>>1,w=-7,g=u?f-1:0,E=u?-1:1,x=p[c+g];for(g+=E,a=x&(1<<-w)-1,x>>=-w,w+=o;w>0;a=a*256+p[c+g],g+=E,w-=8);for(d=a&(1<<-w)-1,a>>=-w,w+=h;w>0;d=d*256+p[c+g],g+=E,w-=8);if(a===0)a=1-S;else{if(a===m)return d?NaN:(x?-1:1)*(1/0);d=d+Math.pow(2,h),a=a-S}return(x?-1:1)*d*Math.pow(2,a-h)};ke.write=function(p,c,u,h,f,a){var d,o,m,S=a*8-f-1,w=(1<<S)-1,g=w>>1,E=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,x=h?0:a-1,R=h?1:-1,A=c<0||c===0&&1/c<0?1:0;for(c=Math.abs(c),isNaN(c)||c===1/0?(o=isNaN(c)?1:0,d=w):(d=Math.floor(Math.log(c)/Math.LN2),c*(m=Math.pow(2,-d))<1&&(d--,m*=2),d+g>=1?c+=E/m:c+=E*Math.pow(2,1-g),c*m>=2&&(d++,m/=2),d+g>=w?(o=0,d=w):d+g>=1?(o=(c*m-1)*Math.pow(2,f),d=d+g):(o=c*Math.pow(2,g-1)*Math.pow(2,f),d=0));f>=8;p[u+x]=o&255,x+=R,o/=256,f-=8);for(d=d<<f|o,S+=f;S>0;p[u+x]=d&255,x+=R,d/=256,S-=8);p[u+x-R]|=A*128};(function(p){const c=Se,u=ke,h=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;p.Buffer=o,p.SlowBuffer=le,p.INSPECT_MAX_BYTES=50;const f=2147483647;p.kMaxLength=f,o.TYPED_ARRAY_SUPPORT=a(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function a(){try{const r=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(r,e),r.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function d(r){if(r>f)throw new RangeError('The value "'+r+'" is invalid for option "size"');const e=new Uint8Array(r);return Object.setPrototypeOf(e,o.prototype),e}function o(r,e,t){if(typeof r=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(r)}return m(r,e,t)}o.poolSize=8192;function m(r,e,t){if(typeof r=="string")return E(r,e);if(ArrayBuffer.isView(r))return R(r);if(r==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);if(O(r,ArrayBuffer)||r&&O(r.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(O(r,SharedArrayBuffer)||r&&O(r.buffer,SharedArrayBuffer)))return A(r,e,t);if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const i=r.valueOf&&r.valueOf();if(i!=null&&i!==r)return o.from(i,e,t);const n=G(r);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof r[Symbol.toPrimitive]=="function")return o.from(r[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r)}o.from=function(r,e,t){return m(r,e,t)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function S(r){if(typeof r!="number")throw new TypeError('"size" argument must be of type number');if(r<0)throw new RangeError('The value "'+r+'" is invalid for option "size"')}function w(r,e,t){return S(r),r<=0?d(r):e!==void 0?typeof t=="string"?d(r).fill(e,t):d(r).fill(e):d(r)}o.alloc=function(r,e,t){return w(r,e,t)};function g(r){return S(r),d(r<0?0:V(r)|0)}o.allocUnsafe=function(r){return g(r)},o.allocUnsafeSlow=function(r){return g(r)};function E(r,e){if((typeof e!="string"||e==="")&&(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const t=q(r,e)|0;let i=d(t);const n=i.write(r,e);return n!==t&&(i=i.slice(0,n)),i}function x(r){const e=r.length<0?0:V(r.length)|0,t=d(e);for(let i=0;i<e;i+=1)t[i]=r[i]&255;return t}function R(r){if(O(r,Uint8Array)){const e=new Uint8Array(r);return A(e.buffer,e.byteOffset,e.byteLength)}return x(r)}function A(r,e,t){if(e<0||r.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(r.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&t===void 0?i=new Uint8Array(r):t===void 0?i=new Uint8Array(r,e):i=new Uint8Array(r,e,t),Object.setPrototypeOf(i,o.prototype),i}function G(r){if(o.isBuffer(r)){const e=V(r.length)|0,t=d(e);return t.length===0||r.copy(t,0,0,e),t}if(r.length!==void 0)return typeof r.length!="number"||z(r.length)?d(0):x(r);if(r.type==="Buffer"&&Array.isArray(r.data))return x(r.data)}function V(r){if(r>=f)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+f.toString(16)+" bytes");return r|0}function le(r){return+r!=r&&(r=0),o.alloc(+r)}o.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==o.prototype},o.compare=function(e,t){if(O(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),O(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let i=e.length,n=t.length;for(let s=0,l=Math.min(i,n);s<l;++s)if(e[s]!==t[s]){i=e[s],n=t[s];break}return i<n?-1:n<i?1:0},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return o.alloc(0);let i;if(t===void 0)for(t=0,i=0;i<e.length;++i)t+=e[i].length;const n=o.allocUnsafe(t);let s=0;for(i=0;i<e.length;++i){let l=e[i];if(O(l,Uint8Array))s+l.length>n.length?(o.isBuffer(l)||(l=o.from(l)),l.copy(n,s)):Uint8Array.prototype.set.call(n,l,s);else if(o.isBuffer(l))l.copy(n,s);else throw new TypeError('"list" argument must be an Array of Buffers');s+=l.length}return n};function q(r,e){if(o.isBuffer(r))return r.length;if(ArrayBuffer.isView(r)||O(r,ArrayBuffer))return r.byteLength;if(typeof r!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof r);const t=r.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&t===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return ne(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return k(r).length;default:if(n)return i?-1:ne(r).length;e=(""+e).toLowerCase(),n=!0}}o.byteLength=q;function ce(r,e,t){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(r||(r="utf8");;)switch(r){case"hex":return pe(this,e,t);case"utf8":case"utf-8":return ye(this,e,t);case"ascii":return Ie(this,e,t);case"latin1":case"binary":return be(this,e,t);case"base64":return fe(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ue(this,e,t);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),i=!0}}o.prototype._isBuffer=!0;function N(r,e,t){const i=r[e];r[e]=r[t],r[t]=i}o.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)N(this,t,t+1);return this},o.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)N(this,t,t+3),N(this,t+1,t+2);return this},o.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)N(this,t,t+7),N(this,t+1,t+6),N(this,t+2,t+5),N(this,t+3,t+4);return this},o.prototype.toString=function(){const e=this.length;return e===0?"":arguments.length===0?ye(this,0,e):ce.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:o.compare(this,e)===0},o.prototype.inspect=function(){let e="";const t=p.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},h&&(o.prototype[h]=o.prototype.inspect),o.prototype.compare=function(e,t,i,n,s){if(O(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),s===void 0&&(s=this.length),t<0||i>e.length||n<0||s>this.length)throw new RangeError("out of range index");if(n>=s&&t>=i)return 0;if(n>=s)return-1;if(t>=i)return 1;if(t>>>=0,i>>>=0,n>>>=0,s>>>=0,this===e)return 0;let l=s-n,y=i-t;const _=Math.min(l,y),C=this.slice(n,s),b=e.slice(t,i);for(let F=0;F<_;++F)if(C[F]!==b[F]){l=C[F],y=b[F];break}return l<y?-1:y<l?1:0};function ue(r,e,t,i,n){if(r.length===0)return-1;if(typeof t=="string"?(i=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,z(t)&&(t=n?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(n)return-1;t=r.length-1}else if(t<0)if(n)t=0;else return-1;if(typeof e=="string"&&(e=o.from(e,i)),o.isBuffer(e))return e.length===0?-1:we(r,e,t,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):we(r,[e],t,i,n);throw new TypeError("val must be string, number or Buffer")}function we(r,e,t,i,n){let s=1,l=r.length,y=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(r.length<2||e.length<2)return-1;s=2,l/=2,y/=2,t/=2}function _(b,F){return s===1?b[F]:b.readUInt16BE(F*s)}let C;if(n){let b=-1;for(C=t;C<l;C++)if(_(r,C)===_(e,b===-1?0:C-b)){if(b===-1&&(b=C),C-b+1===y)return b*s}else b!==-1&&(C-=C-b),b=-1}else for(t+y>l&&(t=l-y),C=t;C>=0;C--){let b=!0;for(let F=0;F<y;F++)if(_(r,C+F)!==_(e,F)){b=!1;break}if(b)return C}return-1}o.prototype.includes=function(e,t,i){return this.indexOf(e,t,i)!==-1},o.prototype.indexOf=function(e,t,i){return ue(this,e,t,i,!0)},o.prototype.lastIndexOf=function(e,t,i){return ue(this,e,t,i,!1)};function Ce(r,e,t,i){t=Number(t)||0;const n=r.length-t;i?(i=Number(i),i>n&&(i=n)):i=n;const s=e.length;i>s/2&&(i=s/2);let l;for(l=0;l<i;++l){const y=parseInt(e.substr(l*2,2),16);if(z(y))return l;r[t+l]=y}return l}function re(r,e,t,i){return L(ne(e,r.length-t),r,t,i)}function Ee(r,e,t,i){return L(he(e),r,t,i)}function ae(r,e,t,i){return L(k(e),r,t,i)}function Fe(r,e,t,i){return L(se(e,r.length-t),r,t,i)}o.prototype.write=function(e,t,i,n){if(t===void 0)n="utf8",i=this.length,t=0;else if(i===void 0&&typeof t=="string")n=t,i=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const s=this.length-t;if((i===void 0||i>s)&&(i=s),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let l=!1;for(;;)switch(n){case"hex":return Ce(this,e,t,i);case"utf8":case"utf-8":return re(this,e,t,i);case"ascii":case"latin1":case"binary":return Ee(this,e,t,i);case"base64":return ae(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Fe(this,e,t,i);default:if(l)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),l=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function fe(r,e,t){return e===0&&t===r.length?c.fromByteArray(r):c.fromByteArray(r.slice(e,t))}function ye(r,e,t){t=Math.min(r.length,t);const i=[];let n=e;for(;n<t;){const s=r[n];let l=null,y=s>239?4:s>223?3:s>191?2:1;if(n+y<=t){let _,C,b,F;switch(y){case 1:s<128&&(l=s);break;case 2:_=r[n+1],(_&192)===128&&(F=(s&31)<<6|_&63,F>127&&(l=F));break;case 3:_=r[n+1],C=r[n+2],(_&192)===128&&(C&192)===128&&(F=(s&15)<<12|(_&63)<<6|C&63,F>2047&&(F<55296||F>57343)&&(l=F));break;case 4:_=r[n+1],C=r[n+2],b=r[n+3],(_&192)===128&&(C&192)===128&&(b&192)===128&&(F=(s&15)<<18|(_&63)<<12|(C&63)<<6|b&63,F>65535&&F<1114112&&(l=F))}}l===null?(l=65533,y=1):l>65535&&(l-=65536,i.push(l>>>10&1023|55296),l=56320|l&1023),i.push(l),n+=y}return _e(i)}const Ae=4096;function _e(r){const e=r.length;if(e<=Ae)return String.fromCharCode.apply(String,r);let t="",i=0;for(;i<e;)t+=String.fromCharCode.apply(String,r.slice(i,i+=Ae));return t}function Ie(r,e,t){let i="";t=Math.min(r.length,t);for(let n=e;n<t;++n)i+=String.fromCharCode(r[n]&127);return i}function be(r,e,t){let i="";t=Math.min(r.length,t);for(let n=e;n<t;++n)i+=String.fromCharCode(r[n]);return i}function pe(r,e,t){const i=r.length;(!e||e<0)&&(e=0),(!t||t<0||t>i)&&(t=i);let n="";for(let s=e;s<t;++s)n+=Z[r[s]];return n}function Ue(r,e,t){const i=r.slice(e,t);let n="";for(let s=0;s<i.length-1;s+=2)n+=String.fromCharCode(i[s]+i[s+1]*256);return n}o.prototype.slice=function(e,t){const i=this.length;e=~~e,t=t===void 0?i:~~t,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),t<e&&(t=e);const n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n};function U(r,e,t){if(r%1!==0||r<0)throw new RangeError("offset is not uint");if(r+e>t)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(e,t,i){e=e>>>0,t=t>>>0,i||U(e,t,this.length);let n=this[e],s=1,l=0;for(;++l<t&&(s*=256);)n+=this[e+l]*s;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(e,t,i){e=e>>>0,t=t>>>0,i||U(e,t,this.length);let n=this[e+--t],s=1;for(;t>0&&(s*=256);)n+=this[e+--t]*s;return n},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e=e>>>0,t||U(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||U(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||U(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||U(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readBigUInt64LE=P(function(e){e=e>>>0,J(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&X(e,this.length-8);const n=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,s=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(s)<<BigInt(32))}),o.prototype.readBigUInt64BE=P(function(e){e=e>>>0,J(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&X(e,this.length-8);const n=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],s=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(s)}),o.prototype.readIntLE=function(e,t,i){e=e>>>0,t=t>>>0,i||U(e,t,this.length);let n=this[e],s=1,l=0;for(;++l<t&&(s*=256);)n+=this[e+l]*s;return s*=128,n>=s&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,i){e=e>>>0,t=t>>>0,i||U(e,t,this.length);let n=t,s=1,l=this[e+--n];for(;n>0&&(s*=256);)l+=this[e+--n]*s;return s*=128,l>=s&&(l-=Math.pow(2,8*t)),l},o.prototype.readInt8=function(e,t){return e=e>>>0,t||U(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},o.prototype.readInt16LE=function(e,t){e=e>>>0,t||U(e,2,this.length);const i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i},o.prototype.readInt16BE=function(e,t){e=e>>>0,t||U(e,2,this.length);const i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i},o.prototype.readInt32LE=function(e,t){return e=e>>>0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e=e>>>0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readBigInt64LE=P(function(e){e=e>>>0,J(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&X(e,this.length-8);const n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),o.prototype.readBigInt64BE=P(function(e){e=e>>>0,J(e,"offset");const t=this[e],i=this[e+7];(t===void 0||i===void 0)&&X(e,this.length-8);const n=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)}),o.prototype.readFloatLE=function(e,t){return e=e>>>0,t||U(e,4,this.length),u.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e=e>>>0,t||U(e,4,this.length),u.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||U(e,8,this.length),u.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||U(e,8,this.length),u.read(this,e,!1,52,8)};function T(r,e,t,i,n,s){if(!o.isBuffer(r))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<s)throw new RangeError('"value" argument is out of bounds');if(t+i>r.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,i,n){if(e=+e,t=t>>>0,i=i>>>0,!n){const y=Math.pow(2,8*i)-1;T(this,e,t,i,y,0)}let s=1,l=0;for(this[t]=e&255;++l<i&&(s*=256);)this[t+l]=e/s&255;return t+i},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(e,t,i,n){if(e=+e,t=t>>>0,i=i>>>0,!n){const y=Math.pow(2,8*i)-1;T(this,e,t,i,y,0)}let s=i-1,l=1;for(this[t+s]=e&255;--s>=0&&(l*=256);)this[t+s]=e/l&255;return t+i},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,1,255,0),this[t]=e&255,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function ie(r,e,t,i,n){$(e,i,n,r,t,7);let s=Number(e&BigInt(4294967295));r[t++]=s,s=s>>8,r[t++]=s,s=s>>8,r[t++]=s,s=s>>8,r[t++]=s;let l=Number(e>>BigInt(32)&BigInt(4294967295));return r[t++]=l,l=l>>8,r[t++]=l,l=l>>8,r[t++]=l,l=l>>8,r[t++]=l,t}function xe(r,e,t,i,n){$(e,i,n,r,t,7);let s=Number(e&BigInt(4294967295));r[t+7]=s,s=s>>8,r[t+6]=s,s=s>>8,r[t+5]=s,s=s>>8,r[t+4]=s;let l=Number(e>>BigInt(32)&BigInt(4294967295));return r[t+3]=l,l=l>>8,r[t+2]=l,l=l>>8,r[t+1]=l,l=l>>8,r[t]=l,t+8}o.prototype.writeBigUInt64LE=P(function(e,t=0){return ie(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeBigUInt64BE=P(function(e,t=0){return xe(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),o.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t=t>>>0,!n){const _=Math.pow(2,8*i-1);T(this,e,t,i,_-1,-_)}let s=0,l=1,y=0;for(this[t]=e&255;++s<i&&(l*=256);)e<0&&y===0&&this[t+s-1]!==0&&(y=1),this[t+s]=(e/l>>0)-y&255;return t+i},o.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t=t>>>0,!n){const _=Math.pow(2,8*i-1);T(this,e,t,i,_-1,-_)}let s=i-1,l=1,y=0;for(this[t+s]=e&255;--s>=0&&(l*=256);)e<0&&y===0&&this[t+s+1]!==0&&(y=1),this[t+s]=(e/l>>0)-y&255;return t+i},o.prototype.writeInt8=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},o.prototype.writeInt16LE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},o.prototype.writeInt32LE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,i){return e=+e,t=t>>>0,i||T(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},o.prototype.writeBigInt64LE=P(function(e,t=0){return ie(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),o.prototype.writeBigInt64BE=P(function(e,t=0){return xe(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ge(r,e,t,i,n,s){if(t+i>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function I(r,e,t,i,n){return e=+e,t=t>>>0,n||ge(r,e,t,4),u.write(r,e,t,i,23,4),t+4}o.prototype.writeFloatLE=function(e,t,i){return I(this,e,t,!0,i)},o.prototype.writeFloatBE=function(e,t,i){return I(this,e,t,!1,i)};function Q(r,e,t,i,n){return e=+e,t=t>>>0,n||ge(r,e,t,8),u.write(r,e,t,i,52,8),t+8}o.prototype.writeDoubleLE=function(e,t,i){return Q(this,e,t,!0,i)},o.prototype.writeDoubleBE=function(e,t,i){return Q(this,e,t,!1,i)},o.prototype.copy=function(e,t,i,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);const s=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),t),s},o.prototype.fill=function(e,t,i,n){if(typeof e=="string"){if(typeof t=="string"?(n=t,t=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){const l=e.charCodeAt(0);(n==="utf8"&&l<128||n==="latin1")&&(e=l)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;t=t>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let s;if(typeof e=="number")for(s=t;s<i;++s)this[s]=e;else{const l=o.isBuffer(e)?e:o.from(e,n),y=l.length;if(y===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(s=0;s<i-t;++s)this[s+t]=l[s%y]}return this};const D={};function W(r,e,t){D[r]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${r}]`,this.stack,delete this.name}get code(){return r}set code(n){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:n,writable:!0})}toString(){return`${this.name} [${r}]: ${this.message}`}}}W("ERR_BUFFER_OUT_OF_BOUNDS",function(r){return r?`${r} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),W("ERR_INVALID_ARG_TYPE",function(r,e){return`The "${r}" argument must be of type number. Received type ${typeof e}`},TypeError),W("ERR_OUT_OF_RANGE",function(r,e,t){let i=`The value of "${r}" is out of range.`,n=t;return Number.isInteger(t)&&Math.abs(t)>2**32?n=v(String(t)):typeof t=="bigint"&&(n=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(n=v(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function v(r){let e="",t=r.length;const i=r[0]==="-"?1:0;for(;t>=i+4;t-=3)e=`_${r.slice(t-3,t)}${e}`;return`${r.slice(0,t)}${e}`}function H(r,e,t){J(e,"offset"),(r[e]===void 0||r[e+t]===void 0)&&X(e,r.length-(t+1))}function $(r,e,t,i,n,s){if(r>t||r<e){const l=typeof e=="bigint"?"n":"";let y;throw e===0||e===BigInt(0)?y=`>= 0${l} and < 2${l} ** ${(s+1)*8}${l}`:y=`>= -(2${l} ** ${(s+1)*8-1}${l}) and < 2 ** ${(s+1)*8-1}${l}`,new D.ERR_OUT_OF_RANGE("value",y,r)}H(i,n,s)}function J(r,e){if(typeof r!="number")throw new D.ERR_INVALID_ARG_TYPE(e,"number",r)}function X(r,e,t){throw Math.floor(r)!==r?(J(r,t),new D.ERR_OUT_OF_RANGE("offset","an integer",r)):e<0?new D.ERR_BUFFER_OUT_OF_BOUNDS:new D.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,r)}const oe=/[^+/0-9A-Za-z-_]/g;function de(r){if(r=r.split("=")[0],r=r.trim().replace(oe,""),r.length<2)return"";for(;r.length%4!==0;)r=r+"=";return r}function ne(r,e){e=e||1/0;let t;const i=r.length;let n=null;const s=[];for(let l=0;l<i;++l){if(t=r.charCodeAt(l),t>55295&&t<57344){if(!n){if(t>56319){(e-=3)>-1&&s.push(239,191,189);continue}else if(l+1===i){(e-=3)>-1&&s.push(239,191,189);continue}n=t;continue}if(t<56320){(e-=3)>-1&&s.push(239,191,189),n=t;continue}t=(n-55296<<10|t-56320)+65536}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,t<128){if((e-=1)<0)break;s.push(t)}else if(t<2048){if((e-=2)<0)break;s.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;s.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;s.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return s}function he(r){const e=[];for(let t=0;t<r.length;++t)e.push(r.charCodeAt(t)&255);return e}function se(r,e){let t,i,n;const s=[];for(let l=0;l<r.length&&!((e-=2)<0);++l)t=r.charCodeAt(l),i=t>>8,n=t%256,s.push(n),s.push(i);return s}function k(r){return c.toByteArray(de(r))}function L(r,e,t,i){let n;for(n=0;n<i&&!(n+t>=e.length||n>=r.length);++n)e[n+t]=r[n];return n}function O(r,e){return r instanceof e||r!=null&&r.constructor!=null&&r.constructor.name!=null&&r.constructor.name===e.name}function z(r){return r!==r}const Z=(function(){const r="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){const i=t*16;for(let n=0;n<16;++n)e[i+n]=r[t]+r[n]}return e})();function P(r){return typeof BigInt>"u"?j:r}function j(){throw new Error("BigInt not supported")}})(De);var Xe={exports:{}};(function(p,c){ace.define("ace/ext/modelist",["require","exports","module"],function(u,h,f){var a=[];function d(G){for(var V=w.text,le=G.split(/[\/\\]/).pop(),q=0;q<a.length;q++)if(a[q].supportsFile(le)){V=a[q];break}return V}var o=(function(){function G(V,le,q){this.name=V,this.caption=le,this.mode="ace/mode/"+V,this.extensions=q;var ce;/\^/.test(q)?ce=q.replace(/\|(\^)?/g,function(N,ue){return"$|"+(ue?"^":"^.*\\.")})+"$":ce="\\.("+q+")$",this.extRe=new RegExp(ce,"gi")}return G.prototype.supportsFile=function(V){return V.match(this.extRe)},G})(),m={ABAP:["abap"],ABC:["abc"],ActionScript:["as"],ADA:["ada|adb"],Alda:["alda"],Apache_Conf:["^htaccess|^htgroups|^htpasswd|^conf|htaccess|htgroups|htpasswd"],Apex:["apex|cls|trigger|tgr"],AQL:["aql"],AsciiDoc:["asciidoc|adoc"],ASL:["dsl|asl|asl.json"],Assembly_ARM32:["s"],Assembly_x86:["asm|a"],Astro:["astro"],AutoHotKey:["ahk"],Basic:["bas|bak"],BatchFile:["bat|cmd"],BibTeX:["bib"],C_Cpp:["cpp|c|cc|cxx|h|hh|hpp|ino"],C9Search:["c9search_results"],Cedar:["cedar"],CedarSchema:["cedarschema"],Cirru:["cirru|cr"],Clojure:["clj|cljs"],Clue:["clue"],Cobol:["CBL|COB"],coffee:["coffee|cf|cson|^Cakefile"],ColdFusion:["cfm|cfc"],Crystal:["cr"],CSharp:["cs"],Csound_Document:["csd"],Csound_Orchestra:["orc"],Csound_Score:["sco"],CSS:["css"],CSV:["csv"],Curly:["curly"],Cuttlefish:["conf"],D:["d|di"],Dart:["dart"],Diff:["diff|patch"],Django:["djt|html.djt|dj.html|djhtml"],Dockerfile:["^Dockerfile"],Dot:["dot"],Drools:["drl"],Edifact:["edi"],Eiffel:["e|ge"],EJS:["ejs"],Elixir:["ex|exs"],Elm:["elm"],Erlang:["erl|hrl"],Flix:["flix"],Forth:["frt|fs|ldr|fth|4th"],Fortran:["f|f90"],FSharp:["fsi|fs|ml|mli|fsx|fsscript"],FSL:["fsl"],FTL:["ftl"],Gcode:["gcode"],Gherkin:["feature"],Gitignore:["^.gitignore"],Glsl:["glsl|frag|vert"],Gobstones:["gbs"],golang:["go"],GraphQLSchema:["gql"],GROQ:["groq"],Groovy:["groovy"],HAML:["haml"],Handlebars:["hbs|handlebars|tpl|mustache"],Haskell:["hs"],Haskell_Cabal:["cabal"],haXe:["hx"],Hjson:["hjson"],HTML:["html|htm|xhtml|we|wpy"],HTML_Elixir:["eex|html.eex"],HTML_Ruby:["erb|rhtml|html.erb"],INI:["ini|conf|cfg|prefs"],Io:["io"],Ion:["ion"],Jack:["jack"],Jade:["jade|pug"],Java:["java"],JavaScript:["js|jsm|cjs|mjs"],JEXL:["jexl"],JSON:["json"],JSON5:["json5"],JSONiq:["jq"],JSP:["jsp"],JSSM:["jssm|jssm_state"],JSX:["jsx"],Julia:["jl"],Kotlin:["kt|kts"],LaTeX:["tex|latex|ltx|bib"],Latte:["latte"],LESS:["less"],Liquid:["liquid"],Lisp:["lisp"],LiveScript:["ls"],LogiQL:["logic|lql"],Logtalk:["lgt"],LSL:["lsl"],Lua:["lua"],LuaPage:["lp"],Lucene:["lucene"],Makefile:["^Makefile|^GNUmakefile|^makefile|^OCamlMakefile|make"],Markdown:["md|markdown"],Mask:["mask"],MATLAB:["matlab"],Maze:["mz"],MediaWiki:["wiki|mediawiki"],MEL:["mel"],MIPS:["s|asm"],MIXAL:["mixal"],MUSHCode:["mc|mush"],MySQL:["mysql"],Mariadb:["mariadb"],Nasal:["nas"],Nginx:["nginx|conf"],Nim:["nim"],Nix:["nix"],NSIS:["nsi|nsh"],Nunjucks:["nunjucks|nunjs|nj|njk"],ObjectiveC:["m|mm"],OCaml:["ml|mli"],Odin:["odin"],PartiQL:["partiql|pql"],Pascal:["pas|p"],Perl:["pl|pm"],pgSQL:["pgsql"],PHP:["php|inc|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],PHP_Laravel_blade:["blade.php"],Pig:["pig"],PLSQL:["plsql"],Powershell:["ps1"],Praat:["praat|praatscript|psc|proc"],Prisma:["prisma"],Prolog:["plg|prolog"],Properties:["properties"],Protobuf:["proto"],PRQL:["prql"],Puppet:["epp|pp"],Python:["py"],QML:["qml"],R:["r"],Raku:["raku|rakumod|rakutest|p6|pl6|pm6"],Razor:["cshtml|asp"],RDoc:["Rd"],Red:["red|reds"],RHTML:["Rhtml"],Robot:["robot|resource"],RST:["rst"],Ruby:["rb|ru|gemspec|rake|^Guardfile|^Rakefile|^Gemfile"],Rust:["rs"],SaC:["sac"],SASS:["sass"],SCAD:["scad"],Scala:["scala|sbt"],Scheme:["scm|sm|rkt|oak|scheme"],Scrypt:["scrypt"],SCSS:["scss"],SH:["sh|bash|^.bashrc"],SJS:["sjs"],Slim:["slim|skim"],Smarty:["smarty|tpl"],Smithy:["smithy"],snippets:["snippets"],Soy_Template:["soy"],Space:["space"],SPARQL:["rq"],SQL:["sql"],SQLServer:["sqlserver"],Stylus:["styl|stylus"],SVG:["svg"],Swift:["swift"],Tcl:["tcl"],Terraform:["tf","tfvars","terragrunt"],Tex:["tex"],Text:["txt"],Textile:["textile"],Toml:["toml"],TSV:["tsv"],TSX:["tsx"],Turtle:["ttl"],Twig:["twig|swig"],Typescript:["ts|mts|cts|typescript|str"],Vala:["vala"],VBScript:["vbs|vb"],Velocity:["vm"],Verilog:["v|vh|sv|svh"],VHDL:["vhd|vhdl"],Visualforce:["vfp|component|page"],Vue:["vue"],Wollok:["wlk|wpgm|wtest"],XML:["xml|rdf|rss|wsdl|xslt|atom|mathml|mml|xul|xbl|xaml"],XQuery:["xq"],YAML:["yaml|yml"],Zeek:["zeek|bro"],Zig:["zig"]},S={ObjectiveC:"Objective-C",CSharp:"C#",golang:"Go",C_Cpp:"C and C++",Csound_Document:"Csound Document",Csound_Orchestra:"Csound",Csound_Score:"Csound Score",coffee:"CoffeeScript",HTML_Ruby:"HTML (Ruby)",HTML_Elixir:"HTML (Elixir)",FTL:"FreeMarker",PHP_Laravel_blade:"PHP (Blade Template)",Perl6:"Perl 6",AutoHotKey:"AutoHotkey / AutoIt"},w={};for(var g in m){var E=m[g],x=(S[g]||g).replace(/_/g," "),R=g.toLowerCase(),A=new o(R,x,E[0]);w[R]=A,a.push(A)}h.getModeForPath=d,h.modes=a,h.modesByName=w}),(function(){ace.require(["ace/ext/modelist"],function(u){p&&(p.exports=u)})})()})(Xe);const Ye=Te.require?Te.require("ace/ext/modelist"):Te.acequire("ace/ext/modelist");class je extends ee.FileViewerClass{constructor(c){super(c),Object.assign(this.state,{editing:!!this.props.formatEditFile||!1})}static getEditFile(c){switch(c){case"json":return"json";case"json5":return"json5";case"js":return"javascript";case"html":return"html";case"txt":return"html";default:return Ye.getModeForPath(`testFile.${c}`).mode.split("/").pop()}}writeFile64=()=>{const c=this.props.href.split("/"),u=this.state.editingValue;c.splice(0,2);const h=c[0],f=c.splice(1).join("/");this.props.socket.writeFile64(h,f,De.Buffer.from(u).toString("base64")).then(()=>this.props.onClose()).catch(a=>window.alert(`Cannot write file: ${a}`))};getEditorOrViewer(){return B.jsx(Ge,{mode:je.getEditFile(this.props.formatEditFile),themeType:this.props.themeType,value:this.state.editingValue||this.state.code||this.state.text,onChange:this.state.editing?c=>this.setState({editingValue:c,changed:!0}):void 0})}onSave(){this.writeFile64()}}const Ke=[{Owner:[{name:"read",valueNum:1024,title:"read owner"},{name:"write",valueNum:512,title:"write owner"}]},{Group:[{name:"read",valueNum:64,title:"read group"},{name:"write",valueNum:32,title:"write group"}]},{Everyone:[{name:"read",valueNum:4,title:"read everyone"},{name:"write",valueNum:2,title:"write everyone"}]}],Me=(p,c,u)=>(p|=c&u,p&=c|~u&65535,p),Ze=({value:p,setValue:c,t:u,differentValues:h,applyToChildren:f,mask:a,setMask:d,disabled:o})=>{M.useEffect(()=>{if(f){let S=0;for(let w=0;w<h.length;w++)S|=p^h[w];d(S)}else d(0)},[h,f,d,p]);let m=p;return B.jsx("div",{style:{display:"flex",width:"fit-content",margin:20,border:"1px solid",borderLeft:0},children:Ke.map(S=>{const w=Object.keys(S)[0];return B.jsxs("div",{style:{width:150,height:150,display:"flex",flexDirection:"column",alignItems:"center",borderLeft:"1px solid"},children:[B.jsx("div",{style:{height:50,display:"flex",alignItems:"center",fontSize:18,borderBottom:"1px solid silver",width:"100%",justifyContent:"center"},children:u(w)}),B.jsx("div",{style:{display:"flex",width:"100%"},children:S[w].map((g,E)=>{let x=!1;const R=a&g.valueNum;return m-g.valueNum>=0&&(m-=g.valueNum,x=!0),B.jsxs("div",{style:{display:"flex",flexDirection:"column",flex:1,alignItems:"center",borderRight:E===0?"1px solid":0},children:[B.jsx("div",{style:{height:50,borderBottom:"1px solid",width:"100%",justifyContent:"center",display:"flex",alignItems:"center",color:"silver"},children:u(g.name)}),B.jsx("div",{style:{height:50,display:"flex"},children:B.jsx(Be.Checkbox,{disabled:o,checked:x,color:R?"primary":"secondary",indeterminate:!!R,style:R?{opacity:.5}:void 0,onChange:A=>{R&&(a&=~g.valueNum&65535,d(a));let G=p;A.target.checked?G|=g.valueNum:G&=~g.valueNum&65535,c(G)}})})]},g.valueNum)})})]},w)})})};async function Pe(p,c,u){let h=c[p];if(!h){const f=p.split("/"),a=f.length,d=f.shift()||null,o=f.join("/"),m=await u.readDir(d,o);c[p]=[];for(let S=0;S<m.length;S++){const w=m[S],g={id:`${p}/${w.file}`,ext:Ne.getFileExtension(w.file),folder:w.isDir,name:w.file,size:w.stats&&w.stats.size,modified:w.modifiedAt,acl:w.acl,level:a};c[p].push(g)}h=c[p]}for(let f=0;f<h.length;f++){const a=h[f];a.folder&&await Pe(a.id,c,u)}}function et(p){const c={};return Object.keys(p).forEach(u=>{c[u]={folder:!0,id:u,level:0,name:u},p[u].forEach(h=>{c[h.id]=h})}),c}async function Re(p,c,u,h="",f="",a=0){if(typeof u=="string"&&(u=u.split("/"),a=0,h=u.shift()||"",f=""),!(u.length>=a))if(c[h+f]){if(u.length-1===a){const d=`${h+f}/${u[a]}`,o=c[h+f].find(m=>m.id===d);o&&o.folder&&await Pe(h+f,c,p);return}f+=`/${u[a]}`,await Re(p,c,u,h,f,a+1)}else{const d=await p.readDir(h||null,f);c[h+f]=[],d.forEach(o=>{const m={id:`${f}/${o.file}`,ext:Ne.getFileExtension(o.file),folder:o.isDir,name:o.file,size:o.stats&&o.stats.size,modified:o.modifiedAt,acl:o.acl,level:a};c[h+f].push(m)}),await Re(p,c,u,h,f,a+1)}}const Y="different",tt=({onClose:p,onApply:c,selected:u,applyChangesToObject:h,applyChangesToFile:f,objects:a,t:d,themeType:o,folders:m,socket:S,theme:w})=>{const g=u.substring(0,u.lastIndexOf("/"))||u,E=(u.split("/").length===1?m["/"].find(({id:I})=>I===u):m[g].find(({id:I})=>I===u))||{},[x,R]=M.useState(null),[A,G]=M.useState(null),[V,le]=M.useState([]),[q,ce]=M.useState([]),[N,ue]=M.useState(!1),[we,Ce]=M.useState(0),[re,Ee]=M.useState(null),[ae,Fe]=M.useState(!1),[fe,ye]=M.useState(!1),[Ae,_e]=M.useState([]),[Ie,be]=M.useState(0),[pe,Ue]=M.useState([]),[U,T]=M.useState(!0),[ie,xe]=M.useState(!1),ge=ee.I18n.getLanguage();return M.useEffect(()=>{const I=[],Q=E.id;let D=!1,W=!1,v=null,H=null,$=null;const J=[];let X=0;Re(S,m,Q).then(()=>{const oe=et(m),de=`${Q}/`;Object.keys(oe).forEach(k=>{var L,O,z,Z,P,j,r,e,t;if(k!=="/"&&(k===Q||k.startsWith(de))){if(!k.includes("/")&&a[k]){const i=a[k];X++,J.push(i),$===null&&((L=i.acl)==null?void 0:L.file)!==void 0&&($=i.acl.file),v===null&&((O=i.acl)==null?void 0:O.owner)!==void 0&&(v=i.acl.owner),H===null&&((z=i.acl)==null?void 0:z.ownerGroup)!==void 0&&(H=i.acl.ownerGroup),!ae&&v!==((Z=i.acl)==null?void 0:Z.owner)&&((P=i.acl)==null?void 0:P.owner)!==void 0&&(D=!0),!fe&&H!==((j=i.acl)==null?void 0:j.ownerGroup)&&((r=i.acl)==null?void 0:r.ownerGroup)!==void 0&&(W=!0),((e=i.acl)==null?void 0:e.file)!==void 0&&$!==((t=i.acl)==null?void 0:t.file)&&!I.includes(i.acl.file)&&I.push(i.acl.file)}else if(!oe[k].folder){X++;const i=oe[k];J.push(i),$===null&&i.acl.permissions!==void 0&&($=i.acl.permissions),v===null&&i.acl.owner!==void 0&&(v=i.acl.owner),H===null&&i.acl.ownerGroup!==void 0&&(H=i.acl.ownerGroup),!ae&&v!==i.acl.owner&&i.acl.owner!==void 0&&(D=!0),!fe&&H!==i.acl.ownerGroup&&i.acl.ownerGroup!==void 0&&(W=!0),i.acl.permissions!==void 0&&$!==i.acl.permissions&&!I.includes(i.acl.permissions)&&I.push(i.acl.permissions)}}});const ne=[],he=[];Object.keys(a).forEach(k=>{const L=a[k];k.startsWith("system.group.")&&(L==null?void 0:L.type)==="group"?he.push(L):k.startsWith("system.user.")&&(L==null?void 0:L.type)==="user"&&ne.push(L)});const se=a["system.config"].common.defaultNewAcl;v=v||se.owner,H=H||se.ownerGroup,$=$||se.file,Ee($),R(v),G(H),Fe(D),ye(W),le(ne),ce(he),E!=null&&E.folder&&ue(!0),Ce(X),_e(I),Ue(J)})},[a,u]),M.useEffect(()=>{var I,Q,D,W;N?(ae&&x!==Y&&R(Y),fe&&A!==Y&&G(Y)):(x&&x===Y&&R(((Q=(I=a[u])==null?void 0:I.acl)==null?void 0:Q.owner)||null),A&&A===Y&&G(((W=(D=a[u])==null?void 0:D.acl)==null?void 0:W.ownerGroup)||null)),console.log(`stateOwnerUser ${x}`)},[N,x,A,ae,fe]),pe.length?B.jsx(ve,{theme:w,titleButtonApply:"apply",overflowHidden:!0,disableApply:U,progress:ie,onClose:p,onApply:()=>{xe(!0),setTimeout(async()=>{var Q,D,W,v,H,$,J,X,oe,de,ne,he,se,k,L,O;const I=((D=(Q=a["system.config"].common)==null?void 0:Q.defaultNewAcl)==null?void 0:D.file)||1636;if(N){const z=~Ie&65535;for(let Z=0;Z<pe.length;Z++){const P=pe[Z];let j=!1;const r=P,e=P;if(r._id){const t=Me(((oe=r.acl)==null?void 0:oe.file)||I,re,z);t!==((de=r.acl)==null?void 0:de.file)&&(r.acl=r.acl||{},r.acl.file=t,j=!0),x!==Y&&x!==((ne=r.acl)==null?void 0:ne.owner)&&(r.acl=r.acl||{},r.acl.owner=x,j=!0),A!==Y&&A!==((he=r.acl)==null?void 0:he.ownerGroup)&&(r.acl=r.acl||{},r.acl.ownerGroup=A,j=!0);try{j&&await h(r)}catch(i){console.error(i)}}else if(e&&!e.folder){const t={},i=Me(((se=e.acl)==null?void 0:se.permissions)||I,re,z);if(i!==((k=e.acl)==null?void 0:k.permissions)&&(t.permissions=i,j=!0),x!==Y&&x!==((L=e.acl)==null?void 0:L.owner)&&(t.owner=x,j=!0),A!==Y&&A!==((O=e.acl)==null?void 0:O.ownerGroup)&&(t.ownerGroup=A,j=!0),j){const n=e.id.split("/"),s=n.shift(),l=n.join("/");try{await f(s,l,t)}catch(y){console.error(y)}}}}}else{const z=E.id.split("/"),Z=z.shift(),P=z.join("/"),j={};let r=!1;if(!E.folder)((W=E.acl)==null?void 0:W.permissions)!==re&&(j.permissions=re,r=!0),((v=E.acl)==null?void 0:v.owner)!==x&&(j.owner=x,r=!0),((H=E.acl)==null?void 0:H.ownerGroup)!==A&&(j.ownerGroup=A,r=!0),r&&await f(Z,P,j);else if(!z.length&&a[E.id]){const e=a[E.id];(($=e.acl)==null?void 0:$.file)!==re&&(e.acl=e.acl||{},e.acl.file=re,r=!0),((J=e.acl)==null?void 0:J.owner)!==x&&(e.acl=e.acl||{},e.acl.owner=x,r=!0),((X=e.acl)==null?void 0:X.ownerGroup)!==A&&(e.acl=e.acl||{},e.acl.ownerGroup=A,r=!0),r&&await h(e)}}xe(!1),c()},200)},children:B.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[B.jsx("div",{style:{margin:10,fontSize:20},children:d("Access control list: %s",u)}),B.jsxs("div",{style:{display:"flex"},children:[B.jsx(ee.SelectWithIcon,{fullWidth:!0,style:{marginRight:10},label:d("Owner user"),lang:ge,list:V,t:d,disabled:ie,value:x||void 0,themeType:o,different:ae?Y:!1,onChange:I=>{Fe(!1),R(I),T(!1)}}),B.jsx(ee.SelectWithIcon,{fullWidth:!0,label:d("Owner group"),lang:ge,list:q,t:d,disabled:ie,value:A||void 0,themeType:o,different:fe?Y:!1,onChange:I=>{ye(!1),G(I),T(!1)}})]}),B.jsxs("div",{style:{display:"flex",margin:10,alignItems:"center",fontSize:10,marginLeft:0,color:"silver"},children:[B.jsx("div",{style:!E.folder||!N?{color:"green"}:void 0,children:d("to apply one item")}),B.jsx(Be.Switch,{disabled:pe.length===1||ie,checked:!a[E.id]&&!!E.folder||N,onChange:I=>{ue(I.target.checked),T(!1)},color:"primary"}),B.jsxs("div",{style:E.folder||N?{color:"green"}:void 0,children:[d("to apply with children")," ",E.folder||we>1?`(${we} ${d("object(s)")})`:""]})]}),ie&&B.jsx(Be.LinearProgress,{}),B.jsx("div",{style:{overflowY:"auto"},children:B.jsxs("div",{children:[B.jsx("h2",{children:d("File rights")}),B.jsx(Ze,{disabled:ie,mask:Ie,setMask:be,applyToChildren:N,differentValues:Ae,t:d,setValue:I=>{Ee(I),T(!1)},value:re})]})})]})}):B.jsx(Be.LinearProgress,{})};class Lt extends M.Component{t;wordCache;objects;constructor(c){super(c),this.t=this.translate,this.wordCache={},this.objects={}}componentDidMount(){this.props.socket.getObjects(!0,!0).then(c=>this.objects=c)}translate=(c,u,h)=>u!==void 0?this.props.t(c,u,h):(this.wordCache[c]||(this.wordCache[c]=this.props.t(c)),this.wordCache[c]);renderAclDialog(c){return B.jsx(tt,{theme:this.props.theme,themeType:this.props.themeType,applyChangesToObject:async u=>{const h=await this.props.socket.getObject(u._id);h.acl=u.acl,await this.props.socket.setObject(h._id,h);const f=h;f!=null&&f.acl&&c.updateItemsAcl([{id:f._id,acl:f.acl,level:0,name:f._id,folder:!1}])},applyChangesToFile:async(u,h,f)=>{let a;if((f.owner||f.ownerGroup)&&f.permissions?(await this.props.socket.chownFile(u,h,{owner:f.owner,ownerGroup:f.ownerGroup}),a=await this.props.socket.chmodFile(u,h,{mode:f.permissions})):f.permissions?a=await this.props.socket.chmodFile(u,h,{mode:f.permissions}):(f.owner||f.ownerGroup)&&(a=await this.props.socket.chownFile(u,h,{owner:f.owner,ownerGroup:f.ownerGroup})),Array.isArray(a))for(let d=0;d<a.length;d++){const o=a[d];o&&o.file&&o.acl&&c.updateItemsAcl([{id:`${u}/${o.path?`${o.path}/`:""}${o.file}`,acl:o.acl,level:0,name:"",folder:!1}])}},selected:c.state.selected,folders:c.state.folders,objects:this.objects,socket:this.props.socket,t:this.t,onClose:()=>c.setState({modalEditOfAccess:!1}),onApply:()=>c.setState({modalEditOfAccess:!1})})}render(){if(!this.props.ready)return B.jsx(Be.LinearProgress,{});const c=ee.Router.getLocation(),u=c.tab==="tab-files"&&c.id?{mode:c.dialog==="view"?"view":"select",id:c.id}:null;return B.jsx(ee.TabContainer,{children:B.jsx(ee.TabContent,{overflow:"auto",children:B.jsx(ee.FileBrowser,{navigateTo:u,onNavigateTo:h=>{h!=null&&h.id?ee.Router.doNavigate("tab-files",h.mode,encodeURIComponent(h.id)):ee.Router.doNavigate("tab-files")},showViewTypeButton:!0,ready:this.props.ready,socket:this.props.socket,themeType:this.props.themeType,theme:this.props.theme,lang:this.props.lang,t:this.props.t,showToolbar:!0,allowUpload:!0,allowView:!0,allowDownload:!0,allowCreateFolder:!0,allowDelete:!0,expertMode:this.props.expertMode,modalEditOfAccessControl:h=>this.renderAclDialog(h),FileViewer:je})})})}}export{Lt as default};
|