filecat 6.59.1 → 6.60.0
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/build/dist/{1472.985063460de46d5b4709.js → 1472.9d3201dddf293c385633.js} +1 -1
- package/build/dist/1695.8a7beb249e1ad17a47f3.js +1 -0
- package/build/dist/3105.8506dea62edb242a898c.js +1 -0
- package/build/dist/3457.e003dede632769cfe55e.js +1 -0
- package/build/dist/3721.c484f07613f940d94b90.js +1 -0
- package/build/dist/378.a32383dade4a2e55152a.js +1 -0
- package/build/dist/5137.ea60635374bc8146dbe3.js +1 -0
- package/build/dist/5622.01faef0a863f5cad9619.js +1 -0
- package/build/dist/6284.10deb80685728f50aa45.js +1 -0
- package/build/dist/647.42e7ab2f84bd57ba60e4.js +1 -0
- package/build/dist/6636.cc3f66845c61dbf76bd1.js +1 -0
- package/build/dist/6919.f30a30d5d03530a80dde.js +1 -0
- package/build/dist/7277.aa3af95608a9d9d07634.js +1 -0
- package/build/dist/7454.e647fbf309ca068e39e8.js +1 -0
- package/build/dist/7834.7a593dcb80ca09f58586.js +1 -0
- package/build/dist/8840.525f17063dc60979415b.js +1 -0
- package/build/dist/8947.5c2814b7a2c2810f0ce2.js +2 -0
- package/build/dist/{2637.9c1a442f4131e029385d.js → 9214.7750d99fcaff8de186f9.js} +1 -1
- package/build/dist/9421.7eb137bdb14410e9f6f4.js +1 -0
- package/build/dist/9482.a952553a24ad781da8c4.js +1 -0
- package/build/dist/9546.0621e5736f104bc83c15.js +1 -0
- package/build/dist/970.0a2e1e7d00bc1b8a2d6c.js +1 -0
- package/build/dist/9899.2a79d3f40f2bf1ae7829.js +1 -0
- package/build/dist/dark.css +8 -0
- package/build/dist/google-dark.css +8 -0
- package/build/dist/index.html +1 -1
- package/build/dist/main.2dba8f586160288d6981.js +2 -0
- package/build/main.js +1 -1
- package/package.json +1 -1
- package/build/dist/1070.f9959455a7cb92f7cc56.js +0 -1
- package/build/dist/1297.f0c54354f6a56960f66e.js +0 -1
- package/build/dist/1327.4b8e684f28cdee892e00.js +0 -1
- package/build/dist/2824.2990d63b1d3564cf19fb.js +0 -1
- package/build/dist/2857.870fe5dcf2cff743819f.js +0 -1
- package/build/dist/4253.f6c2ea8c7314d4df9c6d.js +0 -1
- package/build/dist/4306.9618c407f36d82608325.js +0 -1
- package/build/dist/4806.1e68bc623f8c369611a3.js +0 -1
- package/build/dist/4830.0042c6dcd47f7dcec003.js +0 -1
- package/build/dist/5315.0a806bc186510d2d0152.js +0 -1
- package/build/dist/5332.00d54e3fd946dafee80e.js +0 -1
- package/build/dist/6459.06eb5a8b0d8c8f7d3bd0.js +0 -1
- package/build/dist/6488.4de7c86754406277783e.js +0 -1
- package/build/dist/6506.ae8f7efceae47503af40.js +0 -1
- package/build/dist/6535.a5c5040e658bc76d0da8.js +0 -1
- package/build/dist/727.45aacafb8172bc2bb662.js +0 -1
- package/build/dist/821.1cd8faa58770da7e977c.js +0 -1
- package/build/dist/8947.7e10e5115cc7edc7fc85.js +0 -2
- package/build/dist/9269.f5e25bc611f9230a1aae.js +0 -1
- package/build/dist/9546.0a915019be21a971b5e2.js +0 -1
- package/build/dist/main.482b0111f4321dad3178.js +0 -2
- /package/build/dist/{8947.7e10e5115cc7edc7fc85.js.LICENSE.txt → 8947.5c2814b7a2c2810f0ce2.js.LICENSE.txt} +0 -0
- /package/build/dist/{main.482b0111f4321dad3178.js.LICENSE.txt → main.2dba8f586160288d6981.js.LICENSE.txt} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9269],{75937(e,t,s){var n=s(86309),i=s(51931);const r=(e,t)=>n.A.lang.round(i.A.parse(e)[t]);s.d(t,["A",0,r])},79269(e,t,s){s.d(t,{diagram:()=>Se});var n=s(64918),i=s(46853),r=s(717),o=(s(79515),s(44505),s(69793),s(43287),s(12505)),a=s(86535),c=s(31293),l=s(86827),h=s(37110),g=s(99125),u=s(89826);var d=s(19663);function y(e){if((0,h.s)(e))return e;const t=(0,g.b)(e);if(!function(e){switch((0,g.b)(e)){case u.R_:case u.Uw:case u.cT:case u.iq:case u.$V:case u.vC:case u.ri:case u.ML:case u.XZ:case u.i1:case u._u:case u.pj:case u.kj:case u.GX:case u.Av:case u.NA:case u.OG:case u.VP:case u.Qb:case u.q:case u.x6:case u.ZR:return!0;default:return!1}}(e))return{};if(s=e,Array.isArray(s)){const t=Array.from(e);return e.length>0&&"string"==typeof e[0]&&Object.hasOwn(e,"index")&&(t.index=e.index,t.input=e.input),t}var s;if((0,d.i)(e)){const t=e;return new(0,t.constructor)(t.buffer,t.byteOffset,t.length)}if("[object ArrayBuffer]"===t)return new ArrayBuffer(e.byteLength);if("[object DataView]"===t){const t=e,s=t.buffer,n=t.byteOffset,i=t.byteLength,r=new ArrayBuffer(i),o=new Uint8Array(s,n,i);return new Uint8Array(r).set(o),new DataView(r)}if("[object Boolean]"===t||"[object Number]"===t||"[object String]"===t){const s=new(0,e.constructor)(e.valueOf());return"[object String]"===t?function(e,t){const s=t.valueOf().length;for(const n in t)Object.hasOwn(t,n)&&(Number.isNaN(Number(n))||Number(n)>=s)&&(e[n]=t[n])}(s,e):p(s,e),s}if("[object Date]"===t)return new Date(Number(e));if("[object RegExp]"===t){const t=e,s=new RegExp(t.source,t.flags);return s.lastIndex=t.lastIndex,s}if("[object Symbol]"===t)return Object(Symbol.prototype.valueOf.call(e));if("[object Map]"===t){const t=e,s=new Map;return t.forEach((e,t)=>{s.set(t,e)}),s}if("[object Set]"===t){const t=e,s=new Set;return t.forEach(e=>{s.add(e)}),s}if("[object Arguments]"===t){const t=e,s={};return p(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}const n={};return function(e,t){const s=Object.getPrototypeOf(t);null!==s&&"function"==typeof t.constructor&&Object.setPrototypeOf(e,s)}(n,e),p(n,e),function(e,t){const s=Object.getOwnPropertySymbols(t);for(let n=0;n<s.length;n++){const i=s[n];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}(n,e),n}function p(e,t){for(const s in t)Object.hasOwn(t,s)&&(e[s]=t[s])}var b=s(75937),f=s(25582),x=s(51444),S=s(697),m=function(){var e=(0,l.K)(function(e,t,s,n){for(s=s||{},n=e.length;n--;s[e[n]]=t);return s},"o"),t=[1,15],s=[1,7],n=[1,13],i=[1,14],r=[1,19],o=[1,16],a=[1,17],c=[1,18],h=[8,30],g=[8,10,21,28,29,30,31,39,43,46],u=[1,23],d=[1,24],y=[8,10,15,16,21,28,29,30,31,39,43,46],p=[8,10,15,16,21,27,28,29,30,31,39,43,46],b=[1,49],f={trace:(0,l.K)(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:(0,l.K)(function(e,t,s,n,i,r,o){var a=r.length-1;switch(i){case 4:n.getLogger().debug("Rule: separator (NL) ");break;case 5:n.getLogger().debug("Rule: separator (Space) ");break;case 6:n.getLogger().debug("Rule: separator (EOF) ");break;case 7:n.getLogger().debug("Rule: hierarchy: ",r[a-1]),n.setHierarchy(r[a-1]);break;case 8:n.getLogger().debug("Stop NL ");break;case 9:n.getLogger().debug("Stop EOF ");break;case 10:n.getLogger().debug("Stop NL2 ");break;case 11:n.getLogger().debug("Stop EOF2 ");break;case 12:n.getLogger().debug("Rule: statement: ",r[a]),"number"==typeof r[a].length?this.$=r[a]:this.$=[r[a]];break;case 13:n.getLogger().debug("Rule: statement #2: ",r[a-1]),this.$=[r[a-1]].concat(r[a]);break;case 14:n.getLogger().debug("Rule: link: ",r[a],e),this.$={edgeTypeStr:r[a],label:""};break;case 15:n.getLogger().debug("Rule: LABEL link: ",r[a-3],r[a-1],r[a]),this.$={edgeTypeStr:r[a],label:r[a-1]};break;case 18:const t=parseInt(r[a]),s=n.generateId();this.$={id:s,type:"space",label:"",width:t,children:[]};break;case 23:n.getLogger().debug("Rule: (nodeStatement link node) ",r[a-2],r[a-1],r[a]," typestr: ",r[a-1].edgeTypeStr);const i=n.edgeStrToEdgeData(r[a-1].edgeTypeStr),o=n.edgeStrToEdgeStartData(r[a-1].edgeTypeStr),c=n.edgeStrToThickness(r[a-1].edgeTypeStr),l=n.edgeStrToPattern(r[a-1].edgeTypeStr);this.$=[{id:r[a-2].id,label:r[a-2].label,type:r[a-2].type,directions:r[a-2].directions},{id:r[a-2].id+"-"+r[a].id,start:r[a-2].id,end:r[a].id,label:r[a-1].label,type:"edge",thickness:c,pattern:l,directions:r[a].directions,arrowTypeEnd:i,arrowTypeStart:o},{id:r[a].id,label:r[a].label,type:n.typeStr2Type(r[a].typeStr),directions:r[a].directions}];break;case 24:n.getLogger().debug("Rule: nodeStatement (abc88 node size) ",r[a-1],r[a]),this.$={id:r[a-1].id,label:r[a-1].label,type:n.typeStr2Type(r[a-1].typeStr),directions:r[a-1].directions,widthInColumns:parseInt(r[a],10)};break;case 25:n.getLogger().debug("Rule: nodeStatement (node) ",r[a]),this.$={id:r[a].id,label:r[a].label,type:n.typeStr2Type(r[a].typeStr),directions:r[a].directions,widthInColumns:1};break;case 26:n.getLogger().debug("APA123",this?this:"na"),n.getLogger().debug("COLUMNS: ",r[a]),this.$={type:"column-setting",columns:"auto"===r[a]?-1:parseInt(r[a])};break;case 27:n.getLogger().debug("Rule: id-block statement : ",r[a-2],r[a-1]);n.generateId();this.$={...r[a-2],type:"composite",children:r[a-1]};break;case 28:n.getLogger().debug("Rule: blockStatement : ",r[a-2],r[a-1],r[a]);const h=n.generateId();this.$={id:h,type:"composite",label:"",children:r[a-1]};break;case 29:n.getLogger().debug("Rule: node (NODE_ID separator): ",r[a]),this.$={id:r[a]};break;case 30:n.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",r[a-1],r[a]),this.$={id:r[a-1],label:r[a].label,typeStr:r[a].typeStr,directions:r[a].directions};break;case 31:n.getLogger().debug("Rule: dirList: ",r[a]),this.$=[r[a]];break;case 32:n.getLogger().debug("Rule: dirList: ",r[a-1],r[a]),this.$=[r[a-1]].concat(r[a]);break;case 33:n.getLogger().debug("Rule: nodeShapeNLabel: ",r[a-2],r[a-1],r[a]),this.$={typeStr:r[a-2]+r[a],label:r[a-1]};break;case 34:n.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",r[a-3],r[a-2]," #3:",r[a-1],r[a]),this.$={typeStr:r[a-3]+r[a],label:r[a-2],directions:r[a-1]};break;case 35:case 36:this.$={type:"classDef",id:r[a-1].trim(),css:r[a].trim()};break;case 37:this.$={type:"applyClass",id:r[a-1].trim(),styleClass:r[a].trim()};break;case 38:this.$={type:"applyStyles",id:r[a-1].trim(),stylesStr:r[a].trim()}}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:s,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:r,39:o,43:a,46:c},{8:[1,20]},e(h,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:s,28:n,29:i,31:r,39:o,43:a,46:c}),e(g,[2,16],{14:22,15:u,16:d}),e(g,[2,17]),e(g,[2,18]),e(g,[2,19]),e(g,[2,20]),e(g,[2,21]),e(g,[2,22]),e(y,[2,25],{27:[1,25]}),e(g,[2,26]),{19:26,26:12,31:r},{10:t,11:27,13:4,19:5,20:6,21:s,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:r,39:o,43:a,46:c},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(p,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(h,[2,13]),{26:35,31:r},{31:[2,14]},{17:[1,36]},e(y,[2,24]),{10:t,11:37,13:4,14:22,15:u,16:d,19:5,20:6,21:s,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:r,39:o,43:a,46:c},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(p,[2,30]),{18:[1,43]},{18:[1,44]},e(y,[2,23]),{18:[1,45]},{30:[1,46]},e(g,[2,28]),e(g,[2,35]),e(g,[2,36]),e(g,[2,37]),e(g,[2,38]),{36:[1,47]},{33:48,34:b},{15:[1,50]},e(g,[2,27]),e(p,[2,33]),{38:[1,51]},{33:52,34:b,38:[2,31]},{31:[2,15]},e(p,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:(0,l.K)(function(e,t){if(!t.recoverable){var s=new Error(e);throw s.hash=t,s}this.trace(e)},"parseError"),parse:(0,l.K)(function(e){var t=this,s=[0],n=[],i=[null],r=[],o=this.table,a="",c=0,h=0,g=0,u=r.slice.call(arguments,1),d=Object.create(this.lexer),y={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(y.yy[p]=this.yy[p]);d.setInput(e,y.yy),y.yy.lexer=d,y.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var b=d.yylloc;r.push(b);var f=d.options&&d.options.ranges;function x(){var e;return"number"!=typeof(e=n.pop()||d.lex()||1)&&(e instanceof Array&&(e=(n=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,l.K)(function(e){s.length=s.length-2*e,i.length=i.length-e,r.length=r.length-e},"popStack"),(0,l.K)(x,"lex");for(var S,m,L,_,k,w,E,D,I,T={};;){if(L=s[s.length-1],this.defaultActions[L]?_=this.defaultActions[L]:(null==S&&(S=x()),_=o[L]&&o[L][S]),void 0===_||!_.length||!_[0]){var $="";for(w in I=[],o[L])this.terminals_[w]&&w>2&&I.push("'"+this.terminals_[w]+"'");$=d.showPosition?"Parse error on line "+(c+1)+":\n"+d.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[S]||S)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==S?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError($,{text:d.match,token:this.terminals_[S]||S,line:d.yylineno,loc:b,expected:I})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+L+", token: "+S);switch(_[0]){case 1:s.push(S),i.push(d.yytext),r.push(d.yylloc),s.push(_[1]),S=null,m?(S=m,m=null):(h=d.yyleng,a=d.yytext,c=d.yylineno,b=d.yylloc,g>0&&g--);break;case 2:if(E=this.productions_[_[1]][1],T.$=i[i.length-E],T._$={first_line:r[r.length-(E||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(E||1)].first_column,last_column:r[r.length-1].last_column},f&&(T._$.range=[r[r.length-(E||1)].range[0],r[r.length-1].range[1]]),void 0!==(k=this.performAction.apply(T,[a,h,c,y.yy,_[1],i,r].concat(u))))return k;E&&(s=s.slice(0,-1*E*2),i=i.slice(0,-1*E),r=r.slice(0,-1*E)),s.push(this.productions_[_[1]][0]),i.push(T.$),r.push(T._$),D=o[s[s.length-2]][s[s.length-1]],s.push(D);break;case 3:return!0}}return!0},"parse")},x=function(){return{EOF:1,parseError:(0,l.K)(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:(0,l.K)(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,l.K)(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:(0,l.K)(function(e){var t=e.length,s=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===n.length?this.yylloc.first_column:0)+n[n.length-s.length].length-s[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:(0,l.K)(function(){return this._more=!0,this},"more"),reject:(0,l.K)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,l.K)(function(e){this.unput(this.match.slice(e))},"less"),pastInput:(0,l.K)(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,l.K)(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,l.K)(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:(0,l.K)(function(e,t){var s,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],s=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},"test_match"),next:(0,l.K)(function(){if(this.done)return this.EOF;var e,t,s,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;r<i.length;r++)if((s=this._input.match(this.rules[i[r]]))&&(!t||s[0].length>t[0].length)){if(t=s,n=r,this.options.backtrack_lexer){if(!1!==(e=this.test_match(s,i[r])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[n]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,l.K)(function(){var e=this.next();return e||this.lex()},"lex"),begin:(0,l.K)(function(e){this.conditionStack.push(e)},"begin"),popState:(0,l.K)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,l.K)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,l.K)(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:(0,l.K)(function(e){this.begin(e)},"pushState"),stateStackSize:(0,l.K)(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:(0,l.K)(function(e,t,s,n){switch(s){case 0:return e.getLogger().debug("Found block-beta"),10;case 1:return e.getLogger().debug("Found id-block"),29;case 2:return e.getLogger().debug("Found block"),10;case 3:e.getLogger().debug(".",t.yytext);break;case 4:e.getLogger().debug("_",t.yytext);break;case 5:return 5;case 6:return t.yytext=-1,28;case 7:return t.yytext=t.yytext.replace(/columns\s+/,""),e.getLogger().debug("COLUMNS (LEX)",t.yytext),28;case 8:case 76:case 77:case 99:this.pushState("md_string");break;case 9:return"MD_STR";case 10:case 34:case 79:this.popState();break;case 11:this.pushState("string");break;case 12:e.getLogger().debug("LEX: POPPING STR:",t.yytext),this.popState();break;case 13:return e.getLogger().debug("LEX: STR end:",t.yytext),"STR";case 14:return t.yytext=t.yytext.replace(/space\:/,""),e.getLogger().debug("SPACE NUM (LEX)",t.yytext),21;case 15:return t.yytext="1",e.getLogger().debug("COLUMNS (LEX)",t.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:case 38:case 40:case 41:case 44:return this.popState(),e.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),e.getLogger().debug("Lex: ))"),"NODE_DEND";case 42:return this.popState(),e.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),e.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),e.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),e.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),e.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:case 49:return this.popState(),e.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),e.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),e.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),e.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),e.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return e.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return e.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return e.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:case 59:case 60:case 61:case 64:return e.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return e.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 62:return e.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return e.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 65:case 66:case 67:case 68:case 69:case 70:case 71:return this.pushState("NODE"),35;case 72:return e.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),e.getLogger().debug("LEX ARR START"),37;case 74:return e.getLogger().debug("Lex: NODE_ID",t.yytext),31;case 75:return e.getLogger().debug("Lex: EOF",t.yytext),8;case 78:return"NODE_DESCR";case 80:e.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:e.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return e.getLogger().debug("LEX: NODE_DESCR:",t.yytext),"NODE_DESCR";case 83:e.getLogger().debug("LEX POPPING"),this.popState();break;case 84:e.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (right): dir:",t.yytext),"DIR";case 86:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (left):",t.yytext),"DIR";case 87:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (x):",t.yytext),"DIR";case 88:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (y):",t.yytext),"DIR";case 89:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (up):",t.yytext),"DIR";case 90:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (down):",t.yytext),"DIR";case 91:return t.yytext="]>",e.getLogger().debug("Lex (ARROW_DIR end):",t.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return e.getLogger().debug("Lex: LINK","#"+t.yytext+"#"),15;case 93:case 94:case 95:return e.getLogger().debug("Lex: LINK",t.yytext),15;case 96:case 97:case 98:return e.getLogger().debug("Lex: START_LINK",t.yytext),this.pushState("LLABEL"),16;case 100:return e.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),e.getLogger().debug("Lex: LINK","#"+t.yytext+"#"),15;case 102:case 103:return this.popState(),e.getLogger().debug("Lex: LINK",t.yytext),15;case 104:return e.getLogger().debug("Lex: COLON",t.yytext),t.yytext=t.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}}}();function S(){this.yy={}}return f.lexer=x,(0,l.K)(S,"Parser"),S.prototype=f,f.Parser=S,new S}();m.parser=m;var L=m,_=new Map,k=[],w=new Map,E="color",D="fill",I=new Map,T="",$=(0,l.K)(e=>a.Y2.sanitizeText(e,(0,a.D7)()),"sanitizeText"),N=(0,l.K)(function(e,t=""){let s=I.get(e);s||(s={id:e,styles:[],textStyles:[]},I.set(e,s)),null!=t&&t.split(",").forEach(e=>{const t=e.replace(/([^;]*);/,"$1").trim();if(RegExp(E).exec(e)){const e=t.replace(D,"bgFill").replace(E,D);s.textStyles.push(e)}s.styles.push(t)})},"addStyleClass"),O=(0,l.K)(function(e,t=""){const s=_.get(e);null!=t&&(s.styles=t.split(","))},"addStyle2Node"),R=(0,l.K)(function(e,t){e.split(",").forEach(function(e){let s=_.get(e);if(void 0===s){const t=e.trim();s={id:t,type:"na",children:[]},_.set(t,s)}s.classes||(s.classes=[]),s.classes.push(t)})},"setCssClass"),C=(0,l.K)((e,t)=>{const s=e.flat(),n=[],i=s.find(e=>"column-setting"===e?.type),r=i?.columns??-1;for(const e of s)if("number"==typeof r&&r>0&&"column-setting"!==e.type&&"number"==typeof e.widthInColumns&&e.widthInColumns>r&&c.R.warn(`Block ${e.id} width ${e.widthInColumns} exceeds configured column width ${r}`),e.label&&(e.label=$(e.label)),"classDef"!==e.type)if("applyClass"!==e.type)if("applyStyles"!==e.type)if("column-setting"===e.type)t.columns=e.columns??-1;else if("edge"===e.type){const t=(w.get(e.id)??0)+1;w.set(e.id,t),e.id=t+"-"+e.id,k.push(e)}else{e.label||("composite"===e.type?e.label="":e.label=e.id);const t=_.get(e.id);if(void 0===t?_.set(e.id,e):("na"!==e.type&&(t.type=e.type),e.label!==e.id&&(t.label=e.label)),e.children&&C(e.children,e),"space"===e.type){const t=e.width??1;for(let s=0;s<t;s++){const t=y(e);t.id=t.id+"-"+s,_.set(t.id,t),n.push(t)}}else void 0===t&&n.push(e)}else e?.stylesStr&&O(e.id,e?.stylesStr);else R(e.id,e?.styleClass??"");else N(e.id,e.css);t.children=n},"populateBlockDatabase"),z=[],A={id:"root",type:"composite",children:[],columns:-1},K=(0,l.K)(()=>{c.R.debug("Clear called"),(0,a.IU)(),A={id:"root",type:"composite",children:[],columns:-1},_=new Map([["root",A]]),z=[],I=new Map,k=[],w=new Map,T=""},"clear");function v(e){switch(c.R.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return c.R.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}function B(e){return c.R.debug("typeStr2Type",e),"=="===e?"thick":"normal"}function P(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}function F(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}function j(e){return e.includes("==")?"thick":"normal"}function M(e){return e.includes(".-")?"dotted":"solid"}(0,l.K)(v,"typeStr2Type"),(0,l.K)(B,"edgeTypeStr2Type"),(0,l.K)(P,"edgeStrToEdgeData"),(0,l.K)(F,"edgeStrToEdgeStartData"),(0,l.K)(j,"edgeStrToThickness"),(0,l.K)(M,"edgeStrToPattern");var Y=0,X=(0,l.K)(()=>(Y++,"id-"+Math.random().toString(36).substr(2,12)+"-"+Y),"generateId"),W=(0,l.K)(e=>{A.children=e,C(e,A),z=A.children},"setHierarchy"),U=(0,l.K)(e=>{const t=_.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),G=(0,l.K)(()=>[..._.values()],"getBlocksFlat"),H=(0,l.K)(()=>z||[],"getBlocks"),q=(0,l.K)(()=>k,"getEdges"),V=(0,l.K)(e=>_.get(e),"getBlock"),Z=(0,l.K)(e=>{_.set(e.id,e)},"setBlock"),J=(0,l.K)(e=>{T=e},"setDiagramId"),Q=(0,l.K)(()=>T,"getDiagramId"),ee=(0,l.K)(()=>c.R,"getLogger"),te=(0,l.K)(function(){return I},"getClasses"),se={getConfig:(0,l.K)(()=>(0,a.zj)().block,"getConfig"),typeStr2Type:v,edgeTypeStr2Type:B,edgeStrToEdgeData:P,edgeStrToEdgeStartData:F,edgeStrToThickness:j,edgeStrToPattern:M,getLogger:ee,getBlocksFlat:G,getBlocks:H,getEdges:q,setHierarchy:W,getBlock:V,setBlock:Z,getColumns:U,getClasses:te,clear:K,generateId:X,setDiagramId:J,getDiagramId:Q},ne=(0,l.K)((e,t)=>{const s=b.A,n=s(e,"r"),i=s(e,"g"),r=s(e,"b");return f.A(n,i,r,t)},"fade"),ie=(0,l.K)(e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span {\n color: ${e.titleColor};\n }\n\n\n\n .label text,span {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n /*\n * This is for backward compatibility with existing code that didn't\n * add a \`<p>\` around edge labels.\n *\n * TODO: We should probably remove this in a future release.\n */\n p {\n margin: 0;\n padding: 0;\n display: inline;\n }\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${e.edgeLabelBackground};\n }\n\n .node .cluster {\n // fill: ${ne(e.mainBkg,.5)};\n fill: ${ne(e.clusterBkg,.5)};\n stroke: ${ne(e.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n ${(0,n.o)()}\n`,"getStyles");function re(e,t){if(0===e||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(1===e)return{px:0,py:t};return{px:t%e,py:Math.floor(t/e)}}(0,l.K)(re,"calculateBlockPosition");var oe=(0,l.K)(e=>{let t=0,s=0;for(const n of e.children){const{width:e,height:i,x:r,y:o}=n.size??{width:0,height:0,x:0,y:0};if(c.R.debug("getMaxChildSize abc95 child:",n.id,"width:",e,"height:",i,"x:",r,"y:",o,n.type),"space"===n.type)continue;const a=e/(n.widthInColumns??1);a>t&&(t=a),i>s&&(s=i)}return{width:t,height:s}},"getMaxChildSize");function ae(e,t,s=0,n=0,i=8){c.R.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",s),e?.size?.width||(e.size={width:s,height:n,x:0,y:0});let r=0,o=0;if(e.children?.length>0){for(const s of e.children)ae(s,t,0,0,i);const a=oe(e);r=a.width,o=a.height,c.R.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",r,o);for(const t of e.children)t.size&&(c.R.debug(`abc95 Setting size of children of ${e.id} id=${t.id} ${r} ${o} ${JSON.stringify(t.size)}`),t.size.width=r*(t.widthInColumns??1)+i*((t.widthInColumns??1)-1),t.size.height=o,t.size.x=0,t.size.y=0,c.R.debug(`abc95 updating size of ${e.id} children child:${t.id} maxWidth:${r} maxHeight:${o}`));for(const s of e.children)ae(s,t,r,o,i);const l=e.columns??-1;let h=0;for(const t of e.children)h+=t.widthInColumns??1;let g=e.children.length;l>0&&l<h&&(g=l);const u=Math.ceil(h/g);let d=g*(r+i)+i,y=u*(o+i)+i;if(d<s){c.R.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${s} siblingHeight ${n} width ${d}`),d=s,y=n;const t=(s-g*i-i)/g,a=(n-u*i-i)/u;c.R.debug("Size indata abc88",e.id,"childWidth",t,"maxWidth",r),c.R.debug("Size indata abc88",e.id,"childHeight",a,"maxHeight",o),c.R.debug("Size indata abc88 xSize",g,"padding",i);for(const s of e.children)s.size&&(s.size.width=t,s.size.height=a,s.size.x=0,s.size.y=0)}if(c.R.debug(`abc95 (finale calc) ${e.id} xSize ${g} ySize ${u} columns ${l}${e.children.length} width=${Math.max(d,e.size?.width||0)}`),d<(e?.size?.width||0)){d=e?.size?.width||0;const t=l>0?Math.min(e.children.length,l):e.children.length;if(t>0){const s=(d-t*i-i)/t;c.R.debug("abc95 (growing to fit) width",e.id,d,e.size?.width,s);for(const t of e.children)t.size&&(t.size.width=s)}}e.size={width:d,height:y,x:0,y:0}}c.R.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}function ce(e,t,s=8){c.R.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const n=e.columns??-1;if(c.R.debug("layoutBlocks columns abc95",e.id,"=>",n,e),e.children&&e.children.length>0){const i=e?.children[0]?.size?.width??0,r=e.children.length*i+(e.children.length-1)*s;c.R.debug("widthOfChildren 88",r,"posX");const o=new Map;{let t=0;for(const s of e.children){if(!s.size)continue;const{py:e}=re(n,t),i=o.get(e)??0;s.size.height>i&&o.set(e,s.size.height);let r=s?.widthInColumns??1;n>0&&(r=Math.min(r,n-t%n)),t+=r}}const a=new Map;{let e=0;const t=[...o.keys()].sort((e,t)=>e-t);for(const n of t)a.set(n,e),e+=(o.get(n)??0)+s}let l=0;c.R.debug("abc91 block?.size?.x",e.id,e?.size?.x);let h=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-s,g=0;for(const i of e.children){const r=e;if(!i.size)continue;const{width:u,height:d}=i.size,{px:y,py:p}=re(n,l);if(p!=g&&(g=p,h=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-s,c.R.debug("New row in layout for block",e.id," and child ",i.id,g)),c.R.debug(`abc89 layout blocks (child) id: ${i.id} Pos: ${l} (px, py) ${y},${p} (${r?.size?.x},${r?.size?.y}) parent: ${r.id} width: ${u}${s}`),r.size){const e=u/2;i.size.x=h+s+e,c.R.debug(`abc91 layout blocks (calc) px, pyid:${i.id} startingPos=X${h} new startingPosX${i.size.x} ${e} padding=${s} width=${u} halfWidth=${e} => x:${i.size.x} y:${i.size.y} ${i.widthInColumns} (width * (child?.w || 1)) / 2 ${u*(i?.widthInColumns??1)/2}`),h=i.size.x+e;const t=a.get(p)??0,n=o.get(p)??d;i.size.y=r.size.y-r.size.height/2+t+n/2+s,c.R.debug(`abc88 layout blocks (calc) px, pyid:${i.id}startingPosX${h}${s}${e}=>x:${i.size.x}y:${i.size.y}${i.widthInColumns}(width * (child?.w || 1)) / 2${u*(i?.widthInColumns??1)/2}`)}i.children&&ce(i,t,s);let b=i?.widthInColumns??1;n>0&&(b=Math.min(b,n-l%n)),l+=b,c.R.debug("abc88 columnsPos",i,l)}}c.R.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}function le(e,{minX:t,minY:s,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&"root"!==e.id){const{x:r,y:o,width:a,height:c}=e.size;r-a/2<t&&(t=r-a/2),o-c/2<s&&(s=o-c/2),r+a/2>n&&(n=r+a/2),o+c/2>i&&(i=o+c/2)}if(e.children)for(const r of e.children)({minX:t,minY:s,maxX:n,maxY:i}=le(r,{minX:t,minY:s,maxX:n,maxY:i}));return{minX:t,minY:s,maxX:n,maxY:i}}function he(e){const t=e.getBlock("root");if(!t)return;const s=(0,a.D7)()?.block?.padding??8;ae(t,e,0,0,s),ce(t,e,s),c.R.debug("getBlocks",JSON.stringify(t,null,2));const{minX:n,minY:i,maxX:r,maxY:o}=le(t);return{x:n,y:i,width:r-n,height:o-i}}function ge(e,t,s=!1){const n=e;let i="default";(n?.classes?.length||0)>0&&(i=(n?.classes??[]).join(" ")),i+=" flowchart-label";const r=(n?.classes??[]).flatMap(e=>t.getClasses().get(e)?.styles??[]);let c,l=0,h="rect";switch(n.type){case"round":l=5,h="rect";break;case"composite":l=0,h="composite",c=0;break;case"square":case"group":default:h="rect";break;case"diamond":h="question";break;case"hexagon":h="hexagon";break;case"block_arrow":h="block_arrow";break;case"odd":case"rect_left_inv_arrow":h="rect_left_inv_arrow";break;case"lean_right":h="lean_right";break;case"lean_left":h="lean_left";break;case"trapezoid":h="trapezoid";break;case"inv_trapezoid":h="inv_trapezoid";break;case"circle":h="circle";break;case"ellipse":h="ellipse";break;case"stadium":h="stadium";break;case"subroutine":h="subroutine";break;case"cylinder":h="cylinder";break;case"doublecircle":h="doublecircle"}const g=(0,o.sM)(n?.styles??[]),u=n.label,d=n.size??{width:0,height:0,x:0,y:0},y=t.getDiagramId();return{labelStyle:g.labelStyle,shape:h,label:u,labelText:u,rx:l,ry:l,class:i,cssClasses:i,cssStyles:n?.styles??[],cssCompiledStyles:r,style:g.style,id:n.id,domId:y?`${y}-${n.id}`:n.id,isGroup:!1,directions:n.directions,width:d.width||void 0,height:d.height||void 0,wrappingWidth:d.width||Number.POSITIVE_INFINITY,x:d.x,y:d.y,positioned:s,intersect:void 0,padding:c??(0,a.zj)()?.block?.padding??0,widthInColumns:n.widthInColumns??1}}async function ue(e,t,s){const n=ge(t,s,!1);if("group"===t.type)return;const i=(0,a.zj)(),o=await(0,r.on)(e,n,{config:i}),c=o.node()?.getBBox()??{width:0,height:0},l=s.getBlock(n.id);l.size={width:c.width,height:c.height,x:0,y:0,node:o},s.setBlock(l),o.remove()}async function de(e,t,s){const n=ge(t,s,!0);if("space"!==s.getBlock(n.id).type){const s=(0,a.zj)();await(0,r.on)(e,n,{config:s}),t.intersect=n?.intersect,(0,r.U_)(n)}}async function ye(e,t,s,n){for(const i of t)await n(e,i,s),i.children&&await ye(e,i.children,s,n)}async function pe(e,t,s){await ye(e,t,s,ue)}async function be(e,t,s){await ye(e,t,s,de)}async function fe(e,t,s,n,r){const o=new S.T({multigraph:!0,compound:!0});o.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const e of s)e.size&&o.setNode(e.id,{width:e.size.width,height:e.size.height,intersect:e.intersect});for(const s of t)if(s.start&&s.end){const t=n.getBlock(s.start),a=n.getBlock(s.end);if(t?.size&&a?.size){const n=t.size,c=a.size,l=[{x:n.x,y:n.y},{x:n.x+(c.x-n.x)/2,y:n.y+(c.y-n.y)/2},{x:c.x,y:c.y}],h=r?`${r}-${s.id}`:s.id,g=`${"thick"===s.thickness?"edge-thickness-thick":"edge-thickness-normal"} ${"dotted"===s.pattern?"edge-pattern-dotted":"edge-pattern-solid"} flowchart-link LS-a1 LE-b1`;(0,i.Jo)(e,{...s,id:h,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:l,classes:g},{},"block",o.node(s.start),o.node(s.end),r),s.label&&(await(0,i.jP)(e,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:l,classes:g}),(0,i.T_)({...s,x:l[1].x,y:l[1].y},{originalPath:l}))}}}(0,l.K)(ae,"setBlockSizes"),(0,l.K)(ce,"layoutBlocks"),(0,l.K)(le,"findBounds"),(0,l.K)(he,"layout"),(0,l.K)(ge,"getNodeFromBlock"),(0,l.K)(ue,"calculateBlockSize"),(0,l.K)(de,"insertBlockPositioned"),(0,l.K)(ye,"performOperations"),(0,l.K)(pe,"calculateBlockSizes"),(0,l.K)(be,"insertBlocks"),(0,l.K)(fe,"insertEdges");var xe=(0,l.K)(function(e,t){return t.db.getClasses()},"getClasses"),Se={parser:L,db:se,renderer:{draw:(0,l.K)(async function(e,t,s,n){const{securityLevel:r,block:o}=(0,a.zj)(),l=n.db;let h;l.setDiagramId(t),"sandbox"===r&&(h=(0,x.Ltv)("#i"+t));const g="sandbox"===r?(0,x.Ltv)(h.nodes()[0].contentDocument.body):(0,x.Ltv)("body"),u="sandbox"===r?g.select(`[id="${t}"]`):(0,x.Ltv)(`[id="${t}"]`);(0,i.g0)(u,["point","circle","cross"],n.type,t);const d=l.getBlocks(),y=l.getBlocksFlat(),p=l.getEdges(),b=u.insert("g").attr("class","block");await pe(b,d,l);const f=he(l);await be(b,d,l),await fe(b,p,y,l,t);const S=b.node()?.getBBox(),m=S&&Number.isFinite(S.width)&&Number.isFinite(S.height)?S:f;if(m){const e=Math.max(1,Math.round(m.width/m.height*.125)),t=m.height+e+10,s=m.width+10,{useMaxWidth:n}=o;(0,a.a$)(u,t,s,!!n),c.R.debug("Here Bounds",f,m),u.attr("viewBox",`${m.x-5} ${m.y-5} ${m.width+10} ${m.height+10}`)}},"draw"),getClasses:xe},styles:ie}},64918(e,t,s){s.d(t,{o:()=>n});var n=(0,s(86827).K)(()=>"\n /* Font Awesome icon styling - consolidated */\n .label-icon {\n display: inline-block;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n }\n \n .node .label-icon path {\n fill: currentColor;\n stroke: revert;\n stroke-width: revert;\n }\n","getIconStyles")}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[9546],{75007(e,t,s){s.d(t,{h:()=>r});s(96540);var n=s(85997),i=s(74848);function r(e){return(0,i.jsxs)("h2",{className:"message",children:[(0,i.jsx)(n.In,{icon:"sentiment_dissatisfied"}),(0,i.jsx)("span",{children:e.context})]})}},22081(e,t,s){var n=s(96540),i=s(16349),r=s(74848);const c=({percentage:e})=>{const t=(0,n.useRef)(null),[s,c]=(0,n.useState)(null);return(0,n.useEffect)(()=>{const s=t.current.getContext("2d"),n=new i.Ay(s,{type:"doughnut",data:{labels:["use","left"],datasets:[{data:[e,100-e],backgroundColor:["#007bff","#f0f0f0"],borderWidth:0}]},options:{plugins:{legend:{display:!1},tooltip:{enabled:!1}},elements:{arc:{borderWidth:0}}}});return c(n),()=>{n.destroy()}},[]),(0,n.useEffect)(()=>{s&&(s.data.datasets[0].data=[e,100-e],s.update())},[e]),(0,r.jsx)("div",{style:{width:"8rem",overflow:"hidden"},children:(0,r.jsx)("canvas",{ref:t})})};s.d(t,["A",0,c])},77481(e,t,s){s.d(t,{S:()=>c,X:()=>r});var n=s(96540),i=s(74848);function r(e){const[t,s]=n.useState([]);return(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]),(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:e.headers?.map((e,t)=>(0,i.jsx)("th",{children:e},t))})}),(0,i.jsx)("tbody",{children:t.map((t,s)=>(0,i.jsx)("tr",{onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},children:t.map((s,n)=>(0,i.jsx)("td",{style:{width:e.width??"auto"},className:n===t.length-1?"small":"",children:s},n))},s))})]})}function c(e){return(0,i.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,i.jsx)("div",{children:e},t))})}},88062(e,t,s){s(96540),s(47022);var n=s(74848);function i(e){return(0,n.jsx)("div",{className:"black-tip",onClick:()=>{e.click&&e.click(e)},onContextMenu:t=>{t.stopPropagation(),t.nativeEvent.stopImmediatePropagation(),e.onContextMenu&&e.onContextMenu(t,e)},children:e.name})}const r=e=>(0,n.jsxs)("li",{children:[e.click?(0,n.jsx)(i,{...e.node,name:e.render?e.render(e.node):e.node.name,click:e.click,onContextMenu:e.onContextMenu}):(0,n.jsx)("div",{children:e.render?e.render(e.node):e.node.name}),e.node.children&&e.node.children.length>0&&(0,n.jsx)("ul",{children:e.node.children.map((t,s)=>(0,n.jsx)(r,{node:t,click:e.click,onContextMenu:e.onContextMenu,render:e.render},s))})]}),c=e=>(0,n.jsx)("div",{className:"card-tree-view",children:(0,n.jsx)("ul",{children:e.list&&e.list.map((t,s)=>(0,n.jsx)(r,{node:t,click:e.click,onContextMenu:e.onContextMenu,render:e.render},s))})});s.d(t,["A",0,c])},59546(e,t,s){s.r(t),s.d(t,{default:()=>ce});var n=s(96540),i=s(75725),r=s(70447),c=s(22081),o=s(92275),l=s(14944),a=s(14284),d=s(57952),h=s(85997),u=s(77481),x=s(53459),p=s(34899),m=s(34843),f=s(82893),j=s(74777),_=s(62042),y=s(61443),g=s(74848);function w(e){const{t}=(0,p.Bd)(),[s,c]=(0,m.fp)(f.AG.disk),[o,l]=(0,n.useState)({}),[j,_]=(0,n.useState)([]),y=[t("名字"),t("当前值"),t("历史最低"),t("临界值")];return(0,n.useEffect)(()=>{(async()=>{const s=await a.Yu.post("sys/disk/info",{name:e.name});if(s.code===x.m.Success){const e=[];for(const n of s.data.ata_smart_attributes??[]){let s;n[1]>=n[2]?s="var(--icon-green)":n[1]<=n[3]&&(s="var(--icon-red)"),n[0]=(0,g.jsx)("span",{style:{color:s},children:t(n[0])}),e.push(n)}_(s.data.ata_smart_attributes),l(s.data)}})()},[]),(0,g.jsxs)("div",{children:[(0,g.jsx)(d.A,{children:(0,g.jsx)(h.rA,{icon:"close",title:t("关闭"),onClick:()=>{c({})}})}),(0,g.jsx)(i.jW,{isFull:!0,more:!0,children:(0,g.jsx)(i.NN,{children:(0,g.jsxs)(i.fI,{children:[(0,g.jsxs)(i.VP,{widthPer:30,children:[(0,g.jsx)(i.xh,{children:(0,g.jsxs)(r.Zp,{title:t("基本信息"),children:[(0,g.jsx)(i.Yh,{left:t("名字"),right:e.name}),(0,g.jsx)(i.Yh,{left:t("厂商名称"),right:e.typeName}),(0,g.jsx)(i.Yh,{left:t("类型"),right:e.type}),(0,g.jsx)(i.Yh,{left:t("容量"),right:e.total})]})}),(0,g.jsx)(i.xh,{children:(0,g.jsxs)(r.Zp,{title:t("物理信息"),children:[(0,g.jsx)(i.Yh,{left:t("是否健康"),right:!0===o.smart_status?"是":"否"}),(0,g.jsx)(i.Yh,{left:t("设备型号"),right:o.model_name}),(0,g.jsx)(i.Yh,{left:t("序列号"),right:o.serial_number}),(0,g.jsx)(i.Yh,{left:t("固件版本"),right:o.firmware_version}),(0,g.jsx)(i.Yh,{left:t("转速(每分钟)"),right:o.rotation_rate}),(0,g.jsx)(i.Yh,{left:t("通电时长(小时)"),right:o.power_on_time_hours}),(0,g.jsx)(i.Yh,{left:t("通电次数"),right:o.power_cycle_count}),(0,g.jsx)(i.Yh,{left:t("温度(°C)"),right:o.temperature}),(0,g.jsx)(i.Yh,{left:t("通信协议"),right:o.device_protocol})]})})]}),(0,g.jsx)(i.VP,{widthPer:50,children:(0,g.jsxs)(i.xh,{children:[j?.length?(0,g.jsx)(r.uF,{title:t("ATA/SATA详细信息"),children:(0,g.jsx)(u.X,{headers:y,rows:j,width:"10rem"})}):(0,g.jsx)(g.Fragment,{}),o.nvme_smart?(0,g.jsxs)(r.Zp,{title:t("NVME详细信息"),children:[(0,g.jsx)(i.Yh,{left:t("NVMe 可用备用块(%)"),right:o.nvme_smart.available_spare}),(0,g.jsx)(i.Yh,{left:t("NVMe 已使用寿命(%)"),right:o.nvme_smart.percentage_used}),(0,g.jsx)(i.Yh,{left:t("NVMe 读取量"),right:o.nvme_smart.data_units_read}),(0,g.jsx)(i.Yh,{left:t("NVMe 写入量"),right:o.nvme_smart.data_units_written}),(0,g.jsx)(i.Yh,{left:t("NVMe 通电次数"),right:o.nvme_smart.power_cycles}),(0,g.jsx)(i.Yh,{left:t("NVMe 通电时长(小时)"),right:o.nvme_smart.power_on_hours}),(0,g.jsx)(i.Yh,{left:t("NVMe 非正常关机"),right:o.nvme_smart.unsafe_shutdowns}),(0,g.jsx)(i.Yh,{left:t("NVMe 媒体错误"),right:o.nvme_smart.media_errors}),(0,g.jsx)(i.Yh,{left:t("NVMe 错误日志数"),right:o.nvme_smart.num_err_log_entries})]}):(0,g.jsx)(g.Fragment,{})]})})]})})})]})}let v=function(e){return e[e.mount=0]="mount",e}({});var k=s(88062),S=s(78247),b=s(23430);const C=e=>(0,g.jsxs)("div",{style:{border:"2px solid black",padding:"10px",width:"300px",height:"300px",position:"relative"},children:[e.name,e.lvms.map((e,t)=>(0,g.jsx)("div",{style:{margin:"5px",height:"40px",display:"flex",alignItems:"center",justifyContent:"center",border:"1px solid "},children:e.name},t))]});function A(){return(0,g.jsx)("div",{style:{position:"relative",height:"300px",margin:"10px",width:"30px",display:"flex",alignItems:"center",justifyContent:"center"},children:(0,g.jsx)("div",{style:{width:0,height:0,borderTop:"10px solid transparent",borderBottom:"10px solid transparent",borderLeft:"10px solid black"}})})}function P(){const{t:e}=(0,p.Bd)(),[t,s]=(0,m.fp)(f.AG.disk),[c,o]=(0,n.useState)({}),[l,j]=(0,n.useState)([]),[y,w]=(0,n.useState)([]),[P,V]=(0,m.fp)(f.AG.showPrompt),{check_user_auth:Y}=(0,S.MH)(),[$,F]=(0,n.useState)([]),{click_file:I}=(0,S.kZ)(),[N,M]=(0,m.fp)(f.AG.prompt_card),E=[e("挂载点"),"uuid",e("类型"),e("文件系统类型"),e("文件系统容量"),e("卷容量"),e("设备路径"),e("分区表类型")],K=async()=>{const e=await a.Yu.get("disk/blk");return e.code===x.m.Success&&j(e.data),e.code};(0,n.useEffect)(()=>{(async()=>{K()})()},[]);const B=[(0,g.jsx)(h.rA,{icon:"info",title:e("提示"),onClick:async()=>{M({open:!0,title:"信息",context_div:(0,g.jsx)("div",{children:(0,g.jsxs)("ul",{children:[(0,g.jsxs)("li",{children:["通用格式:","<文件系统> <挂载点> <类型> <挂载选项> <dump> <fsck> "]}),(0,g.jsxs)("li",{children:["文件系统,有多种格式",(0,g.jsxs)("ul",{children:[(0,g.jsx)("li",{children:"1(usb口默认名称)./dev/sda1"}),(0,g.jsx)("li",{children:"2(唯一Id).UUID=123e4567-e89b-12d3-a456-426614174000"}),(0,g.jsx)("li",{children:"3.LABEL=DATA"})]})]}),(0,g.jsx)("li",{children:"挂载点,就是文件路径,例如 /mnt/data ,这个目录要提前创建,且为空"}),(0,g.jsx)("li",{children:"类型,就是文件系统类型,对于系统不支持的类型,例如ntfs需要额外前提安装ntfs-3g(linux 5.15内核以后自带 ntfs)"}),(0,g.jsxs)("li",{children:['挂载选项的值只能是以下这些,可以用 "," 同时使用多个选项',(0,g.jsxs)("ul",{children:[(0,g.jsx)("li",{children:"defaults:使用默认挂载选项"}),(0,g.jsx)("li",{children:"noatime:不更新访问时间,提高性能"}),(0,g.jsx)("li",{children:"auto:系统启动时自动挂载"}),(0,g.jsx)("li",{children:"rw:以读写方式挂载"}),(0,g.jsx)("li",{children:"nofail:防止启动阻塞,挂载失败系统继续执行"}),(0,g.jsx)("li",{children:"...等"})]})]}),(0,g.jsx)("li",{children:"dump 0是需要备份 1是不需要备份"}),(0,g.jsx)("li",{children:"Fsck 整数值0是不检查,文件系统检查顺序越小越先检查"}),(0,g.jsx)("li",{children:"提示:只有含有文件系统的逻辑卷,或者分区才可以进行挂载。"})]})})})}}),(0,g.jsx)(h.rA,{icon:"update",title:e("更新挂载"),onClick:async()=>{(await a.Yu.post("cmd/exe",{type:v.mount})).code===x.m.Success&&(0,_.SK)("挂载文件已生效")}},1)],H=async()=>(await a.Yu.get("get_fstab")).data,z=async e=>{await a.Yu.post("save_fstab",{content:e})};return(0,g.jsxs)("div",{children:[(0,g.jsx)(d.A,{children:(0,g.jsx)(h.rA,{icon:"close",title:e("关闭"),onClick:()=>{s({})}})}),(0,g.jsx)(i.jW,{isFull:!0,more:!0,children:(0,g.jsx)(i.NN,{children:(0,g.jsxs)(i.fI,{children:[(0,g.jsx)(i.VP,{widthPer:40,children:(0,g.jsxs)(r.Zp,{title:e("物理块(硬盘)设备、逻辑卷、物理卷"),titleCom:(0,g.jsxs)("div",{children:[Y(b.oV.sys_disk_mount)&&(0,g.jsx)(h.rA,{icon:"file_open",title:e("打开挂载文件"),onClick:async()=>{I({name:"fstab(谨慎修改,内容错误会导致系统无法启动)",model:"text",get_file_fun:H,save_file_fun:z,menu_list:B})}}),(0,g.jsx)(h.rA,{icon:"update",title:e("刷新"),onClick:async()=>{await K()===x.m.Success&&(0,_.SK)("刷新成功")}})]}),children:[(0,g.jsx)(u.X,{headers:E,rows:y,width:"10rem"}),(0,g.jsx)(k.A,{list:l,render:e=>{let t=e.name;return e.label&&(t+=`(${e.label})`),e.mountpoint?(0,g.jsxs)("span",{children:[t,(0,g.jsx)("span",{style:{color:"green"},children:"(已挂载)"})]}):t},onContextMenu:(e,t)=>{e.preventDefault()},click:t=>{let s="";if(t.mountpoint)for(let e=0;e<t.mountpoints.length;e++)s+=t.mountpoints[e]+";";w([[(0,g.jsx)(r.xP,{children:s}),(0,g.jsx)(r.xP,{children:t.uuid}),e(t.type),e(t.fstype),t.fssize,t.size,(0,g.jsx)(r.xP,{children:t.path}),t.pttype]])}})]})}),(0,g.jsx)(i.VP,{widthPer:60,children:$.map((t,s)=>{const n=[];for(const e of t.pv_list)n.push({name:`${e.name}---(${e.size})---(${e.free_size})`});const c=[];for(const e of t.lv_list)c.push({name:`${e.name}---(${e.size})`});return(0,g.jsx)(r.Zp,{children:(0,g.jsxs)(i.n5,{children:[(0,g.jsx)(C,{name:e("物理卷"),lvms:n}),(0,g.jsx)(A,{}),(0,g.jsx)(C,{name:`${e("逻辑卷")}---(${t.name})---size(${t.size})`,lvms:[]}),(0,g.jsx)(A,{}),(0,g.jsx)(C,{name:e("逻辑卷"),lvms:c})]})},s)})})]})})})]})}var V=s(88815);let Y=!0;function $(e){const{t}=(0,p.Bd)(),s=[t("名字"),t("厂商名称"),t("类型"),t("容量")],y=[t("名字"),t("物理硬盘"),t("文件系统类型"),t("挂载位置"),t("总容量"),t("剩余容量")],[v,k]=(0,m.fp)(f.AG.user_base_info),[S,C]=(0,n.useState)(0),[A,$]=(0,n.useState)(0),[F,I]=(0,n.useState)(0),[N,M]=(0,n.useState)(0),[E,K]=(0,n.useState)(0),[B,H]=(0,n.useState)({}),[z,G]=(0,n.useState)(!1),[W,Z]=(0,n.useState)(!1),[D,T]=(0,n.useState)(!1),[X,U]=(0,n.useState)(Y),[L,q]=(0,n.useState)(null),[R,O]=(0,n.useState)([]),[J,Q]=(0,n.useState)([]),[ee,te]=(0,m.fp)(f.AG.user_base_info),[se,ne]=(0,m.fp)(f.AG.disk),ie=async()=>{if(!Y)return;const e=new o.hf(o.HK.sys_get);await l.ws.send(e),l.ws.addMsg(o.HK.sys_getting,e=>{M(e.context?.cpu_currentLoad);const t=e.context?.memLeft,s=e.context?.memTotal;$(t),I(s),C((s-t)/s*100),q(e.context?.node_memory_usage),K(e.context?.node_cpu_usage)})};return(0,n.useEffect)(()=>((async()=>{await ie()})(),()=>{l.ws.sendData(o.HK.sys_cancel,{})}),[]),(0,g.jsxs)("div",{children:[(0,g.jsxs)(d.A,{children:[v.sys===b.XM.linux&&(0,g.jsx)(h.rA,{icon:"sd_card",title:"硬盘挂载",onClick:()=>{ne({type:"mount"})}}),(0,g.jsx)(h.Z$,{defaultStatus:!1,text:t("基本信息"),clickFun:e=>{G(e),e&&(async()=>{const e=await a.Yu.get("base");if(e.code===x.m.Success){const t=e.data;H(t)}})()}}),(0,g.jsx)(h.Z$,{defaultStatus:!1,text:t("物理硬盘"),clickFun:e=>{Z(e),e&&(async()=>{const e=await a.Yu.get("disk");if(e.code===x.m.Success){const s=e.data,n=[];let i=!0;ee.sysSoftWare&&ee.sysSoftWare[j.jk.smartmontools]&&ee.sysSoftWare[j.jk.smartmontools].installed||(i=!1);for(const e of s??[])n.push([(0,g.jsx)(r.xP,{context:e.name}),e.typeName,e.type,e.total,(0,g.jsx)(h.rA,{icon:"health_and_safety",title:t("查看健康信息"),onClick:()=>{i?ne({type:"check",data:e}):(0,_.zN)("没有安装smartmontools")}})]);O(n)}})()}}),(0,g.jsx)(h.Z$,{defaultStatus:!1,text:t("文件硬盘"),clickFun:e=>{T(e),e&&(async()=>{const e=await a.Yu.get("filedisk");if(e.code===x.m.Success){const t=e.data,s=[];for(const e of t??[])s.push([(0,g.jsx)(r.xP,{context:e.name}),(0,g.jsx)(r.xP,{context:e.device_name}),e.fsType,(0,g.jsx)(r.xP,{context:e.mount}),e.total,e.available]);Q(s)}})()}}),(0,g.jsx)(h.Z$,{defaultStatus:X,text:t("实时信息"),clickFun:e=>{U(e),Y=e,ie()}})]}),(0,g.jsxs)(i.xh,{children:[X&&(0,g.jsxs)(i.fI,{children:[(0,g.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,g.jsx)(r.Zp,{title:"Sys "+t("内存"),children:(0,g.jsxs)(i.fI,{children:[(0,g.jsx)(i.VP,{children:(0,g.jsx)(c.A,{percentage:S})}),(0,g.jsx)(i.VP,{children:(0,g.jsxs)(i.fI,{children:[(0,g.jsx)(i.VP,{widthPer:100,children:(0,g.jsx)("div",{children:(0,g.jsx)(i.Yh,{left:t("总容量"),center:`${F}G`})})}),(0,g.jsx)(i.VP,{widthPer:100,children:(0,g.jsx)(i.Yh,{left:t("剩余"),center:`${A}G`})})]})})]})})}),(0,g.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,g.jsx)(r.Zp,{title:"Sys cpu",children:(0,g.jsxs)(i.fI,{children:[(0,g.jsx)(i.VP,{children:(0,g.jsx)(c.A,{percentage:N})}),(0,g.jsx)(i.VP,{children:(0,g.jsx)(i.fI,{children:(0,g.jsx)(i.Yh,{left:t("使用率"),center:N})})})]})})}),(0,g.jsx)(i.VP,{widthPer:33,maxWidth:"30rem",children:(0,g.jsx)(r.Zp,{title:"FileCat",children:(0,g.jsxs)(i.fI,{children:[(0,g.jsxs)(i.VP,{children:[(0,g.jsx)(i.qV,{content:t("内存")}),(0,g.jsx)(i.qV,{content:"total: "+(0,V.v7)(L?.rss)}),(0,g.jsx)(i.qV,{content:"object: "+(0,V.v7)(L?.heapTotal)}),(0,g.jsx)(i.qV,{content:"obj-use: "+(0,V.v7)(L?.heapUsed)}),(0,g.jsx)(i.qV,{content:"external: "+(0,V.v7)(L?.external)}),(0,g.jsx)(i.qV,{content:"buffer: "+(0,V.v7)(L?.arrayBuffers)})]}),(0,g.jsx)(i.VP,{children:(0,g.jsx)(i.qV,{content:"cpu growth rate: "+E})})]})})})]}),(0,g.jsxs)(i.fI,{children:[z&&(0,g.jsx)(i.VP,{children:(0,g.jsxs)(r.Zp,{title:t("基本信息"),children:[(0,g.jsx)(i.Yh,{left:t("总内存"),right:B.mem_total}),(0,g.jsx)(i.Yh,{left:`cpu ${t("制造商")}`,right:B.cpu_manufacturer}),(0,g.jsx)(i.Yh,{left:`cpu ${t("品牌")}`,right:B.cpu_brand}),(0,g.jsx)(i.Yh,{left:`cpu ${t("逻辑核心")}`,right:B.cpu_core_num}),(0,g.jsx)(i.Yh,{left:`cpu ${t("物理核心")}`,right:B.cpu_phy_core_num}),(0,g.jsx)(i.Yh,{left:`cpu ${t("最大")}hz`,right:B.cpu_speed_hz}),(0,g.jsx)(i.Yh,{left:`${t("当前系统")}:pid;ppid`,right:B.pid_ppid}),(0,g.jsx)(i.Yh,{left:t("运行用户"),right:B.user})]})}),W&&(0,g.jsx)(i.VP,{children:(0,g.jsx)(r.uF,{title:t("物理硬盘"),children:(0,g.jsx)(u.X,{headers:s,rows:R,width:"10rem"})})}),D&&(0,g.jsx)(i.VP,{children:(0,g.jsx)(r.uF,{title:t("文件硬盘"),children:(0,g.jsx)(u.X,{headers:y,rows:J,width:"10rem"})})})]})]}),se&&"check"===se.type&&(0,g.jsx)(w,{...se.data}),se&&"mount"===se.type&&(0,g.jsx)(P,{})]})}var F=s(75007),I=s(97856),N=s(64405);const M=n.lazy(()=>Promise.all([s.e(2543),s.e(5614)]).then(s.bind(s,85614)));function E(e){const[t,s]=(0,n.useState)(null),[i,r]=(0,m.fp)(f.AG.dockerShellShow),[c,a]=(0,m.fp)(f.AG.user_base_info),d=c.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",h=()=>{(async()=>{t&&(t.writeln("[38;2;29;153;243mclose![0m "),t.dispose(),s(null))})()};(0,n.useEffect)(()=>{i.show?(async()=>{const e=new I.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:d,cursor:d,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0});let t;l.ws.subscribeUnconnect(h);const n=t=>{e.write(t)};t=s=>{e.clear(),e.write(s),t=n},l.ws.addMsg("logs"===i.type?o.HK.docker_shell_logs_getting:o.HK.docker_shell_exec_getting,e=>{"error"===e.context&&h(),t(e.context)}),"exec"===i.type&&e.onData(async e=>{const t=new o.hf(o.HK.docker_shell_exec);t.context=e,await l.ws.send(t)}),s(e)})():h()},[i]),(0,n.useEffect)(()=>()=>{h()},[]);return(0,g.jsx)(M,{show:i.show,terminal:t,init:(e,s)=>{t.writeln("[38;2;29;153;243mconnect...[0m ");const n=new N.n;let r;n.rows=e,n.cols=s,n.dockerId=i.dockerId,r="logs"===i.type?new o.hf(o.HK.docker_shell_logs):new o.hf(o.HK.docker_shell_exec_open),r.context=n,l.ws.send(r)}})}var K=s(27690);let B="",H=[],z=!1;function G(e){const{t}=(0,p.Bd)(),[s,c]=(0,n.useState)({}),[j,w]=(0,n.useState)([]),[v,k]=(0,n.useState)([]),{check_user_auth:C}=(0,S.MH)(),[A,P]=(0,m.fp)(f.AG.dockerShellShow),[V,Y]=(0,m.fp)(f.AG.showPrompt),[$,I]=(0,m.fp)(f.AG.confirm),[N,M]=(0,n.useState)(B),[G,W]=(0,n.useState)(["id",t("名字"),t("镜像"),t("命令"),t("状态"),t("内存"),"cpu%",t("选择")]),[Z,D]=(0,n.useState)([]),[T,X]=(0,n.useState)(void 0),[U,L]=(0,n.useState)(!1),q=["id",t("name"),t("create时间"),t("大小"),(0,g.jsxs)("span",{children:["选中",(0,g.jsx)(h.rA,{icon:"check_box",title:"全选",onClick:()=>{z=!z;const e={};for(let t=0;t<v.length&&z;t++)e[v[t][0].props.context]=1;c(e)}})]})],R=async()=>{w([]),D([]);const e=new o.hf(o.HK.docker_get);await l.ws.send(e),l.ws.addMsg(o.HK.docker_getting,e=>{const t=[];if(B){for(const s of e.context)for(const e of s)if(`${e}`.includes(B)){t.push(s);break}}else t.push(...e.context);w(t.map(e=>{const t=e.map(e=>(0,g.jsx)(r.xP,{context:e}));return t.push((0,g.jsx)(h.rA,{icon:"place",title:"选中",onClick:()=>{D(t)}})),t}))})};(0,n.useEffect)(()=>(M(B),R(),()=>{(async()=>{P({show:!1,type:"",dockerId:""})})()}),[]),(0,n.useEffect)(()=>{B=N},[N]);const O=()=>{const e=new o.hf("logs"===A.type?o.HK.docker_shell_logs_cancel:o.HK.docker_shell_exec_cancel);e.context="",l.ws.send(e)},J=e=>{const t=new o.hf(o.HK.docker_switch);t.context={type:e,dockerId:Z[0].props.context},D([]),l.ws.send(t)},Q=async()=>{const e=await a.Yu.get("docker/images");if(e.code===x.m.Success){const t=e.data??[],s=[];for(let e=0;e<t.length;e++){const n=t[e],i=[(0,g.jsx)(r.xP,{context:n[0]}),(0,g.jsx)(r.xP,{context:n[1]}),n[2],n[3],""];s.push(i)}H=s,k(s)}};return(0,g.jsxs)("div",{children:[(0,g.jsxs)(d.A,{left_children:(0,g.jsx)(h.Z$,{defaultStatus:!1,text:t("docker镜像"),clickFun:e=>{L(e),e?(Q(),D([])):(R(),k([]),c({}))}}),children:[Object.keys(s).length>0&&(0,g.jsx)(h.rA,{icon:"delete",title:t("删除镜像"),onClick:async()=>{I({open:!0,title:t("确定删除选中的镜像吗"),handle:async()=>{const e=Object.keys(s),t=await a.Yu.post("docker/check/delete",{ids:e});if(t.code===x.m.Success)if(0===t.data.length){(await a.Yu.post("docker/delete",{ids:e})).code===x.m.Success&&((0,_.SK)("删除完成"),Q(),I({open:!1,handle:null}))}else(0,_.N9)(`有镜像正在运行${JSON.stringify(t.data)}`)}})}}),Z.length>0&&(0,g.jsx)("div",{children:Z[1].props.context}),Z.length>0&&(0,g.jsxs)("div",{children:[C(b.oV.docker_container_update)&&(0,g.jsx)(h.rA,{icon:"delete",title:t("删除容器"),onClick:()=>{Y({show:!0,overlay:!0,type:K.PromptEnum.DockerDel,data:{dockerId:Z[0].props.context,name:Z[1].props.context}})}}),(0,g.jsx)(h.rA,{icon:"print",title:t("打印日志"),onClick:()=>{A.show?(P({show:!1,type:"",dockerId:""}),O()):P({show:!0,dockerId:Z[0].props.context,type:"logs"})}}),C(b.oV.docker_container_update)&&(0,g.jsx)(h.rA,{icon:"personal_video",title:t("执行命令"),onClick:()=>{A.show?(P({show:!1,type:"",dockerId:""}),O()):P({show:!0,dockerId:Z[0].props.context,type:"exec"})}}),C(b.oV.docker_container_update)&&Z[4].props.context.includes("Up")&&(0,g.jsx)(h.rA,{icon:"stop",title:t("停止"),onClick:()=>J("stop")}),C(b.oV.docker_container_update)&&!Z[4].props.context.includes("Up")&&(0,g.jsx)(h.rA,{icon:"play_arrow",title:t("开启"),onClick:()=>{J("start")}})]}),(0!==j.length||N)&&!U&&(0,g.jsx)(h.rA,{icon:"refresh",title:t("列表更新"),onClick:async()=>{const e=new o.hf(o.HK.docker_get);await l.ws.send(e)}})]}),(0,g.jsxs)(i.xh,{children:[U&&(0,g.jsx)(i.fI,{children:(0,g.jsx)(i.VP,{widthPer:80,children:(0,g.jsx)(r.uF,{title:`${t("镜像")} (${v.length})`,titleCom:(0,g.jsx)(y.Sm,{placeholder:t("过滤镜像"),value:T,handleInputChange:e=>{X(e)},handlerEnter:()=>{const e=[];if(T){for(const t of v)(t[0].props.context.includes(T)||t[1].props.context.includes(T))&&e.push(t);k(e)}else k(H)}}),children:(0,g.jsx)(u.X,{headers:q,rows:v.map((e,n)=>(e[4]=(0,g.jsx)(y.GL,{context:t(""),selected:s[e[0].props.context],onchange:()=>{(e=>{const t={};Object.assign(t,s),t[e]?delete t[e]:t[e]=1,c(t)})(e[0].props.context)}}),e)),width:"10rem"})})})}),0===j.length&&!N&&!U&&(0,g.jsx)(F.h,{context:t("检测不到docker,主机可能没有安装docker or 容器为空")}),(0!==j.length||N)&&!U&&(0,g.jsx)(i.fI,{children:(0,g.jsx)(i.VP,{widthPer:80,children:(0,g.jsx)(r.uF,{title:`${t("容器")} (${j.length})`,titleCom:(0,g.jsx)(y.Sm,{placeholder:t("过滤"),value:N,handleInputChange:e=>{M(e)}}),children:(0,g.jsx)(u.X,{headers:G,rows:j,width:"10rem"})})})})]}),(0,g.jsx)(E,{})]})}var W=s(64694);let Z="",D=!1,T=!1;function X(e){const{t}=(0,p.Bd)(),[s,c]=(0,n.useState)([]),[a,x]=(0,n.useState)([]),[m,f]=(0,n.useState)(0),[j,_]=(0,n.useState)(""),[w,v]=(0,n.useState)(["pid",t("名字"),t("创建用户"),(0,g.jsxs)("span",{children:[t("内存"),(0,g.jsx)(h.rA,{icon:"sort",title:t("升序"),onClick:()=>{D=!D}})]}),(0,g.jsxs)("span",{children:["cpu%",(0,g.jsx)(h.rA,{icon:"sort",title:t("升序"),onClick:()=>{T=!T}})]}),t("选择")]),{check_user_auth:k}=(0,S.MH)();(0,n.useEffect)(()=>{_(Z),(async()=>{c([]),f(0),x([]);const e=new o.hf(o.HK.process_get);await l.ws.send(e),l.ws.addMsg(o.HK.process_getting,e=>{const s=[];if(Z){for(const t of e.context)for(const e of t)if(`${e}`.includes(Z)){s.push(t);break}}else s.push(...e.context);D&&(0,W.di)(s,e=>e[3],!1),T&&(0,W.di)(s,e=>e[4],!1);const n=s.map(e=>{const s=e.map((e,t)=>(0,g.jsx)(r.xP,{context:3===t?(0,V.v7)(e):e}));return s.push((0,g.jsx)(h.rA,{icon:"place",title:t("选中"),onClick:()=>{x(s)}})),s});f(s.length),c(n)})})()},[]),(0,n.useEffect)(()=>{Z=j},[j]);return(0,g.jsxs)("div",{children:[(0,g.jsxs)(d.A,{children:[a.length>0&&(0,g.jsx)("div",{children:a[1].props.context}),a.length>0&&k(b.oV.sys_process_close)&&(0,g.jsx)("div",{children:(0,g.jsx)(h.rA,{icon:"stop",title:t("停止"),onClick:()=>{const e=new o.hf(o.HK.process_close);e.context={pid:a[0].props.context},x([]),l.ws.send(e)}})})]}),(0,g.jsx)(i.xh,{children:0!==s.length||Z?(0,g.jsx)(i.fI,{children:(0,g.jsx)(i.VP,{widthPer:80,children:(0,g.jsx)(r.uF,{title:`${t("进程")} (${m})`,titleCom:(0,g.jsx)(y.Sm,{placeholder:t("过滤"),value:j,handleInputChange:e=>{_(e)}}),children:(0,g.jsx)(u.X,{headers:w,rows:s,width:"10rem"})})})}):(0,g.jsx)(F.h,{context:t("加载中请等待...")})})]})}const U=n.lazy(()=>Promise.all([s.e(2543),s.e(5614)]).then(s.bind(s,85614)));function L(e){const[t,s]=(0,n.useState)(null),[i,r]=(0,m.fp)(f.AG.systemd_shell_show),[c,a]=(0,m.fp)(f.AG.user_base_info),d=c.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",h=()=>{(async()=>{t&&(t.writeln("[38;2;29;153;243mclose![0m "),t.dispose(),s(null))})()};(0,n.useEffect)(()=>{if(!i.show)return void h();(async()=>{const e=new I.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:d,cursor:d,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4,convertEol:!0});l.ws.subscribeUnconnect(h),l.ws.addMsg(o.HK.systemd_logs_getting,t=>{"error"===t.context&&h(),e.write(t.context)}),s(e)})();const e=e=>{};return document.addEventListener("cancel_systemd_logs",e),()=>{document.removeEventListener("cancel_systemd_logs",e)}},[i]),(0,n.useEffect)(()=>()=>{h()},[]);return(0,g.jsx)(U,{show:i.show,terminal:t,init:(e,s)=>{t.writeln("[38;2;29;153;243mconnect...[0m ");const n={unit_name:i.unit_name},r=new o.hf(o.HK.systemd_logs_get);r.context=n,l.ws.send(r)}})}const q=[{title:"no(不自动重启)",value:"no"},{title:"always(总是重启)",value:"always"},{title:"on-failure(失败才重启)",value:"on-failure"},{title:"on-abnormal(异常才重启)",value:"on-abnormal"}],R=[{title:"simple",value:"simple"},{title:"forking",value:"forking"},{title:"oneshot",value:"oneshot"},{title:"notify",value:"notify"}],O=[{title:"multi-user.target",value:"multi-user.target"},{title:"network.target",value:"network.target"}];function J(e,t){const s=[];return s.push("[Unit]"),t.description.trim()?s.push(`Description=${t.description.trim()}`):s.push(`Description=${e}`),s.push(""),s.push("[Service]"),s.push(`Type=${t.type.trim()||"simple"}`),t.exec_start.trim()&&s.push(`ExecStart=${t.exec_start.trim()}`),t.working_dir.trim()&&s.push(`WorkingDirectory=${t.working_dir.trim()}`),t.user_.trim()&&s.push(`User=${t.user_.trim()}`),t.restart&&"no"!==t.restart&&s.push(`Restart=${t.restart.trim()}`),s.push(""),s.push("[Install]"),s.push(`WantedBy=${t.wanted.trim()||"multi-user.target"}`),s.push(""),s.join("\n")}function Q(e){const t={description:"",type:"simple",exec_start:"",working_dir:"",user_:"root",restart:"no",wanted:"multi-user.target"},s=(t,s)=>{const n=e.split(/\r?\n/);let i=!1;for(const e of n){const n=e.trim(),r=n.match(/^\[(.*)\]$/);if(r){i=(r[1]||"").trim()===t;continue}if(!i)continue;const c=n.match(new RegExp(`^${s}\\s*=\\s*(.*)$`,"i"));if(c)return c[1].trim()}return""};return t.description=s("Unit","Description"),t.type=s("Service","Type")||"simple",t.exec_start=s("Service","ExecStart"),t.working_dir=s("Service","WorkingDirectory"),t.user_=s("Service","User"),t.restart=s("Service","Restart")||"no",t.wanted=s("Install","WantedBy")||"multi-user.target",t}function ee(e){const{t}=(0,p.Bd)(),[s,i]=(0,n.useState)("form"),[r,c]=(0,n.useState)(()=>(e.unit_name||"").replace(/\.service$/i,"")),[o,l]=(0,n.useState)({description:"",type:"simple",exec_start:"",working_dir:"",user_:"root",restart:"no",wanted:"multi-user.target"}),[d,h]=(0,n.useState)(""),[u,m]=(0,n.useState)(""),[f,j]=(0,n.useState)(!1);(0,n.useEffect)(()=>{"edit"===e.mode&&e.unit_name&&(async()=>{j(!0);try{const t=await a.Yu.post("systemd/get/context",{unit_name:e.unit_name});if(t.code!==x.m.Success)return;const s=t.data.context??"",n=t.data.path??"";m(n),h(s),l(Q(s))}finally{j(!1)}})()},[e.mode,e.unit_name]);const w=e=>{e!==s&&("text"===e?h(J(r,o)):l(Q(d)),i(e))},v=e=>t=>{l(s=>({...s,[e]:t}))};return(0,g.jsxs)("div",{children:[(0,g.jsxs)("div",{style:{display:"flex",gap:"0.4rem",marginBottom:"0.6rem"},children:[(0,g.jsx)("button",{className:"button button--flat "+("form"===s?"":"button--grey"),onClick:()=>w("form"),children:t("表单")}),(0,g.jsx)("button",{className:"button button--flat "+("text"===s?"":"button--grey"),onClick:()=>w("text"),children:t("文本")})]}),f?(0,g.jsx)("div",{children:t("加载中...")}):"form"===s?(0,g.jsxs)("div",{style:{display:"flex",flexDirection:"column",gap:"0.6rem"},children:[(0,g.jsx)(y.BC,{label:t("服务名称"),children:(0,g.jsx)(y.Sm,{placeholder:t("服务名称"),value:r,disabled:"edit"===e.mode,handleInputChange:e=>c(e),width:"100%"})}),(0,g.jsx)(y.BC,{label:t("服务描述"),children:(0,g.jsx)(y.Sm,{placeholder:t("服务描述"),value:o.description,handleInputChange:v("description"),width:"100%"})}),(0,g.jsx)(y.BC,{label:t("启动命令"),required:!0,children:(0,g.jsx)(y.Sm,{placeholder:t("ExecStart 启动命令,必填"),value:o.exec_start,handleInputChange:v("exec_start"),width:"100%"})}),(0,g.jsx)(y.BC,{label:t("运行类型"),children:(0,g.jsx)(y.l6,{options:R,value:o.type,onChange:v("type")})}),(0,g.jsx)(y.BC,{label:t("工作目录"),children:(0,g.jsx)(y.Sm,{placeholder:t("工作目录(可选)"),value:o.working_dir,handleInputChange:v("working_dir"),width:"100%"})}),(0,g.jsx)(y.BC,{label:t("运行用户"),children:(0,g.jsx)(y.Sm,{placeholder:t("运行用户(可选)"),value:o.user_,handleInputChange:v("user_"),width:"100%"})}),(0,g.jsx)(y.BC,{label:t("重启策略"),children:(0,g.jsx)(y.l6,{options:q,value:o.restart,onChange:v("restart")})}),(0,g.jsx)(y.BC,{label:t("安装目标"),children:(0,g.jsx)(y.l6,{options:O,value:o.wanted,onChange:v("wanted")})})]}):(0,g.jsx)("textarea",{className:"input--textarea input--no_border",style:{width:"100%",minHeight:"16rem",fontFamily:"monospace",fontSize:"0.85rem",boxSizing:"border-box"},value:d,onChange:e=>h(e.target.value),spellCheck:!1}),(0,g.jsxs)("div",{style:{display:"flex",justifyContent:"flex-end",gap:"0.4rem",marginTop:"0.6rem"},children:[(0,g.jsx)("button",{className:"button button--flat button--grey",disabled:f,onClick:e.onClose,children:t("取消")}),(0,g.jsx)("button",{className:"button button--flat",disabled:f,onClick:async()=>{if(!r.trim())return void(0,_.zN)(t("请填写服务名称"));const n=(i=r).trim().endsWith(".service")?i.trim():`${i.trim()}.service`;var i;const c="text"===s?d:J(n,o);if(c.includes("ExecStart=")){j(!0);try{if("create"===e.mode){const e=`/etc/systemd/system/${n}`;await a.Yu.post("systemd/sys/save",{unit_name:n,path:e,context:c}),await a.Yu.post("systemd/add",{unit_name:n}),(0,_.SK)(t("添加成功"))}else await a.Yu.post("systemd/sys/save",{unit_name:n,path:u,context:c}),(0,_.SK)(t("保存成功"));e.onClose(),e.onDone?.()}catch(e){console.error("systemd 保存失败",e)}finally{j(!1)}}else(0,_.zN)(t("请至少填写 ExecStart 启动命令"))},children:t("保存")})]})]})}let te,se="";function ne(e){const{t}=(0,p.Bd)(),{check_user_auth:s}=(0,S.MH)(),[c,j]=(0,m.fp)(f.AG.systemd_shell_show),[w,v]=(0,m.fp)(f.AG.confirm),[k,C]=(0,n.useState)(["pid","name","process",t("创建用户"),t("内存"),t("cpu%"),t("active状态"),t("选择")]),[A,P]=(0,n.useState)(["单元名字","加载状态",t("active(sub)状态"),t("描述"),t("选择")]),[Y,$]=(0,n.useState)([]),[I,N]=(0,n.useState)([]),[M,E]=(0,n.useState)([]),[K,B]=(0,n.useState)(!1),[H,z]=(0,n.useState)([]),[G,W]=(0,n.useState)(""),[Z,D]=(0,n.useState)(""),[T,X]=(0,n.useState)(new Set),[U,q]=(0,m.fp)(f.AG.editorSetting),[R,O]=(0,m.fp)(f.AG.prompt_card);(0,n.useEffect)(()=>{D(se),(async()=>{$([]),E([]);const e=new o.hf(o.HK.systemd_inside_get);await l.ws.send(e),l.ws.addMsg(o.HK.systemd_inside_getting,e=>{const t=[];if(se){for(const s of e.context)for(const e of s)if(`${e}`.includes(se)){t.push(s);break}}else t.push(...e.context);$(t.map(e=>{const t=e.map((e,t)=>(0,g.jsx)(r.xP,{context:4===t?(0,V.v7)(e):e}));return t.push((0,g.jsx)(h.rA,{icon:"place",title:"选中",onClick:()=>{E(t)}})),t}))})})()},[]),(0,n.useEffect)(()=>{se=Z},[Z]);const J=e=>{if(c.show){j({show:!1,unit_name:""});const e=new CustomEvent("cancel_systemd_logs",{detail:{}});document.dispatchEvent(e)}else j({show:!0,unit_name:e})},Q=async()=>{N([]),z([]);const e=await a.Yu.get("systemd/inside/all");if(e.code!==x.m.Success)return;X(new Set(e.data));const t=await a.Yu.get("systemd/allget");if(t.code===x.m.Success){const e=t.data,s=[];for(const t of e??[]){const e=[(0,g.jsx)(r.xP,{context:t.unit}),t.load,`${t.active}(${t.sub})`,(0,g.jsx)(r.xP,{context:t.description})];s.push([...e,(0,g.jsx)(h.rA,{icon:"place",title:"添加",onClick:()=>{z([...e])}})])}te=s,N(s)}},ne=(e,s)=>{O({open:!0,title:t("create"===e?"新建 systemd 服务":"编辑 systemd 服务"),context_div:(0,g.jsx)(ee,{mode:e,unit_name:s,onClose:()=>O({open:!1}),onDone:()=>{O({open:!1}),l.ws.send(new o.hf(o.HK.systemd_inside_get)),K&&Q(),E([]),z([])}})})};return(0,g.jsxs)("div",{children:[(0,g.jsxs)(d.A,{left_children:(0,g.jsx)(h.Z$,{defaultStatus:!1,text:t("系统systemd单元"),clickFun:e=>{B(e),e?(Q(),E([])):z([])}}),children:[s(b.oV.systemd)&&(0,g.jsx)("div",{children:(0,g.jsx)(h.rA,{icon:"add_circle",title:t("添加 systemd"),onClick:()=>{ne("create")}})}),M.length>0&&(0,g.jsx)("div",{children:M[1].props.context}),H.length>0&&(0,g.jsx)("div",{children:H[0].props.context}),M.length>0&&(0,g.jsxs)("div",{children:[s(b.oV.systemd)&&(0,g.jsx)(h.rA,{icon:"delete",title:"从实时监控删除",onClick:()=>{(async e=>{v({open:!0,handle:async()=>{(await a.Yu.post("systemd/delete",{unit_name:e})).code===x.m.Success&&((0,_.SK)("删除成功"),v({open:!1,handle:null}))}})})(M[1].props.context)}}),s(b.oV.systemd)&&(0,g.jsx)(h.rA,{icon:"edit",title:"可视化编辑",onClick:()=>{ne("edit",M[1].props.context)}}),(0,g.jsx)(h.rA,{icon:"print",title:"打印日志",onClick:()=>{J(M[1].props.context)}})]}),H.length>0&&(0,g.jsxs)("div",{children:[s(b.oV.systemd)&&(0,g.jsx)(h.rA,{icon:"delete",title:"删除系统上的sytemd",onClick:()=>{(async e=>{v({open:!0,handle:async()=>{(await a.Yu.post("systemd/sys/delete",{unit_name:e})).code===x.m.Success&&((0,_.SK)("删除成功"),v({open:!1,handle:null}))}})})(H[0].props.context)}}),(0,g.jsx)(h.rA,{icon:"print",title:"打印日志",onClick:()=>{J(H[0].props.context)}}),s(b.oV.systemd)&&(0,g.jsx)(h.rA,{icon:"text_fields",title:"sytemd文件内容",onClick:()=>{(async t=>{const s=await a.Yu.post("systemd/get/context",{unit_name:t});s.code===x.m.Success&&(q({model:"text",open:!0,fileName:e.name,save:async e=>{const n={unit_name:t,path:s.data.path,context:e};(await a.Yu.post("systemd/sys/save",n)).code===x.m.Success&&(S.xK.set_value_temp(""),q({open:!1,model:"",fileName:"",save:null}))}}),S.xK.set_value_temp(s.data.context))})(H[0].props.context)}}),s(b.oV.systemd)&&!T.has(H[0].props.context)&&(0,g.jsx)(h.rA,{icon:"plus_one",title:"添加到管理",onClick:()=>(async e=>{const t=await a.Yu.post("systemd/add",{unit_name:e});t.code===x.m.Success&&(X(new Set(t.data)),(0,_.SK)("添加成功"))})(H[0].props.context)})]})]}),(0,g.jsxs)(i.xh,{children:[K&&(0,g.jsx)(i.fI,{children:(0,g.jsx)(i.VP,{widthPer:80,children:(0,g.jsx)(r.uF,{title:`systemd系统单元(${I.length})`,titleCom:(0,g.jsx)(y.Sm,{placeholder:"过滤单元",value:G,handleInputChange:e=>{W(e)},handlerEnter:()=>{const e=[];if(G){for(const t of te)(t[0].props.context.includes(G)||t[3].props.context.includes(G))&&e.push(t);N(e)}else N(te)}}),children:(0,g.jsx)(u.X,{headers:A,rows:I,width:"10rem"})})})}),0===Y.length&&!K&&(0,g.jsx)(F.h,{context:"没有管理的单元 or 加载中请等待..."}),0!==Y.length&&!K&&(0,g.jsx)(i.fI,{children:(0,g.jsx)(i.VP,{widthPer:80,children:(0,g.jsx)(r.uF,{title:`filecat监控单元(${Y.length})`,titleCom:(0,g.jsx)(y.Sm,{placeholder:"过滤单元",value:Z,handleInputChange:e=>{D(e)}}),children:(0,g.jsx)(u.X,{headers:k,rows:Y,width:"10rem"})})})})]}),(0,g.jsx)(L,{})]})}function ie(){const{t:e}=(0,p.Bd)(),[t,s]=(0,n.useState)([]),[c,o]=(0,n.useState)("ufw"),[l,u]=(0,n.useState)("tcp"),[m,f]=(0,n.useState)(""),[j,w]=(0,n.useState)(""),[v,k]=(0,n.useState)(""),[S,b]=(0,n.useState)(!1),C=async()=>{const e=await a.V_.get("firewall/status");if(e.code===x.m.Success){const t=e.data??[];s(t);const n=t.find(e=>e.installed);n&&!0!==t.find(e=>e.id===c)?.installed&&o(n.id)}},A=async()=>{b(!0);try{const e=await a.V_.get(`firewall/rules?backend=${c}`);e.code===x.m.Success&&k(e.data??"")}catch(e){k("")}finally{b(!1)}};(0,n.useEffect)(()=>{C()},[]),(0,n.useEffect)(()=>{c&&A()},[c]);const P=!0===t.find(e=>e.id===c)?.installed,V=!0===t.find(e=>e.id===c)?.active;return(0,g.jsxs)("div",{children:[(0,g.jsxs)(d.A,{left_children:(0,g.jsx)("span",{className:"header-title",children:e("防火墙")}),children:[(0,g.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.4rem"},children:[(0,g.jsxs)("span",{style:{whiteSpace:"nowrap"},children:[e("后端"),":"]}),(0,g.jsx)("button",{className:"button button--flat "+("ufw"===c?"":"button--grey"),disabled:!0!==t.find(e=>"ufw"===e.id)?.installed,onClick:()=>o("ufw"),children:"ufw"}),(0,g.jsx)("button",{className:"button button--flat "+("nft"===c?"":"button--grey"),disabled:!0!==t.find(e=>"nft"===e.id)?.installed,onClick:()=>o("nft"),children:"nftables"})]}),P&&(0,g.jsx)(h.rA,{icon:"power_settings_new",title:e(V?"停用":"启用"),onClick:()=>(async t=>{try{const s=await a.V_.post("firewall/enable",{backend:c,enabled:t});if(s.code!==x.m.Success)return void(0,_.zN)(s.message||e("操作失败"));(0,_.SK)(s.data||e(t?"已启用":"已停用")),C(),A()}catch(e){}})(!V)}),(0,g.jsx)(h.rA,{icon:"refresh",title:e("刷新规则"),onClick:A})]}),(0,g.jsxs)(i.xh,{children:[(0,g.jsx)(i.fI,{children:(0,g.jsx)(i.VP,{widthPer:100,children:(0,g.jsx)(r.Zp,{title:e("状态"),children:(0,g.jsx)("div",{style:{display:"flex",gap:"1rem",flexWrap:"wrap"},children:t.map(t=>(0,g.jsxs)("div",{style:{padding:"0.6rem 0.8rem",minWidth:"12rem",border:"1px solid var(--border-color)",borderRadius:"0.4rem"},children:[(0,g.jsx)("div",{style:{fontWeight:"bold"},children:"ufw"===t.id?"ufw":"nftables"}),(0,g.jsxs)("div",{children:[e("已安装"),": ",(0,g.jsx)(r.xP,{context:t.installed?(0,g.jsx)("span",{style:{color:"green"},children:"✓"}):(0,g.jsx)("span",{style:{color:"red"},children:"✗"})})]}),(0,g.jsxs)("div",{children:[e("已启用"),": ",(0,g.jsx)(r.xP,{context:t.active?(0,g.jsx)("span",{style:{color:"green"},children:"✓"}):(0,g.jsx)("span",{style:{color:"gray"},children:"✗"})})]}),(0,g.jsx)("div",{style:{color:"gray",fontSize:"0.8rem"},children:t.note})]},t.id))})})})}),(0,g.jsx)(i.fI,{children:(0,g.jsx)(i.VP,{widthPer:100,children:(0,g.jsx)(r.uF,{title:e("端口放行 / 禁用"),children:(0,g.jsxs)("div",{style:{display:"flex",gap:"0.6rem",alignItems:"center",flexWrap:"wrap"},children:[(0,g.jsx)(y.l6,{options:[{title:"tcp",value:"tcp"},{title:"udp",value:"udp"}],value:l,onChange:e=>u(e),defaultValue:"tcp"}),(0,g.jsx)(y.Sm,{placeholder:e("端口号"),value:m,handleInputChange:e=>f(e),width:"10rem"}),(0,g.jsx)(y.Sm,{placeholder:e("来源地址(可选)"),value:j,handleInputChange:e=>w(e),width:"12rem"}),(0,g.jsx)(h.C3,{text:e("放行"),clickFun:async()=>{if(m.trim())try{const t=await a.V_.post("firewall/rule/add",{backend:c,proto:l,port:m.trim(),from:j.trim()||void 0});if(t.code!==x.m.Success)return void(0,_.zN)(t.message||e("操作失败"));(0,_.SK)(t.data||e("已放行")),A()}catch(e){}else(0,_.zN)(e("请填写端口号"))}}),(0,g.jsx)(h.C3,{text:e("禁用"),clickFun:async()=>{if(m.trim())try{const t=await a.V_.post("firewall/rule/del",{backend:c,proto:l,port:m.trim(),from:j.trim()||void 0});if(t.code!==x.m.Success)return void(0,_.zN)(t.message||e("操作失败"));(0,_.SK)(t.data||e("已禁用放行")),A()}catch(e){}else(0,_.zN)(e("请填写端口号"))}})]})})})}),(0,g.jsx)(i.fI,{children:(0,g.jsx)(i.VP,{widthPer:100,children:(0,g.jsxs)(r.uF,{title:`${e("规则列表")} (${c})`,children:[S&&(0,g.jsx)(F.h,{context:e("加载中...")}),!S&&!v&&(0,g.jsx)(F.h,{context:e("暂无规则")}),!S&&v&&(0,g.jsx)("pre",{style:{whiteSpace:"pre-wrap",wordBreak:"break-all",fontSize:"0.85rem",margin:0},children:v})]})})})]})]})}var re=s(87361);function ce(e){const{t}=(0,p.Bd)(),[s,n]=(0,m.fp)(f.AG.user_base_info),r=[{index:1,name:t("系统性能"),rto:"sys/",component:(0,g.jsx)($,{})},{index:2,name:t("系统进程"),rto:"process/",component:(0,g.jsx)(X,{})},{index:3,name:t("docker容器"),rto:"docker/",component:(0,g.jsx)(G,{})}];if(s.sys===b.XM.linux){(s.user_data?.is_root||(s.user_data?.auth_list??[]).includes(b.oV.systemd))&&r.push({index:4,name:t("systemd"),rto:"systemd/",component:(0,g.jsx)(ne,{})});(s.user_data?.is_root||(s.user_data?.auth_list??[]).includes(b.oV.firewall))&&r.push({index:5,name:t("防火墙"),rto:"firewall/",component:(0,g.jsx)(ie,{})})}return(0,g.jsx)(i.W1,{optionList:r,father_route:re.o.info})}}}]);
|