iobroker.eos-admin 7.9.53 → 7.9.54
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.js +1 -1
- package/adminWww/assets/Adapters-B5_jQ7DE.js +1 -1
- package/adminWww/assets/Config-hHK2UzGP.js +1 -1
- package/adminWww/assets/CustomTab-B0wqoazH.js +1 -1
- package/adminWww/assets/DeviceManager-BFmQeYQ1.js +1 -1
- package/adminWww/assets/EasyMode-B1d9Vdc4.js +1 -1
- package/adminWww/assets/Enums-DbWYxKOo.js +1 -1
- package/adminWww/assets/Fields-CX3rKuWb.js +1 -1
- package/adminWww/assets/Files-Cd2HOzIE.js +1 -1
- package/adminWww/assets/Hosts-Bg8QzW5i.js +1 -1
- package/adminWww/assets/Instances-YdaGnS5a.js +1 -1
- package/adminWww/assets/Intro-DkwRiz1n.js +1 -1
- package/adminWww/assets/Logs-CsVPSLJH.js +1 -1
- package/adminWww/assets/Objects-DPan0bzw-v54.js +878 -0
- package/adminWww/assets/Objects-DPan0bzw.js +3 -3
- package/adminWww/assets/Users-BgnBRgwU.js +1 -1
- package/adminWww/assets/bootstrap-COulQZax-v54.js +317 -0
- package/adminWww/assets/bootstrap-COulQZax.js +2 -2
- package/adminWww/assets/hostInit-v54.js +2 -0
- package/adminWww/assets/index-CQZugZ1z.js +2 -2
- package/adminWww/assets/index-D2ymscJA-v54.js +950 -0
- package/adminWww/assets/index-D2ymscJA.js +2 -2
- package/adminWww/index.html +8 -9
- package/adminWww/js/eos-branding.js +3 -28
- package/adminWww/js/eos-objects-state-tools.js +6 -17
- package/adminWww/js/eos-role-ui.js +2 -10
- package/adminWww/js/eos-security-ui.js +5 -13
- package/adminWww/mf-manifest.json +1 -1
- package/adminWww/remoteEntry-v54.js +2 -0
- package/adminWww/remoteEntry.js +2 -2
- package/build/main.js +0 -58
- package/io-package.json +7 -15
- package/package.json +1 -1
|
@@ -1 +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.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};
|
|
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-v54.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./DefaultPropsProvider-BiXBMQYQ.js";import{i as T,a as $}from"./iobroker_admin__loadShare__react__loadShare__-LM7uyL45.js";import{i as o,a as y}from"./iobroker_admin__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-CJO5yP3h.js";import{i as h}from"./iobroker_admin__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-LFZoiUTt.js";import{m as tt,n as pt,E as dt,b as z,s as ct,S as st}from"./bootstrap-COulQZax.js";import{G as it}from"./iconBase-2IlPecPg.js";import{A as ut}from"./AdapterUpdateDialog-BMg84Hpf.js";import{g as mt}from"./_commonjsHelpers-CE1G-McA.js";import{C as xt}from"./CustomModal-CqDLqryN.js";import{q as at,v as gt,g as ft}from"./createTheme-DFX8CY6F.js";import{a as yt}from"./amber-D7aVlNg3.js";import{b as bt}from"./blue-CagzI6CQ.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"./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"./index-DcK0RDrH.js";import"./ThemeProvider-BOFFjWAF.js";import"./emotion-cache.browser.esm-BgJfNZJN.js";import"./setYear-3ufv5yRD.js";import"./en-US-DBFJNIH6.js";import"./zh-cn-nUtvS7Wc.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./State-qCI8JACH.js";function vt(u){return it({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.293 9.293 12 13.586 7.707 9.293l-1.414 1.414L12 16.414l5.707-5.707z"},child:[]}]})(u)}function jt(u){return it({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m6.293 13.293 1.414 1.414L12 10.414l4.293 4.293 1.414-1.414L12 7.586z"},child:[]}]})(u)}var et={exports:{}},Ct=et.exports;(function(u){(function(t){const s="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${s}\\.${s}\\.${s}\\.${s}$`,"i"),threeOctet:new RegExp(`^${s}\\.${s}\\.${s}$`,"i"),twoOctet:new RegExp(`^${s}\\.${s}$`,"i"),longValue:new RegExp(`^${s}$`,"i")},p=new RegExp("^0[0-7]+$","i"),b=new RegExp("^0x[a-f0-9]+$","i"),g="%[0-9a-z]{1,}",k="(?:[0-9a-f]+::?)+",F={zoneIndex:new RegExp(g,"i"),native:new RegExp(`^(::)?(${k})?([0-9a-f]+)?(::)?(${g})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${s}\\.${s}\\.${s}\\.${s}(${g})?)$`,"i"),transitional:new RegExp(`^((?:${k})|(?:::)(?:${k})?)${s}\\.${s}\\.${s}\\.${s}(${g})?$`,"i")};function H(n,i){if(n.indexOf("::")!==n.lastIndexOf("::"))return null;let l=0,a=-1,d=(n.match(F.zoneIndex)||[])[0],c,C;for(d&&(d=d.substring(1),n=n.replace(/%.+$/,""));(a=n.indexOf(":",a+1))>=0;)l++;if(n.substr(0,2)==="::"&&l--,n.substr(-2,2)==="::"&&l--,l>i)return null;for(C=i-l,c=":";C--;)c+="0:";return n=n.replace("::",c),n[0]===":"&&(n=n.slice(1)),n[n.length-1]===":"&&(n=n.slice(0,-1)),i=(function(){const M=n.split(":"),J=[];for(let N=0;N<M.length;N++)J.push(parseInt(M[N],16));return J})(),{parts:i,zoneId:d}}function D(n,i,l,a){if(n.length!==i.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let d=0,c;for(;a>0;){if(c=l-a,c<0&&(c=0),n[d]>>c!==i[d]>>c)return!1;a-=l,d+=1}return!0}function L(n){if(b.test(n))return parseInt(n,16);if(n[0]==="0"&&!isNaN(parseInt(n[1],10))){if(p.test(n))return parseInt(n,8);throw new Error(`ipaddr: cannot parse ${n} as octal`)}return parseInt(n,10)}function X(n,i){for(;n.length<i;)n=`0${n}`;return n}const m={};m.IPv4=(function(){function n(i){if(i.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let l,a;for(l=0;l<i.length;l++)if(a=i[l],!(0<=a&&a<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=i}return n.prototype.SpecialRanges={unspecified:[[new n([0,0,0,0]),8]],broadcast:[[new n([255,255,255,255]),32]],multicast:[[new n([224,0,0,0]),4]],linkLocal:[[new n([169,254,0,0]),16]],loopback:[[new n([127,0,0,0]),8]],carrierGradeNat:[[new n([100,64,0,0]),10]],private:[[new n([10,0,0,0]),8],[new n([172,16,0,0]),12],[new n([192,168,0,0]),16]],reserved:[[new n([192,0,0,0]),24],[new n([192,0,2,0]),24],[new n([192,88,99,0]),24],[new n([198,18,0,0]),15],[new n([198,51,100,0]),24],[new n([203,0,113,0]),24],[new n([240,0,0,0]),4]],as112:[[new n([192,175,48,0]),24],[new n([192,31,196,0]),24]],amt:[[new n([192,52,193,0]),24]]},n.prototype.kind=function(){return"ipv4"},n.prototype.match=function(i,l){let a;if(l===void 0&&(a=i,i=a[0],l=a[1]),i.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return D(this.octets,i.octets,8,l)},n.prototype.prefixLengthFromSubnetMask=function(){let i=0,l=!1;const a={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let d,c,C;for(d=3;d>=0;d-=1)if(c=this.octets[d],c in a){if(C=a[c],l&&C!==0)return null;C!==8&&(l=!0),i+=C}else return null;return 32-i},n.prototype.range=function(){return m.subnetMatch(this,this.SpecialRanges)},n.prototype.toByteArray=function(){return this.octets.slice(0)},n.prototype.toIPv4MappedAddress=function(){return m.IPv6.parse(`::ffff:${this.toString()}`)},n.prototype.toNormalizedString=function(){return this.toString()},n.prototype.toString=function(){return this.octets.join(".")},n})(),m.IPv4.broadcastAddressFromCIDR=function(n){try{const i=this.parseCIDR(n),l=i[0].toByteArray(),a=this.subnetMaskFromPrefixLength(i[1]).toByteArray(),d=[];let c=0;for(;c<4;)d.push(parseInt(l[c],10)|parseInt(a[c],10)^255),c++;return new this(d)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},m.IPv4.isIPv4=function(n){return this.parser(n)!==null},m.IPv4.isValid=function(n){try{return new this(this.parser(n)),!0}catch{return!1}},m.IPv4.isValidCIDR=function(n){try{return this.parseCIDR(n),!0}catch{return!1}},m.IPv4.isValidFourPartDecimal=function(n){return!!(m.IPv4.isValid(n)&&n.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},m.IPv4.isValidCIDRFourPartDecimal=function(n){const i=n.match(/^(.+)\/(\d+)$/);return!m.IPv4.isValidCIDR(n)||!i?!1:m.IPv4.isValidFourPartDecimal(i[1])},m.IPv4.networkAddressFromCIDR=function(n){let i,l,a,d,c;try{for(i=this.parseCIDR(n),a=i[0].toByteArray(),c=this.subnetMaskFromPrefixLength(i[1]).toByteArray(),d=[],l=0;l<4;)d.push(parseInt(a[l],10)&parseInt(c[l],10)),l++;return new this(d)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},m.IPv4.parse=function(n){const i=this.parser(n);if(i===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(i)},m.IPv4.parseCIDR=function(n){let i;if(i=n.match(/^(.+)\/(\d+)$/)){const l=parseInt(i[2]);if(l>=0&&l<=32){const a=[this.parse(i[1]),l];return Object.defineProperty(a,"toString",{value:function(){return this.join("/")}}),a}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},m.IPv4.parser=function(n){let i,l,a;if(i=n.match(r.fourOctet))return(function(){const d=i.slice(1,6),c=[];for(let C=0;C<d.length;C++)l=d[C],c.push(L(l));return c})();if(i=n.match(r.longValue)){if(a=L(i[1]),a>4294967295||a<0)throw new Error("ipaddr: address outside defined range");return(function(){const d=[];let c;for(c=0;c<=24;c+=8)d.push(a>>c&255);return d})().reverse()}else return(i=n.match(r.twoOctet))?(function(){const d=i.slice(1,4),c=[];if(a=L(d[1]),a>16777215||a<0)throw new Error("ipaddr: address outside defined range");return c.push(L(d[0])),c.push(a>>16&255),c.push(a>>8&255),c.push(a&255),c})():(i=n.match(r.threeOctet))?(function(){const d=i.slice(1,5),c=[];if(a=L(d[2]),a>65535||a<0)throw new Error("ipaddr: address outside defined range");return c.push(L(d[0])),c.push(L(d[1])),c.push(a>>8&255),c.push(a&255),c})():null},m.IPv4.subnetMaskFromPrefixLength=function(n){if(n=parseInt(n),n<0||n>32)throw new Error("ipaddr: invalid IPv4 prefix length");const i=[0,0,0,0];let l=0;const a=Math.floor(n/8);for(;l<a;)i[l]=255,l++;return a<4&&(i[a]=Math.pow(2,n%8)-1<<8-n%8),new this(i)},m.IPv6=(function(){function n(i,l){let a,d;if(i.length===16)for(this.parts=[],a=0;a<=14;a+=2)this.parts.push(i[a]<<8|i[a+1]);else if(i.length===8)this.parts=i;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(a=0;a<this.parts.length;a++)if(d=this.parts[a],!(0<=d&&d<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");l&&(this.zoneId=l)}return n.prototype.SpecialRanges={unspecified:[new n([0,0,0,0,0,0,0,0]),128],linkLocal:[new n([65152,0,0,0,0,0,0,0]),10],multicast:[new n([65280,0,0,0,0,0,0,0]),8],loopback:[new n([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new n([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new n([0,0,0,0,0,65535,0,0]),96],discard:[new n([256,0,0,0,0,0,0,0]),64],rfc6145:[new n([0,0,0,0,65535,0,0,0]),96],rfc6052:[new n([100,65435,0,0,0,0,0,0]),96],"6to4":[new n([8194,0,0,0,0,0,0,0]),16],teredo:[new n([8193,0,0,0,0,0,0,0]),32],benchmarking:[new n([8193,2,0,0,0,0,0,0]),48],amt:[new n([8193,3,0,0,0,0,0,0]),32],as112v6:[[new n([8193,4,274,0,0,0,0,0]),48],[new n([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new n([8193,16,0,0,0,0,0,0]),28],orchid2:[new n([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new n([8193,48,0,0,0,0,0,0]),28],reserved:[[new n([8193,0,0,0,0,0,0,0]),23],[new n([8193,3512,0,0,0,0,0,0]),32]]},n.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},n.prototype.kind=function(){return"ipv6"},n.prototype.match=function(i,l){let a;if(l===void 0&&(a=i,i=a[0],l=a[1]),i.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return D(this.parts,i.parts,16,l)},n.prototype.prefixLengthFromSubnetMask=function(){let i=0,l=!1;const a={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let d,c;for(let C=7;C>=0;C-=1)if(d=this.parts[C],d in a){if(c=a[d],l&&c!==0)return null;c!==16&&(l=!0),i+=c}else return null;return 128-i},n.prototype.range=function(){return m.subnetMatch(this,this.SpecialRanges)},n.prototype.toByteArray=function(){let i;const l=[],a=this.parts;for(let d=0;d<a.length;d++)i=a[d],l.push(i>>8),l.push(i&255);return l},n.prototype.toFixedLengthString=function(){const i=(function(){const a=[];for(let d=0;d<this.parts.length;d++)a.push(X(this.parts[d].toString(16),4));return a}).call(this).join(":");let l="";return this.zoneId&&(l=`%${this.zoneId}`),i+l},n.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const i=this.parts.slice(-2),l=i[0],a=i[1];return new m.IPv4([l>>8,l&255,a>>8,a&255])},n.prototype.toNormalizedString=function(){const i=(function(){const a=[];for(let d=0;d<this.parts.length;d++)a.push(this.parts[d].toString(16));return a}).call(this).join(":");let l="";return this.zoneId&&(l=`%${this.zoneId}`),i+l},n.prototype.toRFC5952String=function(){const i=/((^|:)(0(:|$)){2,})/g,l=this.toNormalizedString();let a=0,d=-1,c;for(;c=i.exec(l);)c[0].length>d&&(a=c.index,d=c[0].length);return d<0?l:`${l.substring(0,a)}::${l.substring(a+d)}`},n.prototype.toString=function(){return this.toRFC5952String()},n})(),m.IPv6.broadcastAddressFromCIDR=function(n){try{const i=this.parseCIDR(n),l=i[0].toByteArray(),a=this.subnetMaskFromPrefixLength(i[1]).toByteArray(),d=[];let c=0;for(;c<16;)d.push(parseInt(l[c],10)|parseInt(a[c],10)^255),c++;return new this(d)}catch(i){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${i})`)}},m.IPv6.isIPv6=function(n){return this.parser(n)!==null},m.IPv6.isValid=function(n){if(typeof n=="string"&&n.indexOf(":")===-1)return!1;try{const i=this.parser(n);return new this(i.parts,i.zoneId),!0}catch{return!1}},m.IPv6.isValidCIDR=function(n){if(typeof n=="string"&&n.indexOf(":")===-1)return!1;try{return this.parseCIDR(n),!0}catch{return!1}},m.IPv6.networkAddressFromCIDR=function(n){let i,l,a,d,c;try{for(i=this.parseCIDR(n),a=i[0].toByteArray(),c=this.subnetMaskFromPrefixLength(i[1]).toByteArray(),d=[],l=0;l<16;)d.push(parseInt(a[l],10)&parseInt(c[l],10)),l++;return new this(d)}catch(C){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${C})`)}},m.IPv6.parse=function(n){const i=this.parser(n);if(i.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(i.parts,i.zoneId)},m.IPv6.parseCIDR=function(n){let i,l,a;if((l=n.match(/^(.+)\/(\d+)$/))&&(i=parseInt(l[2]),i>=0&&i<=128))return a=[this.parse(l[1]),i],Object.defineProperty(a,"toString",{value:function(){return this.join("/")}}),a;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},m.IPv6.parser=function(n){let i,l,a,d,c,C;if(a=n.match(F.deprecatedTransitional))return this.parser(`::ffff:${a[1]}`);if(F.native.test(n))return H(n,8);if((a=n.match(F.transitional))&&(C=a[6]||"",i=a[1],a[1].endsWith("::")||(i=i.slice(0,-1)),i=H(i+C,6),i.parts)){for(c=[parseInt(a[2]),parseInt(a[3]),parseInt(a[4]),parseInt(a[5])],l=0;l<c.length;l++)if(d=c[l],!(0<=d&&d<=255))return null;return i.parts.push(c[0]<<8|c[1]),i.parts.push(c[2]<<8|c[3]),{parts:i.parts,zoneId:i.zoneId}}return null},m.IPv6.subnetMaskFromPrefixLength=function(n){if(n=parseInt(n),n<0||n>128)throw new Error("ipaddr: invalid IPv6 prefix length");const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let l=0;const a=Math.floor(n/8);for(;l<a;)i[l]=255,l++;return a<16&&(i[a]=Math.pow(2,n%8)-1<<8-n%8),new this(i)},m.fromByteArray=function(n){const i=n.length;if(i===4)return new m.IPv4(n);if(i===16)return new m.IPv6(n);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},m.isValid=function(n){return m.IPv6.isValid(n)||m.IPv4.isValid(n)},m.isValidCIDR=function(n){return m.IPv6.isValidCIDR(n)||m.IPv4.isValidCIDR(n)},m.parse=function(n){if(m.IPv6.isValid(n))return m.IPv6.parse(n);if(m.IPv4.isValid(n))return m.IPv4.parse(n);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},m.parseCIDR=function(n){try{return m.IPv6.parseCIDR(n)}catch{try{return m.IPv4.parseCIDR(n)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},m.process=function(n){const i=this.parse(n);return i.kind()==="ipv6"&&i.isIPv4MappedAddress()?i.toIPv4Address():i},m.subnetMatch=function(n,i,l){let a,d,c,C;l==null&&(l="unicast");for(d in i)if(Object.prototype.hasOwnProperty.call(i,d)){for(c=i[d],c[0]&&!(c[0]instanceof Array)&&(c=[c]),a=0;a<c.length;a++)if(C=c[a],n.kind()===C[0].kind()&&n.match.apply(n,C))return d}return l},u.exports?u.exports=m:t.ipaddr=m})(Ct)})(et);var It=et.exports;const ot=mt(It);class St extends T.Component{updating=!1;textareaRef=$.createRef();link=`${window.location.protocol}//${window.location.host}/`;interval;startTimeout;constructor(t){super(t),this.state={response:null,error:null,starting:!0}}setUpdating(t){this.updating!==t&&(this.updating=t,this.props.onUpdating(t))}async findIpAddress(){var b,g,k,F;if((await this.props.socket.getObject(`system.adapter.${this.props.adminInstance}`)).common.host===this.props.hostId)return;const s=await this.props.socket.getObject(this.props.hostId),r=await this.props.socket.readBaseSettings(this.props.hostId);let p=(g=(b=r==null?void 0:r.config)==null?void 0:b.objects)==null?void 0:g.host;if(!(!p||p==="localhost")&&(p=ot.parse(Array.isArray(p)?p[0]:p).toString(),!!((F=(k=s==null?void 0:s.native)==null?void 0:k.hardware)!=null&&F.networkInterfaces)))for(const H of Object.values(s.native.hardware.networkInterfaces))H.find(D=>{try{const L=ot.parseCIDR(D.cidr).toString();D.internal===!1&&p.match(L)&&(this.link=`${window.location.protocol}//${D.family==="IPv6"?`[${D.address}]`:D.address}:${window.location.port}`)}catch{}return!1})}async componentDidMount(){try{await this.findIpAddress()}catch(t){console.error(`Cannot find ip address: ${t.message}`)}try{await this.props.socket.upgradeController(this.props.hostId,this.props.version,parseInt(this.props.adminInstance.split(".").pop(),10))}catch(t){console.error(`Cannot update controller: ${t.message}`),this.setState({error:h.I18n.t("Not updatable"),starting:!1}),this.setUpdating(!1);return}this.setUpdating(!0),this.interval=setInterval(()=>this.checkStatus(),1e3),this.startTimeout=setTimeout(()=>{this.startTimeout=null,this.setState({starting:!1})},1e4)}componentWillUnmount(){this.interval&&(clearInterval(this.interval),this.interval=null),this.startTimeout&&(clearTimeout(this.startTimeout),this.startTimeout=null)}async checkStatus(){console.log(`Request update status from: ${this.link}`);try{const s=await(await fetch(this.link)).text();console.log(`Received status: ${s}`);const r=JSON.parse(s);r!=null&&r.stderr&&(r.stderr=r.stderr.filter(p=>p.trim())),r&&!r.running&&r.success&&r.stdout?(r.stdout.push(""),r.stdout.push("---------------------------------------------------"),r.stdout.push(h.I18n.t("%s was successfully updated to %s","js-controller",this.props.version))):r!=null&&r.stdout&&(r.stdout.unshift(""),r.stdout.unshift("---------------------------------------------------"),r.stdout.unshift(h.I18n.t("updating %s to %s...","js-controller",this.props.version))),this.setState({response:r,error:null},()=>{r&&!r.running?(this.setUpdating(!1),this.interval&&(clearInterval(this.interval),this.interval=null)):r!=null&&r.running&&this.setUpdating(!0),this.textareaRef.current&&setTimeout(()=>this.textareaRef.current.scrollTop=this.textareaRef.current.scrollHeight,100)})}catch(t){this.state.starting||this.setState({error:t.toString()},()=>this.setUpdating(!1))}}render(){var t,s,r,p,b;return e.jsxs(o.Dialog,{onClose:(g,k)=>{k!=="escapeKeyDown"&&k!=="backdropClick"&&this.props.onClose()},open:!0,maxWidth:"lg",fullWidth:!0,children:[e.jsx(o.DialogTitle,{children:h.I18n.t("Updating %s...","js-controller")}),e.jsxs(o.DialogContent,{style:{height:400,padding:"0 20px",overflow:"hidden"},children:[(!this.state.response||this.state.response.running)&&!this.state.error?e.jsx(o.LinearProgress,{}):null,this.state.response||this.state.error?e.jsx("textarea",{ref:this.textareaRef,style:{width:"100%",height:"100%",resize:"none",background:this.props.themeType==="dark"?"#000":"#fff",color:this.props.themeType==="dark"?"#EEE":"#111",boxSizing:"border-box",fontFamily:"Consolas,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New, monospace",border:(t=this.state.response)!=null&&t.success?"2px solid green":this.state.error||this.state.response&&!this.state.response.running&&!this.state.response.success?"2px solid red":void 0},value:this.state.error?this.state.error:this.state.response.stderr&&this.state.response.stderr.length?this.state.response.stderr.join(`
|
|
1
|
+
import{j as e}from"./DefaultPropsProvider-BiXBMQYQ.js";import{i as T,a as $}from"./iobroker_admin__loadShare__react__loadShare__-LM7uyL45.js";import{i as o,a as y}from"./iobroker_admin__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-CJO5yP3h.js";import{i as h}from"./iobroker_admin__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-LFZoiUTt.js";import{m as tt,n as pt,E as dt,b as z,s as ct,S as st}from"./bootstrap-COulQZax-v54.js";import{G as it}from"./iconBase-2IlPecPg.js";import{A as ut}from"./AdapterUpdateDialog-BMg84Hpf.js";import{g as mt}from"./_commonjsHelpers-CE1G-McA.js";import{C as xt}from"./CustomModal-CqDLqryN.js";import{q as at,v as gt,g as ft}from"./createTheme-DFX8CY6F.js";import{a as yt}from"./amber-D7aVlNg3.js";import{b as bt}from"./blue-CagzI6CQ.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"./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"./index-DcK0RDrH.js";import"./ThemeProvider-BOFFjWAF.js";import"./emotion-cache.browser.esm-BgJfNZJN.js";import"./setYear-3ufv5yRD.js";import"./en-US-DBFJNIH6.js";import"./zh-cn-nUtvS7Wc.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";import"./State-qCI8JACH.js";function vt(u){return it({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M16.293 9.293 12 13.586 7.707 9.293l-1.414 1.414L12 16.414l5.707-5.707z"},child:[]}]})(u)}function jt(u){return it({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"m6.293 13.293 1.414 1.414L12 10.414l4.293 4.293 1.414-1.414L12 7.586z"},child:[]}]})(u)}var et={exports:{}},Ct=et.exports;(function(u){(function(t){const s="(0?\\d+|0x[a-f0-9]+)",r={fourOctet:new RegExp(`^${s}\\.${s}\\.${s}\\.${s}$`,"i"),threeOctet:new RegExp(`^${s}\\.${s}\\.${s}$`,"i"),twoOctet:new RegExp(`^${s}\\.${s}$`,"i"),longValue:new RegExp(`^${s}$`,"i")},p=new RegExp("^0[0-7]+$","i"),b=new RegExp("^0x[a-f0-9]+$","i"),g="%[0-9a-z]{1,}",k="(?:[0-9a-f]+::?)+",F={zoneIndex:new RegExp(g,"i"),native:new RegExp(`^(::)?(${k})?([0-9a-f]+)?(::)?(${g})?$`,"i"),deprecatedTransitional:new RegExp(`^(?:::)(${s}\\.${s}\\.${s}\\.${s}(${g})?)$`,"i"),transitional:new RegExp(`^((?:${k})|(?:::)(?:${k})?)${s}\\.${s}\\.${s}\\.${s}(${g})?$`,"i")};function H(n,i){if(n.indexOf("::")!==n.lastIndexOf("::"))return null;let l=0,a=-1,d=(n.match(F.zoneIndex)||[])[0],c,C;for(d&&(d=d.substring(1),n=n.replace(/%.+$/,""));(a=n.indexOf(":",a+1))>=0;)l++;if(n.substr(0,2)==="::"&&l--,n.substr(-2,2)==="::"&&l--,l>i)return null;for(C=i-l,c=":";C--;)c+="0:";return n=n.replace("::",c),n[0]===":"&&(n=n.slice(1)),n[n.length-1]===":"&&(n=n.slice(0,-1)),i=(function(){const M=n.split(":"),J=[];for(let N=0;N<M.length;N++)J.push(parseInt(M[N],16));return J})(),{parts:i,zoneId:d}}function D(n,i,l,a){if(n.length!==i.length)throw new Error("ipaddr: cannot match CIDR for objects with different lengths");let d=0,c;for(;a>0;){if(c=l-a,c<0&&(c=0),n[d]>>c!==i[d]>>c)return!1;a-=l,d+=1}return!0}function L(n){if(b.test(n))return parseInt(n,16);if(n[0]==="0"&&!isNaN(parseInt(n[1],10))){if(p.test(n))return parseInt(n,8);throw new Error(`ipaddr: cannot parse ${n} as octal`)}return parseInt(n,10)}function X(n,i){for(;n.length<i;)n=`0${n}`;return n}const m={};m.IPv4=(function(){function n(i){if(i.length!==4)throw new Error("ipaddr: ipv4 octet count should be 4");let l,a;for(l=0;l<i.length;l++)if(a=i[l],!(0<=a&&a<=255))throw new Error("ipaddr: ipv4 octet should fit in 8 bits");this.octets=i}return n.prototype.SpecialRanges={unspecified:[[new n([0,0,0,0]),8]],broadcast:[[new n([255,255,255,255]),32]],multicast:[[new n([224,0,0,0]),4]],linkLocal:[[new n([169,254,0,0]),16]],loopback:[[new n([127,0,0,0]),8]],carrierGradeNat:[[new n([100,64,0,0]),10]],private:[[new n([10,0,0,0]),8],[new n([172,16,0,0]),12],[new n([192,168,0,0]),16]],reserved:[[new n([192,0,0,0]),24],[new n([192,0,2,0]),24],[new n([192,88,99,0]),24],[new n([198,18,0,0]),15],[new n([198,51,100,0]),24],[new n([203,0,113,0]),24],[new n([240,0,0,0]),4]],as112:[[new n([192,175,48,0]),24],[new n([192,31,196,0]),24]],amt:[[new n([192,52,193,0]),24]]},n.prototype.kind=function(){return"ipv4"},n.prototype.match=function(i,l){let a;if(l===void 0&&(a=i,i=a[0],l=a[1]),i.kind()!=="ipv4")throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");return D(this.octets,i.octets,8,l)},n.prototype.prefixLengthFromSubnetMask=function(){let i=0,l=!1;const a={0:8,128:7,192:6,224:5,240:4,248:3,252:2,254:1,255:0};let d,c,C;for(d=3;d>=0;d-=1)if(c=this.octets[d],c in a){if(C=a[c],l&&C!==0)return null;C!==8&&(l=!0),i+=C}else return null;return 32-i},n.prototype.range=function(){return m.subnetMatch(this,this.SpecialRanges)},n.prototype.toByteArray=function(){return this.octets.slice(0)},n.prototype.toIPv4MappedAddress=function(){return m.IPv6.parse(`::ffff:${this.toString()}`)},n.prototype.toNormalizedString=function(){return this.toString()},n.prototype.toString=function(){return this.octets.join(".")},n})(),m.IPv4.broadcastAddressFromCIDR=function(n){try{const i=this.parseCIDR(n),l=i[0].toByteArray(),a=this.subnetMaskFromPrefixLength(i[1]).toByteArray(),d=[];let c=0;for(;c<4;)d.push(parseInt(l[c],10)|parseInt(a[c],10)^255),c++;return new this(d)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},m.IPv4.isIPv4=function(n){return this.parser(n)!==null},m.IPv4.isValid=function(n){try{return new this(this.parser(n)),!0}catch{return!1}},m.IPv4.isValidCIDR=function(n){try{return this.parseCIDR(n),!0}catch{return!1}},m.IPv4.isValidFourPartDecimal=function(n){return!!(m.IPv4.isValid(n)&&n.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/))},m.IPv4.isValidCIDRFourPartDecimal=function(n){const i=n.match(/^(.+)\/(\d+)$/);return!m.IPv4.isValidCIDR(n)||!i?!1:m.IPv4.isValidFourPartDecimal(i[1])},m.IPv4.networkAddressFromCIDR=function(n){let i,l,a,d,c;try{for(i=this.parseCIDR(n),a=i[0].toByteArray(),c=this.subnetMaskFromPrefixLength(i[1]).toByteArray(),d=[],l=0;l<4;)d.push(parseInt(a[l],10)&parseInt(c[l],10)),l++;return new this(d)}catch{throw new Error("ipaddr: the address does not have IPv4 CIDR format")}},m.IPv4.parse=function(n){const i=this.parser(n);if(i===null)throw new Error("ipaddr: string is not formatted like an IPv4 Address");return new this(i)},m.IPv4.parseCIDR=function(n){let i;if(i=n.match(/^(.+)\/(\d+)$/)){const l=parseInt(i[2]);if(l>=0&&l<=32){const a=[this.parse(i[1]),l];return Object.defineProperty(a,"toString",{value:function(){return this.join("/")}}),a}}throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range")},m.IPv4.parser=function(n){let i,l,a;if(i=n.match(r.fourOctet))return(function(){const d=i.slice(1,6),c=[];for(let C=0;C<d.length;C++)l=d[C],c.push(L(l));return c})();if(i=n.match(r.longValue)){if(a=L(i[1]),a>4294967295||a<0)throw new Error("ipaddr: address outside defined range");return(function(){const d=[];let c;for(c=0;c<=24;c+=8)d.push(a>>c&255);return d})().reverse()}else return(i=n.match(r.twoOctet))?(function(){const d=i.slice(1,4),c=[];if(a=L(d[1]),a>16777215||a<0)throw new Error("ipaddr: address outside defined range");return c.push(L(d[0])),c.push(a>>16&255),c.push(a>>8&255),c.push(a&255),c})():(i=n.match(r.threeOctet))?(function(){const d=i.slice(1,5),c=[];if(a=L(d[2]),a>65535||a<0)throw new Error("ipaddr: address outside defined range");return c.push(L(d[0])),c.push(L(d[1])),c.push(a>>8&255),c.push(a&255),c})():null},m.IPv4.subnetMaskFromPrefixLength=function(n){if(n=parseInt(n),n<0||n>32)throw new Error("ipaddr: invalid IPv4 prefix length");const i=[0,0,0,0];let l=0;const a=Math.floor(n/8);for(;l<a;)i[l]=255,l++;return a<4&&(i[a]=Math.pow(2,n%8)-1<<8-n%8),new this(i)},m.IPv6=(function(){function n(i,l){let a,d;if(i.length===16)for(this.parts=[],a=0;a<=14;a+=2)this.parts.push(i[a]<<8|i[a+1]);else if(i.length===8)this.parts=i;else throw new Error("ipaddr: ipv6 part count should be 8 or 16");for(a=0;a<this.parts.length;a++)if(d=this.parts[a],!(0<=d&&d<=65535))throw new Error("ipaddr: ipv6 part should fit in 16 bits");l&&(this.zoneId=l)}return n.prototype.SpecialRanges={unspecified:[new n([0,0,0,0,0,0,0,0]),128],linkLocal:[new n([65152,0,0,0,0,0,0,0]),10],multicast:[new n([65280,0,0,0,0,0,0,0]),8],loopback:[new n([0,0,0,0,0,0,0,1]),128],uniqueLocal:[new n([64512,0,0,0,0,0,0,0]),7],ipv4Mapped:[new n([0,0,0,0,0,65535,0,0]),96],discard:[new n([256,0,0,0,0,0,0,0]),64],rfc6145:[new n([0,0,0,0,65535,0,0,0]),96],rfc6052:[new n([100,65435,0,0,0,0,0,0]),96],"6to4":[new n([8194,0,0,0,0,0,0,0]),16],teredo:[new n([8193,0,0,0,0,0,0,0]),32],benchmarking:[new n([8193,2,0,0,0,0,0,0]),48],amt:[new n([8193,3,0,0,0,0,0,0]),32],as112v6:[[new n([8193,4,274,0,0,0,0,0]),48],[new n([9760,79,32768,0,0,0,0,0]),48]],deprecated:[new n([8193,16,0,0,0,0,0,0]),28],orchid2:[new n([8193,32,0,0,0,0,0,0]),28],droneRemoteIdProtocolEntityTags:[new n([8193,48,0,0,0,0,0,0]),28],reserved:[[new n([8193,0,0,0,0,0,0,0]),23],[new n([8193,3512,0,0,0,0,0,0]),32]]},n.prototype.isIPv4MappedAddress=function(){return this.range()==="ipv4Mapped"},n.prototype.kind=function(){return"ipv6"},n.prototype.match=function(i,l){let a;if(l===void 0&&(a=i,i=a[0],l=a[1]),i.kind()!=="ipv6")throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");return D(this.parts,i.parts,16,l)},n.prototype.prefixLengthFromSubnetMask=function(){let i=0,l=!1;const a={0:16,32768:15,49152:14,57344:13,61440:12,63488:11,64512:10,65024:9,65280:8,65408:7,65472:6,65504:5,65520:4,65528:3,65532:2,65534:1,65535:0};let d,c;for(let C=7;C>=0;C-=1)if(d=this.parts[C],d in a){if(c=a[d],l&&c!==0)return null;c!==16&&(l=!0),i+=c}else return null;return 128-i},n.prototype.range=function(){return m.subnetMatch(this,this.SpecialRanges)},n.prototype.toByteArray=function(){let i;const l=[],a=this.parts;for(let d=0;d<a.length;d++)i=a[d],l.push(i>>8),l.push(i&255);return l},n.prototype.toFixedLengthString=function(){const i=(function(){const a=[];for(let d=0;d<this.parts.length;d++)a.push(X(this.parts[d].toString(16),4));return a}).call(this).join(":");let l="";return this.zoneId&&(l=`%${this.zoneId}`),i+l},n.prototype.toIPv4Address=function(){if(!this.isIPv4MappedAddress())throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");const i=this.parts.slice(-2),l=i[0],a=i[1];return new m.IPv4([l>>8,l&255,a>>8,a&255])},n.prototype.toNormalizedString=function(){const i=(function(){const a=[];for(let d=0;d<this.parts.length;d++)a.push(this.parts[d].toString(16));return a}).call(this).join(":");let l="";return this.zoneId&&(l=`%${this.zoneId}`),i+l},n.prototype.toRFC5952String=function(){const i=/((^|:)(0(:|$)){2,})/g,l=this.toNormalizedString();let a=0,d=-1,c;for(;c=i.exec(l);)c[0].length>d&&(a=c.index,d=c[0].length);return d<0?l:`${l.substring(0,a)}::${l.substring(a+d)}`},n.prototype.toString=function(){return this.toRFC5952String()},n})(),m.IPv6.broadcastAddressFromCIDR=function(n){try{const i=this.parseCIDR(n),l=i[0].toByteArray(),a=this.subnetMaskFromPrefixLength(i[1]).toByteArray(),d=[];let c=0;for(;c<16;)d.push(parseInt(l[c],10)|parseInt(a[c],10)^255),c++;return new this(d)}catch(i){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${i})`)}},m.IPv6.isIPv6=function(n){return this.parser(n)!==null},m.IPv6.isValid=function(n){if(typeof n=="string"&&n.indexOf(":")===-1)return!1;try{const i=this.parser(n);return new this(i.parts,i.zoneId),!0}catch{return!1}},m.IPv6.isValidCIDR=function(n){if(typeof n=="string"&&n.indexOf(":")===-1)return!1;try{return this.parseCIDR(n),!0}catch{return!1}},m.IPv6.networkAddressFromCIDR=function(n){let i,l,a,d,c;try{for(i=this.parseCIDR(n),a=i[0].toByteArray(),c=this.subnetMaskFromPrefixLength(i[1]).toByteArray(),d=[],l=0;l<16;)d.push(parseInt(a[l],10)&parseInt(c[l],10)),l++;return new this(d)}catch(C){throw new Error(`ipaddr: the address does not have IPv6 CIDR format (${C})`)}},m.IPv6.parse=function(n){const i=this.parser(n);if(i.parts===null)throw new Error("ipaddr: string is not formatted like an IPv6 Address");return new this(i.parts,i.zoneId)},m.IPv6.parseCIDR=function(n){let i,l,a;if((l=n.match(/^(.+)\/(\d+)$/))&&(i=parseInt(l[2]),i>=0&&i<=128))return a=[this.parse(l[1]),i],Object.defineProperty(a,"toString",{value:function(){return this.join("/")}}),a;throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range")},m.IPv6.parser=function(n){let i,l,a,d,c,C;if(a=n.match(F.deprecatedTransitional))return this.parser(`::ffff:${a[1]}`);if(F.native.test(n))return H(n,8);if((a=n.match(F.transitional))&&(C=a[6]||"",i=a[1],a[1].endsWith("::")||(i=i.slice(0,-1)),i=H(i+C,6),i.parts)){for(c=[parseInt(a[2]),parseInt(a[3]),parseInt(a[4]),parseInt(a[5])],l=0;l<c.length;l++)if(d=c[l],!(0<=d&&d<=255))return null;return i.parts.push(c[0]<<8|c[1]),i.parts.push(c[2]<<8|c[3]),{parts:i.parts,zoneId:i.zoneId}}return null},m.IPv6.subnetMaskFromPrefixLength=function(n){if(n=parseInt(n),n<0||n>128)throw new Error("ipaddr: invalid IPv6 prefix length");const i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];let l=0;const a=Math.floor(n/8);for(;l<a;)i[l]=255,l++;return a<16&&(i[a]=Math.pow(2,n%8)-1<<8-n%8),new this(i)},m.fromByteArray=function(n){const i=n.length;if(i===4)return new m.IPv4(n);if(i===16)return new m.IPv6(n);throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address")},m.isValid=function(n){return m.IPv6.isValid(n)||m.IPv4.isValid(n)},m.isValidCIDR=function(n){return m.IPv6.isValidCIDR(n)||m.IPv4.isValidCIDR(n)},m.parse=function(n){if(m.IPv6.isValid(n))return m.IPv6.parse(n);if(m.IPv4.isValid(n))return m.IPv4.parse(n);throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format")},m.parseCIDR=function(n){try{return m.IPv6.parseCIDR(n)}catch{try{return m.IPv4.parseCIDR(n)}catch{throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format")}}},m.process=function(n){const i=this.parse(n);return i.kind()==="ipv6"&&i.isIPv4MappedAddress()?i.toIPv4Address():i},m.subnetMatch=function(n,i,l){let a,d,c,C;l==null&&(l="unicast");for(d in i)if(Object.prototype.hasOwnProperty.call(i,d)){for(c=i[d],c[0]&&!(c[0]instanceof Array)&&(c=[c]),a=0;a<c.length;a++)if(C=c[a],n.kind()===C[0].kind()&&n.match.apply(n,C))return d}return l},u.exports?u.exports=m:t.ipaddr=m})(Ct)})(et);var It=et.exports;const ot=mt(It);class St extends T.Component{updating=!1;textareaRef=$.createRef();link=`${window.location.protocol}//${window.location.host}/`;interval;startTimeout;constructor(t){super(t),this.state={response:null,error:null,starting:!0}}setUpdating(t){this.updating!==t&&(this.updating=t,this.props.onUpdating(t))}async findIpAddress(){var b,g,k,F;if((await this.props.socket.getObject(`system.adapter.${this.props.adminInstance}`)).common.host===this.props.hostId)return;const s=await this.props.socket.getObject(this.props.hostId),r=await this.props.socket.readBaseSettings(this.props.hostId);let p=(g=(b=r==null?void 0:r.config)==null?void 0:b.objects)==null?void 0:g.host;if(!(!p||p==="localhost")&&(p=ot.parse(Array.isArray(p)?p[0]:p).toString(),!!((F=(k=s==null?void 0:s.native)==null?void 0:k.hardware)!=null&&F.networkInterfaces)))for(const H of Object.values(s.native.hardware.networkInterfaces))H.find(D=>{try{const L=ot.parseCIDR(D.cidr).toString();D.internal===!1&&p.match(L)&&(this.link=`${window.location.protocol}//${D.family==="IPv6"?`[${D.address}]`:D.address}:${window.location.port}`)}catch{}return!1})}async componentDidMount(){try{await this.findIpAddress()}catch(t){console.error(`Cannot find ip address: ${t.message}`)}try{await this.props.socket.upgradeController(this.props.hostId,this.props.version,parseInt(this.props.adminInstance.split(".").pop(),10))}catch(t){console.error(`Cannot update controller: ${t.message}`),this.setState({error:h.I18n.t("Not updatable"),starting:!1}),this.setUpdating(!1);return}this.setUpdating(!0),this.interval=setInterval(()=>this.checkStatus(),1e3),this.startTimeout=setTimeout(()=>{this.startTimeout=null,this.setState({starting:!1})},1e4)}componentWillUnmount(){this.interval&&(clearInterval(this.interval),this.interval=null),this.startTimeout&&(clearTimeout(this.startTimeout),this.startTimeout=null)}async checkStatus(){console.log(`Request update status from: ${this.link}`);try{const s=await(await fetch(this.link)).text();console.log(`Received status: ${s}`);const r=JSON.parse(s);r!=null&&r.stderr&&(r.stderr=r.stderr.filter(p=>p.trim())),r&&!r.running&&r.success&&r.stdout?(r.stdout.push(""),r.stdout.push("---------------------------------------------------"),r.stdout.push(h.I18n.t("%s was successfully updated to %s","js-controller",this.props.version))):r!=null&&r.stdout&&(r.stdout.unshift(""),r.stdout.unshift("---------------------------------------------------"),r.stdout.unshift(h.I18n.t("updating %s to %s...","js-controller",this.props.version))),this.setState({response:r,error:null},()=>{r&&!r.running?(this.setUpdating(!1),this.interval&&(clearInterval(this.interval),this.interval=null)):r!=null&&r.running&&this.setUpdating(!0),this.textareaRef.current&&setTimeout(()=>this.textareaRef.current.scrollTop=this.textareaRef.current.scrollHeight,100)})}catch(t){this.state.starting||this.setState({error:t.toString()},()=>this.setUpdating(!1))}}render(){var t,s,r,p,b;return e.jsxs(o.Dialog,{onClose:(g,k)=>{k!=="escapeKeyDown"&&k!=="backdropClick"&&this.props.onClose()},open:!0,maxWidth:"lg",fullWidth:!0,children:[e.jsx(o.DialogTitle,{children:h.I18n.t("Updating %s...","js-controller")}),e.jsxs(o.DialogContent,{style:{height:400,padding:"0 20px",overflow:"hidden"},children:[(!this.state.response||this.state.response.running)&&!this.state.error?e.jsx(o.LinearProgress,{}):null,this.state.response||this.state.error?e.jsx("textarea",{ref:this.textareaRef,style:{width:"100%",height:"100%",resize:"none",background:this.props.themeType==="dark"?"#000":"#fff",color:this.props.themeType==="dark"?"#EEE":"#111",boxSizing:"border-box",fontFamily:"Consolas,Monaco,Lucida Console,Liberation Mono,DejaVu Sans Mono,Bitstream Vera Sans Mono,Courier New, monospace",border:(t=this.state.response)!=null&&t.success?"2px solid green":this.state.error||this.state.response&&!this.state.response.running&&!this.state.response.success?"2px solid red":void 0},value:this.state.error?this.state.error:this.state.response.stderr&&this.state.response.stderr.length?this.state.response.stderr.join(`
|
|
2
2
|
`):this.state.response.stdout.join(`
|
|
3
3
|
`),readOnly:!0}):null]}),e.jsx(o.DialogActions,{children:e.jsx(o.Button,{id:"js-controller-updater-close",variant:"contained",disabled:this.state.starting||!this.state.error&&((s=this.state.response)==null?void 0:s.running),onClick:()=>{var g;(g=this.state.response)!=null&&g.success&&window.location.reload(),this.props.onClose()},color:(r=this.state.response)!=null&&r.success?"primary":"grey",startIcon:(p=this.state.response)!=null&&p.success?e.jsx(y.Refresh,{}):e.jsx(y.Close,{}),children:(b=this.state.response)!=null&&b.success?h.I18n.t("Reload"):h.I18n.t("Close")})})]})}}const x={root:{width:"100%",height:"auto",display:"flex",flexDirection:"column",overflow:"auto",padding:10},paper:{maxWidth:1e3},overflowHidden:{display:"flex",overflow:"hidden"},h2:u=>({p:"10px 7px",fontSize:25,fontWeight:300,borderRadius:"3px",background:"#4dabf5",color:u.palette.mode==="dark"?"black":"white"}),h22:u=>({p:0,m:0,fontSize:25,fontWeight:300,borderRadius:"3px",background:"#4dabf5",color:u.palette.mode==="dark"?"black":"white"}),standardText:{fontSize:15,margin:"10px 0","& > a":{textDecoration:"none",color:"#1e88e5"}},standardTextSmall:{fontSize:12,color:"black"},standardTextSmall2:{fontSize:12},pre:{whiteSpace:"pre-wrap",background:"#e4e3e3",padding:10,borderRadius:3,position:"relative"},copyButton:{color:"black",position:"absolute",right:10,top:4},accordionSummary:{background:"#4dabf5",borderRadius:"3px","& .MuiAccordionSummary-content":{m:0}},accordionDetails:{display:"flex",flexDirection:"column"},code:u=>({backgroundColor:u.palette.mode==="dark"?"#123456":"#93bbe7",p:"0 3px 0 3px"}),copyButtonSmall:{width:31,height:16}};function rt(u,t,s){const r=u.split(`
|
|
4
4
|
`),p=[];let b=!1;for(let g=0;g<r.length;g++){const k=r[g].toLowerCase();k.startsWith("##")&&(b=k.includes(t.toLowerCase())&&(!s||!k.includes(s.toLowerCase()))),b||p.push(r[g])}return p.join(`
|