filecat 7.0.0 → 7.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/build/dist/1149.cbeaf4f434dffe8aa534.js +1 -0
  2. package/build/dist/{1893.f142d5709dc62fbd5385.js → 1893.c1053a2905d62db34d28.js} +1 -1
  3. package/build/dist/2851.b30185a469835aca77d0.js +1 -0
  4. package/build/dist/3328.85aa4fcbe515c670f1ad.js +1 -0
  5. package/build/dist/5877.c200f0882c61c4fca268.js +1 -0
  6. package/build/dist/{5937.47fe3c8460bd56b2784e.js → 5937.a80359e7e94cf8d00a45.js} +1 -1
  7. package/build/dist/6505.ade0bac4db1c9b922f35.js +1 -0
  8. package/build/dist/{676.c674f478ab4413ea910b.js → 676.44e642b4ef2b6a7a0fd0.js} +1 -1
  9. package/build/dist/6805.e710a58739319eb7ae8a.js +1 -0
  10. package/build/dist/6919.233769cf0439b571c2be.js +1 -0
  11. package/build/dist/6966.2432063a0d9349aff6b4.js +1 -0
  12. package/build/dist/7759.f7992b7ccdaa3bd07578.js +1 -0
  13. package/build/dist/8302.e7a6d156582a0132eb31.js +1 -0
  14. package/build/dist/{8714.bf18d28e4641be164b30.js → 8714.8fcad52f220ca72a1b6f.js} +1 -1
  15. package/build/dist/8765.4b41dd887f09c4c1a556.js +1 -0
  16. package/build/dist/9546.421e124c9297955f5a4d.js +1 -0
  17. package/build/dist/index.html +1 -1
  18. package/build/dist/main.d07c1bd328b47164e2a8.js +2 -0
  19. package/build/main.js +1 -1
  20. package/build/threads.work.filecat.js +1 -1
  21. package/package.json +1 -1
  22. package/build/dist/1149.7da2123c4f08574dd45f.js +0 -1
  23. package/build/dist/2851.4b018efbab28bccfeef8.js +0 -1
  24. package/build/dist/3328.2e0cb7e7579ccd119da6.js +0 -1
  25. package/build/dist/5877.3e4d78f19b08f948b547.js +0 -1
  26. package/build/dist/6505.f37ff577812fccac9b45.js +0 -1
  27. package/build/dist/6805.f2561ba5509cc4e9cadc.js +0 -1
  28. package/build/dist/6919.423a2e831e713be54ea0.js +0 -1
  29. package/build/dist/6966.f0d2adb09965f20c3f18.js +0 -1
  30. package/build/dist/7759.868061de8d33d120b740.js +0 -1
  31. package/build/dist/8302.e0f4d085e33b3b95b7a3.js +0 -1
  32. package/build/dist/8765.c7095ad906a9b71315c0.js +0 -1
  33. package/build/dist/9546.3240869de641c3dfd5b8.js +0 -1
  34. package/build/dist/main.8ee4ca5baecfc0267edb.js +0 -2
  35. /package/build/dist/{main.8ee4ca5baecfc0267edb.js.LICENSE.txt → main.d07c1bd328b47164e2a8.js.LICENSE.txt} +0 -0
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5937],{8694(e,t,a){a.d(t,{$K:()=>o,RB:()=>r,l5:()=>c,qB:()=>s,vo:()=>i,vr:()=>l});class s{targetProxyUrl;proxyPort;sysProxyPort}let n=function(e){return e[e.tcp=0]="tcp",e[e.udp=1]="udp",e}({});class o{open=!1;port;key="";async_ips=[]}class i{client_num_id;client_name;open=!1;ip;mask;serverIp;serverPort;key="";model=n.udp}let r=function(e){return e[e.row=1]="row",e[e.json=2]="json",e[e.form=3]="form",e}({});class l{body_type;header_type;url;method;headers;data;form_data_list;local_download_path}class c{enabled;ip;port;bypass;useForLocal;type}},75007(e,t,a){a.d(t,{h:()=>o});a(96540);var s=a(85997),n=a(74848);function o(e){return(0,n.jsxs)("h2",{className:"message",children:[(0,n.jsx)(s.In,{icon:"sentiment_dissatisfied"}),(0,n.jsx)("span",{children:e.context})]})}},47374(e,t,a){a.d(t,{e:()=>p});var s=a(96540),n=a(86090),o=a(64694),i=a(34289),r=a(61443),l=a(75725),c=a(86149),d=a(85997),u=a(74848);function p(e){let t=(0,n.zy)();const[a,p]=(0,s.useState)([]),[h,m]=(0,s.useState)("/"),[f,y]=(0,s.useState)(void 0),{t:_,i18n:v}=(0,c.B)();s.useEffect(()=>{let t="",a=(0,i.vX)().split("/");a=a.filter(e=>e);const s=a.indexOf(e.baseRoute),n=[];if(-1!=s){t=(0,o.IO)(a.slice(0,s),e.baseRoute);const i=a.slice(s+1);for(let e=0;e<i.length;e++){const a=i[e];n.push({value:a,href:0===e?`${t}${a}/`:(0,o.IO)(n[e-1].href,a)})}m(t),p(n)}},[t]);const x=t=>{t.stopPropagation(),e.clickFun(t)};return(0,u.jsx)("div",{className:"breadcrumbs",onClick:e=>{y(void 0!==f?void 0:"")},children:(0,u.jsx)(s.Fragment,{children:void 0===f?(0,u.jsxs)(s.Fragment,{children:[(0,u.jsx)("span",{className:"chevron",children:(0,u.jsx)(n.N_,{to:h,onClick:x,children:(0,u.jsx)(d.In,{icon:"home"})})}),a.map((e,t)=>(0,u.jsxs)("span",{className:"chevron",children:[(0,u.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,u.jsx)(n.N_,{to:e.href,onClick:x,children:decodeURIComponent(e.value)})]},t))]}):(0,u.jsx)(l.QM,{click:()=>{y(void 0)},children:(0,u.jsx)(r.Sm,{width:"100%",placeholder:_("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),y(void 0)}})})})})}},77481(e,t,a){a.d(t,{S:()=>r,X:()=>i});var s=a(96540),n=a(61443),o=a(74848);function i(e){const[t,a]=s.useState([]),i=(0,s.useRef)(-1),[r,l]=(0,s.useState)(-1),[c,d]=(0,s.useState)(-1);(0,s.useEffect)(()=>{e.children?a(Array.isArray(e.children)?e.children:[e.children]):a(e.rows)},[e.rows,e.children]);const u=()=>{i.current=-1,l(-1),d(-1)};return(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:e.headers?.map((t,a)=>{const s=!!e.filter&&(e.filter.column??0)===a;let i=t;if(s){const a=e.filter,s=a.options.find(e=>e.value===a.value);null!=a.value&&s&&(i=`${t} (${s.label})`)}return(0,o.jsx)("th",{className:s?"table-filter-col":"",children:s?(0,o.jsx)(n.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:i}):t},a)})})}),(0,o.jsx)("tbody",{children:t.map((t,a)=>{const s=!!e.onRowDrag;return(0,o.jsx)("tr",{className:s?(r===a?"row-dragging":"")+(c===a?" row-drop-target":""):"",draggable:s,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{s&&(i.current=a,l(a),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!s||i.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(a))},onDrop:t=>{s&&(t.preventDefault(),(()=>{const t=i.current,a=c;u(),t<0||a<0||t===a||e.onRowDrag?.(t,a)})())},onDragEnd:u,children:t.map((a,s)=>{const n=s===t.length-1?"small":"";return(0,o.jsx)("td",{className:n,style:{width:e.width??"auto"},children:a},s)})},a)})})]})}function r(e){return(0,o.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,o.jsx)("div",{children:e},t))})}},83029(e,t,a){a.d(t,{N:()=>v});var s=a(96540),n=a(34843),o=a(82893),i=a(74848);function r(e){const[t,a]=(0,n.fp)(o.AG.user_base_info);return(0,i.jsx)("div",{children:e.div?(0,i.jsx)("div",{className:"nav_list_a",style:{background:e.color},children:e.name}):e.clickItem||"dir"===e._type?(0,i.jsx)("div",{className:"nav_list_a",style:{background:e.color},onClick:()=>{"dir"!==e._type?e.clickItem&&e.clickItem(e):e.click_dir(e.item)},children:e.name}):(0,i.jsx)("a",{href:e.url,target:e.target,className:"nav_list_a",style:{background:e.color},children:e.name})})}var l=a(64694),c=a(61443),d=a(85997),u=a(86090),p=a(86149);const h=["#ffffff","#fefff8","#fcfdf1","#d3d2dc","#f8f9fd","#ebf4fe","#ebebeb","#e8f7eb","#eaf2f9"];let m,f,y=[];const _=[];function v(e){const[t,a]=(0,s.useState)([]),[v,x]=(0,s.useState)(-1),g=(0,u.zy)(),[w,j]=(0,s.useState)(!1),[k,N]=(0,s.useState)(!1),{t:K}=(0,p.B)(),[b,S]=(0,s.useState)([]),[C,A]=(0,n.fp)(o.AG.nav_index_add_item_by_now_list),F=e=>{-1!==v?_[v]._children=e:y=e};(0,s.useEffect)(()=>{(async()=>{if(!e.getItems)return;const t=await e.getItems();y=t,a(y)})()},[g]);(0,s.useEffect)(()=>{if(C){const e=[...t,{name:"",color:(0,l.Lr)(h),...C}];F(e),a(e),j(!0),A(void 0)}},[C]);const D=e=>{x(v+1),a(e._children),_.push(e)};return(0,i.jsxs)("div",{className:"nav_list_div scroll-div-y",children:[-1!==v&&(0,i.jsx)(d.rA,{title:"返回",icon:"arrow_back",onClick:()=>{a(0===v?y:_[v-1]._children),x(v-1),_.pop()}}),t.map((n,o)=>(0,i.jsxs)("div",{draggable:!0,onDragOver:e=>{e.preventDefault()},onDragStart:e=>((e,t)=>{m=t})(0,o),onDrop:e=>((e,s)=>{e.preventDefault();const n=t[m],o=t[s];if(o&&"dir"===o._type){const e=[...t];return e.splice(m,1),o._children||(o._children=[]),o._children.push(n),F(e),void a(e)}const i=[...t],r=i[m];i.splice(m,1),i.splice(s,0,r),F(i),a(i)})(e,o),style:{cursor:w?"move":"pointer"},children:[(0,i.jsx)(r,{name:n.name,item:n,...n,div:w,target:"_blank",click_dir:D,clickItem:e.clickItem}),w&&(void 0!==b.find(e=>e===o)||k)&&(0,i.jsxs)("div",{className:k?"":" site_edit ",children:["dir"===n._type?(0,i.jsxs)(s.Fragment,{children:[(0,i.jsx)(c.Sm,{value:n.name,handleInputChange:e=>{n.name=e},placeholder:K("输入类目名"),no_border:!0}),(0,i.jsx)(c.Sm,{value:n.color,handleInputChange:e=>{n.color=e},placeholder:"color",no_border:!0})]}):e.items.map((e,t)=>(0,i.jsx)("div",{children:(0,i.jsx)(c.Sm,{value:n[e.key],handleInputChange:t=>{n[e.key]=t},placeholder:e.preName,no_border:!0})},t)),!k&&(0,i.jsx)(d.C3,{text:K("折叠"),clickFun:()=>{S((0,l.P1)(b,o))}})]}),w&&(0,i.jsx)("div",{style:{display:"block"},children:(0,i.jsxs)("span",{className:"div-row ",children:[(0,i.jsx)(d.C3,{text:K("删除"),clickFun:()=>{(e=>{const s=[...t];s.splice(e,1),F(s),a(s)})(o)}}),(0,i.jsx)(d.C3,{text:K("编辑"),clickFun:()=>{void 0===b.find(e=>e===o)&&S([...b,o])}})]})})]},o)),w&&(0,i.jsxs)("div",{style:{display:"block"},children:[(0,i.jsx)(d.rA,{title:K("取消"),icon:"cancel",onClick:()=>{S([]),j(!1),f&&(a(f),F(f)),N(!1)}}),(0,i.jsx)(d.rA,{title:K("添加"),icon:"add",onClick:async()=>{const s=[...t,{name:"",color:(0,l.Lr)(h),...e.get_pre_add_item&&await e.get_pre_add_item()}];F(s),a(s)}}),(0,i.jsx)(d.rA,{title:K("添加类目"),icon:"add_box",onClick:()=>{const e=[...t,{name:"",_type:"dir",_children:[],color:"#c1edfb"}];F(e),a(e)}}),(0,i.jsx)(d.rA,{title:K("全部编辑"),icon:k?"unfold_less":"unfold_more",onClick:()=>{N(!k)}})]}),(void 0===e.have_auth_edit||!0===e.have_auth_edit)&&(0,i.jsx)(d.rA,{icon:w?"save":"edit",title:K(w?"保存":"编辑"),onClick:async()=>{w?e.save&&await e.save(y):f=t,j(!w)}})]})}},15937(e,t,a){a.r(t),a.d(t,{default:()=>me});var s=a(96540),n=a(70447),o=a(75725),i=a(61443),r=a(85997),l=a(4412),c=a(14284),d=a(8694),u=a(53459),p=a(83029),h=a(86149),m=a(82893),f=a(34843),y=a(78247),_=a(23430),v=a(62042),x=a(74848);function g(e){const{t}=(0,h.B)(),[a,n]=(0,f.fp)(m.AG.header_min),[g,w]=(0,s.useState)(""),[j,k]=(0,s.useState)(""),[N,K]=(0,s.useState)(void 0),[b,S]=(0,s.useState)(!1),{check_user_auth:C}=(0,y.MH)(),A=async()=>{const e=new d.qB;e.targetProxyUrl="string"==typeof g?g:j;(await c._U.post("close",e)).code===u.m.Success&&(k(""),n(!1))},F=async e=>{const t=new d.qB;if(t.targetProxyUrl="string"==typeof e?e:g,!t.targetProxyUrl.startsWith("http"))return void(0,v.zN)("must start with http[s]://");const a=await c._U.post("start",t);if(a.code!==u.m.Success)return;const s=`${window.location.protocol}//${window.location.hostname}:${a.data}`;k(s)};(0,s.useEffect)(()=>()=>{A()},[]);return(0,x.jsxs)("div",{children:[(0,x.jsxs)(l.aZ,{position:"right",children:[(0,x.jsx)(i.$Z,{placeholder:t("要代理的url"),icon:"link",value:g,handleInputChange:e=>{w(e)}}),(0,x.jsx)(r.rA,{icon:"play_arrow",title:t("开始代理"),onClick:F}),(0,x.jsx)(r.rA,{icon:"fullscreen",title:t("全屏"),onClick:()=>{S(!b),n(!b)}}),(0,x.jsx)(r.rA,{icon:"close",title:t(t("关闭")),onClick:()=>{A(),S(!1),w("")}})]}),(0,x.jsx)(o.jW,{isFull:b,children:(0,x.jsxs)("div",{id:"browser",children:[!j&&(0,x.jsx)(p.N,{have_auth_edit:C(_.oV.browser_proxy_tag_update),getItems:async()=>{const e=await c._U.get("tag");return e.code===u.m.Success?e.data:[]},save:async e=>{(await c._U.post("tag/save",e)).code!==u.m.Success&&(0,v.zN)("网络错误")},clickItem:async e=>{w(e.url),F(e.url)},items:[{key:"name",preName:t("名字")},{key:"url",preName:"url"},{key:"color",preName:"color"}]}),(0,x.jsx)("iframe",{id:"webview",src:j})]})})]})}var w=a(34289),j=(a(75007),a(97856)),k=a(92275),N=a(14944),K=a(64405);const b=s.lazy(()=>Promise.all([a.e(2543),a.e(5614)]).then(()=>a(85614)));function S(e){const[t,a]=(0,s.useState)(null),[n,o]=(0,f.fp)(m.AG.remoteShellShow),[i,r]=(0,s.useState)(!1),[l,c]=(0,f.fp)(m.AG.sshInfo),[d,u]=(0,f.fp)(m.AG.shellNowDir),[p,h]=(0,f.fp)(m.AG.user_base_info),y=p.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",_=()=>{(async()=>{t&&(t.dispose(),a(null))})()};(0,s.useEffect)(()=>()=>{_()},[]),(0,s.useEffect)(()=>{n.show?t||((async()=>{const e=new j.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:y,cursor:y,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4});let t;const s=t=>{e.write(t)};t=a=>{e.clear(),e.write(a),t=s},N.ws.addMsg(k.HK.remote_shell_getting,e=>{t(e.context)}),e.onData(async e=>{const t=new K.x;t.key=l.key,t.cmd=e;const a=new k.hf(k.HK.remote_shell_send);a.context=t,await N.ws.send(a)}),a(e)})(),r(!0)):_()},[n]);return(0,x.jsx)(b,{show:n.show,terminal:t,init:(e,a)=>{t.writeln("open shell... ");const s=new k.hf(k.HK.remote_shell_open),o=new K.x;o.key=l.key,o.init_path=n.path,o.rows=e,o.cols=a,s.context=o,N.ws.send(s)}})}var C=a(47374),A=a(86090),F=a(99214),D=a(47022),L=a(88815),M=a(6960),B=a(79240),I=a(83529),P=a(12730);function R(e){const{t}=(0,h.B)();(0,A.zy)();(0,A.Zp)();const{check_user_auth:a}=(0,y.MH)(),[n,o]=(0,f.fp)(m.AG.nowFileList),[i,l]=(0,f.fp)(m.AG.uploadFiles),[c,d]=(0,f.fp)(m.AG.showPrompt),[u,p]=(0,f.fp)(m.AG.selectedFileList),[_,g]=(0,f.fp)(m.AG.enterKey),[j,k]=(0,f.fp)(m.AG.copyedFileList),[N,K]=(0,f.fp)(m.AG.cutedFileList),[b,S]=(0,f.fp)(m.AG.selectedFileList),[C,L]=(0,f.fp)(m.AG.clickFileList),[M,B]=(0,f.fp)(m.AG.remoteShellShow),[R,E]=(0,f.fp)(m.AG.sshInfo),$=(0,F.Vs)();function G(e){(0,v.SK)(e)}return(0,x.jsxs)(s.Fragment,{children:[u.length>0&&(0,x.jsx)(r.rA,{icon:"delete",title:t("删除"),onClick:()=>{d({show:!0,type:I.PromptEnum.SshDelete,overlay:!0,data:{}})}}),u.length>0&&(0,x.jsx)(r.rA,{icon:"content_copy",title:t("复制"),onClick:function(){const e=(0,F.ib)(n,u);k(e.map(e=>`/${(0,w.GG)("remoteShell",(0,w.vX)())}${e.name}`)),K([]),G("已复制")}}),u.length>0&&(0,x.jsx)(r.rA,{icon:"content_cut",title:t("剪切"),onClick:function(){const e=(0,F.ib)(n,u);K(e.map(e=>`/${(0,w.GG)("remoteShell",(0,w.vX)())}${e.name}`)),k([]),G("已剪切")}}),(j.length>0||N.length>0)&&(0,x.jsx)(r.rA,{onClick:function(){d({show:!0,type:I.PromptEnum.SshPaste,overlay:!0,data:{}})},icon:"content_paste",title:t("粘贴到此处"),tip:j.length+N.length}),1===u.length&&n.files.length>=1&&(0,F.ib)(n,u)[0].type!==D.Iw.folder&&(0,x.jsx)(r.rA,{icon:"download",title:t("下载"),onClick:function(){const e=(0,F.ib)(n,u),t=`/api/ssh/download?file=${`/${(0,w.GG)("remoteShell",(0,w.vX)())}${decodeURIComponent(e[0].name)}`}&key=${R.key}&token=${localStorage.getItem("token")}`;window.open(t)}}),1===u.length&&(0,x.jsx)(r.rA,{icon:"edit_attributes",title:t("重命名"),onClick:function(){d({show:!0,type:I.PromptEnum.SshReName,overlay:!0,data:{}})}}),(0,x.jsx)(r.rA,{icon:"terminal",title:"shell",onClick:function(){M.show?B({show:!1,path:""}):B({show:!0,path:`/${(0,w.GG)("remoteShell",(0,w.vX)())}`})}}),(0,x.jsx)(r.rA,{icon:"grid_view",title:t("切换样式"),onClick:$}),(0,x.jsx)(r.rA,{icon:"create_new_folder",title:t("创建文件夹"),onClick:function(){d({show:!0,type:I.PromptEnum.SshNewDir,overlay:!0,data:{}})}}),(0,x.jsx)(r.rA,{icon:"note_add",title:t("创建文本文件"),onClick:function(){d({show:!0,type:I.PromptEnum.SshNewFile,overlay:!0,data:{}})}}),(0,x.jsx)(r.rA,{icon:"upload_file",title:"上传",onClick:()=>{d({show:!0,type:I.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let a=!!t[0].webkitRelativePath;const s=[],n=new Set;for(let e=0;e<t.length;e++){const o=t[e],i=a?o.webkitRelativePath:`${o.webkitRelativePath}${o.name}`;o.fullPath=i,a&&n.add((0,P.S)(i)),s.push(o)}const o=[];if(a)for(const e of Array.from(n))o.push({isDir:!0,fullPath:e,name:e});o.push(...s),l(o),d({show:!0,type:I.PromptEnum.SshUpload,overlay:!1,data:{}})}}})}}),(0,x.jsx)(r.rA,{icon:"close",title:t("关闭"),onClick:()=>{e.close()}})]})}var E=a(60096),$=a(21499);let G;function O(e){const{t}=(0,h.B)(),a=(0,A.zy)(),[n,o]=(0,f.fp)(m.AG.nowFileList),[r,d]=(0,f.fp)(m.AG.selectedFileList),[p,y]=(0,f.fp)(m.AG.clickFileList),[g,j]=(0,f.fp)(m.AG.sshInfo),[k,N]=(0,s.useState)(""),b=(0,A.Zp)(),[D,I]=(0,f.fp)(m.AG.user_base_info),P=async e=>{const t=new K.x;t.key=g.key,t.dir=e||`/${(0,w.GG)("remoteShell",(0,w.vX)())}`;const a=await c.Fg.post("get/dir",t);if(a.code!==u.m.Success)return void(0,v.zN)("连接失败");const{folders:s,files:n}=a.data||{};for(const e of n??[])e.origin_size=e.size,e.size=(0,L.v7)(e.size),D.user_data.file_time_show_type===_.KD.time?e.show_mtime=e.mtime?(0,$.Yq)(e.mtime):"":e.show_mtime=e.mtime?(0,M.s)(e.mtime):"";for(const e of s??[])D.user_data.file_time_show_type===_.KD.time?e.show_mtime=e.mtime?(0,$.Yq)(e.mtime):"":e.show_mtime=e.mtime?(0,M.s)(e.mtime):"";const i={folders:s||[],files:n||[]};(0,F.yC)(i,D.user_data.dir_show_type),o(i),G=i};function O(){d([]),y([])}(0,s.useEffect)(()=>{O(),(async()=>{await P()})()},[a]);return(0,x.jsxs)(s.Fragment,{children:[(0,x.jsx)(l.aZ,{children:(0,x.jsx)(i.$Z,{handleEnterPress:()=>{if(!G)return;d([]),y([]);const e=[],t=[];for(const t of G.files??[])t.name.includes(k)&&e.push(t);for(const e of G.folders??[])e.name.includes(k)&&t.push(e);o({files:e,folders:t})},placeholder:t("搜索当前目录"),icon:"search",value:"",handleInputChange:e=>{N(e)},max_width:"25em"})}),(0,x.jsx)(l.aZ,{position:"right",children:(0,x.jsx)(R,{close:e.close})}),(0,x.jsx)(C.e,{baseRoute:"remoteShell",clickFun:O,input_path_enter:e=>{(0,B.Z1)(e)?P(e):b((0,B.Jn)((0,w.vX)(),e)),d([]),y([]),o({files:[],folders:[]})}}),(0,x.jsx)(E.Ic,{handleContextMenu:()=>{},clickBlank:e=>{e.target===e.currentTarget&&d([])},file_list:n.files,folder_list:n.folders,fileHandler:P}),(0,x.jsx)(S,{})]})}function H(e){const{t}=(0,h.B)(),a=(0,A.Zp)(),[n,o]=(0,s.useState)(""),[d,g]=(0,s.useState)(""),[w,j]=(0,s.useState)(""),[k,N]=(0,s.useState)(""),[b,S]=(0,s.useState)(void 0),[C,F]=(0,s.useState)(""),[D,L]=(0,f.fp)(m.AG.shellNowDir),[M,I]=(0,f.fp)(m.AG.sshInfo),{check_user_auth:P}=(0,y.MH)(),R=async e=>{const t=new K.x;if(t.password=e?e.password:d,t.domain=e?e.domain:k,t.port=e?e.port:b,t.username=e?e.username:n,t.private_path=e?e.private_path:w,t.dir=e?e.dir:C,!t.dir)return void(0,v.zN)("dir not found");if(!t.username)return void(0,v.zN)("username not found");if(!t.domain)return void(0,v.zN)("domain not found");if(!t.port)return void(0,v.zN)("port not found");if(!t.private_path&&!t.password)return void(0,v.zN)("private_path password not found");const s=await c.Fg.post("start",t);s&&s.code===u.m.Success&&(a((0,B.Jn)("/proxy/remoteShell",t.dir)),L([t.dir]),I(s.data))};return(0,x.jsxs)(s.Fragment,{children:[(0,x.jsxs)(l.aZ,{position:"right",children:[(0,x.jsx)(i.$Z,{placeholder:t("目录"),icon:"home",value:C,handleInputChange:e=>F(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("账号"),icon:"verified_user",value:n,handleInputChange:e=>o(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{type:"password",placeholder:t("密码"),icon:"password",value:d,handleInputChange:e=>g(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("私钥路径"),icon:"private_connectivity",value:w,handleInputChange:e=>j(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("连接地址"),icon:"location_on",value:k,handleInputChange:e=>{N(e)},max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("端口"),icon:"outlet",value:b,handleInputChange:e=>{if(!e)return;/^\d+$/.test(e)||(0,v.zN)("不是数字"),S(parseInt(e))},max_width:"7rem"}),(0,x.jsx)(r.rA,{icon:"play_arrow",title:t("连接"),onClick:()=>{R()}})]}),M.key?(0,x.jsx)(O,{close:async()=>{const e=new K.x;e.key=M.key;await c.Fg.post("close",e);I({})},data:{port:b,password:d,username:n,domain:k,dir:C}}):(0,x.jsx)(p.N,{have_auth_edit:P(_.oV.ssh_proxy_tag_update),getItems:async()=>{const e=await c.Fg.get("tag");return e.code===u.m.Success?e.data:[]},save:async e=>{await c.Fg.post("tag/save",e)},clickItem:async e=>{N(e.domain),F(e.dir),S(e.port),o(e.username),g(e.password),j(e.private_path),await R(e)},items:[{key:"name",preName:t("名字")},{key:"domain",preName:t("地址")},{key:"port",preName:t("端口")},{key:"username",preName:t("账号")},{key:"password",preName:t("密码")},{key:"private_path",preName:t("私钥路径")},{key:"dir",preName:t("访问目录")},{key:"color",preName:"color"}]})]})}function U(e){switch(e){case 0:return 1;case 2:return 2;default:return 0}}class T{constructor(e){this.canvas=e,this.render=new Y.Canvas.create(this.canvas),this.activeSession=!1,this.install()}close(){this.activeSession=!1}install(){var e=this;return this.canvas.addEventListener("mousemove",function(t){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:0,isPressed:!1}),t.preventDefault||e.activeSession(),!1}),this.canvas.addEventListener("mousedown",function(t){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:U(t.button),isPressed:!0}),t.preventDefault(),!1}),this.canvas.addEventListener("mouseup",function(t){if(e.activeSession){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:U(t.button),isPressed:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("contextmenu",function(t){if(e.activeSession){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:U(t.button),isPressed:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("DOMMouseScroll",function(t){if(e.activeSession){var a=t.detail,s=Math.round(15*Math.abs(a)/8),n=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.wheel,{x:t.clientX-n.left,y:t.clientY-n.top,step:s,isNegative:a>0,isHorizontal:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("mousewheel",function(t){if(e.activeSession){var a=Math.abs(t.deltaX)>Math.abs(t.deltaY),s=a?t.deltaX:t.deltaY,n=Math.round(15*Math.abs(s)/8),o=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.wheel,{x:t.clientX-o.left,y:t.clientY-o.top,step:n,isNegative:s>0,isHorizontal:a}),t.preventDefault(),!1}}),window.addEventListener("keydown",function(t){if(e.activeSession)return N.ws.sendData(k.HK.scancode,{code:Y.scancode(t),isPressed:!0}),t.preventDefault(),!1}),window.addEventListener("keyup",function(t){if(e.activeSession)return N.ws.sendData(k.HK.scancode,{code:Y.scancode(t),isPressed:!1}),t.preventDefault(),!1}),this}connect(e,t,a,s,n,o){var i=this;N.ws.addMsg(k.HK.rdp_connect,e=>{console.log("[mstsc.js] connected"),i.activeSession=!0}),N.ws.addMsg(k.HK.rdp_bitmap,e=>{const t=e.context;t.data=e.bin_context,i.render.update(t)}),N.ws.addMsg(k.HK.rdp_close,e=>{o(null),console.log("[mstsc.js] close"),i.activeSession=!1}),N.ws.addMsg(k.HK.rdp_error,e=>{i.activeSession=!1});const r=new k.hf;r.cmdType=k.HK.infos,r.context={ip:e.indexOf(":")>-1?e.split(":")[0]:e,port:a,screen:{width:this.canvas.width,height:this.canvas.height},domain:t,username:s,password:n,locale:Y.locale()},N.ws.send(r)}}class z{constructor(e){this.canvas=e,this.ctx=e.getContext("2d")}update(e){var t=null;t=e.isCompress?function(e){var t=null;switch(e.bitsPerPixel){case 15:t="bitmap_decompress_15";break;case 16:t="bitmap_decompress_16";break;case 24:t="bitmap_decompress_24";break;case 32:t="bitmap_decompress_32";break;default:throw"invalid bitmap data format"}var a=new Uint8Array(e.data),s=Module._malloc(a.length),n=new Uint8Array(Module.HEAPU8.buffer,s,a.length);n.set(a);var o=e.destRight-e.destLeft+1,i=e.destBottom-e.destTop+1,r=o*i*4,l=Module._malloc(r),c=new Uint8Array(Module.HEAPU8.buffer,l,r),d=(Module.ccall(t,"number",["number","number","number","number","number","number","number","number"],[c.byteOffset,o,i,e.width,e.height,n.byteOffset,a.length]),new Uint8ClampedArray(c.buffer,c.byteOffset,r));return Module._free(s),Module._free(l),{width:o,height:i,data:d}}(e):function(e){return{width:e.width,height:e.height,data:new Uint8ClampedArray(e.data)}}(e);var a=this.ctx.createImageData(t.width,t.height);a.data.set(t.data),this.ctx.putImageData(a,e.destLeft,e.destTop)}}var Z={"":0,Escape:1,Digit1:2,Digit2:3,Digit3:4,Digit4:5,Digit5:6,Digit6:7,Digit7:8,Digit8:9,Digit9:10,Digit0:11,Minus:12,Equal:13,Backspace:14,Tab:15,KeyQ:16,KeyW:17,KeyE:18,KeyR:19,KeyT:20,KeyY:21,KeyU:22,KeyI:23,KeyO:24,KeyP:25,BracketLeft:26,BracketRight:27,Enter:28,ControlLeft:29,KeyA:30,KeyS:31,KeyD:32,KeyF:33,KeyG:34,KeyH:35,KeyJ:36,KeyK:37,KeyL:38,Semicolon:39,Quote:40,Backquote:41,ShiftLeft:42,Backslash:43,KeyZ:44,KeyX:45,KeyC:46,KeyV:47,KeyB:48,KeyN:49,KeyM:50,Comma:51,Period:52,Slash:53,ShiftRight:54,NumpadMultiply:55,AltLeft:56,Space:57,CapsLock:58,F1:59,F2:60,F3:61,F4:62,F5:63,F6:64,F7:65,F8:66,F9:67,F10:68,Pause:69,ScrollLock:70,Numpad7:71,Numpad8:72,Numpad9:73,NumpadSubtract:74,Numpad4:75,Numpad5:76,Numpad6:77,NumpadAdd:78,Numpad1:79,Numpad2:80,Numpad3:81,Numpad0:82,NumpadDecimal:83,PrintScreen:84,IntlBackslash:86,F11:87,F12:88,NumpadEqual:89,F13:100,F14:101,F15:102,F16:103,F17:104,F18:105,F19:106,F20:107,F21:108,F22:109,F23:110,KanaMode:112,Lang2:113,Lang1:114,IntlRo:115,F24:118,Convert:121,NonConvert:123,IntlYen:125,NumpadComma:126,MediaTrackPrevious:57360,MediaTrackNext:57369,NumpadEnter:57372,ControlRight:57373,VolumeMute:57376,LaunchApp2:57377,MediaPlayPause:57378,MediaStop:57380,VolumeDown:57390,VolumeUp:57392,BrowserHome:57394,NumpadDivide:57397,PrintScreen:57399,AltRight:57400,NumLock:57413,Pause:57414,Home:57415,ArrowUp:57416,PageUp:57417,ArrowLeft:57419,ArrowRight:57421,End:57423,ArrowDown:57424,PageDown:57425,Insert:57426,Delete:57427,OSLeft:57435,OSRight:57436,ContextMenu:57437,Power:57438,BrowserSearch:57445,BrowserFavorites:57446,BrowserRefresh:57447,BrowserStop:57448,BrowserForward:57449,BrowserBack:57450,LaunchApp1:57451,LaunchMail:57452,MediaSelect:57453},V={27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",192:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",173:"Minus",61:"Equal",8:"Backspace",9:"Tab",81:"KeyQ",87:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",219:"BracketLeft",221:"BracketRight",13:"Enter",20:"CapsLock",65:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",59:"Semicolon",222:"Quote",220:"Backslash",16:"ShiftLeft",220:"IntlBackslash",90:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",77:"KeyM",188:"Comma",190:"Period",191:"Slash",16:"ShiftRight",17:"ControlLeft",18:"AltLeft",91:"OSLeft",32:"Space",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",13:"NumpadEnter",96:"Numpad0",110:"NumpadDecimal",17:"ControlLeft"},J={firefox:{fr:{27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",0:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",169:"Minus",61:"Equal",8:"Backspace",9:"Tab",65:"KeyQ",90:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",160:"BracketLeft",164:"BracketRight",13:"Enter",20:"CapsLock",20:"CapsLock",81:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",77:"Semicolon",165:"Quote",170:"Backslash",16:"ShiftLeft",60:"IntlBackslash",87:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",188:"KeyM",59:"Comma",58:"Period",161:"Slash",16:"ShiftRight",17:"ControlLeft",91:"OSLeft",18:"AltLeft",32:"Space",17:"ControlLeft",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",96:"Numpad0",110:"NumpadDecimal",13:"NumpadEnter",17:"ControlLeft",67:"KeyC",17:"ControlLeft"},en:V},chrome:{fr:{27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",0:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",219:"Minus",187:"Equal",8:"Backspace",9:"Tab",65:"KeyQ",90:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",221:"BracketLeft",186:"BracketRight",13:"Enter",20:"CapsLock",20:"CapsLock",81:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",77:"Semicolon",192:"Quote",220:"Backslash",16:"ShiftLeft",60:"IntlBackslash",87:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",188:"KeyM",190:"Comma",191:"Period",223:"Slash",16:"ShiftRight",17:"ControlLeft",91:"OSLeft",18:"AltLeft",32:"Space",17:"ControlLeft",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",96:"Numpad0",110:"NumpadDecimal",13:"NumpadEnter",17:"ControlLeft",67:"KeyC",17:"ControlLeft"},en:V}};function X(){}X.prototype={$:function(e){return document.getElementById(e)},elementOffset:function(e){for(var t=0,a=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-e.scrollLeft,a+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{top:a,left:t}},browser:function(){return"undefined"!=typeof InstallTrigger?"firefox":window.chrome?"chrome":document.docuemntMode?"ie":null},locale:function(){return window.navigator.userLanguage||window.navigator.language},client:{create:function(e){return new T(e)}},Canvas:{create:function(e){return new z(e)}},scancode(e){var t=X.prototype.locale();return t=["fr","en"].indexOf(t)>0&&t||"en",Z[e.code||J[X.prototype.browser()||"firefox"][t][e.keyCode]]}};let Y=new X;var q=a(38240);let W;function Q(){const{t:e}=(0,h.B)(),[t,a]=(0,f.fp)(m.AG.header_min),{check_user_auth:n}=(0,y.MH)(),[d,g]=(0,s.useState)(void 0),[w,j]=(0,s.useState)(3389),[K,b]=(0,s.useState)(void 0),[S,C]=(0,s.useState)(void 0),[A,F]=(0,s.useState)(!1),[D,L]=(0,s.useState)(!1);var M=null;(0,s.useEffect)(()=>(W||(async()=>{try{await(0,q.J)("rle.js"),W=!0}catch(e){return void(0,v.zN)("加载资源失败")}})(),()=>{M&&(M.close(),M=null)}),[]);const B=t=>{L(!0),function(s,n,o,i){if(s=s||t.address,o=o||t.username,i=i||t.password,!s||!o)return(0,v.zN)(e("ip或者账号不允许为空")),void L(!1);!function(e){M||(M=Y.client.create(Y.$(e)))}("rdpwebview");var r=Y.$("rdpwebview");r.style.display="inline",r.width=window.innerWidth,r.height=window.innerHeight,F(!0),a(!0),M.connect(s,"",n,o,i,function(e){Y.$("rdpwebview").style.display="none",a(!1),L(!1),F(!1)})}(d,w,K,S)};return(0,x.jsxs)("div",{children:[(0,x.jsxs)(l.aZ,{position:"right",children:[(0,x.jsx)(i.$Z,{placeholder:e("地址"),icon:"network_ping",value:d,max_width:"15rem",handleInputChange:e=>g(e)}),(0,x.jsx)(i.$Z,{placeholder:e("端口"),icon:"outlet",value:w,max_width:"10rem",handleInputChange:e=>{e&&j(parseInt(e))}}),(0,x.jsx)(i.$Z,{placeholder:e("账号"),icon:"manage_accounts",value:K,max_width:"15rem",handleInputChange:e=>b(e)}),(0,x.jsx)(i.$Z,{placeholder:e("密码"),icon:"password",value:S,max_width:"15rem",handleInputChange:e=>C(e)}),!D&&(0,x.jsx)(r.rA,{icon:"play_arrow",title:e("连接"),onClick:B}),D&&(0,x.jsx)(r.rA,{icon:"close",title:e("关闭"),onClick:async()=>{F(!1),await N.ws.sendData(k.HK.rdp_disconnect,"");var e=Y.$("rdpwebview");e.getContext("2d").clearRect(0,0,e.width,e.height),Y.$("rdpwebview").style.display="none",L(!1),a(!1)}})]}),(0,x.jsxs)(o.jW,{isFull:A,children:[!D&&(0,x.jsx)(p.N,{have_auth_edit:n(_.oV.rdp_proxy_tag_update),getItems:async()=>{const e=await c.J0.get("tag");return e.code===u.m.Success?e.data:[]},save:async e=>{(await c.J0.post("tag/save",e)).code!==u.m.Success&&(0,v.zN)("网络错误")},clickItem:async e=>{C(e.password),b(e.username),g(e.address),j(e.port),B(e)},items:[{key:"name",preName:e("名字")},{key:"address",preName:e("地址")},{key:"port",preName:e("端口")},{key:"username",preName:e("账号")},{key:"password",preName:e("密码")},{key:"color",preName:"color"}]}),(0,x.jsx)("canvas",{id:"rdpwebview",style:{display:"none"}})]})]})}var ee=a(77481),te=a(40505),ae=a(99380);const se=(0,s.createContext)({activeKey:"",setActiveKey:()=>{}});function ne(e){const{children:t,activeKey:a,defaultActiveKey:n,onChange:o,width:i}=e,[r,l]=(0,s.useState)(()=>a??n??"");(0,s.useEffect)(()=>{void 0!==a&&l(a)},[a]);const c=e=>{void 0===a&&l(e),o&&o(e)},d=[];return s.Children.forEach(t,e=>{s.isValidElement(e)&&e.type===oe&&d.push({key:e.props.itemKey,tab:e.props.tab,disabled:e.props.disabled})}),(0,s.useEffect)(()=>{!r&&d.length>0&&l(d[0].key)},[d,r]),(0,x.jsx)(se.Provider,{value:{activeKey:r,setActiveKey:c},children:(0,x.jsxs)("div",{className:"modern-tabs-container",style:{width:i||"100%"},children:[(0,x.jsx)("div",{className:"modern-tabs-nav",children:d.map(e=>{const t=["modern-tabs-tab",r===e.key?"active":"",e.disabled?"disabled":""].filter(Boolean).join(" ");return(0,x.jsx)("div",{className:t,onClick:()=>!e.disabled&&c(e.key),children:e.tab},e.key)})}),(0,x.jsx)("div",{className:"modern-tabs-content",children:t})]})})}function oe(e){const{itemKey:t,children:a}=e,{activeKey:n}=(0,s.useContext)(se),o=n===t;return(0,x.jsx)("div",{className:"modern-tab-panel "+(o?"active":""),children:a})}const ie=s.lazy(()=>Promise.all([a.e(5880),a.e(9381)]).then(()=>a(19381)));let re,le,ce,de;function ue(){const{t:e}=(0,h.B)(),[t,a]=(0,f.fp)(m.AG.confirm),[l,g]=(0,f.fp)(m.AG.showPrompt),{check_user_auth:w}=(0,y.MH)(),[j,K]=(0,s.useState)(""),[b,S]=(0,f.fp)(m.AG.router_jump),[C,A]=(0,s.useState)("get"),[F,D]=(0,s.useState)(""),[M,B]=(0,s.useState)(void 0),[P,R]=(0,s.useState)([]),[E,G]=(0,s.useState)([]),[O,H]=(0,s.useState)("headers"),[U,T]=(0,s.useState)(String(d.RB.row)),[z,Z]=(0,s.useState)("body"),[V,J]=(0,s.useState)(),[X,Y]=(0,f.fp)(m.AG.nav_index_add_item_by_now_list),[q,W]=(0,f.fp)(m.AG.prompt_card);y.xK.set_value_temp("{}",0),y.xK.set_value_temp("",1),(0,s.useEffect)(()=>(re={},le="",ce="",de="",y.xK.get_editor(0).session.setMode("ace/mode/json"),b.http_download_map_path&&(B(b.http_download_map_path),S({})),N.ws.sendData(k.HK.http_download_water,void 0).then(()=>{N.ws.addMsg(k.HK.http_download_water,e=>{const t=e.context;G(t)})}),()=>{N.ws&&"function"==typeof N.ws.removeMsg&&N.ws.removeMsg(k.HK.http_download_water)}),[]);const Q=e=>{const t=new d.vr;t.url=F,t.method=C,t.header_type="headers"===O?1:2,"headers"===O&&(re=JSON.parse(y.xK.get_editor_value(0))),t.headers=re;const a=Number(U);if(t.body_type=a,a===d.RB.row)le=y.xK.get_editor_value(1),t.data=le;else if(a===d.RB.json)re["Content-Type"]="application/json",le=y.xK.get_editor_value(1),t.data=le;else if(a===d.RB.form){re["Content-Type"]="multipart/form-data",t.form_data_list=P;for(const t of P)t.key&&t.is_file&&e&&e.append(t.fullPath,t.file_object)}return t};return(0,x.jsx)("div",{children:(0,x.jsxs)(o.xh,{children:[(0,x.jsxs)(o.fI,{children:[(0,x.jsxs)(o.VP,{children:[0!==E.length&&(0,x.jsx)(n.Zp,{title:"正在下载",children:(0,x.jsx)("div",{children:E.map((t,a)=>(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"div-row",children:[(0,x.jsx)(r.rA,{icon:"cancel",title:e("取消"),onClick:()=>{N.ws.sendData(k.HK.http_download_cancel,t.local_download_path)}}),(0,x.jsx)(n.xP,{context:t.filename,tip_context:t.local_download_path}),(0,x.jsx)("span",{style:{paddingLeft:".3rem",color:"green"},children:`${t.progresses??0}% ${t.loaded?(0,L.v7)(t.loaded):""}MB / ${t.seep??""}MB/s `})]}),(0,x.jsx)("div",{style:{width:t.progresses?`${t.progresses}%`:"0",backgroundColor:"#40c4ff",height:"5px",transition:"0.2s ease width",borderRadius:"10px"}})]},a))})}),(0,x.jsxs)(n.Zp,{title:"",rightBottomCom:Number(U)===d.RB.form&&"body"===O&&(0,x.jsx)(r.rA,{icon:"add",title:e("添加"),onClick:()=>{R([{},...P])}}),children:[(0,x.jsxs)("div",{className:"http_url",children:[(0,x.jsx)(i.l6,{width:"10rem",value:C,onChange:e=>{A(e)},options:[{value:"get",color:"#28a745"},{value:"post",color:"#007bff"},{value:"put",color:"#fd7e14"},{value:"delete",color:"#dc3545"},{value:"head",color:"#6f42c1"},{value:"options",color:"#17a2b8"},{value:"connect",color:"#666666"},{value:"trace",color:"#666666"},{value:"custom",color:"#e83e8c"}]}),(0,x.jsx)(i.Sm,{width:"50rem",placeholder:e("http url"),value:F,handleInputChange:e=>{D(e)}}),(0,x.jsx)(r.rA,{icon:"send",title:e("发送"),onClick:async()=>{if(!c._U.have_http_method(C))return void(0,v.zN)("不存在的http method");if(!F)return void(0,v.zN)("url is empty");J(void 0),K("");const e=new FormData;e.append("data",JSON.stringify(Q(e)));let t="http/send";M&&(t+=`?local_download_path=${M}`),ae.A.post(c._U.getUrl(t),e,{headers:{"Content-Type":"multipart/form-data",Authorization:localStorage.getItem("token")}}).catch(e=>{(0,v.zN)(e.message)}).then(e=>{if(!e)return;let t={};try{if(e.headers.filecat_remote_raw_headers&&(t=JSON.parse(e.headers.filecat_remote_raw_headers),de=JSON.stringify(t,null,2)),e.headers.filecat_remote_code)try{const t=JSON.parse(e.headers.filecat_remote_code);J(200===t||201===t?(0,x.jsx)("span",{style:{color:"green"},children:"200"}):t)}catch(e){console.log(e)}}catch(t){de=String(e.headers.filecat_remote_raw_headers)}const a=(t["content-type"]||t["Content-Type"]||"").toLowerCase();ce="object"==typeof e.data?JSON.stringify(e.data,null,2):e.data;const s=y.xK.get_editor(2),n="body"===z?ce:de;if(s){if(a.includes("application/json")||a.includes("+json")){s.session.setMode("ace/mode/json");try{const e=JSON.parse(ce);ce=JSON.stringify(e,null,2)}catch(e){}}else a.includes("html")?s.session.setMode("ace/mode/html"):a.includes("xml")?s.session.setMode("ace/mode/xml"):a.includes("javascript")?s.session.setMode("ace/mode/javascript"):s.session.setMode("ace/mode/text");s.setValue("body"===z?ce:de,-1)}K(n)})}}),w(_.oV.http_proxy_tag_update)&&(0,x.jsx)(r.rA,{title:e("添加"),icon:"save_as",onClick:()=>{if(!w(_.oV.http_proxy_tag_update))return void(0,v.zN)("no permission");for(const t of P)if(t.is_file)return void(0,v.zN)(e("表单中含有文件,浏览器限制不能添加"));let t;W({open:!0,title:e("信息"),context_div:(0,x.jsxs)("div",{children:[(0,x.jsx)("div",{className:"card-content",children:(0,x.jsx)(i.Sm,{placeholderOut:e("输入标签名"),handleInputChange:e=>t=e})}),(0,x.jsx)("div",{className:"card-action",children:(0,x.jsx)("button",{className:"button button--flat",onClick:async()=>{const e=await Q();e.local_download_path=M,e.form_data_list=JSON.stringify(P),e.headers=JSON.stringify(e.headers),"object"==typeof e.data&&(e.data=JSON.stringify(e.data)),e.name=t,Y(e),W({open:!1})},children:e("确定")})})]})})}})]}),(0,x.jsxs)(ne,{activeKey:O,onChange:e=>H(e),children:[(0,x.jsx)(oe,{itemKey:"headers",tab:e("请求头")+"(json)",children:(0,x.jsxs)("div",{style:{marginTop:"10px"},children:[(0,x.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:"4px"},children:(0,x.jsx)(r.rA,{title:e("格式化"),icon:"data_object",onClick:function(){y.xK.get_editor(0)?.formatCode?.()}})}),(0,x.jsx)("div",{className:"http_ace",children:(0,x.jsx)(ie,{name:"",editor_id:0})})]})}),(0,x.jsx)(oe,{itemKey:"body",tab:e("请求体"),children:(0,x.jsxs)("div",{style:{marginTop:"10px"},children:[(0,x.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,x.jsxs)(ne,{activeKey:U,onChange:e=>{T(e);const t=Number(e);t===d.RB.row?y.xK.get_editor(1).session.setMode("ace/mode/text"):t===d.RB.json&&y.xK.get_editor(1).session.setMode("ace/mode/json")},children:[(0,x.jsx)(oe,{itemKey:String(d.RB.row),tab:e("row")}),(0,x.jsx)(oe,{itemKey:String(d.RB.json),tab:e("json")}),(0,x.jsx)(oe,{itemKey:String(d.RB.form),tab:e("form")})]}),Number(U)!==d.RB.form&&(0,x.jsx)(r.rA,{title:e("格式化"),icon:"data_object",onClick:function(){y.xK.get_editor(1)?.formatCode?.()}})]}),Number(U)===d.RB.form&&(0,x.jsx)("div",{style:{marginTop:"10px"},children:(0,x.jsx)(ee.X,{headers:["key",e("值")],rows:P.map((t,a)=>[(0,x.jsx)(i.Sm,{value:t.key,handleInputChange:e=>{t.key=e,R([...P])},no_border:!0}),(0,x.jsx)(i.Sm,{value:t.value,handleInputChange:e=>{t.value=e,t.is_file=!1,R([...P])},no_border:!0}),(0,x.jsxs)("div",{children:[(0,x.jsx)(r.rA,{icon:"file_upload",title:e("上传文件"),onClick:()=>(e=>{g({show:!0,type:I.PromptEnum.UploadFile,overlay:!0,data:{extra_data:{only_file:!0},call:t=>{let a=t.currentTarget?.files;if(!a)return;const s=a[0];s.fullPath=(0,$.hU)()+Date.now().toString(),P[e].value=`${s}(${s.name})`,P[e].is_file=!0,P[e].fileName=s.name,P[e].fullPath=s.fullPath,R([...P]),P[e].file_object=s,g({overlay:!1,type:"",show:!1,data:{}})}}})})(a)}),(0,x.jsx)(r.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{P.splice(e,1),R([...P])})(a)})]})]),width:"10rem"})}),(0,x.jsx)("div",{className:"http_ace",style:{marginTop:"10px",display:Number(U)!==d.RB.form?"block":"none"},children:(0,x.jsx)(ie,{name:"",editor_id:1})})]})})]}),(0,x.jsx)("div",{style:{paddingTop:"1rem"},children:void 0===M?(0,x.jsx)("span",{style:{cursor:"pointer",color:"#3b82f6"},onClick:()=>{B("")},children:e("下载到本地目录")}):(0,x.jsx)(i.Sm,{placeholder:e("本地地址"),value:M,handleInputChange:e=>{B(e)},handlerEnter:()=>{M||B(void 0)}})})]})]}),(0,x.jsx)(o.VP,{children:(0,x.jsxs)(n.Zp,{title:V,titleCom:(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,x.jsx)(r.rA,{title:e("格式化"),icon:"data_object",onClick:()=>{y.xK.get_editor(2)?.formatCode?.()}}),(0,x.jsx)(r.rA,{title:e("复制"),icon:"copy_all",onClick:()=>{const e=y.xK.get_editor_value(2);e&&((0,te.lW)(e),(0,v.SK)("完成"))}})]}),children:[(0,x.jsxs)(ne,{activeKey:z,onChange:e=>{Z(e);const t="body"===e?ce:de;K(t);const a=y.xK.get_editor(2);if(a){try{JSON.parse(t),a.session.setMode("ace/mode/json")}catch{a.session.setMode("ace/mode/text")}a.setValue(t,-1)}},children:[(0,x.jsx)(oe,{itemKey:"body",tab:e("响应体")}),(0,x.jsx)(oe,{itemKey:"headers",tab:e("响应头")})]}),(0,x.jsx)("div",{className:"http_ace",style:{marginTop:"10px",height:"21rem"},children:(0,x.jsx)(ie,{name:"",editor_id:2})})]})})]}),(0,x.jsx)(o.fI,{children:(0,x.jsx)(o.VP,{children:(0,x.jsx)(p.N,{getItems:async()=>{const e=await c._U.get("http/tag");return e.code===u.m.Success?e.data:[]},save:async e=>{(await c._U.post("http/tag/save",e)).code!==u.m.Success&&(0,v.zN)("网络错误")},have_auth_edit:w(_.oV.http_proxy_tag_update),clickItem:async e=>{D(e.url),A(e.method),B(e.local_download_path),e.header_type&&H(1===e.header_type?"headers":"body"),e.headers&&(re=JSON.parse(e.headers),1===e.header_type&&(y.xK.get_editor(0).setValue(e.headers,-1),y.xK.get_editor(0).session.setMode("ace/mode/json"))),e.form_data_list&&R(JSON.parse(e.form_data_list)),e.data&&(le=e.data),e.body_type&&(T(String(e.body_type)),e.body_type===d.RB.row?y.xK.get_editor(1).session.setMode("ace/mode/text"):e.body_type===d.RB.json&&y.xK.get_editor(1).session.setMode("ace/mode/json"),y.xK.get_editor(1).setValue(e.data,-1))},items:[{key:"name",preName:e("名字")},{key:"url",preName:"url"},{key:"method",preName:"method"},{key:"headers",preName:"headers"},{key:"data",preName:"data"},{key:"form_data_list",preName:"form_data_list"},{key:"local_download_path",preName:"local_download_path"},{key:"color",preName:"color"}]})})})]})})}var pe=a(87361);const he=s.lazy(()=>Promise.all([a.e(3215),a.e(8257),a.e(7759)]).then(()=>a(45601)));function me({}){const{check_user_auth:e}=(0,y.MH)(),{t}=(0,h.B)(),a=[];return e(_.oV.http_proxy)&&a.push({index:1,name:t("http代理"),rto:"http/",component:(0,x.jsx)(ue,{})}),e(_.oV.ssh_proxy)&&a.push({index:1,name:`ssh${t("代理")}`,rto:"remoteShell/",component:(0,x.jsx)(H,{})}),e(_.oV.browser_proxy)&&a.push({index:1,name:`${t("浏览器")}${t("代理")}`,rto:"browserproxy/",component:(0,x.jsx)(g,{})}),e(_.oV.rdp_proxy)&&a.push({index:1,name:`rdp${t("代理")}`,rto:"rdp/",component:(0,x.jsx)(Q,{})}),e(_.oV.rtsp_proxy)&&a.push({index:1,name:t("rtsp播放器"),rto:"rtsp/",component:(0,x.jsx)(he,{})}),(0,x.jsx)(o.W1,{optionList:a,father_route:pe.o.proxy})}}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5937],{8694(e,t,a){a.d(t,{$K:()=>o,RB:()=>r,l5:()=>c,qB:()=>s,vo:()=>i,vr:()=>l});class s{targetProxyUrl;proxyPort;sysProxyPort}let n=function(e){return e[e.tcp=0]="tcp",e[e.udp=1]="udp",e}({});class o{open=!1;port;key="";async_ips=[]}class i{client_num_id;client_name;open=!1;ip;mask;serverIp;serverPort;key="";model=n.udp}let r=function(e){return e[e.row=1]="row",e[e.json=2]="json",e[e.form=3]="form",e}({});class l{body_type;header_type;url;method;headers;data;form_data_list;local_download_path}class c{enabled;ip;port;bypass;useForLocal;type}},75007(e,t,a){a.d(t,{h:()=>o});a(96540);var s=a(85997),n=a(74848);function o(e){return(0,n.jsxs)("h2",{className:"message",children:[(0,n.jsx)(s.In,{icon:"sentiment_dissatisfied"}),(0,n.jsx)("span",{children:e.context})]})}},47374(e,t,a){a.d(t,{e:()=>p});var s=a(96540),n=a(86090),o=a(64694),i=a(34289),r=a(61443),l=a(75725),c=a(86149),d=a(85997),u=a(74848);function p(e){let t=(0,n.zy)();const[a,p]=(0,s.useState)([]),[h,m]=(0,s.useState)("/"),[f,y]=(0,s.useState)(void 0),{t:_,i18n:v}=(0,c.B)();s.useEffect(()=>{let t="",a=(0,i.vX)().split("/");a=a.filter(e=>e);const s=a.indexOf(e.baseRoute),n=[];if(-1!=s){t=(0,o.IO)(a.slice(0,s),e.baseRoute);const i=a.slice(s+1);for(let e=0;e<i.length;e++){const a=i[e];n.push({value:a,href:0===e?`${t}${a}/`:(0,o.IO)(n[e-1].href,a)})}m(t),p(n)}},[t]);const x=t=>{t.stopPropagation(),e.clickFun(t)};return(0,u.jsx)("div",{className:"breadcrumbs",onClick:e=>{y(void 0!==f?void 0:"")},children:(0,u.jsx)(s.Fragment,{children:void 0===f?(0,u.jsxs)(s.Fragment,{children:[(0,u.jsx)("span",{className:"chevron",children:(0,u.jsx)(n.N_,{to:h,onClick:x,children:(0,u.jsx)(d.In,{icon:"home"})})}),a.map((e,t)=>(0,u.jsxs)("span",{className:"chevron",children:[(0,u.jsx)(d.In,{icon:"keyboard_arrow_right"}),(0,u.jsx)(n.N_,{to:e.href,onClick:x,children:decodeURIComponent(e.value)})]},t))]}):(0,u.jsx)(l.QM,{click:()=>{y(void 0)},children:(0,u.jsx)(r.Sm,{width:"100%",placeholder:_("输入跳转的目录"),handlerEnter:t=>{e.input_path_enter&&e.input_path_enter(t),y(void 0)}})})})})}},77481(e,t,a){a.d(t,{S:()=>r,X:()=>i});var s=a(96540),n=a(61443),o=a(74848);function i(e){const[t,a]=s.useState([]),i=(0,s.useRef)(-1),[r,l]=(0,s.useState)(-1),[c,d]=(0,s.useState)(-1);(0,s.useEffect)(()=>{e.children?a(Array.isArray(e.children)?e.children:[e.children]):a(e.rows)},[e.rows,e.children]);const u=()=>{i.current=-1,l(-1),d(-1)};return(0,o.jsxs)("table",{children:[(0,o.jsx)("thead",{children:(0,o.jsx)("tr",{children:e.headers?.map((t,a)=>{const s=!!e.filter&&(e.filter.column??0)===a;let i=t;if(s){const a=e.filter,s=a.options.find(e=>e.value===a.value);null!=a.value&&s&&(i=`${t} (${s.label})`)}return(0,o.jsx)("th",{className:s?"table-filter-col":"",children:s?(0,o.jsx)(n.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:i}):t},a)})})}),(0,o.jsx)("tbody",{children:t.map((t,a)=>{const s=!!e.onRowDrag;return(0,o.jsx)("tr",{className:s?(r===a?"row-dragging":"")+(c===a?" row-drop-target":""):"",draggable:s,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{s&&(i.current=a,l(a),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!s||i.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(a))},onDrop:t=>{s&&(t.preventDefault(),(()=>{const t=i.current,a=c;u(),t<0||a<0||t===a||e.onRowDrag?.(t,a)})())},onDragEnd:u,children:t.map((a,s)=>{const n=s===t.length-1?"small":"";return(0,o.jsx)("td",{className:n,style:{width:e.width??"auto"},children:a},s)})},a)})})]})}function r(e){return(0,o.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,o.jsx)("div",{children:e},t))})}},83029(e,t,a){a.d(t,{N:()=>v});var s=a(96540),n=a(34843),o=a(82893),i=a(74848);function r(e){const[t,a]=(0,n.fp)(o.AG.user_base_info);return(0,i.jsx)("div",{children:e.div?(0,i.jsx)("div",{className:"nav_list_a",style:{background:e.color},children:e.name}):e.clickItem||"dir"===e._type?(0,i.jsx)("div",{className:"nav_list_a",style:{background:e.color},onClick:()=>{"dir"!==e._type?e.clickItem&&e.clickItem(e):e.click_dir(e.item)},children:e.name}):(0,i.jsx)("a",{href:e.url,target:e.target,className:"nav_list_a",style:{background:e.color},children:e.name})})}var l=a(64694),c=a(61443),d=a(85997),u=a(86090),p=a(86149);const h=["#ffffff","#fefff8","#fcfdf1","#d3d2dc","#f8f9fd","#ebf4fe","#ebebeb","#e8f7eb","#eaf2f9"];let m,f,y=[];const _=[];function v(e){const[t,a]=(0,s.useState)([]),[v,x]=(0,s.useState)(-1),g=(0,u.zy)(),[w,j]=(0,s.useState)(!1),[k,N]=(0,s.useState)(!1),{t:K}=(0,p.B)(),[b,S]=(0,s.useState)([]),[C,A]=(0,n.fp)(o.AG.nav_index_add_item_by_now_list),F=e=>{-1!==v?_[v]._children=e:y=e};(0,s.useEffect)(()=>{(async()=>{if(!e.getItems)return;const t=await e.getItems();y=t,a(y)})()},[g]);(0,s.useEffect)(()=>{if(C){const e=[...t,{name:"",color:(0,l.Lr)(h),...C}];F(e),a(e),j(!0),A(void 0)}},[C]);const D=e=>{x(v+1),a(e._children),_.push(e)};return(0,i.jsxs)("div",{className:"nav_list_div scroll-div-y",children:[-1!==v&&(0,i.jsx)(d.rA,{title:"返回",icon:"arrow_back",onClick:()=>{a(0===v?y:_[v-1]._children),x(v-1),_.pop()}}),t.map((n,o)=>(0,i.jsxs)("div",{draggable:!0,onDragOver:e=>{e.preventDefault()},onDragStart:e=>((e,t)=>{m=t})(0,o),onDrop:e=>((e,s)=>{e.preventDefault();const n=t[m],o=t[s];if(o&&"dir"===o._type){const e=[...t];return e.splice(m,1),o._children||(o._children=[]),o._children.push(n),F(e),void a(e)}const i=[...t],r=i[m];i.splice(m,1),i.splice(s,0,r),F(i),a(i)})(e,o),style:{cursor:w?"move":"pointer"},children:[(0,i.jsx)(r,{name:n.name,item:n,...n,div:w,target:"_blank",click_dir:D,clickItem:e.clickItem}),w&&(void 0!==b.find(e=>e===o)||k)&&(0,i.jsxs)("div",{className:k?"":" site_edit ",children:["dir"===n._type?(0,i.jsxs)(s.Fragment,{children:[(0,i.jsx)(c.Sm,{value:n.name,handleInputChange:e=>{n.name=e},placeholder:K("输入类目名"),no_border:!0}),(0,i.jsx)(c.Sm,{value:n.color,handleInputChange:e=>{n.color=e},placeholder:"color",no_border:!0})]}):e.items.map((e,t)=>(0,i.jsx)("div",{children:(0,i.jsx)(c.Sm,{value:n[e.key],handleInputChange:t=>{n[e.key]=t},placeholder:e.preName,no_border:!0})},t)),!k&&(0,i.jsx)(d.C3,{text:K("折叠"),clickFun:()=>{S((0,l.P1)(b,o))}})]}),w&&(0,i.jsx)("div",{style:{display:"block"},children:(0,i.jsxs)("span",{className:"div-row ",children:[(0,i.jsx)(d.C3,{text:K("删除"),clickFun:()=>{(e=>{const s=[...t];s.splice(e,1),F(s),a(s)})(o)}}),(0,i.jsx)(d.C3,{text:K("编辑"),clickFun:()=>{void 0===b.find(e=>e===o)&&S([...b,o])}})]})})]},o)),w&&(0,i.jsxs)("div",{style:{display:"block"},children:[(0,i.jsx)(d.rA,{title:K("取消"),icon:"cancel",onClick:()=>{S([]),j(!1),f&&(a(f),F(f)),N(!1)}}),(0,i.jsx)(d.rA,{title:K("添加"),icon:"add",onClick:async()=>{const s=[...t,{name:"",color:(0,l.Lr)(h),...e.get_pre_add_item&&await e.get_pre_add_item()}];F(s),a(s)}}),(0,i.jsx)(d.rA,{title:K("添加类目"),icon:"add_box",onClick:()=>{const e=[...t,{name:"",_type:"dir",_children:[],color:"#c1edfb"}];F(e),a(e)}}),(0,i.jsx)(d.rA,{title:K("全部编辑"),icon:k?"unfold_less":"unfold_more",onClick:()=>{N(!k)}})]}),(void 0===e.have_auth_edit||!0===e.have_auth_edit)&&(0,i.jsx)(d.rA,{icon:w?"save":"edit",title:K(w?"保存":"编辑"),onClick:async()=>{w?e.save&&await e.save(y):f=t,j(!w)}})]})}},15937(e,t,a){a.r(t),a.d(t,{default:()=>me});var s=a(96540),n=a(70447),o=a(75725),i=a(61443),r=a(85997),l=a(4412),c=a(14284),d=a(8694),u=a(53459),p=a(83029),h=a(86149),m=a(82893),f=a(34843),y=a(78247),_=a(23430),v=a(62042),x=a(74848);function g(e){const{t}=(0,h.B)(),[a,n]=(0,f.fp)(m.AG.header_min),[g,w]=(0,s.useState)(""),[j,k]=(0,s.useState)(""),[N,K]=(0,s.useState)(void 0),[b,S]=(0,s.useState)(!1),{check_user_auth:C}=(0,y.MH)(),A=async()=>{const e=new d.qB;e.targetProxyUrl="string"==typeof g?g:j;(await c._U.post("close",e)).code===u.m.Success&&(k(""),n(!1))},F=async e=>{const t=new d.qB;if(t.targetProxyUrl="string"==typeof e?e:g,!t.targetProxyUrl.startsWith("http"))return void(0,v.zN)("must start with http[s]://");const a=await c._U.post("start",t);if(a.code!==u.m.Success)return;const s=`${window.location.protocol}//${window.location.hostname}:${a.data}`;k(s)};(0,s.useEffect)(()=>()=>{A()},[]);return(0,x.jsxs)("div",{children:[(0,x.jsxs)(l.aZ,{position:"right",children:[(0,x.jsx)(i.$Z,{placeholder:t("要代理的url"),icon:"link",value:g,handleInputChange:e=>{w(e)}}),(0,x.jsx)(r.rA,{icon:"play_arrow",title:t("开始代理"),onClick:F}),(0,x.jsx)(r.rA,{icon:"fullscreen",title:t("全屏"),onClick:()=>{S(!b),n(!b)}}),(0,x.jsx)(r.rA,{icon:"close",title:t(t("关闭")),onClick:()=>{A(),S(!1),w("")}})]}),(0,x.jsx)(o.jW,{isFull:b,children:(0,x.jsxs)("div",{id:"browser",children:[!j&&(0,x.jsx)(p.N,{have_auth_edit:C(_.oV.browser_proxy_tag_update),getItems:async()=>{const e=await c._U.get("tag");return e.code===u.m.Success?e.data:[]},save:async e=>{(await c._U.post("tag/save",e)).code!==u.m.Success&&(0,v.zN)("网络错误")},clickItem:async e=>{w(e.url),F(e.url)},items:[{key:"name",preName:t("名字")},{key:"url",preName:"url"},{key:"color",preName:"color"}]}),(0,x.jsx)("iframe",{id:"webview",src:j})]})})]})}var w=a(34289),j=(a(75007),a(97856)),k=a(92275),N=a(14944),K=a(64405);const b=s.lazy(()=>Promise.all([a.e(2543),a.e(5614)]).then(()=>a(85614)));function S(e){const[t,a]=(0,s.useState)(null),[n,o]=(0,f.fp)(m.AG.remoteShellShow),[i,r]=(0,s.useState)(!1),[l,c]=(0,f.fp)(m.AG.sshInfo),[d,u]=(0,f.fp)(m.AG.shellNowDir),[p,h]=(0,f.fp)(m.AG.user_base_info),y=p.user_data.theme?.includes("dark")?"#FFFFFF":"#000000",_=()=>{(async()=>{t&&(t.dispose(),a(null))})()};(0,s.useEffect)(()=>()=>{_()},[]),(0,s.useEffect)(()=>{n.show?t||((async()=>{const e=new j.Terminal({fontFamily:"Monaco, Menlo, Consolas, 'Courier New', monospace",theme:{background:"#FFFFFF",foreground:y,cursor:y,selectionBackground:"#a6d2ff"},cursorBlink:!0,cursorStyle:"bar",scrollback:1e3,scrollSensitivity:1,tabStopWidth:4});let t;const s=t=>{e.write(t)};t=a=>{e.clear(),e.write(a),t=s},N.ws.addMsg(k.HK.remote_shell_getting,e=>{t(e.context)}),e.onData(async e=>{const t=new K.x;t.key=l.key,t.cmd=e;const a=new k.hf(k.HK.remote_shell_send);a.context=t,await N.ws.send(a)}),a(e)})(),r(!0)):_()},[n]);return(0,x.jsx)(b,{show:n.show,terminal:t,init:(e,a)=>{t.writeln("open shell... ");const s=new k.hf(k.HK.remote_shell_open),o=new K.x;o.key=l.key,o.init_path=n.path,o.rows=e,o.cols=a,s.context=o,N.ws.send(s)}})}var C=a(47374),A=a(86090),F=a(99214),D=a(47022),L=a(88815),M=a(6960),B=a(79240),I=a(83529),P=a(12730);function R(e){const{t}=(0,h.B)();(0,A.zy)();(0,A.Zp)();const{check_user_auth:a}=(0,y.MH)(),[n,o]=(0,f.fp)(m.AG.nowFileList),[i,l]=(0,f.fp)(m.AG.uploadFiles),[c,d]=(0,f.fp)(m.AG.showPrompt),[u,p]=(0,f.fp)(m.AG.selectedFileList),[_,g]=(0,f.fp)(m.AG.enterKey),[j,k]=(0,f.fp)(m.AG.copyedFileList),[N,K]=(0,f.fp)(m.AG.cutedFileList),[b,S]=(0,f.fp)(m.AG.selectedFileList),[C,L]=(0,f.fp)(m.AG.clickFileList),[M,B]=(0,f.fp)(m.AG.remoteShellShow),[R,E]=(0,f.fp)(m.AG.sshInfo),$=(0,F.Vs)();function G(e){(0,v.SK)(e)}return(0,x.jsxs)(s.Fragment,{children:[u.length>0&&(0,x.jsx)(r.rA,{icon:"delete",title:t("删除"),onClick:()=>{d({show:!0,type:I.PromptEnum.SshDelete,overlay:!0,data:{}})}}),u.length>0&&(0,x.jsx)(r.rA,{icon:"content_copy",title:t("复制"),onClick:function(){const e=(0,F.ib)(n,u);k(e.map(e=>`/${(0,w.GG)("remoteShell",(0,w.vX)())}${e.name}`)),K([]),G("已复制")}}),u.length>0&&(0,x.jsx)(r.rA,{icon:"content_cut",title:t("剪切"),onClick:function(){const e=(0,F.ib)(n,u);K(e.map(e=>`/${(0,w.GG)("remoteShell",(0,w.vX)())}${e.name}`)),k([]),G("已剪切")}}),(j.length>0||N.length>0)&&(0,x.jsx)(r.rA,{onClick:function(){d({show:!0,type:I.PromptEnum.SshPaste,overlay:!0,data:{}})},icon:"content_paste",title:t("粘贴到此处"),tip:j.length+N.length}),1===u.length&&n.files.length>=1&&(0,F.ib)(n,u)[0].type!==D.Iw.folder&&(0,x.jsx)(r.rA,{icon:"download",title:t("下载"),onClick:function(){const e=(0,F.ib)(n,u),t=`/api/ssh/download?file=${`/${(0,w.GG)("remoteShell",(0,w.vX)())}${decodeURIComponent(e[0].name)}`}&key=${R.key}&token=${localStorage.getItem("token")}`;window.open(t)}}),1===u.length&&(0,x.jsx)(r.rA,{icon:"edit_attributes",title:t("重命名"),onClick:function(){d({show:!0,type:I.PromptEnum.SshReName,overlay:!0,data:{}})}}),(0,x.jsx)(r.rA,{icon:"terminal",title:"shell",onClick:function(){M.show?B({show:!1,path:""}):B({show:!0,path:`/${(0,w.GG)("remoteShell",(0,w.vX)())}`})}}),(0,x.jsx)(r.rA,{icon:"grid_view",title:t("切换样式"),onClick:$}),(0,x.jsx)(r.rA,{icon:"create_new_folder",title:t("创建文件夹"),onClick:function(){d({show:!0,type:I.PromptEnum.SshNewDir,overlay:!0,data:{}})}}),(0,x.jsx)(r.rA,{icon:"note_add",title:t("创建文本文件"),onClick:function(){d({show:!0,type:I.PromptEnum.SshNewFile,overlay:!0,data:{}})}}),(0,x.jsx)(r.rA,{icon:"upload_file",title:"上传",onClick:()=>{d({show:!0,type:I.PromptEnum.UploadFile,overlay:!0,data:{call:e=>{let t=e.currentTarget?.files;if(!t)return;let a=!!t[0].webkitRelativePath;const s=[],n=new Set;for(let e=0;e<t.length;e++){const o=t[e],i=a?o.webkitRelativePath:`${o.webkitRelativePath}${o.name}`;o.fullPath=i,a&&n.add((0,P.S)(i)),s.push(o)}const o=[];if(a)for(const e of Array.from(n))o.push({isDir:!0,fullPath:e,name:e});o.push(...s),l(o),d({show:!0,type:I.PromptEnum.SshUpload,overlay:!1,data:{}})}}})}}),(0,x.jsx)(r.rA,{icon:"close",title:t("关闭"),onClick:()=>{e.close()}})]})}var E=a(60096),$=a(21499);let G;function O(e){const{t}=(0,h.B)(),a=(0,A.zy)(),[n,o]=(0,f.fp)(m.AG.nowFileList),[r,d]=(0,f.fp)(m.AG.selectedFileList),[p,y]=(0,f.fp)(m.AG.clickFileList),[g,j]=(0,f.fp)(m.AG.sshInfo),[k,N]=(0,s.useState)(""),b=(0,A.Zp)(),[D,I]=(0,f.fp)(m.AG.user_base_info),P=async e=>{const t=new K.x;t.key=g.key,t.dir=e||`/${(0,w.GG)("remoteShell",(0,w.vX)())}`;const a=await c.Fg.post("get/dir",t);if(a.code!==u.m.Success)return void(0,v.zN)("连接失败");const{folders:s,files:n}=a.data||{};for(const e of n??[])e.origin_size=e.size,e.size=(0,L.v7)(e.size),D.user_data.file_time_show_type===_.KD.time?e.show_mtime=e.mtime?(0,$.Yq)(e.mtime):"":e.show_mtime=e.mtime?(0,M.s)(e.mtime):"";for(const e of s??[])D.user_data.file_time_show_type===_.KD.time?e.show_mtime=e.mtime?(0,$.Yq)(e.mtime):"":e.show_mtime=e.mtime?(0,M.s)(e.mtime):"";const i={folders:s||[],files:n||[]};(0,F.yC)(i,D.user_data.dir_show_type),o(i),G=i};function O(){d([]),y([])}(0,s.useEffect)(()=>{O(),(async()=>{await P()})()},[a]);return(0,x.jsxs)(s.Fragment,{children:[(0,x.jsx)(l.aZ,{children:(0,x.jsx)(i.$Z,{handleEnterPress:()=>{if(!G)return;d([]),y([]);const e=[],t=[];for(const t of G.files??[])t.name.includes(k)&&e.push(t);for(const e of G.folders??[])e.name.includes(k)&&t.push(e);o({files:e,folders:t})},placeholder:t("搜索当前目录"),icon:"search",value:"",handleInputChange:e=>{N(e)},max_width:"25em"})}),(0,x.jsx)(l.aZ,{position:"right",children:(0,x.jsx)(R,{close:e.close})}),(0,x.jsx)(C.e,{baseRoute:"remoteShell",clickFun:O,input_path_enter:e=>{(0,B.Z1)(e)?P(e):b((0,B.Jn)((0,w.vX)(),e)),d([]),y([]),o({files:[],folders:[]})}}),(0,x.jsx)(E.Ic,{handleContextMenu:()=>{},clickBlank:e=>{e.target===e.currentTarget&&d([])},file_list:n.files,folder_list:n.folders,fileHandler:P}),(0,x.jsx)(S,{})]})}function H(e){const{t}=(0,h.B)(),a=(0,A.Zp)(),[n,o]=(0,s.useState)(""),[d,g]=(0,s.useState)(""),[w,j]=(0,s.useState)(""),[k,N]=(0,s.useState)(""),[b,S]=(0,s.useState)(void 0),[C,F]=(0,s.useState)(""),[D,L]=(0,f.fp)(m.AG.shellNowDir),[M,I]=(0,f.fp)(m.AG.sshInfo),{check_user_auth:P}=(0,y.MH)(),R=async e=>{const t=new K.x;if(t.password=e?e.password:d,t.domain=e?e.domain:k,t.port=e?e.port:b,t.username=e?e.username:n,t.private_path=e?e.private_path:w,t.dir=e?e.dir:C,!t.dir)return void(0,v.zN)("dir not found");if(!t.username)return void(0,v.zN)("username not found");if(!t.domain)return void(0,v.zN)("domain not found");if(!t.port)return void(0,v.zN)("port not found");if(!t.private_path&&!t.password)return void(0,v.zN)("private_path password not found");const s=await c.Fg.post("start",t);s&&s.code===u.m.Success&&(a((0,B.Jn)("/proxy/remoteShell",t.dir)),L([t.dir]),I(s.data))};return(0,x.jsxs)(s.Fragment,{children:[(0,x.jsxs)(l.aZ,{position:"right",children:[(0,x.jsx)(i.$Z,{placeholder:t("目录"),icon:"home",value:C,handleInputChange:e=>F(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("账号"),icon:"verified_user",value:n,handleInputChange:e=>o(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{type:"password",placeholder:t("密码"),icon:"password",value:d,handleInputChange:e=>g(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("私钥路径"),icon:"private_connectivity",value:w,handleInputChange:e=>j(e),max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("连接地址"),icon:"location_on",value:k,handleInputChange:e=>{N(e)},max_width:"15rem"}),(0,x.jsx)(i.$Z,{placeholder:t("端口"),icon:"outlet",value:b,handleInputChange:e=>{if(!e)return;/^\d+$/.test(e)||(0,v.zN)("不是数字"),S(parseInt(e))},max_width:"7rem"}),(0,x.jsx)(r.rA,{icon:"play_arrow",title:t("连接"),onClick:()=>{R()}})]}),M.key?(0,x.jsx)(O,{close:async()=>{const e=new K.x;e.key=M.key;await c.Fg.post("close",e);I({})},data:{port:b,password:d,username:n,domain:k,dir:C}}):(0,x.jsx)(p.N,{have_auth_edit:P(_.oV.ssh_proxy_tag_update),getItems:async()=>{const e=await c.Fg.get("tag");return e.code===u.m.Success?e.data:[]},save:async e=>{await c.Fg.post("tag/save",e)},clickItem:async e=>{N(e.domain),F(e.dir),S(e.port),o(e.username),g(e.password),j(e.private_path),await R(e)},items:[{key:"name",preName:t("名字")},{key:"domain",preName:t("地址")},{key:"port",preName:t("端口")},{key:"username",preName:t("账号")},{key:"password",preName:t("密码")},{key:"private_path",preName:t("私钥路径")},{key:"dir",preName:t("访问目录")},{key:"color",preName:"color"}]})]})}function U(e){switch(e){case 0:return 1;case 2:return 2;default:return 0}}class T{constructor(e){this.canvas=e,this.render=new Y.Canvas.create(this.canvas),this.activeSession=!1,this.install()}close(){this.activeSession=!1}install(){var e=this;return this.canvas.addEventListener("mousemove",function(t){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:0,isPressed:!1}),t.preventDefault||e.activeSession(),!1}),this.canvas.addEventListener("mousedown",function(t){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:U(t.button),isPressed:!0}),t.preventDefault(),!1}),this.canvas.addEventListener("mouseup",function(t){if(e.activeSession){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:U(t.button),isPressed:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("contextmenu",function(t){if(e.activeSession){var a=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.mouse,{x:t.clientX-a.left,y:t.clientY-a.top,button:U(t.button),isPressed:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("DOMMouseScroll",function(t){if(e.activeSession){var a=t.detail,s=Math.round(15*Math.abs(a)/8),n=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.wheel,{x:t.clientX-n.left,y:t.clientY-n.top,step:s,isNegative:a>0,isHorizontal:!1}),t.preventDefault(),!1}}),this.canvas.addEventListener("mousewheel",function(t){if(e.activeSession){var a=Math.abs(t.deltaX)>Math.abs(t.deltaY),s=a?t.deltaX:t.deltaY,n=Math.round(15*Math.abs(s)/8),o=Y.elementOffset(e.canvas);return N.ws.sendData(k.HK.wheel,{x:t.clientX-o.left,y:t.clientY-o.top,step:n,isNegative:s>0,isHorizontal:a}),t.preventDefault(),!1}}),window.addEventListener("keydown",function(t){if(e.activeSession)return N.ws.sendData(k.HK.scancode,{code:Y.scancode(t),isPressed:!0}),t.preventDefault(),!1}),window.addEventListener("keyup",function(t){if(e.activeSession)return N.ws.sendData(k.HK.scancode,{code:Y.scancode(t),isPressed:!1}),t.preventDefault(),!1}),this}connect(e,t,a,s,n,o){var i=this;N.ws.addMsg(k.HK.rdp_connect,e=>{console.log("[mstsc.js] connected"),i.activeSession=!0}),N.ws.addMsg(k.HK.rdp_bitmap,e=>{const t=e.context;t.data=e.bin_context,i.render.update(t)}),N.ws.addMsg(k.HK.rdp_close,e=>{o(null),console.log("[mstsc.js] close"),i.activeSession=!1}),N.ws.addMsg(k.HK.rdp_error,e=>{i.activeSession=!1});const r=new k.hf;r.cmdType=k.HK.infos,r.context={ip:e.indexOf(":")>-1?e.split(":")[0]:e,port:a,screen:{width:this.canvas.width,height:this.canvas.height},domain:t,username:s,password:n,locale:Y.locale()},N.ws.send(r)}}class z{constructor(e){this.canvas=e,this.ctx=e.getContext("2d")}update(e){var t=null;t=e.isCompress?function(e){var t=null;switch(e.bitsPerPixel){case 15:t="bitmap_decompress_15";break;case 16:t="bitmap_decompress_16";break;case 24:t="bitmap_decompress_24";break;case 32:t="bitmap_decompress_32";break;default:throw"invalid bitmap data format"}var a=new Uint8Array(e.data),s=Module._malloc(a.length),n=new Uint8Array(Module.HEAPU8.buffer,s,a.length);n.set(a);var o=e.destRight-e.destLeft+1,i=e.destBottom-e.destTop+1,r=o*i*4,l=Module._malloc(r),c=new Uint8Array(Module.HEAPU8.buffer,l,r),d=(Module.ccall(t,"number",["number","number","number","number","number","number","number","number"],[c.byteOffset,o,i,e.width,e.height,n.byteOffset,a.length]),new Uint8ClampedArray(c.buffer,c.byteOffset,r));return Module._free(s),Module._free(l),{width:o,height:i,data:d}}(e):function(e){return{width:e.width,height:e.height,data:new Uint8ClampedArray(e.data)}}(e);var a=this.ctx.createImageData(t.width,t.height);a.data.set(t.data),this.ctx.putImageData(a,e.destLeft,e.destTop)}}var Z={"":0,Escape:1,Digit1:2,Digit2:3,Digit3:4,Digit4:5,Digit5:6,Digit6:7,Digit7:8,Digit8:9,Digit9:10,Digit0:11,Minus:12,Equal:13,Backspace:14,Tab:15,KeyQ:16,KeyW:17,KeyE:18,KeyR:19,KeyT:20,KeyY:21,KeyU:22,KeyI:23,KeyO:24,KeyP:25,BracketLeft:26,BracketRight:27,Enter:28,ControlLeft:29,KeyA:30,KeyS:31,KeyD:32,KeyF:33,KeyG:34,KeyH:35,KeyJ:36,KeyK:37,KeyL:38,Semicolon:39,Quote:40,Backquote:41,ShiftLeft:42,Backslash:43,KeyZ:44,KeyX:45,KeyC:46,KeyV:47,KeyB:48,KeyN:49,KeyM:50,Comma:51,Period:52,Slash:53,ShiftRight:54,NumpadMultiply:55,AltLeft:56,Space:57,CapsLock:58,F1:59,F2:60,F3:61,F4:62,F5:63,F6:64,F7:65,F8:66,F9:67,F10:68,Pause:69,ScrollLock:70,Numpad7:71,Numpad8:72,Numpad9:73,NumpadSubtract:74,Numpad4:75,Numpad5:76,Numpad6:77,NumpadAdd:78,Numpad1:79,Numpad2:80,Numpad3:81,Numpad0:82,NumpadDecimal:83,PrintScreen:84,IntlBackslash:86,F11:87,F12:88,NumpadEqual:89,F13:100,F14:101,F15:102,F16:103,F17:104,F18:105,F19:106,F20:107,F21:108,F22:109,F23:110,KanaMode:112,Lang2:113,Lang1:114,IntlRo:115,F24:118,Convert:121,NonConvert:123,IntlYen:125,NumpadComma:126,MediaTrackPrevious:57360,MediaTrackNext:57369,NumpadEnter:57372,ControlRight:57373,VolumeMute:57376,LaunchApp2:57377,MediaPlayPause:57378,MediaStop:57380,VolumeDown:57390,VolumeUp:57392,BrowserHome:57394,NumpadDivide:57397,PrintScreen:57399,AltRight:57400,NumLock:57413,Pause:57414,Home:57415,ArrowUp:57416,PageUp:57417,ArrowLeft:57419,ArrowRight:57421,End:57423,ArrowDown:57424,PageDown:57425,Insert:57426,Delete:57427,OSLeft:57435,OSRight:57436,ContextMenu:57437,Power:57438,BrowserSearch:57445,BrowserFavorites:57446,BrowserRefresh:57447,BrowserStop:57448,BrowserForward:57449,BrowserBack:57450,LaunchApp1:57451,LaunchMail:57452,MediaSelect:57453},V={27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",192:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",173:"Minus",61:"Equal",8:"Backspace",9:"Tab",81:"KeyQ",87:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",219:"BracketLeft",221:"BracketRight",13:"Enter",20:"CapsLock",65:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",59:"Semicolon",222:"Quote",220:"Backslash",16:"ShiftLeft",220:"IntlBackslash",90:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",77:"KeyM",188:"Comma",190:"Period",191:"Slash",16:"ShiftRight",17:"ControlLeft",18:"AltLeft",91:"OSLeft",32:"Space",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",13:"NumpadEnter",96:"Numpad0",110:"NumpadDecimal",17:"ControlLeft"},J={firefox:{fr:{27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",0:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",169:"Minus",61:"Equal",8:"Backspace",9:"Tab",65:"KeyQ",90:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",160:"BracketLeft",164:"BracketRight",13:"Enter",20:"CapsLock",20:"CapsLock",81:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",77:"Semicolon",165:"Quote",170:"Backslash",16:"ShiftLeft",60:"IntlBackslash",87:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",188:"KeyM",59:"Comma",58:"Period",161:"Slash",16:"ShiftRight",17:"ControlLeft",91:"OSLeft",18:"AltLeft",32:"Space",17:"ControlLeft",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",96:"Numpad0",110:"NumpadDecimal",13:"NumpadEnter",17:"ControlLeft",67:"KeyC",17:"ControlLeft"},en:V},chrome:{fr:{27:"Escape",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",0:"Backquote",49:"Digit1",50:"Digit2",51:"Digit3",52:"Digit4",53:"Digit5",54:"Digit6",55:"Digit7",56:"Digit8",57:"Digit9",48:"Digit0",219:"Minus",187:"Equal",8:"Backspace",9:"Tab",65:"KeyQ",90:"KeyW",69:"KeyE",82:"KeyR",84:"KeyT",89:"KeyY",85:"KeyU",73:"KeyI",79:"KeyO",80:"KeyP",221:"BracketLeft",186:"BracketRight",13:"Enter",20:"CapsLock",20:"CapsLock",81:"KeyA",83:"KeyS",68:"KeyD",70:"KeyF",71:"KeyG",72:"KeyH",74:"KeyJ",75:"KeyK",76:"KeyL",77:"Semicolon",192:"Quote",220:"Backslash",16:"ShiftLeft",60:"IntlBackslash",87:"KeyZ",88:"KeyX",67:"KeyC",86:"KeyV",66:"KeyB",78:"KeyN",188:"KeyM",190:"Comma",191:"Period",223:"Slash",16:"ShiftRight",17:"ControlLeft",91:"OSLeft",18:"AltLeft",32:"Space",17:"ControlLeft",18:"AltRight",91:"OSRight",93:"ContextMenu",17:"ControlRight",37:"ArrowLeft",38:"ArrowUp",40:"ArrowDown",39:"ArrowRight",144:"NumLock",144:"NumLock",111:"NumpadDivide",106:"NumpadMultiply",109:"NumpadSubtract",103:"Numpad7",104:"Numpad8",105:"Numpad9",107:"NumpadAdd",100:"Numpad4",101:"Numpad5",102:"Numpad6",97:"Numpad1",98:"Numpad2",99:"Numpad3",96:"Numpad0",110:"NumpadDecimal",13:"NumpadEnter",17:"ControlLeft",67:"KeyC",17:"ControlLeft"},en:V}};function X(){}X.prototype={$:function(e){return document.getElementById(e)},elementOffset:function(e){for(var t=0,a=0;e&&!isNaN(e.offsetLeft)&&!isNaN(e.offsetTop);)t+=e.offsetLeft-e.scrollLeft,a+=e.offsetTop-e.scrollTop,e=e.offsetParent;return{top:a,left:t}},browser:function(){return"undefined"!=typeof InstallTrigger?"firefox":window.chrome?"chrome":document.docuemntMode?"ie":null},locale:function(){return window.navigator.userLanguage||window.navigator.language},client:{create:function(e){return new T(e)}},Canvas:{create:function(e){return new z(e)}},scancode(e){var t=X.prototype.locale();return t=["fr","en"].indexOf(t)>0&&t||"en",Z[e.code||J[X.prototype.browser()||"firefox"][t][e.keyCode]]}};let Y=new X;var q=a(38240);let W;function Q(){const{t:e}=(0,h.B)(),[t,a]=(0,f.fp)(m.AG.header_min),{check_user_auth:n}=(0,y.MH)(),[d,g]=(0,s.useState)(void 0),[w,j]=(0,s.useState)(3389),[K,b]=(0,s.useState)(void 0),[S,C]=(0,s.useState)(void 0),[A,F]=(0,s.useState)(!1),[D,L]=(0,s.useState)(!1);var M=null;(0,s.useEffect)(()=>(W||(async()=>{try{await(0,q.J)("rle.js"),W=!0}catch(e){return void(0,v.zN)("加载资源失败")}})(),()=>{M&&(M.close(),M=null)}),[]);const B=t=>{L(!0),function(s,n,o,i){if(s=s||t.address,o=o||t.username,i=i||t.password,!s||!o)return(0,v.zN)(e("ip或者账号不允许为空")),void L(!1);!function(e){M||(M=Y.client.create(Y.$(e)))}("rdpwebview");var r=Y.$("rdpwebview");r.style.display="inline",r.width=window.innerWidth,r.height=window.innerHeight,F(!0),a(!0),M.connect(s,"",n,o,i,function(e){Y.$("rdpwebview").style.display="none",a(!1),L(!1),F(!1)})}(d,w,K,S)};return(0,x.jsxs)("div",{children:[(0,x.jsxs)(l.aZ,{position:"right",children:[(0,x.jsx)(i.$Z,{placeholder:e("地址"),icon:"network_ping",value:d,max_width:"15rem",handleInputChange:e=>g(e)}),(0,x.jsx)(i.$Z,{placeholder:e("端口"),icon:"outlet",value:w,max_width:"10rem",handleInputChange:e=>{e&&j(parseInt(e))}}),(0,x.jsx)(i.$Z,{placeholder:e("账号"),icon:"manage_accounts",value:K,max_width:"15rem",handleInputChange:e=>b(e)}),(0,x.jsx)(i.$Z,{placeholder:e("密码"),icon:"password",value:S,max_width:"15rem",handleInputChange:e=>C(e)}),!D&&(0,x.jsx)(r.rA,{icon:"play_arrow",title:e("连接"),onClick:B}),D&&(0,x.jsx)(r.rA,{icon:"close",title:e("关闭"),onClick:async()=>{F(!1),await N.ws.sendData(k.HK.rdp_disconnect,"");var e=Y.$("rdpwebview");e.getContext("2d").clearRect(0,0,e.width,e.height),Y.$("rdpwebview").style.display="none",L(!1),a(!1)}})]}),(0,x.jsxs)(o.jW,{isFull:A,children:[!D&&(0,x.jsx)(p.N,{have_auth_edit:n(_.oV.rdp_proxy_tag_update),getItems:async()=>{const e=await c.J0.get("tag");return e.code===u.m.Success?e.data:[]},save:async e=>{(await c.J0.post("tag/save",e)).code!==u.m.Success&&(0,v.zN)("网络错误")},clickItem:async e=>{C(e.password),b(e.username),g(e.address),j(e.port),B(e)},items:[{key:"name",preName:e("名字")},{key:"address",preName:e("地址")},{key:"port",preName:e("端口")},{key:"username",preName:e("账号")},{key:"password",preName:e("密码")},{key:"color",preName:"color"}]}),(0,x.jsx)("canvas",{id:"rdpwebview",style:{display:"none"}})]})]})}var ee=a(77481),te=a(40505),ae=a(99380);const se=(0,s.createContext)({activeKey:"",setActiveKey:()=>{}});function ne(e){const{children:t,activeKey:a,defaultActiveKey:n,onChange:o,width:i}=e,[r,l]=(0,s.useState)(()=>a??n??"");(0,s.useEffect)(()=>{void 0!==a&&l(a)},[a]);const c=e=>{void 0===a&&l(e),o&&o(e)},d=[];return s.Children.forEach(t,e=>{s.isValidElement(e)&&e.type===oe&&d.push({key:e.props.itemKey,tab:e.props.tab,disabled:e.props.disabled})}),(0,s.useEffect)(()=>{!r&&d.length>0&&l(d[0].key)},[d,r]),(0,x.jsx)(se.Provider,{value:{activeKey:r,setActiveKey:c},children:(0,x.jsxs)("div",{className:"modern-tabs-container",style:{width:i||"100%"},children:[(0,x.jsx)("div",{className:"modern-tabs-nav",children:d.map(e=>{const t=["modern-tabs-tab",r===e.key?"active":"",e.disabled?"disabled":""].filter(Boolean).join(" ");return(0,x.jsx)("div",{className:t,onClick:()=>!e.disabled&&c(e.key),children:e.tab},e.key)})}),(0,x.jsx)("div",{className:"modern-tabs-content",children:t})]})})}function oe(e){const{itemKey:t,children:a}=e,{activeKey:n}=(0,s.useContext)(se),o=n===t;return(0,x.jsx)("div",{className:"modern-tab-panel "+(o?"active":""),children:a})}const ie=s.lazy(()=>Promise.all([a.e(5880),a.e(9381)]).then(()=>a(19381)));let re,le,ce,de;function ue(){const{t:e}=(0,h.B)(),[t,a]=(0,f.fp)(m.AG.confirm),[l,g]=(0,f.fp)(m.AG.showPrompt),{check_user_auth:w}=(0,y.MH)(),[j,K]=(0,s.useState)(""),[b,S]=(0,f.fp)(m.AG.router_jump),[C,A]=(0,s.useState)("get"),[F,D]=(0,s.useState)(""),[M,B]=(0,s.useState)(void 0),[P,R]=(0,s.useState)([]),[E,G]=(0,s.useState)([]),[O,H]=(0,s.useState)("headers"),[U,T]=(0,s.useState)(String(d.RB.row)),[z,Z]=(0,s.useState)("body"),[V,J]=(0,s.useState)(),[X,Y]=(0,f.fp)(m.AG.nav_index_add_item_by_now_list),[q,W]=(0,f.fp)(m.AG.prompt_card);y.xK.set_value_temp("{}",0),y.xK.set_value_temp("",1),(0,s.useEffect)(()=>(re={},le="",ce="",de="",y.xK.get_editor(0).session.setMode("ace/mode/json"),b.http_download_map_path&&(B(b.http_download_map_path),S({})),N.ws.sendData(k.HK.http_download_water,void 0).then(()=>{N.ws.addMsg(k.HK.http_download_water,e=>{const t=e.context;G(t)})}),()=>{N.ws&&"function"==typeof N.ws.removeMsg&&N.ws.removeMsg(k.HK.http_download_water)}),[]);const Q=e=>{const t=new d.vr;t.url=F,t.method=C,t.header_type="headers"===O?1:2,"headers"===O&&(re=JSON.parse(y.xK.get_editor_value(0))),t.headers=re;const a=Number(U);if(t.body_type=a,a===d.RB.row)le=y.xK.get_editor_value(1),t.data=le;else if(a===d.RB.json)re["Content-Type"]="application/json",le=y.xK.get_editor_value(1),t.data=le;else if(a===d.RB.form){re["Content-Type"]="multipart/form-data",t.form_data_list=P;for(const t of P)t.key&&t.is_file&&e&&e.append(t.fullPath,t.file_object)}return t};return(0,x.jsx)("div",{children:(0,x.jsxs)(o.xh,{children:[(0,x.jsxs)(o.fI,{children:[(0,x.jsxs)(o.VP,{children:[0!==E.length&&(0,x.jsx)(n.Zp,{title:"正在下载",children:(0,x.jsx)("div",{children:E.map((t,a)=>(0,x.jsxs)("div",{children:[(0,x.jsxs)("div",{className:"div-row",children:[(0,x.jsx)(r.rA,{icon:"cancel",title:e("取消"),onClick:()=>{N.ws.sendData(k.HK.http_download_cancel,t.local_download_path)}}),(0,x.jsx)(n.xP,{context:t.filename,tip_context:t.local_download_path}),(0,x.jsx)("span",{style:{paddingLeft:".3rem",color:"green"},children:`${t.progresses??0}% ${t.loaded?(0,L.v7)(t.loaded):""}MB / ${t.seep??""}MB/s `})]}),(0,x.jsx)("div",{style:{width:t.progresses?`${t.progresses}%`:"0",backgroundColor:"#40c4ff",height:"5px",transition:"0.2s ease width",borderRadius:"10px"}})]},a))})}),(0,x.jsxs)(n.Zp,{title:"",rightBottomCom:Number(U)===d.RB.form&&"body"===O&&(0,x.jsx)(r.rA,{icon:"add",title:e("添加"),onClick:()=>{R([{},...P])}}),children:[(0,x.jsxs)("div",{className:"http_url",children:[(0,x.jsx)(i.l6,{width:"10rem",value:C,onChange:e=>{A(e)},options:[{value:"get",color:"#28a745"},{value:"post",color:"#007bff"},{value:"put",color:"#fd7e14"},{value:"delete",color:"#dc3545"},{value:"head",color:"#6f42c1"},{value:"options",color:"#17a2b8"},{value:"connect",color:"#666666"},{value:"trace",color:"#666666"},{value:"custom",color:"#e83e8c"}]}),(0,x.jsx)(i.Sm,{width:"50rem",placeholder:e("http url"),value:F,handleInputChange:e=>{D(e)}}),(0,x.jsx)(r.rA,{icon:"send",title:e("发送"),onClick:async()=>{if(!c._U.have_http_method(C))return void(0,v.zN)("不存在的http method");if(!F)return void(0,v.zN)("url is empty");J(void 0),K("");const e=new FormData;e.append("data",JSON.stringify(Q(e)));let t="http/send";M&&(t+=`?local_download_path=${M}`),ae.A.post(c._U.getUrl(t),e,{headers:{"Content-Type":"multipart/form-data",Authorization:localStorage.getItem("token")}}).catch(e=>{(0,v.zN)(e.message)}).then(e=>{if(!e)return;let t={};try{if(e.headers.filecat_remote_raw_headers&&(t=JSON.parse(e.headers.filecat_remote_raw_headers),de=JSON.stringify(t,null,2)),e.headers.filecat_remote_code)try{const t=JSON.parse(e.headers.filecat_remote_code);J(200===t||201===t?(0,x.jsx)("span",{style:{color:"green"},children:"200"}):t)}catch(e){console.log(e)}}catch(t){de=String(e.headers.filecat_remote_raw_headers)}const a=(t["content-type"]||t["Content-Type"]||"").toLowerCase();ce="object"==typeof e.data?JSON.stringify(e.data,null,2):e.data;const s=y.xK.get_editor(2),n="body"===z?ce:de;if(s){if(a.includes("application/json")||a.includes("+json")){s.session.setMode("ace/mode/json");try{const e=JSON.parse(ce);ce=JSON.stringify(e,null,2)}catch(e){}}else a.includes("html")?s.session.setMode("ace/mode/html"):a.includes("xml")?s.session.setMode("ace/mode/xml"):a.includes("javascript")?s.session.setMode("ace/mode/javascript"):s.session.setMode("ace/mode/text");s.setValue("body"===z?ce:de,-1)}K(n)})}}),w(_.oV.http_proxy_tag_update)&&(0,x.jsx)(r.rA,{title:e("添加"),icon:"save_as",onClick:()=>{if(!w(_.oV.http_proxy_tag_update))return void(0,v.zN)("no permission");for(const t of P)if(t.is_file)return void(0,v.zN)(e("frm_lm"));let t;W({open:!0,title:e("信息"),context_div:(0,x.jsxs)("div",{children:[(0,x.jsx)("div",{className:"card-content",children:(0,x.jsx)(i.Sm,{placeholderOut:e("输入标签名"),handleInputChange:e=>t=e})}),(0,x.jsx)("div",{className:"card-action",children:(0,x.jsx)("button",{className:"button button--flat",onClick:async()=>{const e=await Q();e.local_download_path=M,e.form_data_list=JSON.stringify(P),e.headers=JSON.stringify(e.headers),"object"==typeof e.data&&(e.data=JSON.stringify(e.data)),e.name=t,Y(e),W({open:!1})},children:e("确定")})})]})})}})]}),(0,x.jsxs)(ne,{activeKey:O,onChange:e=>H(e),children:[(0,x.jsx)(oe,{itemKey:"headers",tab:e("请求头")+"(json)",children:(0,x.jsxs)("div",{style:{marginTop:"10px"},children:[(0,x.jsx)("div",{style:{display:"flex",justifyContent:"flex-end",marginBottom:"4px"},children:(0,x.jsx)(r.rA,{title:e("格式化"),icon:"data_object",onClick:function(){y.xK.get_editor(0)?.formatCode?.()}})}),(0,x.jsx)("div",{className:"http_ace",children:(0,x.jsx)(ie,{name:"",editor_id:0})})]})}),(0,x.jsx)(oe,{itemKey:"body",tab:e("请求体"),children:(0,x.jsxs)("div",{style:{marginTop:"10px"},children:[(0,x.jsxs)("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[(0,x.jsxs)(ne,{activeKey:U,onChange:e=>{T(e);const t=Number(e);t===d.RB.row?y.xK.get_editor(1).session.setMode("ace/mode/text"):t===d.RB.json&&y.xK.get_editor(1).session.setMode("ace/mode/json")},children:[(0,x.jsx)(oe,{itemKey:String(d.RB.row),tab:e("row")}),(0,x.jsx)(oe,{itemKey:String(d.RB.json),tab:e("json")}),(0,x.jsx)(oe,{itemKey:String(d.RB.form),tab:e("form")})]}),Number(U)!==d.RB.form&&(0,x.jsx)(r.rA,{title:e("格式化"),icon:"data_object",onClick:function(){y.xK.get_editor(1)?.formatCode?.()}})]}),Number(U)===d.RB.form&&(0,x.jsx)("div",{style:{marginTop:"10px"},children:(0,x.jsx)(ee.X,{headers:["key",e("值")],rows:P.map((t,a)=>[(0,x.jsx)(i.Sm,{value:t.key,handleInputChange:e=>{t.key=e,R([...P])},no_border:!0}),(0,x.jsx)(i.Sm,{value:t.value,handleInputChange:e=>{t.value=e,t.is_file=!1,R([...P])},no_border:!0}),(0,x.jsxs)("div",{children:[(0,x.jsx)(r.rA,{icon:"file_upload",title:e("上传文件"),onClick:()=>(e=>{g({show:!0,type:I.PromptEnum.UploadFile,overlay:!0,data:{extra_data:{only_file:!0},call:t=>{let a=t.currentTarget?.files;if(!a)return;const s=a[0];s.fullPath=(0,$.hU)()+Date.now().toString(),P[e].value=`${s}(${s.name})`,P[e].is_file=!0,P[e].fileName=s.name,P[e].fullPath=s.fullPath,R([...P]),P[e].file_object=s,g({overlay:!1,type:"",show:!1,data:{}})}}})})(a)}),(0,x.jsx)(r.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{P.splice(e,1),R([...P])})(a)})]})]),width:"10rem"})}),(0,x.jsx)("div",{className:"http_ace",style:{marginTop:"10px",display:Number(U)!==d.RB.form?"block":"none"},children:(0,x.jsx)(ie,{name:"",editor_id:1})})]})})]}),(0,x.jsx)("div",{style:{paddingTop:"1rem"},children:void 0===M?(0,x.jsx)("span",{style:{cursor:"pointer",color:"#3b82f6"},onClick:()=>{B("")},children:e("下载到本地目录")}):(0,x.jsx)(i.Sm,{placeholder:e("本地地址"),value:M,handleInputChange:e=>{B(e)},handlerEnter:()=>{M||B(void 0)}})})]})]}),(0,x.jsx)(o.VP,{children:(0,x.jsxs)(n.Zp,{title:V,titleCom:(0,x.jsxs)("div",{style:{display:"flex",alignItems:"center"},children:[(0,x.jsx)(r.rA,{title:e("格式化"),icon:"data_object",onClick:()=>{y.xK.get_editor(2)?.formatCode?.()}}),(0,x.jsx)(r.rA,{title:e("复制"),icon:"copy_all",onClick:()=>{const e=y.xK.get_editor_value(2);e&&((0,te.lW)(e),(0,v.SK)("完成"))}})]}),children:[(0,x.jsxs)(ne,{activeKey:z,onChange:e=>{Z(e);const t="body"===e?ce:de;K(t);const a=y.xK.get_editor(2);if(a){try{JSON.parse(t),a.session.setMode("ace/mode/json")}catch{a.session.setMode("ace/mode/text")}a.setValue(t,-1)}},children:[(0,x.jsx)(oe,{itemKey:"body",tab:e("响应体")}),(0,x.jsx)(oe,{itemKey:"headers",tab:e("响应头")})]}),(0,x.jsx)("div",{className:"http_ace",style:{marginTop:"10px",height:"21rem"},children:(0,x.jsx)(ie,{name:"",editor_id:2})})]})})]}),(0,x.jsx)(o.fI,{children:(0,x.jsx)(o.VP,{children:(0,x.jsx)(p.N,{getItems:async()=>{const e=await c._U.get("http/tag");return e.code===u.m.Success?e.data:[]},save:async e=>{(await c._U.post("http/tag/save",e)).code!==u.m.Success&&(0,v.zN)("网络错误")},have_auth_edit:w(_.oV.http_proxy_tag_update),clickItem:async e=>{D(e.url),A(e.method),B(e.local_download_path),e.header_type&&H(1===e.header_type?"headers":"body"),e.headers&&(re=JSON.parse(e.headers),1===e.header_type&&(y.xK.get_editor(0).setValue(e.headers,-1),y.xK.get_editor(0).session.setMode("ace/mode/json"))),e.form_data_list&&R(JSON.parse(e.form_data_list)),e.data&&(le=e.data),e.body_type&&(T(String(e.body_type)),e.body_type===d.RB.row?y.xK.get_editor(1).session.setMode("ace/mode/text"):e.body_type===d.RB.json&&y.xK.get_editor(1).session.setMode("ace/mode/json"),y.xK.get_editor(1).setValue(e.data,-1))},items:[{key:"name",preName:e("名字")},{key:"url",preName:"url"},{key:"method",preName:"method"},{key:"headers",preName:"headers"},{key:"data",preName:"data"},{key:"form_data_list",preName:"form_data_list"},{key:"local_download_path",preName:"local_download_path"},{key:"color",preName:"color"}]})})})]})})}var pe=a(87361);const he=s.lazy(()=>Promise.all([a.e(3215),a.e(8257),a.e(7759)]).then(()=>a(45601)));function me({}){const{check_user_auth:e}=(0,y.MH)(),{t}=(0,h.B)(),a=[];return e(_.oV.http_proxy)&&a.push({index:1,name:t("http代理"),rto:"http/",component:(0,x.jsx)(ue,{})}),e(_.oV.ssh_proxy)&&a.push({index:1,name:`ssh${t("代理")}`,rto:"remoteShell/",component:(0,x.jsx)(H,{})}),e(_.oV.browser_proxy)&&a.push({index:1,name:`${t("浏览器")}${t("代理")}`,rto:"browserproxy/",component:(0,x.jsx)(g,{})}),e(_.oV.rdp_proxy)&&a.push({index:1,name:`rdp${t("代理")}`,rto:"rdp/",component:(0,x.jsx)(Q,{})}),e(_.oV.rtsp_proxy)&&a.push({index:1,name:t("rtsp播放器"),rto:"rtsp/",component:(0,x.jsx)(he,{})}),(0,x.jsx)(o.W1,{optionList:a,father_route:pe.o.proxy})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6505],{26505(t,s,e){e.r(s),e.d(s,{default:()=>m});var a=e(96540),i=(e(82893),e(14284)),l=e(62042),c=e(86149),o=e(85997),n=e(57952),r=e(86090),d=e(34289),h=e(87361),u=e(2543),p=e(74848);const g={modified:"#f9ab00",added:"var(--secondary, #34a853)",deleted:"var(--accent, #ea4335)",untracked:"var(--textSecondary, #5f6368)",renamed:"var(--primary, #1a73e8)",conflict:"var(--accent, #ea4335)"},x={modified:"M",added:"A",deleted:"D",untracked:"?",renamed:"R",conflict:"!"};function m(){const{t}=(0,c.B)(),s=(0,r.Zp)();let e=decodeURIComponent((0,d.GG)(h.o.git_page,(0,d.vX)()));e=e.replace(/\/+$/,"");const[m,y]=(0,a.useState)([]),[j,v]=(0,a.useState)([]),[N,b]=(0,a.useState)({current:"",branches:[]}),[f,S]=(0,a.useState)(""),[w,C]=(0,a.useState)(new Set),[z,k]=(0,a.useState)("status"),[_,U]=(0,a.useState)(!1),[T,P]=(0,a.useState)(16),[K,W]=(0,a.useState)(!1),F=(0,a.useRef)(null),A=(0,a.useRef)(null),[R,L]=(0,a.useState)({name:"",email:""}),[D,E]=(0,a.useState)(""),[I,B]=(0,a.useState)(""),[G,X]=(0,a.useState)(!1),[H,M]=(0,a.useState)(null),[Z,$]=(0,a.useState)(!1),[q,J]=(0,a.useState)(""),[O,Q]=(0,a.useState)(""),[V,Y]=(0,a.useState)(""),[tt,st]=(0,a.useState)("");(0,a.useEffect)(()=>{e&&(et(),at(),it(),lt(),ct())},[e]);const et=async()=>{try{U(!0);const t=await i.TU.post("status",{path:e});0===t.code&&y(t.data||[])}catch(t){}finally{U(!1)}},at=async()=>{try{const t=await i.TU.post("log",{path:e,maxCount:50});0===t.code&&v(t.data||[])}catch(t){}},it=async()=>{try{const t=await i.TU.post("branches",{path:e});0===t.code&&b(t.data||{current:"",branches:[]})}catch(t){}},lt=async()=>{try{const t=await i.TU.post("get_user_config",{path:e});0===t.code&&(L(t.data),E(t.data.name||""),B(t.data.email||""))}catch(t){}},ct=async()=>{try{const t=await i.TU.post("get_proxy",{path:e});0===t.code&&(M(t.data),J(t.data.global?.http||""),Q(t.data.global?.https||""),Y(t.data.local?.http||""),st(t.data.local?.https||""))}catch(t){}},ot=()=>{w.size===m.length?C(new Set):C(new Set(m.map(t=>t.path)))},nt=async(s=!1)=>{try{U(!0);const a=await i.TU.post("push",{path:e,force:s});0===a.code?(0,l.SK)(t("推送成功")):(0,l.zN)(a.message)}catch(t){(0,l.zN)(t?.message)}finally{U(!1)}},rt=(0,a.useCallback)(u.throttle(t=>{const s=parseFloat(getComputedStyle(A.current).fontSize),e=window.innerWidth/s-4,a=t.clientX/s,i=2.25+F.current.offsetWidth/s;a<=e&&a>=i&&P(parseFloat(a.toFixed(2)))},32),[]),dt=()=>{W(!1),A.current.removeEventListener("pointermove",rt)},ht=e.split("/").filter(Boolean).pop()||e;return(0,p.jsxs)("div",{className:"studio",children:[(0,p.jsx)(n.A,{ignore_tags:!0,left_children:[(0,p.jsx)(o.rA,{title:t("取消"),icon:"close",onClick:()=>s(-1)},1),(0,p.jsx)("span",{children:decodeURIComponent(ht)})],children:(0,p.jsx)(o.rA,{icon:"refresh",title:t("刷新"),onClick:()=>{et(),at(),it(),lt(),ct()}})}),(0,p.jsxs)("div",{className:"studio-body",ref:A,children:[(0,p.jsxs)("div",{className:"studio-nav",style:{width:T-1+"em"},children:[(0,p.jsxs)("div",{className:"git-studio-tab-bar",children:[(0,p.jsxs)("button",{className:"git-studio-tab "+("status"===z?"git-studio-tab--active":""),onClick:()=>k("status"),children:["📝 ",t("变更")," (",m.length,")"]}),(0,p.jsxs)("button",{className:"git-studio-tab "+("log"===z?"git-studio-tab--active":""),onClick:()=>k("log"),children:["📜 ",t("提交记录")," (",j.length,")"]})]}),"status"===z&&(0,p.jsxs)("div",{style:{flex:1,overflow:"auto"},children:[m.length>0&&(0,p.jsxs)("div",{className:"git-studio-select-all",onClick:ot,children:[(0,p.jsx)("input",{type:"checkbox",checked:w.size===m.length&&m.length>0,onChange:ot}),(0,p.jsxs)("span",{children:[t("全选")," (",w.size,"/",m.length,")"]})]}),m.map(t=>(0,p.jsxs)("div",{className:"git-studio-file-item "+(w.has(t.path)?"git-studio-file-item--selected":""),onClick:()=>(t=>{const s=new Set(w);s.has(t)?s.delete(t):s.add(t),C(s)})(t.path),children:[(0,p.jsx)("input",{type:"checkbox",checked:w.has(t.path),onChange:()=>{}}),(0,p.jsx)("span",{className:"git-studio-status-badge",style:{background:g[t.status]||g.untracked},children:x[t.status]||t.status}),(0,p.jsxs)("span",{className:"git-studio-filename",children:[t.path,t.oldPath&&(0,p.jsxs)("span",{style:{color:"var(--textSecondary)",fontSize:11},children:[" (← ",t.oldPath,")"]})]})]},t.path)),0===m.length&&(0,p.jsx)("p",{style:{color:"var(--textSecondary)",textAlign:"center",padding:20,fontSize:12},children:t("没有变更")})]}),"log"===z&&(0,p.jsxs)("div",{style:{flex:1,overflow:"auto"},children:[j.map((t,s)=>(0,p.jsxs)("div",{className:"git-studio-log-entry",children:[(0,p.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:8},children:[(0,p.jsx)("span",{className:"git-studio-log-hash",children:t.hash}),(0,p.jsx)("span",{style:{fontSize:13,color:"var(--textPrimary)",flex:1},children:t.message})]}),(0,p.jsxs)("div",{style:{fontSize:11,color:"var(--textSecondary)",paddingLeft:4},children:[t.author," · ",t.date]})]},s)),0===j.length&&(0,p.jsx)("p",{style:{color:"var(--textSecondary)",textAlign:"center",padding:20,fontSize:12},children:t("暂无提交记录")})]})]}),(0,p.jsx)("div",{className:"studio__divider",ref:F,onPointerDown:()=>{W(!0),A.current.addEventListener("pointermove",rt)},onPointerUp:dt}),K&&(0,p.jsx)("div",{className:"shell__overlay",onPointerUp:dt}),(0,p.jsx)("div",{className:"studio-editor",children:(0,p.jsxs)("div",{style:{display:"flex",flexDirection:"column",height:"100%",padding:"16px",gap:12,overflow:"auto"},children:[(0,p.jsxs)("div",{className:"git-studio-card",children:[(0,p.jsxs)("div",{className:"git-studio-card-title",children:["🌿 ",t("分支"),": ",(0,p.jsx)("span",{style:{color:"var(--secondary, #34a853)"},children:N.current})]}),(0,p.jsx)("div",{style:{display:"flex",flexWrap:"wrap",gap:4},children:N.branches.map(s=>(0,p.jsx)("button",{className:"git-studio-branch-chip "+(s===N.current?"git-studio-branch-chip--current":""),onClick:()=>(async s=>{try{U(!0);const a=await i.TU.post("checkout",{path:e,branch:s});0===a.code?((0,l.SK)(t("切换分支成功")),et(),at(),it()):(0,l.zN)(a.message)}catch(t){(0,l.zN)(t?.message)}finally{U(!1)}})(s),disabled:s===N.current||s.startsWith("*"),children:s.replace("remotes/origin/","")},s))})]}),(0,p.jsxs)("div",{className:"git-studio-card",children:[(0,p.jsx)("textarea",{className:"git-studio-textarea",placeholder:t("git_msg"),value:f,onChange:t=>S(t.target.value),rows:2}),(0,p.jsxs)("div",{className:"git-studio-btn-row",children:[(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{if(f.trim())try{U(!0);const s=await i.TU.post("commit",{path:e,message:f.trim(),allChanged:!0});0===s.code?((0,l.SK)(t("提交成功")),S(""),et(),at()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}finally{U(!1)}else(0,l.zN)(t("请输入提交信息"))},disabled:_||!f.trim(),style:{borderColor:"var(--secondary, #34a853)",color:"var(--secondary, #34a853)"},children:["✅ ",t("提交")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{const s=await i.TU.post("add_all",{path:e});0===s.code?((0,l.SK)(t("已暂存全部")),et()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}},children:["➕ ",t("暂存全部")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{if(0!==w.size)try{const s=await i.TU.post("add",{path:e,files:[...w]});0===s.code?((0,l.SK)(t("已暂存")),C(new Set),et()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}else(0,l.zN)(t("请先选择文件"))},children:["📥 ",t("暂存选中")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{if(0!==w.size)try{const s=await i.TU.post("reset",{path:e,files:[...w]});0===s.code?((0,l.SK)(t("已取消暂存")),C(new Set),et()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}else(0,l.zN)(t("请先选择文件"))},style:{borderColor:"#f9ab00",color:"#f9ab00"},children:["↩ ",t("取消暂存")]})]})]}),(0,p.jsxs)("div",{className:"git-studio-card",children:[(0,p.jsxs)("div",{className:"git-studio-card-title",children:["☁️ ",t("远程操作")]}),(0,p.jsxs)("div",{className:"git-studio-btn-row",children:[(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{U(!0);const s=await i.TU.post("pull",{path:e});0===s.code?((0,l.SK)(t("拉取成功")),et(),at()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}finally{U(!1)}},disabled:_,children:["⬇ ",t("拉取")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>nt(!1),disabled:_,children:["⬆ ",t("推送")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>nt(!0),disabled:_,style:{borderColor:"var(--accent, #ea4335)",color:"var(--accent, #ea4335)"},children:["⚠ ",t("强制推送")]})]}),(0,p.jsxs)("div",{className:"git-studio-btn-row",children:[(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{const s=await i.TU.post("stash",{path:e});0===s.code?((0,l.SK)(t("暂存工作区成功")),et()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}},style:{borderColor:"var(--textSecondary)",color:"var(--textSecondary)"},children:["📦 ",t("暂存工作区")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{const s=await i.TU.post("stash_pop",{path:e});0===s.code?((0,l.SK)(t("恢复工作区成功")),et()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}},style:{borderColor:"var(--textSecondary)",color:"var(--textSecondary)"},children:["📤 ",t("恢复工作区")]})]})]}),(0,p.jsxs)("div",{className:"git-studio-card",children:[(0,p.jsxs)("div",{className:"git-studio-card-title",children:["👤 ",t("用户配置")]}),G?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"git-studio-config-row",children:[(0,p.jsxs)("span",{className:"git-studio-config-label",children:[t("用户名"),":"]}),(0,p.jsx)("input",{className:"git-studio-input",value:D,onChange:t=>E(t.target.value),placeholder:"user.name"})]}),(0,p.jsxs)("div",{className:"git-studio-config-row",children:[(0,p.jsxs)("span",{className:"git-studio-config-label",children:[t("邮箱"),":"]}),(0,p.jsx)("input",{className:"git-studio-input",value:I,onChange:t=>B(t.target.value),placeholder:"user.email"})]}),(0,p.jsxs)("div",{className:"git-studio-btn-row",children:[(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{const s=await i.TU.post("set_user_config",{path:e,name:D,email:I});0===s.code?((0,l.SK)(t("用户配置已保存")),X(!1),lt()):(0,l.zN)(s.message)}catch(t){(0,l.zN)(t?.message)}},children:["💾 ",t("保存")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>{X(!1),E(R.name),B(R.email)},children:["✖ ",t("取消")]})]})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsxs)("div",{className:"git-studio-config-row",children:[(0,p.jsxs)("span",{className:"git-studio-config-label",children:[t("用户名"),":"]}),(0,p.jsx)("span",{style:{fontSize:13,color:"var(--textPrimary)"},children:R.name||"-"})]}),(0,p.jsxs)("div",{className:"git-studio-config-row",children:[(0,p.jsxs)("span",{className:"git-studio-config-label",children:[t("邮箱"),":"]}),(0,p.jsx)("span",{style:{fontSize:13,color:"var(--textPrimary)"},children:R.email||"-"})]}),(0,p.jsx)("div",{className:"git-studio-btn-row",children:(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>X(!0),children:["✏ ",t("修改")]})})]})]}),(0,p.jsxs)("div",{className:"git-studio-card",children:[(0,p.jsxs)("div",{className:"git-studio-card-title",children:["🌐 ",t("代理设置")]}),Z?(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"var(--textSecondary)"},children:t("全局代理")}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"http.proxy:"}),(0,p.jsx)("input",{className:"git-studio-input",value:q,onChange:t=>J(t.target.value),placeholder:"http://127.0.0.1:7890"})]}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"https.proxy:"}),(0,p.jsx)("input",{className:"git-studio-input",value:O,onChange:t=>Q(t.target.value),placeholder:"http://127.0.0.1:7890"})]}),(0,p.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"var(--textSecondary)"},children:t("仓库代理")}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"http.proxy:"}),(0,p.jsx)("input",{className:"git-studio-input",value:V,onChange:t=>Y(t.target.value),placeholder:"http://127.0.0.1:7890"})]}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"https.proxy:"}),(0,p.jsx)("input",{className:"git-studio-input",value:tt,onChange:t=>st(t.target.value),placeholder:"http://127.0.0.1:7890"})]}),(0,p.jsx)("div",{style:{fontSize:11,color:"var(--textSecondary)"},children:t("pxy_clr")}),(0,p.jsxs)("div",{className:"git-studio-btn-row",children:[(0,p.jsxs)("button",{className:"git-studio-btn",onClick:async()=>{try{const s=[{scope:"global",type:"http",value:q},{scope:"global",type:"https",value:O},{scope:"local",type:"http",value:V},{scope:"local",type:"https",value:tt}];for(const t of s)await i.TU.post("set_proxy",{path:e,...t});(0,l.SK)(t("代理配置已保存")),$(!1),ct()}catch(t){(0,l.zN)(t?.message)}},children:["💾 ",t("保存")]}),(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>{$(!1),ct()},children:["✖ ",t("取消")]})]})]}):(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"var(--textSecondary)"},children:t("全局代理")}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"http.proxy:"}),(0,p.jsx)("span",{style:{color:"var(--textPrimary)"},children:H?.global?.http||"-"})]}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"https.proxy:"}),(0,p.jsx)("span",{style:{color:"var(--textPrimary)"},children:H?.global?.https||"-"})]}),(0,p.jsx)("div",{style:{fontSize:12,fontWeight:600,color:"var(--textSecondary)"},children:t("仓库代理")}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"http.proxy:"}),(0,p.jsx)("span",{style:{color:"var(--textPrimary)"},children:H?.local?.http||"-"})]}),(0,p.jsxs)("div",{className:"git-studio-proxy-item",children:[(0,p.jsx)("span",{className:"git-studio-proxy-label",children:"https.proxy:"}),(0,p.jsx)("span",{style:{color:"var(--textPrimary)"},children:H?.local?.https||"-"})]}),(0,p.jsx)("div",{className:"git-studio-btn-row",children:(0,p.jsxs)("button",{className:"git-studio-btn",onClick:()=>$(!0),children:["✏ ",t("修改")]})})]})]}),(0,p.jsxs)("div",{style:{padding:"12px",borderRadius:8,border:"1px solid var(--divider, rgba(0,0,0,0.08))",background:"var(--surfaceSecondary, #f1f3f4)",fontSize:11,color:"var(--textSecondary)",lineHeight:1.6},children:["💡 ",t("提示:"),(0,p.jsxs)("ul",{style:{margin:"4px 0",paddingLeft:16},children:[(0,p.jsx)("li",{children:t("git_stg")}),(0,p.jsx)("li",{children:t("git_cmt")}),(0,p.jsx)("li",{children:t("git_cf")}),(0,p.jsx)("li",{children:t("git_frc")}),(0,p.jsx)("li",{children:t("pxy_nte")})]})]})]})})]})]})}}}]);
@@ -1 +1 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[676,8319,9381],{77481(e,t,s){s.d(t,{S:()=>l,X:()=>i});var n=s(96540),r=s(61443),a=s(74848);function i(e){const[t,s]=n.useState([]),i=(0,n.useRef)(-1),[l,o]=(0,n.useState)(-1),[c,u]=(0,n.useState)(-1);(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]);const d=()=>{i.current=-1,o(-1),u(-1)};return(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((t,s)=>{const n=!!e.filter&&(e.filter.column??0)===s;let i=t;if(n){const s=e.filter,n=s.options.find(e=>e.value===s.value);null!=s.value&&n&&(i=`${t} (${n.label})`)}return(0,a.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,a.jsx)(r.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:i}):t},s)})})}),(0,a.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,a.jsx)("tr",{className:n?(l===s?"row-dragging":"")+(c===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(i.current=s,o(s),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||i.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",u(s))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=i.current,s=c;d(),t<0||s<0||t===s||e.onRowDrag?.(t,s)})())},onDragEnd:d,children:t.map((s,n)=>{const r=n===t.length-1?"small":"";return(0,a.jsx)("td",{className:r,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function l(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,a.jsx)("div",{children:e},t))})}},19381(e,t,s){s.r(t),s.d(t,{default:()=>d});var n=s(96540),r=s(80952),a=(s(82327),s(1766),s(24854),s(90008),s(90846),s(40975),s(44286),s(30766),s(14973),s(69687),s(1234),s(47507),s(87268),s(24522));const i=`https://gcore.jsdelivr.net/npm/ace-builds@${r.version}/src-min-noconflict/`;r.config.set("basePath",i),r.config.set("modePath",i),r.config.set("themePath",i),r.config.set("workerPath",i);var l=s(34843),o=s(82893),c=s(78247),u=s(74848);function d(e){const t=(0,n.useRef)(null),[s,i]=(0,l.fp)(o.AG.user_base_info),d=s.user_data.theme?.includes("dark")?"cloud_editor_dark":"cloud9_day";return(0,n.useEffect)(()=>{const s=r.edit(t.current,{value:c.xK.get_value_temp(e.editor_id),showPrintMargin:!1,theme:`ace/theme/${d}`,mode:e.model??a.getModeForPath(e.name??"").mode,wrap:!1,highlightActiveLine:!1,fontSize:14,...e.options});return s.setOptions({}),s.container.addEventListener("wheel",function(e){e.preventDefault()}),s.focus(),s.on("change",function(t){e.on_change&&e.on_change()}),t.current=s,s.formatCode=()=>{const e=r.require("ace/ext/beautify"),s=t.current;s&&e.beautify(s.session)},c.xK.set_editor_temp(s,e.editor_id),()=>{c.xK.delete_editor_temp(e.editor_id),s.destroy()}},[]),(0,u.jsx)("div",{ref:t,style:{height:"100%",width:"100%"}})}},60676(e,t,s){s.r(t),s.d(t,{default:()=>C});var n=s(96540),r=s(57952),a=s(85997),i=s(14284),l=s(86090),o=s(77481),c=s(70447),u=s(34843),d=s(82893),p=s(19381),h=s(78247),f=s(61443),x=s(23496),_=s(62042),m=s(86149),j=s(53459),v=s(7523),g=s(74848);function b(e,t="auto"){return"s"===t||"auto"===t&&e>=1e3?`${(e/1e3).toFixed(2)} s`:`${Math.round(e)} ms`}function S(e){const{running:t=!1,resetKey:s=0,format:r="auto",prefix:a="",onTick:i,className:l}=e,[o,c]=(0,n.useState)(0),u=(0,n.useRef)(0),d=(0,n.useRef)(null),p=(0,n.useRef)(t);p.current=t;const h=(0,n.useCallback)(()=>{null!==d.current&&(cancelAnimationFrame(d.current),d.current=null)},[]),f=(0,n.useCallback)(()=>{h();const e=()=>{const t=performance.now()-u.current;c(t),i?.(t),p.current&&(d.current=requestAnimationFrame(e))};e()},[i,h]);return(0,n.useEffect)(()=>{u.current=performance.now(),c(0),i?.(0),p.current&&f()},[s]),(0,n.useEffect)(()=>{t?f():h()},[t,f,h]),(0,n.useEffect)(()=>()=>h(),[h]),(0,g.jsxs)("span",{className:l,children:[a,b(o,r)]})}var q=s(87361),y=s(28319);function w(e){const[t,s]=(0,n.useState)("");return(0,g.jsxs)("div",{className:"db-query-preset-input",children:[(0,g.jsx)(f.Sm,{placeholder:e.placeholder,value:t,handleInputChange:s}),(0,g.jsx)("div",{className:"db-query-preset-input__actions",children:(0,g.jsx)(a.C3,{text:e.confirmText,clickFun:()=>e.onConfirm(t.trim())})})]})}function C(){const e=(0,l.Zp)(),{t}=(0,m.B)(),{initUserInfo:s}=(0,n.useContext)(v.F),[b]=(0,u.fp)(d.AG.sqlite_query_context),[C]=(0,u.fp)(d.AG.user_base_info),[,k]=(0,u.fp)(d.AG.prompt_card),N=(0,n.useMemo)(()=>b?.path??"",[b?.path]),E=(0,n.useMemo)(()=>b?.path?`${b?.name||"数据库"} | ${b.path}`:"未选择数据库",[b?.name,b?.path]),A=97,[K,L]=(0,n.useState)(""),[F,$]=(0,n.useState)("table"),[R,M]=(0,n.useState)(!1),[Q,O]=(0,n.useState)(""),[D,P]=(0,n.useState)(null),[T,G]=(0,n.useState)(!1),[I,J]=(0,n.useState)(0),[Z,W]=(0,n.useState)(!1),[B,H]=(0,n.useState)([]),[V,X]=(0,n.useState)(-1);(0,n.useEffect)(()=>{const e=C?.user_data?.sql_preset_list;e&&e.length?H([...e]):H([{index:0,note:t("查询全部表"),sql:"SELECT name, type FROM sqlite_master WHERE type='table';"}])},[C?.user_data?.sql_preset_list]);const U=async e=>{const t=e.map((e,t)=>({...e,index:t})),n=await i.wm.post(x.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:t});return n?.code===j.m.Success&&(await s(),H(t),!0)},z=async(e,s)=>{const n=[...B,{note:s||t("SQL 预设"),sql:e,env:y.sqlEnvDefault}];await U(n)&&(k({open:!1}),(0,_.SK)(t("创建成功")),X(n.length-1))},Y=(e,t)=>{if(!e)return"";for(const s of e.split("\n")){const e=s.indexOf("=");if(!(e<0)&&s.slice(0,e).trim()===t)return s.slice(e+1).trim()}return""},[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)("");(0,n.useEffect)(()=>{h.xK.set_value_temp(K,A)},[K]),(0,n.useEffect)(()=>{L(""),O(""),P(null),$("table"),G(!1),W(!1),J(0),te(""),ne(""),h.xK.set_value_temp("",A),N||O("请先从文件右键打开一个数据库")},[N,b?.open]);const re=async()=>{const e=(h.xK.get_editor_value(A)??K).trim();if(!N)return O("请先从文件右键打开一个数据库"),void P(null);if(!e)return O("请输入 SQL 语句"),void P(null);M(!0),O(""),W(!0),J(e=>e+1),G(!0);try{const s=(t=e,ee?t.split(ee).join(se):t),n=await i.$M.post("sqlite/query",{path:N,sql:s});P(n.data),$("table")}catch(e){O(e?.message??`${e}`),P(null)}finally{G(!1),M(!1)}var t},ae=D?.columns?.length?D.columns:Object.keys(D?.rows?.[0]??{}),ie=(D?.rows??[]).map(e=>ae.map(t=>{return null==(s=e[t])?"":"object"==typeof s?JSON.stringify(s):`${s}`;var s}));return(0,g.jsxs)("div",{className:"db-query-page",children:[(0,g.jsx)(r.A,{ignore_tags:!0,left_children:[(0,g.jsx)(a.rA,{icon:"arrow_back",title:"返回",onClick:()=>e(-1)},"back"),(0,g.jsx)(a.rA,{icon:"play_arrow",title:"执行",onClick:re},"run"),(0,g.jsx)(a.rA,{icon:"table_chart",title:"表格视图",onClick:()=>$("table")},"table"),(0,g.jsx)(a.rA,{icon:"data_object",title:"原 JSON",onClick:()=>$("json")},"json"),(0,g.jsx)(a.rA,{icon:"settings",title:t("SQL预设设置"),onClick:()=>{e(q.o.sql_preset_setting_page)}},"preset-setting")],children:(0,g.jsx)(c.xP,{context:E,tip_context:"点击复制数据库信息"})}),(0,g.jsxs)("div",{className:"db-query-page__content",children:[(0,g.jsxs)(c.Zp,{title:"SQL 查询",titleCom:(0,g.jsxs)("div",{className:"db-query-page__preset-bar",children:[ee&&(0,g.jsx)(f.Sm,{placeholder:`${t("替换")}: ${ee}`,value:se,handleInputChange:ne,width:"12rem"}),B.length>0&&(0,g.jsx)(f.l6,{width:"16rem",tip:t("SQL预设"),value:V,onChange:e=>{const t=B[e];t&&(X(e),(e=>{h.xK.set_value_temp(e,A);const t=h.xK.get_editor(A);t&&t.setValue(e,-1),L(e)})(t.sql),te(Y(t.env??"","find")),ne(""),O(""))},options:B.map((e,t)=>({value:t,title:`${e.note||e.sql.slice(0,24)}`}))}),(0,g.jsx)(a.C3,{text:t(V>=0?"更新保存":"创建新预选项"),clickFun:async()=>{const e=(h.xK.get_editor_value(A)??K).trim();if(!e)return void O(t("请输入 SQL 语句"));const s=[...B];if(V>=0&&s[V]){s[V].sql=e,s[V].note||(s[V].note=t("SQL 预设"));await U(s)&&(0,_.SK)(t("更新成功"))}else k({open:!0,title:t("创建新预选项"),context_div:(0,g.jsx)(w,{placeholder:t("请输入备注"),confirmText:t("确认"),onConfirm:t=>z(e,t)}),cancel:()=>k({open:!1})})}})]}),rightBottomCom:(0,g.jsxs)("div",{className:"db-query-page__actions",children:[(0,g.jsx)(a.C3,{text:R?"查询中...":"执行查询",clickFun:re}),(0,g.jsx)(a.C3,{text:"清空",clickFun:()=>{h.xK.set_value_temp("",A);const e=h.xK.get_editor(A);e&&e.setValue("",-1),L("")}}),(0,g.jsx)(a.C3,{text:"table"===F?"表格视图":"切换到表格",clickFun:()=>$("table")}),(0,g.jsx)(a.C3,{text:"json"===F?"原 JSON":"切换到 JSON",clickFun:()=>$("json")})]}),children:[(0,g.jsx)("div",{className:"db-query-page__editor",children:(0,g.jsx)(p.default,{name:"sqlite.sql",editor_id:A,model:"ace/mode/sql",on_change:()=>{const e=h.xK.get_editor_value(A)??"";L(e)},options:{showPrintMargin:!1,highlightActiveLine:!0,wrap:!0}})}),Q&&(0,g.jsx)("div",{className:"db-query-page__error",children:Q})]}),(0,g.jsxs)(c.Zp,{title:"查询结果",titleCom:(0,g.jsxs)("span",{className:"db-query-page__result-meta",children:[D?`${D.row_count} 行`:"暂无结果",Z&&(0,g.jsx)("span",{className:"db-query-page__elapsed",children:(0,g.jsx)(S,{running:T,resetKey:I,prefix:`${t("耗时")}: `,format:"auto"})})]}),children:[D&&"table"===F&&(0,g.jsx)(o.X,{headers:ae,rows:ie}),D&&"json"===F&&(0,g.jsx)("pre",{className:"db-query-page__result-json",children:JSON.stringify(D.rows,null,2)}),!D&&!Q&&(0,g.jsx)("div",{className:"db-query-page__hint",children:"先输入查询语句,再执行。支持 `select`、`with`、`pragma`、`explain`。"}),!D&&Q&&(0,g.jsx)("div",{className:"db-query-page__hint",children:Q})]})]})]})}},28319(e,t,s){s.r(t),s.d(t,{default:()=>q,defaultSqlPreset:()=>b});var n=s(96540),r=s(86149),a=s(4412),i=s(85997),l=s(75725),o=s(77481),c=s(70447),u=s(61443),d=s(34843),p=s(82893),h=s(14284),f=s(23496),x=s(53459),_=s(62042),m=s(7523),j=s(78247),v=s(86090),g=s(74848);function b(e){return{index:0,note:e("查询全部表"),sql:"SELECT name, type FROM sqlite_master WHERE type='table';"}}const S='# 可选:设置 SQL 中的"替换词"(在查询页选中该预设后,会显示输入框)\n# 例子:SQL 为 SELECT * FROM t WHERE id = 123456 ,请填写下面的 find=123456\n# 这样查询页输入新值即可把 SQL 中的 123456 替换掉后再查询\nfind=';function q(){const{t:e}=(0,r.B)(),{initUserInfo:t}=(0,n.useContext)(m.F),[,s]=(0,d.fp)(p.AG.editorSetting),[q]=(0,d.fp)(p.AG.user_base_info),y=(0,v.Zp)(),w=n.useRef(-1),[C,k]=(0,n.useState)([]);(0,n.useEffect)(()=>{const t=q?.user_data?.sql_preset_list;k(t?.length?[...t]:[b(e)])},[e,q?.user_data?.sql_preset_list]);const N=async()=>{const s=C.map((e,t)=>({...e,index:t})),n=await h.wm.post(f.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:s});n?.code===x.m.Success&&(await t(),(0,_.SK)(e("保存成功")))},E=(e,t)=>{w.current=e;const n=C[e][t]??"";j.xK.set_value_temp(n),s({model:"sql"===t?"ace/mode/sql":"ace/mode/ini",open:!0,fileName:"",save:async e=>{C[w.current][t]=e,k([...C]),j.xK.set_value_temp(""),N()}})},A=[e("编号"),e("备注"),e("SQL代码"),e("env编辑"),e("操作")];return(0,g.jsxs)("div",{children:[(0,g.jsx)(a.aZ,{position:"right",children:(0,g.jsx)(i.rA,{icon:"arrow_back",title:e("返回"),onClick:()=>y(-1)})}),(0,g.jsx)(l.jW,{isFull:!0,more:!0,children:(0,g.jsx)(l.NN,{children:(0,g.jsx)(l.xh,{children:(0,g.jsx)(l.fI,{children:(0,g.jsx)(l.VP,{widthPer:60,children:(0,g.jsx)(c.uF,{self_title:(0,g.jsx)("span",{className:"div-row",children:(0,g.jsx)("h2",{children:e("SQL 预设")})}),titleCom:(0,g.jsxs)("div",{className:"db-query-setting__toolbar",children:[(0,g.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>k([...C,{note:"",sql:"",env:S}])}),(0,g.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>N()})]}),children:(0,g.jsx)(o.X,{headers:A,rows:C.map((t,s)=>[(0,g.jsx)("div",{children:s+1}),(0,g.jsx)(u.Sm,{value:t.note,no_border:!0,placeholder:e("备注"),handleInputChange:e=>{t.note=e,k([...C])}}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"short_text",title:e("编辑SQL"),onClick:()=>E(s,"sql")})}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"settings",title:e("env编辑"),onClick:()=>E(s,"env")})}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>{C.splice(s,1),k([...C])}})})]),width:"8rem"})})})})})})})]})}s.d(t,["sqlEnvDefault",0,S])}}]);
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[676,8319,9381],{77481(e,t,s){s.d(t,{S:()=>l,X:()=>i});var n=s(96540),r=s(61443),a=s(74848);function i(e){const[t,s]=n.useState([]),i=(0,n.useRef)(-1),[l,o]=(0,n.useState)(-1),[c,u]=(0,n.useState)(-1);(0,n.useEffect)(()=>{e.children?s(Array.isArray(e.children)?e.children:[e.children]):s(e.rows)},[e.rows,e.children]);const d=()=>{i.current=-1,o(-1),u(-1)};return(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((t,s)=>{const n=!!e.filter&&(e.filter.column??0)===s;let i=t;if(n){const s=e.filter,n=s.options.find(e=>e.value===s.value);null!=s.value&&n&&(i=`${t} (${n.label})`)}return(0,a.jsx)("th",{className:n?"table-filter-col":"",children:n?(0,a.jsx)(r.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:i}):t},s)})})}),(0,a.jsx)("tbody",{children:t.map((t,s)=>{const n=!!e.onRowDrag;return(0,a.jsx)("tr",{className:n?(l===s?"row-dragging":"")+(c===s?" row-drop-target":""):"",draggable:n,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{n&&(i.current=s,o(s),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!n||i.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",u(s))},onDrop:t=>{n&&(t.preventDefault(),(()=>{const t=i.current,s=c;d(),t<0||s<0||t===s||e.onRowDrag?.(t,s)})())},onDragEnd:d,children:t.map((s,n)=>{const r=n===t.length-1?"small":"";return(0,a.jsx)("td",{className:r,style:{width:e.width??"auto"},children:s},n)})},s)})})]})}function l(e){return(0,a.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,a.jsx)("div",{children:e},t))})}},19381(e,t,s){s.r(t),s.d(t,{default:()=>d});var n=s(96540),r=s(80952),a=(s(82327),s(1766),s(24854),s(90008),s(90846),s(40975),s(44286),s(30766),s(14973),s(69687),s(1234),s(47507),s(87268),s(24522));const i=`https://gcore.jsdelivr.net/npm/ace-builds@${r.version}/src-min-noconflict/`;r.config.set("basePath",i),r.config.set("modePath",i),r.config.set("themePath",i),r.config.set("workerPath",i);var l=s(34843),o=s(82893),c=s(78247),u=s(74848);function d(e){const t=(0,n.useRef)(null),[s,i]=(0,l.fp)(o.AG.user_base_info),d=s.user_data.theme?.includes("dark")?"cloud_editor_dark":"cloud9_day";return(0,n.useEffect)(()=>{const s=r.edit(t.current,{value:c.xK.get_value_temp(e.editor_id),showPrintMargin:!1,theme:`ace/theme/${d}`,mode:e.model??a.getModeForPath(e.name??"").mode,wrap:!1,highlightActiveLine:!1,fontSize:14,...e.options});return s.setOptions({}),s.container.addEventListener("wheel",function(e){e.preventDefault()}),s.focus(),s.on("change",function(t){e.on_change&&e.on_change()}),t.current=s,s.formatCode=()=>{const e=r.require("ace/ext/beautify"),s=t.current;s&&e.beautify(s.session)},c.xK.set_editor_temp(s,e.editor_id),()=>{c.xK.delete_editor_temp(e.editor_id),s.destroy()}},[]),(0,u.jsx)("div",{ref:t,style:{height:"100%",width:"100%"}})}},60676(e,t,s){s.r(t),s.d(t,{default:()=>C});var n=s(96540),r=s(57952),a=s(85997),i=s(14284),l=s(86090),o=s(77481),c=s(70447),u=s(34843),d=s(82893),p=s(19381),h=s(78247),f=s(61443),x=s(23496),_=s(62042),m=s(86149),j=s(53459),v=s(7523),g=s(74848);function b(e,t="auto"){return"s"===t||"auto"===t&&e>=1e3?`${(e/1e3).toFixed(2)} s`:`${Math.round(e)} ms`}function S(e){const{running:t=!1,resetKey:s=0,format:r="auto",prefix:a="",onTick:i,className:l}=e,[o,c]=(0,n.useState)(0),u=(0,n.useRef)(0),d=(0,n.useRef)(null),p=(0,n.useRef)(t);p.current=t;const h=(0,n.useCallback)(()=>{null!==d.current&&(cancelAnimationFrame(d.current),d.current=null)},[]),f=(0,n.useCallback)(()=>{h();const e=()=>{const t=performance.now()-u.current;c(t),i?.(t),p.current&&(d.current=requestAnimationFrame(e))};e()},[i,h]);return(0,n.useEffect)(()=>{u.current=performance.now(),c(0),i?.(0),p.current&&f()},[s]),(0,n.useEffect)(()=>{t?f():h()},[t,f,h]),(0,n.useEffect)(()=>()=>h(),[h]),(0,g.jsxs)("span",{className:l,children:[a,b(o,r)]})}var q=s(87361),y=s(28319);function w(e){const[t,s]=(0,n.useState)("");return(0,g.jsxs)("div",{className:"db-query-preset-input",children:[(0,g.jsx)(f.Sm,{placeholder:e.placeholder,value:t,handleInputChange:s}),(0,g.jsx)("div",{className:"db-query-preset-input__actions",children:(0,g.jsx)(a.C3,{text:e.confirmText,clickFun:()=>e.onConfirm(t.trim())})})]})}function C(){const e=(0,l.Zp)(),{t}=(0,m.B)(),{initUserInfo:s}=(0,n.useContext)(v.F),[b]=(0,u.fp)(d.AG.sqlite_query_context),[C]=(0,u.fp)(d.AG.user_base_info),[,k]=(0,u.fp)(d.AG.prompt_card),N=(0,n.useMemo)(()=>b?.path??"",[b?.path]),E=(0,n.useMemo)(()=>b?.path?`${b?.name||"数据库"} | ${b.path}`:"未选择数据库",[b?.name,b?.path]),A=97,[K,F]=(0,n.useState)(""),[L,$]=(0,n.useState)("table"),[R,M]=(0,n.useState)(!1),[O,Q]=(0,n.useState)(""),[D,P]=(0,n.useState)(null),[T,G]=(0,n.useState)(!1),[I,J]=(0,n.useState)(0),[Z,W]=(0,n.useState)(!1),[B,H]=(0,n.useState)([]),[V,X]=(0,n.useState)(-1);(0,n.useEffect)(()=>{const e=C?.user_data?.sql_preset_list;e&&e.length?H([...e]):H([{index:0,note:t("查询全部表"),sql:"SELECT name, type FROM sqlite_master WHERE type='table';"}])},[C?.user_data?.sql_preset_list]);const U=async e=>{const t=e.map((e,t)=>({...e,index:t})),n=await i.wm.post(x.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:t});return n?.code===j.m.Success&&(await s(),H(t),!0)},z=async(e,s)=>{const n=[...B,{note:s||t("SQL 预设"),sql:e,env:y.sqlEnvDefault}];await U(n)&&(k({open:!1}),(0,_.SK)(t("创建成功")),X(n.length-1))},Y=(e,t)=>{if(!e)return"";for(const s of e.split("\n")){const e=s.indexOf("=");if(!(e<0)&&s.slice(0,e).trim()===t)return s.slice(e+1).trim()}return""},[ee,te]=(0,n.useState)(""),[se,ne]=(0,n.useState)("");(0,n.useEffect)(()=>{h.xK.set_value_temp(K,A)},[K]),(0,n.useEffect)(()=>{F(""),Q(""),P(null),$("table"),G(!1),W(!1),J(0),te(""),ne(""),h.xK.set_value_temp("",A),N||Q("请先从文件右键打开一个数据库")},[N,b?.open]);const re=async()=>{const e=(h.xK.get_editor_value(A)??K).trim();if(!N)return Q("请先从文件右键打开一个数据库"),void P(null);if(!e)return Q("请输入 SQL 语句"),void P(null);M(!0),Q(""),W(!0),J(e=>e+1),G(!0);try{const s=(t=e,ee?t.split(ee).join(se):t),n=await i.$M.post("sqlite/query",{path:N,sql:s});P(n.data),$("table")}catch(e){Q(e?.message??`${e}`),P(null)}finally{G(!1),M(!1)}var t},ae=D?.columns?.length?D.columns:Object.keys(D?.rows?.[0]??{}),ie=(D?.rows??[]).map(e=>ae.map(t=>{return null==(s=e[t])?"":"object"==typeof s?JSON.stringify(s):`${s}`;var s}));return(0,g.jsxs)("div",{className:"db-query-page",children:[(0,g.jsx)(r.A,{ignore_tags:!0,left_children:[(0,g.jsx)(a.rA,{icon:"arrow_back",title:"返回",onClick:()=>e(-1)},"back"),(0,g.jsx)(a.rA,{icon:"play_arrow",title:"执行",onClick:re},"run"),(0,g.jsx)(a.rA,{icon:"table_chart",title:"表格视图",onClick:()=>$("table")},"table"),(0,g.jsx)(a.rA,{icon:"data_object",title:"原 JSON",onClick:()=>$("json")},"json"),(0,g.jsx)(a.rA,{icon:"settings",title:t("SQL预设设置"),onClick:()=>{e(q.o.sql_preset_setting_page)}},"preset-setting")],children:(0,g.jsx)(c.xP,{context:E,tip_context:"点击复制数据库信息"})}),(0,g.jsxs)("div",{className:"db-query-page__content",children:[(0,g.jsxs)(c.Zp,{title:"SQL 查询",titleCom:(0,g.jsxs)("div",{className:"db-query-page__preset-bar",children:[ee&&(0,g.jsx)(f.Sm,{placeholder:`${t("替换")}: ${ee}`,value:se,handleInputChange:ne,width:"12rem"}),B.length>0&&(0,g.jsx)(f.l6,{width:"16rem",tip:t("SQL预设"),value:V,onChange:e=>{const t=B[e];t&&(X(e),(e=>{h.xK.set_value_temp(e,A);const t=h.xK.get_editor(A);t&&t.setValue(e,-1),F(e)})(t.sql),te(Y(t.env??"","find")),ne(""),Q(""))},options:B.map((e,t)=>({value:t,title:`${e.note||e.sql.slice(0,24)}`}))}),(0,g.jsx)(a.C3,{text:t(V>=0?"更新保存":"创建新预选项"),clickFun:async()=>{const e=(h.xK.get_editor_value(A)??K).trim();if(!e)return void Q(t("sql_in"));const s=[...B];if(V>=0&&s[V]){s[V].sql=e,s[V].note||(s[V].note=t("SQL 预设"));await U(s)&&(0,_.SK)(t("更新成功"))}else k({open:!0,title:t("创建新预选项"),context_div:(0,g.jsx)(w,{placeholder:t("请输入备注"),confirmText:t("确认"),onConfirm:t=>z(e,t)}),cancel:()=>k({open:!1})})}})]}),rightBottomCom:(0,g.jsxs)("div",{className:"db-query-page__actions",children:[(0,g.jsx)(a.C3,{text:R?"查询中...":"执行查询",clickFun:re}),(0,g.jsx)(a.C3,{text:"清空",clickFun:()=>{h.xK.set_value_temp("",A);const e=h.xK.get_editor(A);e&&e.setValue("",-1),F("")}}),(0,g.jsx)(a.C3,{text:"table"===L?"表格视图":"切换到表格",clickFun:()=>$("table")}),(0,g.jsx)(a.C3,{text:"json"===L?"原 JSON":"切换到 JSON",clickFun:()=>$("json")})]}),children:[(0,g.jsx)("div",{className:"db-query-page__editor",children:(0,g.jsx)(p.default,{name:"sqlite.sql",editor_id:A,model:"ace/mode/sql",on_change:()=>{const e=h.xK.get_editor_value(A)??"";F(e)},options:{showPrintMargin:!1,highlightActiveLine:!0,wrap:!0}})}),O&&(0,g.jsx)("div",{className:"db-query-page__error",children:O})]}),(0,g.jsxs)(c.Zp,{title:"查询结果",titleCom:(0,g.jsxs)("span",{className:"db-query-page__result-meta",children:[D?`${D.row_count} 行`:"暂无结果",Z&&(0,g.jsx)("span",{className:"db-query-page__elapsed",children:(0,g.jsx)(S,{running:T,resetKey:I,prefix:`${t("耗时")}: `,format:"auto"})})]}),children:[D&&"table"===L&&(0,g.jsx)(o.X,{headers:ae,rows:ie}),D&&"json"===L&&(0,g.jsx)("pre",{className:"db-query-page__result-json",children:JSON.stringify(D.rows,null,2)}),!D&&!O&&(0,g.jsx)("div",{className:"db-query-page__hint",children:"先输入查询语句,再执行。支持 `select`、`with`、`pragma`、`explain`。"}),!D&&O&&(0,g.jsx)("div",{className:"db-query-page__hint",children:O})]})]})]})}},28319(e,t,s){s.r(t),s.d(t,{default:()=>q,defaultSqlPreset:()=>b});var n=s(96540),r=s(86149),a=s(4412),i=s(85997),l=s(75725),o=s(77481),c=s(70447),u=s(61443),d=s(34843),p=s(82893),h=s(14284),f=s(23496),x=s(53459),_=s(62042),m=s(7523),j=s(78247),v=s(86090),g=s(74848);function b(e){return{index:0,note:e("查询全部表"),sql:"SELECT name, type FROM sqlite_master WHERE type='table';"}}const S='# 可选:设置 SQL 中的"替换词"(在查询页选中该预设后,会显示输入框)\n# 例子:SQL 为 SELECT * FROM t WHERE id = 123456 ,请填写下面的 find=123456\n# 这样查询页输入新值即可把 SQL 中的 123456 替换掉后再查询\nfind=';function q(){const{t:e}=(0,r.B)(),{initUserInfo:t}=(0,n.useContext)(m.F),[,s]=(0,d.fp)(p.AG.editorSetting),[q]=(0,d.fp)(p.AG.user_base_info),y=(0,v.Zp)(),w=n.useRef(-1),[C,k]=(0,n.useState)([]);(0,n.useEffect)(()=>{const t=q?.user_data?.sql_preset_list;k(t?.length?[...t]:[b(e)])},[e,q?.user_data?.sql_preset_list]);const N=async()=>{const s=C.map((e,t)=>({...e,index:t})),n=await h.wm.post(f.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:s});n?.code===x.m.Success&&(await t(),(0,_.SK)(e("保存成功")))},E=(e,t)=>{w.current=e;const n=C[e][t]??"";j.xK.set_value_temp(n),s({model:"sql"===t?"ace/mode/sql":"ace/mode/ini",open:!0,fileName:"",save:async e=>{C[w.current][t]=e,k([...C]),j.xK.set_value_temp(""),N()}})},A=[e("编号"),e("备注"),e("SQL代码"),e("env编辑"),e("操作")];return(0,g.jsxs)("div",{children:[(0,g.jsx)(a.aZ,{position:"right",children:(0,g.jsx)(i.rA,{icon:"arrow_back",title:e("返回"),onClick:()=>y(-1)})}),(0,g.jsx)(l.jW,{isFull:!0,more:!0,children:(0,g.jsx)(l.NN,{children:(0,g.jsx)(l.xh,{children:(0,g.jsx)(l.fI,{children:(0,g.jsx)(l.VP,{widthPer:60,children:(0,g.jsx)(c.uF,{self_title:(0,g.jsx)("span",{className:"div-row",children:(0,g.jsx)("h2",{children:e("SQL 预设")})}),titleCom:(0,g.jsxs)("div",{className:"db-query-setting__toolbar",children:[(0,g.jsx)(i.rA,{icon:"add",title:e("添加"),onClick:()=>k([...C,{note:"",sql:"",env:S}])}),(0,g.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>N()})]}),children:(0,g.jsx)(o.X,{headers:A,rows:C.map((t,s)=>[(0,g.jsx)("div",{children:s+1}),(0,g.jsx)(u.Sm,{value:t.note,no_border:!0,placeholder:e("备注"),handleInputChange:e=>{t.note=e,k([...C])}}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"short_text",title:e("编辑SQL"),onClick:()=>E(s,"sql")})}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"settings",title:e("env编辑"),onClick:()=>E(s,"env")})}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>{C.splice(s,1),k([...C])}})})]),width:"8rem"})})})})})})})]})}s.d(t,["sqlEnvDefault",0,S])}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6805],{18840(e,n,t){t.d(n,{I:()=>s,gE:()=>l});class s{open;key;option_keys;port}class l{client_name;client_num_id;open=!1;serverIp;serverPort;key="";note;status;is_new;index}t.d(n,["FG",0,{content_max_width:"70%",content_padding:"4%",font_size:"16px",line_height:"1.8"},"mo",0,"\nnode_modules\n.venv\n.gradle\n.cache\nvendor\n"])},47996(e,n,t){t.d(n,{d:()=>l});t(96540);var s=t(74848);function l(e){return(0,s.jsxs)("div",{className:"instance-item",children:[(0,s.jsxs)("div",{className:"instance-item__toolbar",children:[(0,s.jsx)("span",{className:"instance-item__label",children:e.title}),e.toolbar]}),e.children]})}},77481(e,n,t){t.d(n,{S:()=>a,X:()=>r});var s=t(96540),l=t(61443),i=t(74848);function r(e){const[n,t]=s.useState([]),r=(0,s.useRef)(-1),[a,c]=(0,s.useState)(-1),[o,d]=(0,s.useState)(-1);(0,s.useEffect)(()=>{e.children?t(Array.isArray(e.children)?e.children:[e.children]):t(e.rows)},[e.rows,e.children]);const _=()=>{r.current=-1,c(-1),d(-1)};return(0,i.jsxs)("table",{children:[(0,i.jsx)("thead",{children:(0,i.jsx)("tr",{children:e.headers?.map((n,t)=>{const s=!!e.filter&&(e.filter.column??0)===t;let r=n;if(s){const t=e.filter,s=t.options.find(e=>e.value===t.value);null!=t.value&&s&&(r=`${n} (${s.label})`)}return(0,i.jsx)("th",{className:s?"table-filter-col":"",children:s?(0,i.jsx)(l.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:r}):n},t)})})}),(0,i.jsx)("tbody",{children:n.map((n,t)=>{const s=!!e.onRowDrag;return(0,i.jsx)("tr",{className:s?(a===t?"row-dragging":"")+(o===t?" row-drop-target":""):"",draggable:s,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(n)},onDragStart:e=>{s&&(r.current=t,c(t),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!s||r.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(t))},onDrop:n=>{s&&(n.preventDefault(),(()=>{const n=r.current,t=o;_(),n<0||t<0||n===t||e.onRowDrag?.(n,t)})())},onDragEnd:_,children:n.map((t,s)=>{const l=s===n.length-1?"small":"";return(0,i.jsx)("td",{className:l,style:{width:e.width??"auto"},children:t},s)})},t)})})]})}function a(e){return(0,i.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,n)=>(0,i.jsx)("div",{children:e},n))})}},36805(e,n,t){t.r(n),t.d(n,{default:()=>K});var s=t(96540),l=t(75725),i=t(86149),r=t(70447),a=t(85997),c=t(77481),o=t(61443),d=t(14284),_=t(53459),x=t(7523),h=t(34843),u=t(82893),p=t(62042),j=(t(23430),t(21499),t(14944)),m=t(92275),v=t(6960),f=t(40505),g=t(4412),w=t(24659),y=t(74848);let S={};function C(){const{t:e,i18n:n}=(0,i.B)(),{initUserInfo:t,reloadUserInfo:C}=(0,s.useContext)(x.F),[b,k]=(0,h.fp)(u.AG.user_base_info),[I,A]=(0,s.useState)([]),[P,N]=(0,h.fp)(u.AG.prompt_card),$=(0,w.K)(),[F,K]=(0,s.useState)(),[B,U]=(0,s.useState)(void 0),[E,G]=(0,s.useState)(null),[D,V]=(0,s.useState)([]),[q,z]=(0,s.useState)([]),M=[e("序号"),e("名称"),e("在线状态"),e("时间"),e("备注")],X=[e("序号"),e("服务端口"),e("转发ip"),e("转发端口"),e("开启"),e("备注")],Z=[e("序号"),e("服务端口"),e("fwd_nm"),e("转发ip"),e("转发端口"),e("开启"),e("备注")],H=e=>null==e?"":(0,v.s)(e),O=async e=>{const n=await d.s9.post("server_bridge_get_one_fig",{server_client_num_id:e});if(n.code===_.m.Success){const e=n.data;for(const n of e)n.client_name=S?.[n.client_num_id]?.client_name??"";z(e)}},L=async e=>{const n=void 0===e?E:e,t=await d.s9.get("server_client_get");if(t.code===_.m.Success){const e=t.data,s=[],l=[];S={};for(const t of e)null!==n&&!!t.status!==n||(B?`${t.index}${t.client_name}${t.note}`.includes(B)&&s.push(t):s.push(t),l.push({label:t.client_name,value:t.client_num_id}),S[t.client_num_id]=t);A(s),V(l)}};(0,s.useEffect)(()=>{j.ws.addMsg(m.HK.tcp_forward_server_load,e=>{L()}),L()},[]);return(0,y.jsxs)(s.Fragment,{children:[(0,y.jsx)(g.aZ,{position:"right",children:F&&(0,y.jsx)("span",{children:`${F.client_name}${F.note?`(${F.note})`:""}`})}),(0,y.jsxs)(l.fI,{children:[(0,y.jsx)(l.VP,{widthPer:50,children:(0,y.jsx)(l.xh,{children:(0,y.jsx)(r.uF,{self_title:(0,y.jsx)("span",{className:" div-row ",children:(0,y.jsx)("h2",{children:e("客户端列表")})}),titleCom:(0,y.jsx)(o.Sm,{placeholder:e("过滤"),value:B,handleInputChange:e=>{U(e)},handlerEnter:()=>{L()}}),children:(0,y.jsx)(c.X,{headers:M,filter:{title:e("在线状态"),column:2,value:E,options:[{label:e("全部"),value:null},{label:e("在线"),value:!0},{label:e("离线"),value:!1}],onChange:e=>{G(e),L(e)}},rows:I.map((n,t)=>[(0,y.jsx)("p",{children:t}),(0,y.jsx)(r.xP,{children:n.client_name}),(0,y.jsx)(r.fq,{ok:n.status}),(0,y.jsx)(r.xP,{children:H(n.status?n.online_start_time:n.offline_time)}),(0,y.jsx)(r.xP,{children:n.note}),(0,y.jsxs)("div",{children:[(0,y.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:()=>{K({...n}),O(n.client_num_id)}}),(0,y.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>{N({open:!0,title:"share file",confirm:async()=>{N({open:!1}),await(async e=>{(await d.s9.post("server_client_del",{client_num_id:e})).code===_.m.Success&&((0,p.SK)("成功"),L())})(n.client_num_id)},context_div:(0,y.jsx)("div",{className:"card-content",children:e("确定删除这个吗客户端吗?")})})}})]})]),width:"10rem"})})})}),(0,y.jsx)(l.VP,{widthPer:50,children:F?(0,y.jsxs)(l.xh,{children:[(0,y.jsxs)(r.Zp,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:e("代理配置")})," "]}),rightBottomCom:(0,y.jsx)("div",{children:(0,y.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{(await d.s9.post("server_client_save",F)).code===_.m.Success&&(0,p.SK)("成功")}})}),children:[(0,y.jsx)(l.Yh,{left:e("远程地址"),center:F?.client_remote_address??""}),(0,y.jsx)(l.Yh,{left:e(F?.status?"在线时间":"离线时间"),center:H(F?.status?F?.online_start_time:F?.offline_time)}),(0,y.jsx)(o.Sm,{placeholder:"名称",value:F.client_name,handleInputChange:e=>{F.client_name=e,K({...F})}}),(0,y.jsxs)("form",{children:[e("fc_pxy"),":",(0,y.jsx)(c.S,{isFlex:!0,columns:[(0,y.jsx)(o.U6,{value:1,context:e("开启"),selected:F.open_filecat,onchange:()=>{F.open_filecat=!F.open_filecat,K({...F})}}),(0,y.jsx)(o.U6,{value:1,context:e("关闭"),selected:!F.open_filecat,onchange:()=>{F.open_filecat=!F.open_filecat,K({...F})}})]})]}),F.open_filecat&&(0,y.jsxs)(s.Fragment,{children:[(0,y.jsxs)("form",{children:[e("fc_pxyw"),":",(0,y.jsx)(c.S,{isFlex:!0,columns:[(0,y.jsx)(o.U6,{value:1,context:e("开启"),selected:F.filecat_use_local_page,onchange:()=>{F.filecat_use_local_page=!F.filecat_use_local_page,K({...F})}}),(0,y.jsx)(o.U6,{value:1,context:e("关闭"),selected:!F.filecat_use_local_page,onchange:()=>{F.filecat_use_local_page=!F.filecat_use_local_page,K({...F})}})]})]}),(0,y.jsx)(o.Sm,{placeholderOut:e("fc_pxyr"),placeholder:"127.0.0.1:5567",value:F.filecat_proxy_host_port,handleInputChange:e=>{F.filecat_proxy_host_port=e,K({...F})}}),(0,y.jsx)(a.rA,{icon:"content_copy",title:e("复制filecat代理url"),onClick:()=>{const e=`${window.location.origin}?tcp_client_num_id=${F.client_num_id}`;(0,f.lW)(e),(0,p.SK)(e)}})]}),(0,y.jsx)(o.Sm,{placeholder:"备注",value:F.note,handleInputChange:e=>{F.note=e,K({...F})}}),(0,y.jsx)(a.rA,{icon:"add",onClick:()=>{F.proxy_fig_list.push({open:!1}),K({...F})},title:e("添加")}),e("代理"),(0,y.jsx)(c.X,{headers:X,rows:F.proxy_fig_list.map((n,t)=>[(0,y.jsx)("p",{children:t}),(0,y.jsx)(o.Sm,{value:n.server_port,handleInputChange:e=>{n.server_port=parseInt(e)},no_border:!0}),(0,y.jsx)(o.Sm,{value:n.proxy_host,handleInputChange:e=>{n.proxy_host=e},no_border:!0}),(0,y.jsx)(o.Sm,{value:n.proxy_port,handleInputChange:e=>{n.proxy_port=parseInt(e)},no_border:!0}),(0,y.jsx)(o.l6,{value:!!n.open,onChange:e=>{n.open=e,K({...F})},options:$,no_border:!0}),(0,y.jsx)(o.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,y.jsx)("div",{children:(0,y.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>{const e=[];for(let n=0;n<(F.proxy_fig_list.length??0);n++)n!==t&&e.push(F.proxy_fig_list[n]);F.proxy_fig_list=e,K({...F})}})})]),width:"10rem"})]}),(0,y.jsxs)(r.Zp,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:e("桥接配置")})," "]}),children:[(0,y.jsx)(a.rA,{icon:"add",onClick:()=>{q.push({open:!1,server_client_num_id:F.client_num_id}),z([...q])},title:e("添加")}),e("代理"),(0,y.jsx)(c.X,{headers:Z,rows:q.map((n,t)=>[(0,y.jsx)("p",{children:t}),(0,y.jsx)(o.Sm,{value:n.server_port,handleInputChange:e=>{n.server_port=parseInt(e)},no_border:!0}),(0,y.jsx)(o.Sm,{value:n.client_name,options:D,handleInputChange:e=>{const t=(e=>D.find(n=>String(n.value)===String(e)))(e);n.client_num_id=parseInt(String(t.value)),n.client_name=t.label,z([...q])},no_border:!0}),(0,y.jsx)(o.Sm,{value:n.client_proxy_host,handleInputChange:e=>{n.client_proxy_host=e},no_border:!0}),(0,y.jsx)(o.Sm,{value:n.client_proxy_port,handleInputChange:e=>{n.client_proxy_port=parseInt(e)},no_border:!0}),(0,y.jsx)(o.l6,{value:!!n.open,onChange:e=>{n.open=e,z([...q])},options:$,no_border:!0}),(0,y.jsx)(o.Sm,{value:n.note,handleInputChange:e=>{n.note=e},no_border:!0}),(0,y.jsxs)("div",{children:[(0,y.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:async()=>{if(null==n.id){const e=[];for(let n=0;n<(q.length??0);n++)n!==t&&e.push(q[n]);z([...e])}else await(async(e,n)=>{(await d.s9.post("server_bridge_del_fig",{id:e})).code===_.m.Success&&((0,p.SK)("成功"),O(n))})(n.id,n.server_client_num_id)}}),null==n.id?(0,y.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:async()=>{await(async e=>{if(null==e.client_num_id)return void(0,p.zN)("未选择转发送 client");(await d.s9.post("server_bridge_add_fig",e)).code===_.m.Success&&((0,p.SK)("成功"),O(e.server_client_num_id))})(n)}}):(0,y.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{await(async e=>{if(null==e.client_num_id)return void(0,p.zN)("未选择转发送 client");(await d.s9.post("server_bridge_edit_fig",e)).code===_.m.Success&&((0,p.SK)("成功"),O(e.server_client_num_id))})(n)}})]})]),width:"10rem"})]})]}):(0,y.jsx)(l.xh,{})})]})]})}var b=t(18840),k=t(7463);function I(e){const{t:n}=(0,i.B)(),[t,x]=(0,s.useState)([]),[h,u]=(0,s.useState)([]),[v,f]=(0,s.useState)([]),[g,S]=(0,s.useState)([]),C=[n("序号"),n("服务端口"),n("转发客户端名称")],I=[n("序号"),n("原客户端"),n("目标客户端"),n("待同步文件数量")],A=[n("序号"),n("port"),n("host"),n("名称"),n("key"),n("在线"),n("开启"),n("备注")],P=(0,w.K)(),N=async()=>{const e=await d.s9.get("client_get");if(e.code===_.m.Success){const n=e.data;x(n.list)}const n=await d.s9.get("client_bridge_get_all_fig");n.code===_.m.Success&&f(n.data);const t=await d.s9.get("client_sync_task_get");t.code===_.m.Success&&S(t.data)};(0,s.useEffect)(()=>(N(),j.ws.sendData(m.HK.tcp_proxy_client_status,{}).then(()=>{const e=(0,k.sg)(()=>N(),500);j.ws.addMsg(m.HK.tcp_proxy_client_status,e)}),()=>{j.ws.removeMsg(m.HK.tcp_proxy_client_status)}),[]);const $=async e=>{const n=new b.gE;n.index=e.index,n.key=e.key,n.serverIp=e.serverIp,n.serverPort=e.serverPort,n.open=e.open,n.client_name=e.client_name,n.client_num_id=e.client_num_id;(await d.s9.post("client_save",n)).code===_.m.Success?(0,p.SK)("保存成功"):(0,p.zN)("网络错误")};return(0,y.jsxs)("div",{children:[(0,y.jsxs)(l.fI,{children:[(0,y.jsx)(l.VP,{widthPer:33,children:(0,y.jsxs)(r.Zp,{title:"",rightBottomCom:(0,y.jsx)(a.C3,{text:n("保存"),clickFun:()=>{t[0].index=0,$(t[0])}}),titleCom:(0,y.jsxs)("div",{children:[n("连接状态"),(0,y.jsx)(r.fq,{ok:!!t[0]?.status})]}),children:[(0,y.jsx)(o.Sm,{placeholder:`${n("服务器")} ip`,value:t[0]?.serverIp,handleInputChange:e=>{t[0].serverIp=e}}),(0,y.jsx)(o.Sm,{type:"number",placeholder:`${n("服务器")} port`,value:t[0]?.serverPort,handleInputChange:e=>{const n=parseInt(e);!isNaN(n)&&n>=0&&n<=65535&&(t[0].serverPort=n)}}),(0,y.jsx)(o.Sm,{placeholder:n("名称"),value:t[0]?.client_name,handleInputChange:e=>{t[0].client_name=e}}),(0,y.jsx)(o.Sm,{type:"password",placeholder:"key ",value:t[0]?.key,handleInputChange:e=>{t[0].key=e}}),(0,y.jsxs)("form",{children:[n("状态"),(0,y.jsx)(c.S,{isFlex:!0,columns:[(0,y.jsx)(o.U6,{value:1,context:n("开启"),selected:t[0]?.open,onchange:()=>{t[0].open=!t[0].open,x([...t])}}),(0,y.jsx)(o.U6,{value:1,context:n("关闭"),selected:!t[0]?.open,onchange:()=>{t[0].open=!t[0].open,x([...t])}})]})]})]})}),(0,y.jsx)(l.VP,{widthPer:40,children:(0,y.jsxs)(r.Zp,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:n("更多服务器")})," "]}),children:[(0,y.jsx)(a.rA,{icon:"add",onClick:()=>{t.push({open:!1,is_new:!0}),x([...t])},title:n("添加")}),n("代理"),(0,y.jsx)(c.X,{headers:A,rows:t.slice(1).map((e,s)=>[(0,y.jsx)("p",{children:s}),(0,y.jsx)(o.Sm,{type:"number",value:e.serverPort,handleInputChange:n=>{const t=parseInt(n);!isNaN(t)&&t>=0&&t<=65535&&(e.serverPort=t)},no_border:!0}),(0,y.jsx)(o.Sm,{value:e.serverIp,handleInputChange:n=>{e.serverIp=n},no_border:!0}),(0,y.jsx)(o.Sm,{value:e.client_name,handleInputChange:n=>{e.client_name=n},no_border:!0}),(0,y.jsx)(o.Sm,{value:e.key,handleInputChange:n=>{e.key=n},no_border:!0}),(0,y.jsx)(r.fq,{ok:!!e.status}),(0,y.jsx)(o.l6,{value:!!e.open,onChange:n=>{e.open=n,x([...t])},options:P,no_border:!0}),(0,y.jsx)(o.Sm,{value:e.note,handleInputChange:n=>{e.note=n},no_border:!0}),(0,y.jsxs)("div",{children:[(0,y.jsx)(a.rA,{icon:"delete",title:n("删除"),onClick:async()=>{if(e.is_new){const e=[];for(let n=0;n<(t.length??0);n++)n!==s&&e.push(t[n]);x([...e])}else await(async e=>{(await d.s9.post("client_del",{index:e})).code===_.m.Success?((0,p.SK)("保存成功"),N()):(0,p.zN)("网络错误")})(s+1)}}),e.is_new?(0,y.jsx)(a.rA,{icon:"add",title:n("添加"),onClick:async()=>{e.index=s+1,await $(e)}}):(0,y.jsx)(a.rA,{icon:"save",title:n("保存"),onClick:async()=>{e.index=s+1,await $(e)}})]})]),width:"10rem"})]})})]}),(0,y.jsxs)(l.fI,{children:[!!v?.length&&(0,y.jsx)(l.VP,{widthPer:40,children:(0,y.jsx)(r.Zp,{title:n("br_port"),children:(0,y.jsx)(c.X,{headers:C,rows:v.map((e,n)=>[(0,y.jsx)("p",{children:n}),(0,y.jsx)(r.xP,{children:e.server_port}),(0,y.jsx)(r.xP,{children:e.client_name})]),width:"10rem"})})}),!!g?.length&&(0,y.jsx)(l.VP,{widthPer:40,children:(0,y.jsx)(r.Zp,{title:n("文件同步列表"),children:(0,y.jsx)(c.X,{headers:I,rows:g.map((e,n)=>[(0,y.jsx)("p",{children:n}),(0,y.jsx)(r.xP,{children:e.source_client_name}),(0,y.jsx)(r.xP,{children:e.target_client_name}),(0,y.jsx)(r.xP,{children:e.running_num})]),width:"10rem"})})})]})]})}function A(){const{t:e,i18n:n}=(0,i.B)(),{initUserInfo:t,reloadUserInfo:v}=(0,s.useContext)(x.F),[f,g]=(0,h.fp)(u.AG.user_base_info),[w,S]=(0,h.fp)(u.AG.prompt_card),[C,k]=(0,s.useState)(!1),[I,A]=(0,s.useState)([]),[P,N]=(0,s.useState)(null),[$,F]=(0,s.useState)([]),[K,B]=(0,s.useState)(void 0),[U,E]=(0,s.useState)(void 0),G=(0,s.useMemo)(()=>{const e=[...I];return null!=P?(e.sort((e,n)=>P?e.server_port-n.server_port:n.server_port-e.server_port),e):e},[I,P]),D=async()=>{const e=await d.s9.get("get_all_open_server_client_proxy_fig");if(e.code===_.m.Success){const n=[];for(const t of e.data)U?`${t.server_port}${t.client_name}${t.proxy_host}${t.server_port}${t.server_port_note}`.includes(U)&&n.push(t):n.push(t);A(n)}},V=async()=>{const e=await d.s9.get("server_get");e.code===_.m.Success&&(B(e.data.port),k(!!e.data.open),F(e.data.option_keys??[])),D()};(0,s.useEffect)(()=>{j.ws.addMsg(m.HK.tcp_forward_server_load,e=>{V()}),V()},[]);const q=async e=>{const n=new b.I;n.port=K,n.open=C,n.option_keys=$;(await d.s9.post("server_save",{fig:n,notice_client:e})).code===_.m.Success&&(0,p.SK)("成功")};return(0,y.jsxs)(l.fI,{children:[(0,y.jsx)(l.VP,{widthPer:33,children:(0,y.jsx)(l.xh,{children:(0,y.jsxs)(r.Zp,{title:e("服务器配置"),rightBottomCom:(0,y.jsxs)("div",{children:[(0,y.jsx)(a.C3,{text:e("sv_ntf"),clickFun:()=>{q(!0)}}),(0,y.jsx)(a.C3,{text:e("保存"),clickFun:()=>{q(!1)}})]}),children:[(0,y.jsx)(o.Sm,{placeholder:"port",value:K,handleInputChange:e=>{B(e)}}),(0,y.jsxs)("label",{children:[(0,y.jsx)(a.rA,{icon:"add",onClick:()=>{F([...$,""])},title:e("添加")}),e("key")]}),($??[]).map((n,t)=>(0,y.jsxs)("div",{style:{display:"flex"},children:[(0,y.jsx)("div",{style:{width:"90%"},children:(0,y.jsx)(o.Sm,{type:"password",value:n,handleInputChange:e=>{$[t]=e,F([...$])}})}),(0,y.jsx)(a.rA,{icon:"delete",onClick:()=>{$.splice(t,1),F([...$])},title:e("删除")})]},t)),(0,y.jsxs)("form",{children:[e("状态"),":",(0,y.jsx)(c.S,{isFlex:!0,columns:[(0,y.jsx)(o.U6,{value:1,context:e("开启"),selected:C,onchange:()=>{k(!C)}}),(0,y.jsx)(o.U6,{value:1,context:e("关闭"),selected:!C,onchange:()=>{k(!C)}})]})]})]})})}),(0,y.jsx)(l.VP,{widthPer:50,children:(0,y.jsx)(l.xh,{children:(0,y.jsx)(r.uF,{self_title:(0,y.jsx)("span",{className:" div-row ",children:(0,y.jsx)("h2",{children:e("服务器")+e("端口映射")})}),titleCom:(0,y.jsx)(o.Sm,{placeholder:e("过滤"),value:U,handleInputChange:e=>{E(e)},handlerEnter:()=>{D()}}),children:(0,y.jsx)(c.X,{headers:[e("序号"),(0,y.jsx)(a.rA,{title:e("服务端口"),onClick:()=>{N(e=>!e)}}),e("转发ip"),e("转发端口"),"client "+e("名称"),e("开启"),e("备注")],rows:G.map((e,n)=>[(0,y.jsx)("p",{children:n}),(0,y.jsx)(r.xP,{children:e.server_port}),(0,y.jsx)(r.xP,{children:e.proxy_host}),(0,y.jsx)(r.xP,{children:e.proxy_port}),(0,y.jsx)(r.xP,{children:e.client_name}),(0,y.jsx)(r.fq,{ok:!!e.open_success}),(0,y.jsx)(r.xP,{children:e.server_port_note})]),width:"10rem"})})})})]})}var P=t(47996),N=t(78247);function $(){const{t:e,i18n:n}=(0,i.B)(),{initUserInfo:t,reloadUserInfo:j}=(0,s.useContext)(x.F),[m,v]=(0,h.fp)(u.AG.user_base_info),[f,g]=(0,h.fp)(u.AG.prompt_card),[,w]=(0,h.fp)(u.AG.confirm),[S,C]=(0,h.fp)(u.AG.editorSetting),[k,I]=(0,s.useState)([]),[A,$]=(0,s.useState)([]),F=[e("编号"),e("原客户端"),e("开启"),e("备注"),e("操作")],[K,B]=(0,s.useState)(null);(0,s.useEffect)(()=>{(async()=>{const e=await d.s9.get("server_client_get");if(e.code===_.m.Success){const n=e.data,t=[];for(const e of n)t.push({label:e.client_name,value:e.client_num_id});$(t),await U()}})()},[]);const U=async()=>{const e=await d.s9.get("sync_task_get");e.code===_.m.Success&&I(e.data)},E=e=>A.find(n=>String(n.value)===String(e))?.label??"",G=e=>A.find(n=>String(n.value)===String(e)),D=(e,n,t)=>{K?.targets&&(K.targets[e]={...K.targets[e],[n]:t},B({...K,targets:[...K.targets]}))},V=async n=>{const t=await d.s9.post("sync_task_save",n);t.code===_.m.Success?((0,p.SK)(e("成功")),await U()):(0,p.zN)(t.message??e("操作失败"))};return(0,y.jsxs)(l.fI,{children:[(0,y.jsx)(l.VP,{widthPer:50,maxWidth:"40rem",children:(0,y.jsx)(l.xh,{children:(0,y.jsx)(r.uF,{self_title:(0,y.jsxs)("span",{className:" div-row ",children:[(0,y.jsx)("h2",{children:e("客户端文件同步")}),(0,y.jsx)(a.rA,{icon:"info",onClick:()=>{g({open:!0,title:"信息",context_div:(0,y.jsx)("div",{children:(0,y.jsxs)("ul",{children:[(0,y.jsx)("li",{children:e("sy_tp1")}),(0,y.jsx)("li",{children:e("sy_tp2")}),(0,y.jsx)("li",{children:e("sy_tp3")})]})})})},title:e("信息")})]}),titleCom:(0,y.jsx)("div",{children:(0,y.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{B({open:!1,source_client_num_id:void 0,source_dir:"",targets:[],delete_missing:!0,is_new:!0})}})}),children:(0,y.jsx)(c.X,{headers:F,rows:k.map((n,t)=>[(0,y.jsx)("p",{children:t}),(0,y.jsx)(r.xP,{children:n.source_client_name}),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(r.fq,{ok:!!n.open}),n.open?e("开启"):e("关闭")]}),(0,y.jsx)(r.xP,{children:n.note}),(0,y.jsxs)("div",{children:[(0,y.jsx)(a.rA,{icon:"edit",title:e("编辑"),onClick:()=>(e=>{B(JSON.parse(JSON.stringify(e)))})(n)}),(0,y.jsx)(a.rA,{icon:"sync",title:e("立即同步"),onClick:()=>(async n=>{if(!n.id||!n.open)return void(0,p.zN)(e("tsk_off"));const t=await d.s9.post("sync_task_rescan",{id:n.id});t.code===_.m.Success?(0,p.SK)(e("已触发同步")):(0,p.zN)(t.message??e("操作失败"))})(n)}),(0,y.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>{w({open:!0,title:e("确定删除吗"),handle:async()=>{await(async n=>{(await d.s9.post("sync_task_del",{id:n})).code===_.m.Success&&((0,p.SK)(e("成功")),K?.id===n&&B(null),await U())})(n.id),w({open:!1,handle:null})}})}})]})]),width:"10rem"})})})}),(0,y.jsx)(l.VP,{widthPer:50,children:K&&(0,y.jsx)(l.xh,{children:(0,y.jsxs)(r.Zp,{self_title:(0,y.jsx)("span",{className:" div-row ",children:(0,y.jsx)("h2",{children:e(""+(K.is_new?"添加":"编辑"))})}),rightBottomCom:(0,y.jsxs)("div",{children:[(0,y.jsx)(a.rA,{icon:"cancel",title:e("取消"),onClick:()=>B(null)}),(0,y.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{if(!K)return;const n=K,t=await d.s9.post("sync_task_save",n);t.code===_.m.Success?((0,p.SK)(e("成功")),B(null),await U()):(0,p.zN)(t.message??e("操作失败"))}})]}),children:[(0,y.jsx)(o.BC,{label:e("开启"),label_width:"6rem",children:(0,y.jsx)(o.GL,{selected:!!K.open,onchange:()=>{B({...K,open:!K.open})}})}),(0,y.jsx)(o.BC,{label:e("备注"),label_width:"6rem",children:(0,y.jsx)(o.Sm,{value:K.note,handleInputChange:e=>{B({...K,note:e})}})}),(0,y.jsx)(o.BC,{label:e("原客户端"),label_width:"6rem",required:!0,children:(0,y.jsx)(o.Sm,{value:E(K.source_client_num_id),options:A,handleInputChange:e=>{const n=G(e);n&&B({...K,source_client_num_id:parseInt(String(n.value))})}})}),(0,y.jsx)(o.BC,{label:e("原目录"),label_width:"6rem",required:!0,children:(0,y.jsx)(o.Sm,{value:K.source_dir,placeholder:e("被同步的源目录"),handleInputChange:e=>{B({...K,source_dir:e})}})}),(0,y.jsx)("label",{children:e("目标列表")}),(K.targets??[]).map((n,t)=>(0,y.jsxs)(P.d,{title:`${e("目标")}${t+1}`,toolbar:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(o.BC,{label:e("全量同步"),label_width:"6rem",children:(0,y.jsx)(o.GL,{selected:!!n.full_sync,onchange:()=>D(t,"full_sync",!n.full_sync)})}),(0,y.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{if(!K?.targets)return;const n=[...K.targets];n.splice(e,1),B({...K,targets:n})})(t)})]}),children:[(0,y.jsx)(o.BC,{label:e("客户端"),label_width:"6rem",required:!0,children:(0,y.jsx)(o.Sm,{value:E(n.client_num_id),options:A,handleInputChange:e=>{const n=G(e);n&&D(t,"client_num_id",parseInt(String(n.value)))}})}),(0,y.jsx)(o.BC,{label:e("目标目录"),label_width:"6rem",required:!0,children:(0,y.jsx)(o.Sm,{value:n.dir,handleInputChange:e=>D(t,"dir",e)})})]},t)),(0,y.jsxs)("div",{className:"div-row",children:[(0,y.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{if(!K)return;const e=[...K.targets??[],{client_num_id:void 0,dir:"",full_sync:!1}];B({...K,targets:e})}}),(0,y.jsx)(a.rA,{icon:"edit",title:e("忽略目录"),onClick:()=>{var e;e=K,N.xK.set_value_temp(e.ignore_text??b.mo),C({model:"ace/mode/gitignore",open:!0,fileName:"",save:async n=>{e.ignore_text=n,B({...e}),N.xK.set_value_temp(""),await V(e)}})}})]})]})})})]})}var F=t(87361);function K(){const{t:e}=(0,i.B)(),n=[{index:1,name:e("客户端"),rto:"tcp_proxy_client/",component:(0,y.jsx)(I,{})},{index:2,name:e("服务端"),rto:"tcp_proxy_server_info/",component:(0,y.jsx)(A,{})},{index:3,name:e("服务端")+"-"+e("客户端列表"),rto:"tcp_proxy_server_client/",component:(0,y.jsx)(C,{})},{index:4,name:e("服务端")+"-"+e("客户端功能"),rto:"tcp_proxy_server_client_setting/",component:(0,y.jsx)($,{})}];return(0,y.jsx)(l.W1,{optionList:n,father_route:F.o.net_proxy})}},6960(e,n,t){t.d(n,{s:()=>r});var s=t(72635);const l=1440,i=525600;function r(e){e=e>1e12?e:1e3*e;const n=Date.now(),t=Math.abs(n-e)/6e4;return t<1?s.Ay.t("小于一分钟"):t<60?`${t.toFixed(0)} ${s.Ay.t("分钟前")}`:t<l?`${(t/60).toFixed(0)} ${s.Ay.t("小时前")}`:t<43200?`${(t/l).toFixed(0)} ${s.Ay.t("天前")}`:t<i?`${(t/43200).toFixed(0)} ${s.Ay.t("月前")}`:`${(t/i).toFixed(0)} ${s.Ay.t("年前")}`}},24659(e,n,t){var s=t(86149);t.d(n,["K",0,()=>{const{t:e}=(0,s.B)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}])}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6919],{86919(e,t,l){l.r(t),l.d(t,{default:()=>j});var r=l(96540),a=l(86149),i=l(86090),s=l(34843),n=l(4412),o=l(85997),h=l(75725),d=l(70447),c=l(61443),p=l(82893),u=l(14284),m=l(53459),x=l(62042),_=l(74848);function j(){const{t:e}=(0,a.B)(),t=(0,i.Zp)(),[l,j]=(0,s.fp)(p.AG.confirm),[,v]=(0,s.fp)(p.AG.prompt_card),[b,C]=(0,r.useState)(""),[g,w]=(0,r.useState)(""),[S,f]=(0,r.useState)(""),[y,k]=(0,r.useState)(""),[B,I]=(0,r.useState)(""),[W,A]=(0,r.useState)(""),[N,D]=(0,r.useState)(""),[P,Y]=(0,r.useState)(""),[z,F]=(0,r.useState)(!0),[G,H]=(0,r.useState)(!1);(0,r.useEffect)(()=>{(async()=>{const e=await u.Yu.get("docker/config");if(e?.code!==m.m.Success)return;const t=e.data??{};C(t.http_proxy??""),w(t.https_proxy??""),f(t.no_proxy??""),k((t.registry_mirrors||[]).join(",")),I((t.insecure_registries||[]).join(",")),A(t.data_root??""),D(t.storage_driver??""),Y(t.log_driver??""),F(t.iptables??!0),H(!!t.live_restore)})()},[]);return(0,_.jsxs)("div",{children:[(0,_.jsx)(n.aZ,{position:"right",children:(0,_.jsx)(o.rA,{icon:"arrow_back",title:e("返回"),onClick:()=>t(-1)})}),(0,_.jsx)(h.jW,{isFull:!0,more:!0,children:(0,_.jsx)(h.NN,{children:(0,_.jsx)(h.xh,{children:(0,_.jsx)(h.fI,{children:(0,_.jsx)(h.VP,{widthPer:35,children:(0,_.jsxs)(d.uF,{self_title:(0,_.jsxs)("span",{className:"div-row",children:[(0,_.jsx)("h2",{children:e("doc_pxy")}),(0,_.jsx)(o.rA,{icon:"info",title:e("信息"),onClick:()=>{v({open:!0,title:e("信息"),context_div:(0,_.jsx)("div",{style:{whiteSpace:"pre-wrap",lineHeight:"1.6"},children:e("代理写入 systemd 服务环境变量,其余写入 daemon.json;修改后需重启 Docker 生效,请谨慎操作(尤其数据存储目录变更)。")})})}})]}),titleCom:(0,_.jsx)(o.rA,{icon:"save",title:e("保存"),onClick:()=>(async()=>{const t=e=>e.split(/[\n,,]/).map(e=>e.trim()).filter(Boolean),l=await u.Yu.post("docker/config/save",{http_proxy:b,https_proxy:g,no_proxy:S,registry_mirrors:t(y),insecure_registries:t(B),data_root:W,storage_driver:N,log_driver:P,iptables:z,live_restore:G});l?.code===m.m.Success?j({open:!0,title:e("是否重启 Docker 服务以生效?"),sub_title:e("重启 Docker 会短暂中断容器服务,请确认当前没有关键任务在执行"),handle:async()=>{const t=await u.Yu.post("docker/restart");j({open:!1,handle:null}),t?.code===m.m.Success?(0,x.SK)(e("已重启 Docker,代理配置已生效")):(0,x.zN)(e("重启失败"))}}):(0,x.zN)(e("保存失败"))})()}),children:[(0,_.jsx)(c.BC,{label:e("HTTP 代理"),label_width:"4rem",children:(0,_.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"http://127.0.0.1:3067",value:b,handleInputChange:e=>C(e)})}),(0,_.jsx)(c.BC,{label:e("pxy_htt"),label_width:"4rem",children:(0,_.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"https://127.0.0.1:3067",value:g,handleInputChange:e=>w(e)})}),(0,_.jsx)(c.BC,{label:e("pxy_nne"),label_width:"4rem",children:(0,_.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"localhost,127.0.0.1",value:S,handleInputChange:e=>f(e)})}),(0,_.jsx)(c.BC,{label:e("镜像加速"),label_width:"4rem",children:(0,_.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"https://docker.mirrors.ustc.edu.cn,https://hub-mirror.c.163.com",value:y,handleInputChange:e=>k(e)})}),(0,_.jsx)(c.BC,{label:e("不安全仓库"),label_width:"4rem",children:(0,_.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"127.0.0.1:5000,registry.example.com",value:B,handleInputChange:e=>I(e)})}),(0,_.jsx)(c.BC,{label:e("数据存储目录"),label_width:"4rem",children:(0,_.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"/var/lib/docker",value:W,handleInputChange:e=>A(e)})}),(0,_.jsx)(c.BC,{label:e("存储驱动"),label_width:"4rem",children:(0,_.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"overlay2",value:N,handleInputChange:e=>D(e)})}),(0,_.jsx)(c.BC,{label:e("日志驱动"),label_width:"4rem",children:(0,_.jsx)(c.Sm,{maxWidth:"24rem",placeholder:"json-file",value:P,handleInputChange:e=>Y(e)})}),(0,_.jsx)(c.BC,{label:e("fw_iptb"),label_width:"4rem",input_max_width:"8rem",children:(0,_.jsx)(c.l6,{options:[{title:e("是"),value:!0},{title:e("否"),value:!1}],value:z,onChange:e=>F(!!e)})}),(0,_.jsx)(c.BC,{label:e("lve_rst"),label_width:"4rem",input_max_width:"8rem",children:(0,_.jsx)(c.l6,{options:[{title:e("是"),value:!0},{title:e("否"),value:!1}],value:G,onChange:e=>H(!!e)})})]})})})})})})]})}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6966],{18840(e,t,n){n.d(t,{I:()=>r,gE:()=>s});class r{open;key;option_keys;port}class s{client_name;client_num_id;open=!1;serverIp;serverPort;key="";note;status;is_new;index}n.d(t,["FG",0,{content_max_width:"70%",content_padding:"4%",font_size:"16px",line_height:"1.8"},"mo",0,"\nnode_modules\n.venv\n.gradle\n.cache\nvendor\n"])},26966(e,t,n){n.r(t),n.d(t,{default:()=>He});var r=n(96540),s=n(34843),o=n(82893),c=n(78247),a=n(23430),l=n(85997),i=n(57952),u=n(62042),d=n(53459),m=n(14284),h=n(57889),f=n(86149),p=n(42845),g=n(1575),_=n(89781),v=n(61396),k=n(46762),y=n(73337),b=n(89552),w=n(86059),x=n(58903);const M=(0,w.of)({tableGroup:"block",cellContent:"block+",cellAttributes:{}}),$={align:{default:null}},S={doc:{content:"block+"},paragraph:{content:"inline*",group:"block",attrs:$,parseDOM:[{tag:"p"}],toDOM:e=>["p",e.attrs.align?{style:`text-align:${e.attrs.align}`}:{},0]},heading:{content:"inline*",group:"block",attrs:{level:{default:1},...$},defining:!0,parseDOM:[1,2,3,4,5,6].map(e=>({tag:`h${e}`,attrs:{level:e}})),toDOM(e){const t=e.attrs.align?{style:`text-align:${e.attrs.align}`}:{};return[`h${e.attrs.level}`,t,0]}},bullet_list:{group:"block",content:"list_item+",parseDOM:[{tag:"ul"}],toDOM:()=>["ul",0]},ordered_list:{group:"block",content:"list_item+",attrs:{order:{default:1}},parseDOM:[{tag:"ol",getAttrs:e=>({order:Number(e.getAttribute("start")??1)})}],toDOM:e=>1===e.attrs.order?["ol",0]:["ol",{start:e.attrs.order},0]},list_item:{content:"paragraph block*",defining:!0,attrs:{checked:{default:null}},parseDOM:[{tag:"li",getAttrs:e=>{const t=e,n=t.querySelector("input[type=checkbox]");if(n)return{checked:n.checked};const r=t.getAttribute("data-checked");return{checked:null===r?null:"true"===r}}}],toDOM:e=>null!==e.attrs.checked?["li",{"data-checked":String(e.attrs.checked)},0]:["li",0]},blockquote:{content:"block+",group:"block",defining:!0,parseDOM:[{tag:"blockquote"}],toDOM:()=>["blockquote",0]},code_block:{content:"text*",group:"block",marks:"",defining:!0,attrs:{language:{default:""}},parseDOM:[{tag:"pre",preserveWhitespace:"full",getAttrs:e=>{const t=e.querySelector("code"),n=/language-([\w-]+)/.exec(t?.className??"");return{language:n?n[1]:""}}}],toDOM:e=>["pre",{"data-language":e.attrs.language},["code",0]]},horizontal_rule:{group:"block",parseDOM:[{tag:"hr"}],toDOM:()=>["hr"]},hard_break:{inline:!0,group:"inline",selectable:!1,parseDOM:[{tag:"br"}],toDOM:()=>["br"]},image:{inline:!0,group:"inline",draggable:!0,attrs:{src:{},alt:{default:null},title:{default:null}},parseDOM:[{tag:"img[src]",getAttrs:e=>{const t=e;return{src:t.getAttribute("src"),alt:t.getAttribute("alt"),title:t.getAttribute("title")}}}],toDOM(e){const{src:t,alt:n,title:r}=e.attrs,s={src:t};return n&&(s.alt=n),r&&(s.title=r),["img",s]}},text:{group:"inline"},...M},j={strong:{parseDOM:[{tag:"strong"},{tag:"b"},{style:"font-weight=bold"}],toDOM:()=>["strong",0]},em:{parseDOM:[{tag:"i"},{tag:"em"},{style:"font-style=italic"}],toDOM:()=>["em",0]},strike:{parseDOM:[{tag:"s"},{tag:"del"},{tag:"strike"}],toDOM:()=>["s",0]},code:{parseDOM:[{tag:"code",getAttrs:e=>"PRE"!==e.parentElement?.tagName&&null}],toDOM:()=>["code",0]},link:{attrs:{href:{},title:{default:null}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:e=>{const t=e;return{href:t.getAttribute("href"),title:t.getAttribute("title")}}}],toDOM(e){const{href:t,title:n}=e.attrs;return["a",{href:t,title:n,rel:"noopener noreferrer",target:"_blank"},0]}}},E=new x.Sj({nodes:S,marks:j});const C=new(n(22091).A)({html:!0,linkify:!0,breaks:!1,typographer:!1});function A(e){const t=C.render(e??""),n=document.createElement("div");return n.innerHTML=t,x.S4.fromSchema(E).parse(n)}function D(e){let t="";return e.forEach(e=>{if(e.isText){let n=e.marks.some(e=>"code"===e.type.name)?e.text??"":function(e){return e.replace(/([\\`*_[\]<>])/g,"\\$1")}(e.text??"");for(const t of e.marks)switch(t.type.name){case"code":n=`\`${e.text??""}\``;break;case"strong":n=`**${n}**`;break;case"em":n=`*${n}*`;break;case"strike":n=`~~${n}~~`;break;case"link":n=`[${n}](${t.attrs.href}${t.attrs.title?` "${t.attrs.title}"`:""})`}t+=n}else if("image"===e.type.name){const{src:n,alt:r,title:s}=e.attrs;t+=`![${r??""}](${n}${s?` "${s}"`:""})`}else"hard_break"===e.type.name&&(t+=" \n")}),t}function O(e){const t=[];if(e.forEach(e=>{const n=[],r=[];e.forEach(e=>{var t;n.push((t=e.textContent,t.replace(/\|/g,"\\|").replace(/\n/g," ")).trim()),r.push("table_header"===e.type.name)}),t.push({cells:n,header_flags:r})}),0===t.length)return"";const n=Math.max(...t.map(e=>e.cells.length)),r=t[0].header_flags.some(e=>e),s=Array.from({length:n},(e,n)=>Math.max(3,...t.map(e=>N(e.cells[n]??"")))),o=e=>`| ${Array.from({length:n},(t,n)=>{return r=e[n]??"",o=s[n],r+" ".repeat(Math.max(0,o-N(r)));var r,o}).join(" | ")} |`,c=[];if(r){c.push(o(t[0].cells)),c.push(`| ${s.map(e=>"-".repeat(e)).join(" | ")} |`);for(let e=1;e<t.length;e++)c.push(o(t[e].cells))}else{c.push(o(new Array(n).fill(""))),c.push(`| ${s.map(e=>"-".repeat(e)).join(" | ")} |`);for(const e of t)c.push(o(e.cells))}return c.join("\n")}function N(e){let t=0;for(const n of e){const e=n.codePointAt(0)??0;t+=e>=4352&&e<=4447||e>=11904&&e<=42191||e>=44032&&e<=55203||e>=63744&&e<=64255||e>=65072&&e<=65135||e>=65280&&e<=65376||e>=65504&&e<=65510?2:1}return t}function L(e,t=""){switch(e.type.name){case"paragraph":default:return t+D(e);case"heading":return`${t}${"#".repeat(e.attrs.level)} ${D(e)}`;case"blockquote":return R(e,"").split("\n").map(e=>`${t}> ${e}`).join("\n");case"code_block":{const n=e.attrs.language??"";return`${t}\`\`\`${n}\n${e.textContent}\n${t}\`\`\``}case"horizontal_rule":return`${t}---`;case"bullet_list":{const n=[];return e.forEach((e,r,s)=>{n.push(z(e,t,`${t}- `,`${t} `,s))}),n.join("\n")}case"ordered_list":{const n=[],r=e.attrs.order??1;return e.forEach((e,s,o)=>{n.push(z(e,t,`${t}${r+o}. `,`${t} `,o))}),n.join("\n")}case"table":return O(e).split("\n").map(e=>t+e).join("\n")}}function z(e,t,n,r,s){const o=e.attrs.checked,c=null===o?"":o?"[x] ":"[ ] ",a=[];e.forEach((e,t,n)=>{a.push(L(e,0===n?"":r))});const l=a.join("\n").split("\n");return n+c+l[0]+(l.length>1?"\n"+l.slice(1).join("\n"):"")}function R(e,t=""){const n=[];return e.forEach(e=>{n.push(L(e,t))}),n.join("\n\n")}function F(e){return R(e).trim()+"\n"}var G=n(74848);function T(e){const{t}=(0,f.B)(),[n,s]=(0,r.useState)(new Set),o=(0,r.useMemo)(()=>function(e){const t=[],n=[];for(const r of e){const e={...r,children:[]};for(;n.length>0&&n[n.length-1].level>=e.level;)n.pop();0===n.length?t.push(e):n[n.length-1].children.push(e),n.push(e)}return t}(e.items),[e.items]),c=(r,o)=>r.map(r=>{const a=r.children.length>0,l=n.has(r.pos),i=r.pos===e.active_pos;return(0,G.jsxs)("div",{children:[(0,G.jsxs)("div",{className:`md-outline-item md-outline-item--h${r.level}${i?" md-outline-item--active":""}`,style:{paddingLeft:.4+.75*o+"em"},title:r.text,onClick:()=>e.on_click(r),children:[(0,G.jsx)("i",{className:"material-icons md-outline-arrow"+(a?"":" md-outline-arrow--empty"),onClick:a?e=>{return t=r.pos,e.stopPropagation(),void s(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n});var t}:void 0,children:a?l?"arrow_right":"arrow_drop_down":""}),(0,G.jsx)("span",{className:"md-outline-text",children:r.text||t("未命名标题")})]}),a&&!l&&c(r.children,o+1)]},r.pos)});return 0===e.items.length?(0,G.jsxs)("div",{className:"md-outline md-outline--empty",children:[(0,G.jsx)("div",{className:"md-outline-header",children:t("大纲")}),(0,G.jsx)("div",{className:"md-outline-tip",children:t("no_head")})]}):(0,G.jsxs)("div",{className:"md-outline",children:[(0,G.jsx)("div",{className:"md-outline-header",children:t("大纲")}),(0,G.jsx)("div",{className:"md-outline-list",children:c(o,0)})]})}var I=n(19878);const P=new p.hs("md_source_highlight");let W=!1;function q(e){W=e}function V(e,t,n){let r=t;for(const t of e){if("string"==typeof t){r+=t.length;continue}const e=r;Array.isArray(t.children)&&(r=V(t.children,r,n)),t.scope&&n.push({from:e,to:r,cls:`hljs-${t.scope}`})}return r}function B(e,t){const n=e.textContent;if(!n)return[];let r;try{r=I.A.highlight(n,{language:"markdown",ignoreIllegals:!0})}catch{return[]}const s=[],o=r._emitter?.rootNode;o?.children&&V(o.children,0,s);const c=t+1,a=[];for(const e of s){const t=Math.min(e.from,n.length),r=Math.min(e.to,n.length);t>=r||a.push(g.NZ.inline(c+t,c+r,{class:e.cls}))}return a}function H(e){const t=[];return e.descendants((e,n)=>"code_block"!==e.type.name||(t.push(...B(e,n)),!1)),g.zF.create(e,t)}var K=n(38341),J=n(3772);function U(e,t){return new K.fV(e,(e,n,r,s)=>{const o=e.schema.marks[t],c=n[1];if(!o||!c)return null;const a=n[0].indexOf(c);if(a<0)return null;const l=r+a,i=l+c.length,u=e.tr;return u.delete(i,s),u.delete(r,l),u.addMark(r,r+c.length,o.create()),u.removeStoredMark(o),u})}function X(){const e=E;return(0,K.sM)({rules:[(0,K.JJ)(/^(#{1,6})\s$/,e.nodes.heading,e=>({level:e[1].length})),(0,K.JJ)(/^#([1-6])\s$/,e.nodes.heading,e=>({level:Number(e[1])})),(0,K.JJ)(/^```([\w-]*)\s$/,e.nodes.code_block,e=>({language:e[1]??""})),(0,K.tG)(/^\s*>\s$/,e.nodes.blockquote),(0,K.tG)(/^\s*([-+*])\s$/,e.nodes.bullet_list),(0,K.tG)(/^(\d+)\.\s$/,e.nodes.ordered_list,e=>({order:Number(e[1])})),U(/(?:\*\*)([^*]+)(?:\*\*)$/,"strong"),U(/(?:__)([^_]+)(?:__)$/,"strong"),U(/(?<![*])\*([^*]+)\*$/,"em"),U(/(?<![_])_([^_]+)_$/,"em"),U(/(?:~~)([^~]+)(?:~~)$/,"strike"),U(/(?:`)([^`]+)(?:`)$/,"code"),...K.Fr,K.gO]})}const Z=(e,t)=>{const{$from:n,empty:r}=e.selection;if(!r||"paragraph"!==n.parent.type.name)return!1;const s=n.parent.textContent;if(!s.trim())return!1;const o=function(e){const t=e.trim(),n=/^#([1-6])$/.exec(t);if(n)return{type:"heading",attrs:{level:Number(n[1])}};const r=/^(#{1,6})$/.exec(t);if(r)return{type:"heading",attrs:{level:r[1].length}};const s=/^```([\w-]*)$/.exec(t);return s?{type:"code_block",attrs:{language:s[1]??""}}:/^(?:-{3,}|\*{3,}|_{3,})$/.test(t.replace(/\s+/g,""))?{type:"horizontal_rule"}:/^>\s*$/.test(t)?{type:"blockquote"}:/^[-+*]\s*$/.test(t)?{type:"bullet_list"}:/^\d+[.)]?$/.test(t)?{type:"ordered_list"}:null}(s);if(!o)return!1;if("blockquote"===o.type&&n.depth>1)return!1;const c=e.schema.nodes[o.type];if(!c)return!1;const a=n.before(n.depth),l=n.after(n.depth);if(t){const n=e.tr,r=c.createAndFill(o.attrs)??c.create(o.attrs);n.replaceWith(a,l,r),n.scrollIntoView(),t(n)}return!0};function Y(e){return(t,n)=>{const r=t.schema.marks[e];return!!r&&(0,k.wh)(r)(t,n)}}function Q(e,t={}){return(n,r)=>{const s=n.schema.nodes[e];if(!s)return!1;const{$from:o,$to:c}=n.selection,a=o.blockRange(c);if(!a)return!1;const l=o.parent,i=l.type===s&&Object.entries(t).every(([e,t])=>l.attrs[e]===t),u=i?n.schema.nodes.paragraph:s,d=i?{}:t;return r&&r(n.tr.setBlockType(a.start,a.end,u,d)),!0}}const ee=(e,t)=>(0,J.Sd)(e.schema.nodes.bullet_list)(e,t),te=(e,t)=>(0,J.Sd)(e.schema.nodes.ordered_list)(e,t),ne=(e,t)=>{const{blockquote:n}=e.schema.nodes,{$from:r,$to:s}=e.selection,o=r.blockRange(s);if(!o)return!1;if(o.parent.type===n&&o.depth>0){const n=r.before(o.depth),s=e.tr.doc.nodeAt(n);if(s&&1===s.childCount)return t&&t(e.tr.replaceWith(n,n+s.nodeSize,s.child(0)).scrollIntoView()),!0;if(t){const n=e.tr,s=r.parent,c=r.after(o.depth);n.delete(o.start,o.end),n.insert(c,s),t(n.scrollIntoView())}return!0}return t&&t(e.tr.wrap(o,[{type:n}]).scrollIntoView()),!0},re={sink:(0,J.$B)(E.nodes.list_item),lift:(0,J.T2)(E.nodes.list_item),split:(0,J.wn)(E.nodes.list_item),wrap_bullet:ee,wrap_ordered:te};n(41631),n(50576),n(70432);function se(e){return 0===e?Q("paragraph"):Q("heading",{level:e})}function oe(e){return!(!e.ctrlKey&&!e.metaKey)}function ce(e,t){return(0,w.D8)(1)(e,t)}function ae(e){if(1!==e.childCount)return!1;const t=e.firstChild;return!!t&&"code_block"===t.type.name&&"markdown"===t.attrs.language}const le=r.forwardRef(function(e,t){const n=(0,r.useRef)(null),s=(0,r.useRef)(null),o=(0,r.useRef)(e.on_change),c=(0,r.useRef)(e.on_save),a=(0,r.useRef)(e.on_selection_change),l=(0,r.useRef)(e.on_source_mode_change);return(0,r.useEffect)(()=>{o.current=e.on_change,c.current=e.on_save,a.current=e.on_selection_change,l.current=e.on_source_mode_change}),(0,r.useEffect)(()=>{if(!n.current)return;const r=p.$t.create({doc:A(e.value??""),plugins:[(0,_.b6)(),new p.k_({key:P,state:{init:(e,t)=>g.zF.empty,apply:(e,t,n,r)=>W?e.docChanged?H(r.doc):P.getState(r)??g.zF.empty:g.zF.empty},props:{decorations(e){if(!W)return null;const t=P.getState(e);return t&&t.find().length?t:H(e.doc)}}}),X(),(0,v.w)({"Mod-z":_.tN,"Mod-y":_.ZS,"Mod-Shift-z":_.ZS,"Mod-b":Y("strong"),"Mod-i":Y("em"),"Mod-Shift-x":Y("strike"),"Mod-`":Y("code"),"Mod-1":(e,t)=>se(1)(e,t),"Mod-2":(e,t)=>se(2)(e,t),"Mod-3":(e,t)=>se(3)(e,t),"Mod-0":(e,t)=>se(0)(e,t),"Mod-Shift-8":ee,"Mod-Shift-9":te,"Mod-Shift-.":ne,Tab:re.sink,"Shift-Tab":re.lift,"Mod-Enter":ce,"Mod-s":()=>(c.current?.(),!0)}),(0,w.LF)({allowTableNodeSelection:!0}),(0,w.AL)(),(0,y.A)({color:"var(--primary, #1a73e8)",width:2}),(0,b.z)(),(0,v.w)({Enter:(0,k.st)(Z,k.pC,re.split,k.Z1,k.iz,k.aw),"Shift-Enter":(e,t)=>{const{hard_break:n}=e.schema.nodes;return t&&t(e.tr.replaceSelectionWith(n.create()).scrollIntoView()),!0},"Mod-Enter":k.I$}),(0,v.w)(k.RV)]}),i=new g.Lz(n.current,{state:r,editable:()=>!1!==e.editable,handleClickOn(e,t,n,r,s){if(!oe(s))return!1;const o=function(e){if(!(e instanceof Element))return null;const t=e.closest("a[href]"),n=t?.getAttribute("href");return n||null}(s.target)??function(e,t){const n=e.doc.content.size,r=Math.max(0,Math.min(t,n));let s;try{s=e.doc.resolve(r)}catch{return null}for(const t of[1,-1]){const s=1===t?r:r-1;if(!(s<0||s>=n))try{const t=e.doc.resolve(s).marks().find(e=>"link"===e.type.name);if(t?.attrs?.href)return t.attrs.href}catch{}}try{const e=s.parent.marks.find(e=>"link"===e.type.name);if(e?.attrs?.href)return e.attrs.href}catch{}return null}(e.state,t);return!!o&&(window.open(o,"_blank","noopener,noreferrer"),!0)},handleDOMEvents:{keydown:(e,t)=>{if(oe(t)&&e.dom.classList.add("md-ctrl-down"),ae(e.state.doc)&&"Enter"===t.key&&!t.ctrlKey&&!t.metaKey&&!t.altKey){t.preventDefault();const{from:n,to:r}=e.state.selection;return e.dispatch(e.state.tr.insertText("\n",n,r).scrollIntoView()),!0}return!1},keyup:(e,t)=>(oe(t)||e.dom.classList.remove("md-ctrl-down"),!1),blur:e=>(e.dom.classList.remove("md-ctrl-down"),!1),beforeinput:(e,t)=>{if(!ae(e.state.doc))return!1;const n=t;if("insertText"!==n.inputType)return!1;const r=n.data;if(null==r)return!1;n.preventDefault();const{from:s,to:o}=e.state.selection;return e.dispatch(e.state.tr.insertText(r.replace(/\r\n?/g,"\n"),s,o).scrollIntoView()),!0}},dispatchTransaction(e){const t=i.state.apply(e);i.updateState(t);const n=ae(t.doc);q(n),n?i.dom.classList.add("md-source-mode"):i.dom.classList.remove("md-source-mode"),n!==ae(e.before)&&l.current?.(n),e.docChanged&&o.current?.(n?t.doc.textContent:F(t.doc)),(e.selectionSet||e.docChanged)&&a.current?.()},attributes:{class:"md-wysiwyg-content",spellcheck:"false"}});if(s.current=i,e.initial_source_mode&&!ae(i.state.doc)){const e=F(i.state.doc),t=i.state.schema.nodes.code_block.create({language:"markdown"},e?i.state.schema.text(e):null),n=i.state.tr;n.replaceWith(0,i.state.doc.content.size,t),n.setMeta("addToHistory",!1),i.dispatch(n)}const u={get_markdown:()=>ae(i.state.doc)?i.state.doc.textContent:F(i.state.doc),set_markdown:e=>{const t=A(e);i.dispatch(i.state.tr.replaceWith(0,i.state.doc.content.size,t.content))},focus:()=>i.focus(),get_view:()=>s.current,in_table:()=>function(e){const{$from:t}=e.selection;for(let e=t.depth;e>0;e--){if("table"===t.node(e).type.name)return!0}return!1}(i.state),active_marks:()=>(i.state.storedMarks??i.state.selection.$from.marks()).map(e=>e.type.name),active_block:()=>{const{$from:e}=i.state.selection;for(let t=e.depth;t>0;t--){const n=e.node(t);if("heading"===n.type.name)return{name:"heading",level:n.attrs.level};if("paragraph"===n.type.name)return{name:"paragraph"}}return{name:"paragraph"}},insert_table:(e=3,t=3)=>{const n=function(e,t,n){const r=(0,w.e)(e),s=r.table,o=r.row,c=r.cell,a=r.header_cell??r.cell;if(!s||!o||!c)return null;const l=e=>o.create(null,Array.from({length:t},()=>e.createAndFill())),i=l(a),u=Array.from({length:n},()=>l(c));return s.create(null,[i,...u])}(i.state.schema,e,t);if(!n)return;const{from:r}=i.state.selection,s=i.state.doc.resolve(r);let o=r;for(let e=s.depth;e>0;e--)if("table"===s.node(e).type.name){o=s.after(e);break}const c=i.state.tr;o===r?c.replaceSelectionWith(n):c.insert(o,n),i.dispatch(c.scrollIntoView());const a=i.state.doc.resolve(Math.min(o+3,i.state.doc.content.size));try{i.dispatch(i.state.tr.setSelection(i.state.selection.constructor.near(a)))}catch{}},get_headings:()=>function(e){const t=[];return e.doc.descendants((e,n)=>("heading"!==e.type.name||t.push({level:e.attrs.level,text:e.textContent,pos:n}),!0)),t}(i.state),scroll_to_pos:e=>{const t=i.state.doc.content.size,n=Math.max(0,Math.min(e,t)),r=i.state.doc.nodeAt(n);let s;try{s=r?p.U3.near(i.state.doc.resolve(n+1),1):p.U3.near(i.state.doc.resolve(n),1)}catch{s=p.U3.near(i.state.doc.resolve(0),1)}i.dispatch(i.state.tr.setSelection(s).scrollIntoView()),i.focus()},is_source_mode:()=>ae(i.state.doc),enter_source_mode:()=>{if(ae(i.state.doc))return;const e=F(i.state.doc),t=i.state.schema.nodes.code_block.create({language:"markdown"},e?i.state.schema.text(e):null),n=i.state.tr;n.replaceWith(0,i.state.doc.content.size,t),q(!0),i.dispatch(n),i.dom.classList.add("md-source-mode")},exit_source_mode:()=>{if(!ae(i.state.doc))return;const e=A(i.state.doc.textContent),t=i.state.tr;t.replaceWith(0,i.state.doc.content.size,e.content),q(!1),i.dispatch(t),i.dom.classList.remove("md-source-mode")}};return"function"==typeof t?t(u):t&&(t.current=u),e.on_ready?.(u),()=>{i.destroy(),s.current=null}},[]),(0,G.jsx)("div",{className:"md-wysiwyg",ref:n})});function ie(e){const{t}=(0,f.B)(),n=(0,r.useRef)(null),[s,o]=(0,r.useState)({marks:[],block:{name:"paragraph"}}),[c,a]=(0,r.useState)(null),l=(0,r.useCallback)(()=>{const t=e.get_view();if(!t)return;const n=t.state.selection,r=t.state.storedMarks??n.$from.marks();if(o({marks:r.map(e=>e.type.name),block:ue(n.$from)}),n.empty)return void a(null);const s=t.coordsAtPos(n.from),c=t.coordsAtPos(n.to),l=(Math.min(s.left,c.left)+Math.max(s.right,c.right))/2,i=Math.min(s.top,c.top),u=Math.max(s.bottom,c.bottom);a({top:i,bottom:u,left:l})},[e.get_view]);(0,r.useEffect)(()=>{l();const t=e.get_view();if(!t)return;const n=()=>l();t.dom.addEventListener("keyup",n),t.dom.addEventListener("mouseup",n),document.addEventListener("selectionchange",n);const r=t.dom.closest(".md-editor-context");return r?.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n),()=>{t.dom.removeEventListener("keyup",n),t.dom.removeEventListener("mouseup",n),document.removeEventListener("selectionchange",n),r?.removeEventListener("scroll",n),window.removeEventListener("resize",n)}},[l,e.get_view,e.refresh_key]);const i=t=>{const n=e.get_view();n&&(t(n.state,n.dispatch),n.focus(),l())},u=e=>s.marks.includes(e),d=e=>"heading"===s.block.name&&s.block.level===e,[m,h]=(0,r.useState)({w:0,h:36});if((0,r.useLayoutEffect)(()=>{if(!c||!n.current)return;const e=n.current.offsetWidth,t=n.current.offsetHeight;h(n=>n.w===e&&n.h===t?n:{w:e,h:t})},[c,e.refresh_key]),!c)return null;const p=(e,n,r,s,o=!1)=>(0,G.jsx)("button",{className:"mdtb__btn"+(o?" mdtb__btn--on":""),title:t(r),onMouseDown:e=>e.preventDefault(),onClick:s,children:n},e),g=m.w/2,_=g+4,v=Math.max(_,window.innerWidth-g-4),k=document.querySelector(".header")?.getBoundingClientRect().bottom??0,y=c.top-m.h-8,b=y<k+4,w={top:b?Math.min(c.bottom+8,window.innerHeight-m.h-4):y,left:Math.min(v,Math.max(_,c.left))};return(0,G.jsxs)("div",{className:"mdtb mdtb--floating"+(b?" mdtb--below":""),ref:n,style:w,children:[p("h1","H1","一级标题",()=>i(Q("heading",{level:1})),d(1)),p("h2","H2","二级标题",()=>i(Q("heading",{level:2})),d(2)),p("h3","H3","三级标题",()=>i(Q("heading",{level:3})),d(3)),(0,G.jsx)("span",{className:"mdtb__sep"}),p("b","B","加粗",()=>i(Y("strong")),u("strong")),p("i","I","斜体",()=>i(Y("em")),u("em")),p("s","S","删除线",()=>i(Y("strike")),u("strike")),p("code","</>","行内代码",()=>i(Y("code")),u("code")),(0,G.jsx)("span",{className:"mdtb__sep"}),p("ul","≔","无序列表",()=>i(ee)),p("ol","1.","有序列表",()=>i(te)),p("quote","❝","引用",()=>i(ne))]})}function ue(e){for(let t=e.depth;t>0;t--){const n=e.node(t).type.name;if("heading"===n)return{name:"heading",level:e.node(t).attrs.level};if("paragraph"===n)return{name:"paragraph"}}return{name:"paragraph"}}var de=n(75725);const me="cut",he="copy",fe="paste",pe="strong",ge="em",_e="strike",ve="code",ke="h1",ye="h2",be="h3",we="paragraph",xe="bullet",Me="ordered",$e="quote",Se="code_block",je="clean",Ee="row_before",Ce="row_after",Ae="row_delete",De="col_before",Oe="col_after",Ne="col_delete",Le="header_toggle",ze="cell_merge",Re="cell_split",Fe="table_delete",Ge="table_insert",Te="select_all";function Ie(e){const{t}=(0,f.B)(),[n,s]=(0,r.useState)(null),o=(0,r.useRef)(e.get_view);o.current=e.get_view,(0,r.useEffect)(()=>{const e=e=>{const t=o.current();if(!t)return;const n=e.target;if(!n||!n.closest(".md-wysiwyg-content"))return;e.preventDefault();const r=t.posAtCoords({left:e.clientX,top:e.clientY});if(r){const e=t.state.selection;if(r.pos<e.from||r.pos>e.to){const{TextSelection:e}=t.state.selection.constructor;try{t.dispatch(t.state.tr.setSelection(e.near(t.state.doc.resolve(r.pos))))}catch{}}}const c=!!n.closest("td, th");s({x:e.clientX,y:e.clientY,in_table:c||(0,w.aH)(t.state)})};return document.addEventListener("contextmenu",e,!0),()=>document.removeEventListener("contextmenu",e,!0)},[]);const c=()=>s(null),a=(0,r.useCallback)(e=>{const t=o.current();t&&(e(t.state,t.dispatch),t.focus(),c())},[]),l=e=>{const t=o.current();t?.focus(),document.execCommand(e),c()};if(!n)return null;const i=n.in_table?[{r:t("上方插入行"),v:Ee},{r:t("下方插入行"),v:Ce},{r:t("左侧插入列"),v:De},{r:t("右侧插入列"),v:Oe},{r:t("删除行"),v:Ae},{r:t("删除列"),v:Ne},{r:t("切换表头行"),v:Le},{r:t("合并单元格"),v:ze},{r:t("拆分单元格"),v:Re},{r:t("删除表格"),v:Fe}]:[],u=[{r:t("剪切"),v:me},{r:t("复制"),v:he},{r:t("粘贴"),v:fe},{r:t("格式"),v:"format",items:[{r:t("加粗"),v:pe},{r:t("斜体"),v:ge},{r:t("删除线"),v:_e},{r:t("行内代码"),v:ve}]},{r:t("段落"),v:"block",items:[{r:t("一级标题"),v:ke},{r:t("二级标题"),v:ye},{r:t("三级标题"),v:be},{r:t("正文"),v:we}]},{r:t("插入"),v:"insert",items:[{r:t("无序列表"),v:xe},{r:t("有序列表"),v:Me},{r:t("引用"),v:$e},{r:t("代码块"),v:Se},{r:t("插入表格"),v:Ge}]},...i.length?[{r:t("表格"),v:"table",items:i}]:[],{r:t("清除格式"),v:je},{r:t("全选"),v:Te}];return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(de.rY,{click:c}),(0,G.jsx)(de.Pu,{x:n.x,y:n.y,items:u,click:t=>{switch(t){case me:return l("cut");case he:return l("copy");case fe:return l("paste");case pe:return a(Y("strong"));case ge:return a(Y("em"));case _e:return a(Y("strike"));case ve:return a(Y("code"));case ke:return a(Q("heading",{level:1}));case ye:return a(Q("heading",{level:2}));case be:return a(Q("heading",{level:3}));case we:return a(Q("paragraph"));case xe:return a(ee);case Me:return a(te);case $e:return a(ne);case Se:return a(Q("code_block"));case Ge:return c(),void e.on_insert_table?.();case Ee:return a(w.JD);case Ce:return a(w.gC);case De:return a(w.RC);case Oe:return a(w.GU);case Ae:return a(w.aR);case Ne:return a(w.gR);case Le:return a(w.uC);case ze:return a(w.w7);case Re:return a(w.L0);case Fe:return a(w.kG);case je:return a((e,t)=>{const{from:n,to:r}=e.selection;let s=e.tr;return e.doc.nodesBetween(n,r,(e,t)=>{if(e.isText)for(const n of e.marks)s=s.removeMark(t,t+e.nodeSize,n.type)}),t?.(s),!0});case Te:return a((e,t)=>{const{TextSelection:n}=e.selection.constructor;return t?.(e.tr.setSelection(n.create(e.doc,0,e.doc.content.size))),!0})}}})]})}function Pe(e){const t=[];if(!e)return t;const n=e.split(/(\n)/);let r=null,s=0;for(let e=0;e<n.length;e+=2){const o=n[e],c=s;s+=o.length+(n[e+1]?.length??0);const a=o.endsWith("\r")?o.slice(0,-1):o,l=a.trimStart(),i=/^(`{3,}|~{3,})/.exec(l);if(i){const e=i[1][0];null===r?r=e:r===e&&(r=null);continue}if(null!==r)continue;const u=/^ {0,3}(#{1,6})\s+(.*)$/.exec(a);if(!u)continue;const d=u[1].length,m=u[2].replace(/\s+#+\s*$/,"").trim();t.push({level:d,text:m,pos:c})}return t}var We=n(69918),qe=n(2543),Ve=n(86090),Be=n(87361);function He(){const{t:e}=(0,f.B)(),t=(0,Ve.Zp)(),{check_user_auth:n}=(0,c.MH)(),p=n(a.oV.md_editor_setting),[g,_]=(0,s.fp)(o.AG.md_editor),[v,k]=(0,r.useState)(null),[y,b]=(0,r.useState)(!1),[w,x]=(0,r.useState)(!1),[M,$]=(0,r.useState)(0),S=(0,r.useRef)(null),[j,E]=(0,r.useState)([]),[C,A]=(0,r.useState)(-1),[D,O]=(0,r.useState)(15),[N,L]=(0,r.useState)(!1),z=(0,r.useRef)(null),R=(0,r.useRef)(null),[F,I]=(0,s.fp)(o.AG.md_editor_show_outline),[P,W]=(0,s.fp)(o.AG.md_editor_mode),q=(0,r.useCallback)(()=>{const e="wysiwyg"===P?"source":"wysiwyg",t=S.current;t&&("source"===e?t.enter_source_mode():t.exit_source_mode(),W(e))},[P]),[V,B]=(0,r.useState)(We.FG),H=(0,r.useRef)(null);(0,r.useEffect)(()=>{let e=!1;return(0,We.gC)().then(t=>{e||B(t)}),()=>{e=!0}},[]),(0,r.useEffect)(()=>{(0,We.Ce)(H.current,V)},[V]);const K=(0,r.useRef)([]),J=(0,r.useCallback)(()=>{const e=S.current;if(!e)return;const t=e.is_source_mode()?Pe(e.get_markdown()):e.get_headings();K.current=t,E(t)},[]),U=(0,r.useCallback)(()=>{const e=S.current,t=e?.get_view();if(!e||!t)return;const n=e.is_source_mode()?t.state.selection.from-1:t.state.selection.from;let r=-1;for(const e of K.current){if(!(e.pos<=n))break;r=e.pos}A(r)},[]);(0,r.useEffect)(()=>{let t=!1;if(g?.url)return x(!1),b(!0),h.l.get(g.url).then(e=>{if(t)return;k(e??"")}).catch(()=>{t||((0,u.zN)(e("打开失败")),k(""))}).finally(()=>{t||b(!1)}),()=>{t=!0};k(null)},[g?.url]),(0,r.useEffect)(()=>{const e=()=>$(e=>e+1);return document.addEventListener("selectionchange",e),()=>document.removeEventListener("selectionchange",e)},[]);const X=(0,r.useRef)(q);X.current=q,(0,r.useEffect)(()=>{const e=e=>{(e.ctrlKey||e.metaKey)&&"/"===e.key&&(e.preventDefault(),e.stopPropagation(),X.current())};return document.addEventListener("keydown",e,!0),()=>document.removeEventListener("keydown",e,!0)},[]),(0,r.useEffect)(()=>{J(),U()},[M,P,J,U]);const Z=(0,r.useCallback)(qe.throttle(e=>{if(!z.current||!R.current)return;const t=parseFloat(getComputedStyle(z.current).fontSize),n=e.clientX/t,r=window.innerWidth/t-4,s=2.25+R.current.offsetWidth/t;n<=r&&n>=s&&O(parseFloat(n.toFixed(2)))},32),[]),Y=()=>{L(!1),z.current?.removeEventListener("pointermove",Z)},Q=async()=>{if(!g?.name||!g?.path)return;const t=S.current?.get_markdown();if(void 0===t)return;const n=g.path.slice(0,g.path.length-g.name.length),r=`${encodeURIComponent(n)}${g.name}`;(await m.$M.post(`save/${r}`,{context:t})).code===d.m.Success?(x(!1),(0,u.SK)(e("保存成功"))):(0,u.zN)(e("保存失败"))},ee=(0,r.useRef)(Q);ee.current=Q;const te=()=>{_({}),x(!1),k(null),S.current=null,g?.close?.()},ne=(0,r.useMemo)(()=>g?.url??"md_editor",[g?.url]);return g?.name?(0,G.jsxs)("div",{id:"md-editor-container",ref:H,children:[(0,G.jsx)(i.A,{ignore_tags:!0,left_children:[(0,G.jsx)(l.rA,{title:e("关闭"),icon:"close",onClick:te},1),(0,G.jsx)("div",{className:"md-editor-title",children:g.name},3),...w?[(0,G.jsx)(l.rA,{title:e("保存"),icon:"save",onClick:Q},2)]:[],(0,G.jsx)(l.rA,{title:e("大纲"),icon:"list",onClick:()=>I(e=>!e),selected:F},4),(0,G.jsx)(l.rA,{title:e("wysiwyg"===P?"源码模式":"实时编辑模式"),icon:"wysiwyg"===P?"code":"edit",onClick:q},5),...p?[(0,G.jsx)(l.rA,{title:e("编辑器设置"),icon:"settings",onClick:()=>{te(),t(Be.o.md_editor_setting_page)}},6)]:[]]}),(0,G.jsxs)("div",{className:"md-editor-context",ref:z,children:[y&&(0,G.jsxs)("div",{className:"common-box common-box-center",children:[e("加载中"),"..."]}),!y&&null!==v&&(0,G.jsxs)(r.Fragment,{children:[F&&(0,G.jsx)("div",{className:"md-outline-panel",style:{width:`${D}em`},children:(0,G.jsx)(T,{items:j,active_pos:C,on_click:e=>{const t=S.current;t&&(t.scroll_to_pos(t.is_source_mode()?e.pos+1:e.pos),A(e.pos))}})}),F&&(0,G.jsx)("div",{className:"md-editor-divider",ref:R,onPointerDown:()=>{L(!0),z.current?.addEventListener("pointermove",Z)},onPointerUp:Y}),N&&(0,G.jsx)("div",{className:"md-editor-drag-overlay",onPointerUp:Y}),(0,G.jsx)("div",{className:"md-editor-scroll",children:(0,G.jsxs)("div",{className:"md-editor-sheet",children:["wysiwyg"===P&&(0,G.jsx)(ie,{get_view:()=>S.current?.get_view()??null,refresh_key:M}),(0,G.jsx)(le,{value:v,ref:S,initial_source_mode:"source"===P,on_ready:e=>{const t=e.is_source_mode()?Pe(e.get_markdown()):e.get_headings();K.current=t,E(t),A(-1)},on_change:()=>{w||x(!0)},on_save:()=>ee.current(),on_selection_change:()=>$(e=>e+1),on_source_mode_change:e=>{W(e?"source":"wysiwyg"),$(e=>e+1)}},ne),"wysiwyg"===P&&(0,G.jsx)(Ie,{get_view:()=>S.current?.get_view()??null,on_insert_table:()=>{S.current?.insert_table(3,3),x(!0)}})]})})]})]})]}):null}},69918(e,t,n){n.d(t,{Ce:()=>l,FG:()=>r.FG,fy:()=>a,gC:()=>c});var r=n(18840),s=n(14284),o=n(53459);async function c(){try{const e=await s.XO.get("md_editor_setting/get");return{...r.FG,...e?.data??{}}}catch(e){return{...r.FG}}}async function a(e){const t=await s.XO.post("md_editor_setting/save",e);return t?.code!==o.m.Success?null:{...r.FG,...t.data??e}}function l(e,t){e&&(e.style.setProperty("--md-editor-max-width",t.content_max_width),e.style.setProperty("--md-editor-padding",t.content_padding),e.style.setProperty("--md-editor-font-size",t.font_size),e.style.setProperty("--md-editor-line-height",t.line_height))}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[7759],{45601(A,e,s){"use strict";s.r(e),s.d(e,{default:()=>G});var a=s(96540),t=s(86149),c=s(34843),d=s(82893),l=s(14944),o=s(92275),r=s(14284),Y=s(53459),i=s(61443),n=s(85997),p=s(83029),B=s(4412),j=(s(82341),s(7003)),h=s(18257),S=s.n(h),u=s(76559),f=s(62042),x=s(74777),y=s(78247),m=s(23430),z=s(74848);let N;function G(){const{t:A}=(0,t.B)(),[e,s]=(0,a.useState)(void 0),[h,G]=(0,a.useState)(!1),[P,k]=(0,c.fp)(d.AG.user_base_info),{check_user_auth:H}=(0,y.MH)(),g=(0,a.useRef)(null),w=(0,a.useRef)(null);(0,a.useEffect)(()=>()=>{N&&(N.pause(),N.unload(),N.detachMediaElement(),N.destroy(),N=null),w.current&&w.current.dispose()},[]);const L=s=>{G(!0),(async e=>{P.sysSoftWare&&P.sysSoftWare[x.jk.ffmpeg]&&P.sysSoftWare[x.jk.ffmpeg].installed?(w.current=(0,j.default)(g.current,{controls:!0,width:640,height:360}),S().isSupported()?(N=S().createPlayer({type:"flv",url:u.I.getOtherWebSocketUrl(o.HK.rtsp_get,{url:e}),isLive:!0}),N.attachMediaElement(g.current),N.load(),N.load()):(0,f.zN)("FLV.js is not supported in this browser.")):(0,f.zN)(A("ff_none"))})(s.address?s.address:e)};return(0,z.jsxs)("div",{children:[(0,z.jsxs)(B.aZ,{position:"right",children:[(0,z.jsx)(i.$Z,{max_width:"40rem",placeholder:A(" rtsp://username:password@ip:port/path"),icon:"link",value:e,handleInputChange:A=>s(A)}),!h&&(0,z.jsx)(n.rA,{icon:"play_arrow",title:A("连接"),onClick:L}),h&&(0,z.jsx)(n.rA,{icon:"close",title:A("关闭"),onClick:async()=>{await l.ws.sendData(o.HK.rdp_disconnect,""),G(!1)}})]}),!h&&(0,z.jsx)(p.N,{have_auth_edit:H(m.oV.rtsp_proxy_tag_update),getItems:async()=>{const A=await r.K4.get("tag");return A.code===Y.m.Success?A.data:[]},save:async A=>{(await r.K4.post("tag/save",A)).code!==Y.m.Success&&(0,f.zN)("网络错误")},clickItem:async A=>{s(A.address),L(A)},items:[{key:"name",preName:A("名字")},{key:"address",preName:A("地址")},{key:"color",preName:"color"}]}),(0,z.jsx)("canvas",{id:"rdpwebview",style:{display:"none"}}),(0,z.jsx)("div",{style:{display:h?"block":"none"},children:(0,z.jsx)("video",{ref:g,className:"video-js vjs-default-skin"})})]})}},17422(A){"use strict";A.exports="data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAABTsAAsAAAAAIpAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAPgAAAFZRiV32Y21hcAAAAYQAAAEJAAAD5p42+VxnbHlmAAACkAAADtIAABckI4l972hlYWQAABFkAAAAKwAAADYsvIjpaGhlYQAAEZAAAAAdAAAAJA+RCL1obXR4AAARsAAAABcAAAC8Q2YAAGxvY2EAABHIAAAAYAAAAGB7CIGGbWF4cAAAEigAAAAfAAAAIAFAAI9uYW1lAAASSAAAASUAAAIK1cf1oHBvc3QAABNwAAABfAAAAnXdFqh1eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGR7yDiBgZWBgaWQ5RkDA8MvCM0cwxDOeI6BgYmBlZkBKwhIc01hcPjI+FGPHcRdyA4RZgQRADaGCyYAAHic7dPXbcMwAEXRK1vuvffem749XAbKV3bjBA6fXsaIgMMLEWoQJaAEFKNnlELyQ4K27zib5PNF6vl8yld+TKr5kH0+cUw0xv00Hwvx2DResUyFKrV4XoMmLdp06NKjz4AhI8ZMmDJjzoIlK9Zs2LJjz4EjJ85cuHLjziPe/0UWL17mf2tqKLz/9jK9f8tXpGCoRdPKhtS0RqFkWvVQNtSKoVYNtWaoddPXEBqG2jQ9XWgZattQO4baNdSeofYNdWCoQ0MdGerYUCeGOjXUmaHODXVhqEtDXRnq2lA3hro11J2h7g31YKhHQz0Z6tlQL4Z6NdSbod4N9WGoT9MfHF6GmhnZLxyDcRMAAAB4nJ1YC1hU17U+a5/HMA4iA3NmVBDmoQwP5TFnHlFeA4gYiUFRQINoSCBAyK3G2yi+0aipYtFcHYo2xsb4NiY3+VrNxSaX5uvt495ozNdoYoxmem2/L8HGpLc+InB279pnhlGr5mvL4eyz99nrrL32eu1/DQcc/okdYgdHOA6MQKp4r9gx0EcMHMezOalVasW5BM7NcXoSb9fFgE6KtSSBxWz1FYDPG+vMBGcKb9cebu2VS5s2aaTkCvRSf6C7Y+Ppibm5E09v7IDs2/3uZQtbD0zIyppwoHXh/93ukmyYgdePNRp65p5v+3v/9otQl2O7wP34cT88p8Md2YxpYLQZoRcy6FlSBRnwnGAe6BPMSCZo+7NJVqS0cE4uHendzhSnbPH6TDqL1+Nme5LZXkCHnGyoH0kne30WH+gswhm3q+pt/mTas9NLS64GnjmSlTPw0wVQT/ewRaBgxtydy3cuUB9/6SW+vb5yRvr+t0eOfPKJZ/9t3+4tL7xj32Xd3thCxi+ge6ifdsAN+l5+wi5HQ/cCoeull1AszS7CUfEcJzK7sKWJAdJhCd0sPM4+EY7QDm5ov08hXRQXE5bf6PV5Q5+IjW7X7Nku92Ask4l2hCRRD6TPqISiCJeQna3SCFwrhrNzXHzo4yFevBwxpzxk8WCIIfkvVEKVy32SbT8n68gzgaslpaiO2zIGIyuSb7RNf9HSuN26y/7OC1tgEmpiyA6aD4qcgTOiLThwGG0eB694FI8NHLLN6OBlRVaMxNAFS4JdXUG6mW8PwpKuYLCLXKGbu8iwYNdgO06Sn3Th+/vyZAxs8Ro30DjHe9gy8Fywi24OMm7Qyzh3MTZVOMYhLBnoC+J79lpTUyQmorjhnMwlcQ5uPEYGpDjsOkkH49BjQLQBqs3jFtFdJNlksYmoQFDArLh8Xh+Qd6Ghcsb6FUuehDi+U/lqD71K/qiegeV1imcwjl7ExwiSrf4BZyCujV6cVcFo6VX+G9IcPyFjJnUufbU/jzrL1X99as36reXl8K32nFaOr+E8jWJEcJ55DpMVfSMe95/AJaOsGBH2GJCNpiRQbK4C8BjdmQA22QY2j03Em13i2YHqtNLU1NI04Yj2HJgA6fQc6VPNpA/D+Ryks554NnVy2mB72uRUfPLsqR4N0LOBQKArwJYO+5W2fgZX8oC1HR6HjNaQTVIG2FPwnTcXXGZZfNB7TE6pTKZUwaw91XWLAoFFGcnB5PHjsckgBjbWutrL+0h5Y1xw3DRGDumsnXb3MJwXrJIN5U7m0rgJ3yG5w4he5ckFG4pmNEkOm0/xOO4r4yL87wqtQM+hiJIVp+6iG2wPBKD35ElGkDx+UfC2v1mFG1o+M3AjNFty8biKMXwzyxnZLds8wYD2BxmCPHAldPOeLsy/0BugftYhVYFAhO8SqQ0j3oK7dHJZnI/jxmUS4onlxskSF8thmvNZjIrRZwEPxr0lBuLRuz3oy/FOHCsxwOPYh2M+e9u3J5pgPYz9gp6G7C9m0A11F9ddqKMfV+4sbq45/YspOysXvT+3pdFdYNg2fHbW8Dz301MqDVuGrz0Fuh0YMW8mddrpqzST7rV9BcvqPoNvadRndWp0p8HvbiqrFj5yFQ/vNFSXDpxpLEFWp+DcrF3FT1afWshFcmCfeAMjEvO65i0Y6XijQfSRPWx3TV/Df7Km3E1l+kLt56s/rwVzuRusNMhudznkwdLaS+QNdeal2jDPP4l9qHc98vTYZOSkxzD+njBWVWjFPKgipx6DkWvXQiW8OYcewVHE5yukinDMcfGgc0opDltYKDxIGBedkzc6jSfE7tlvESCDFUw0Hx0opS+U0lHCxNottbNWSxX9zZVvEhKWUSyBpaXwBc2a98M6UqPeXAs/GDon8Ax7hsthO8cM5HU7Ad0UvRR9lHmtyQKZ4MAe814X5h9MSUkQmhf96eVJ6p90OjIiqSIjvykvr2l5U55O/fPQKD+jIomYpNyGJQ25uQ2kIikRfAmuBHCPsWqkSDEqgZ5KDI2sifS/R43MbZg0idFHbCPNxXxZws1ACVE6hAhOdJwRkJLFBLPZpRGYJ50pko6XzMkgmSx40ljik6AQcKhFnLcQE6rF7PXFe1Ocoj0T3AXgSgJTDIhHRfHlYZKuSzc6uievOJGXY+i5GJkkTp7UM3y0LqATDbtFcbdBxO7o4T25JYlEjoH0uynUh8rapkxp62QN70svSF+hT4gGPlovlmcm/ComLi7mV4kTykV9NFWjE/QrwgQ4uIcAP0rQF4VZYRP2o3PhHHzfPMJj9Ir+uzKUlrH49ntT18AVvj1sc3YGjUT/Mt2Dxawa8ArcA7bCQIpvfwAYu22vEG/No/5RvPdA7g+AelLrPwzy+LtkLPhnpIxH14m4EYq8eeMHbPEPNm6G7Nv9B4jcFPZ8bJj0SEjP3MPgQdKTqqEoy2v6G32P/Y6dxOv04AxnoAeq+GILvUavtYCBXm+BaIhuodcfrN5B/V2EYMCPh+SxavjGyPwV0x4CJgUPGT0mQaODGBACIJZGsMXwAD0LGXx7l3CdAcKMIKI+f5CepWeD0BvyU/GcdBxPF8SwejC6LGZmAURFdsSWKR5HyHld2kbdIZO1Ixx+bnnzU7n5+blPNV9jnUDWhP2tC68tbN3PVIldsQPxSAcSpjOav7Q05uXn5zW2LLvDXn9B6syscPy9iDLEMmSrJz6nYuWMipukjM0AH8JkGS+XFyMRkzSCH7KD/hwm172SAyZYumHlefr5AddrtA0O0TnwaVZxcRY9Bfukn9Gf05N1r9DV9MoBsJ1f+ZrqUvtPHizJAntWybv7hmqLt6QLuK6ZS9Fqi1jO5rDoWPZXXII5Tgajg53cIXCjDCGIcYrRIY2n6+mXOa/W0bdhau3ryiEYe2FV/5oeaIYK/5w5frCyll6/cYO8DiNhw6t1MBWmznt91QX62UF1N7l0eHBZTRGpKaqpKVIPF9UcIzmReud9TSY75+K899GHbBu6wjoR7RKKZVYiYxSPf5/2wJT5e3NAhmUbVn5KLx1Ujg0+BGvpAIh0DezInTkzF37KVocxrKU3r1+XLtAe2lO3l66kfQfB/unKY+q8N375Ru8bc4pJXfEcESU95q+p8ZNZRTWH1d9FzvUdYXk5rLkcdkEisoKKVHQW/b3GEx6tPaYcoJfOr9wAbSBnv1IHpep0OExr4LPMkpJM+j7sly7UHkOzXjoAZljHCGiyegtNlwljM0v+c19ET9Pvst09a2Mtgcf5/ZSzYO5h1156+eyydfAsxGa9XAuF6vzjh6CssLq6ECysperXX0sX5h5ZdpZe3guxsGIPEtHk/aqXX1hVqP5HYVVVISkrrNqvXorIc+5Ou91Hnr/LcD2afi6eX7UBloOcs7cOpqgGaNfs1g7bNbs9z6wASaylN69d0/TFTIz6Ws8+oGV3mE2612wRTHKcVUbhjKadebloMc+dyXgMVtVK6BwMB/+mVW09igdRBWaRtNQX59d/VD//xdQ0TCiYNj1KT9sq6Wdu5WTbqk3qDXyDaLa1fv621LS01G3z61sD6lH8lAxDLicV921s6Bf92JOYvzNYCL1khbqBXEFUzC521N5NyzNaQIWhjyFyDoBIVrAjmv2UEaLlI+c6zw1jmVIPLLLZZUTj6GxGHW+mq1tgHXR2D85p4Q934+jLbtjVLcyCdS10NVzpHqxp4Q/hK7WopY/NRGx9HGsPGdFjOjcpjBnGYMVqY/4eqT5khWEHWUup2A/pTw7pdWgsWft7ETUERL96nRg0HNFPmCYba6pylECaExX89A9WLUOVB4oKLu/o1oqSYHCgLzBUlAz8hNFDRpeSU1XT+LRmDUgPaKbYdHDn9suF/tu13nHJij0N97LfS0QmqONuyONk7zvUI6Qa0pF9f2+oABL92AT6e0U//z9YqAiWtJLU1JK0gS+1aacwamiNqK067u9ZQ8f1d4qLodMzz3uL89Z68V/Hnr++hXWUuHgw8dfi972PeTyPefu3aNNucemQ74qFuIaJnVkOu4Q+yjuwmmC1FqZpl1i4uzoPxjkpPf3Xv545tl26Rr+dOvUd+omqJzch9dOeU7f10Y64nMcKK137DccIZq2WdXtdZjbEoLSzHwiMtrjYLDxpHQW8gjMX6XFYAE2zSWVD04EGYSs9MbO6sEo20BMEAB4mpvSypsKjZ4Stgzb+c3A9/MQT2+vrBy+qvyFxLUtLlSRF/Ri2wjfZ2dus2Q8lXx4608/jnqK5OOap6NY2PSjYYnECCjiEeLJll/pbmqfeIK+ps3+MxrlEhqmTPipVP7kqlF4VhpEb6r+Q7YOJg38kJ9SHBf3NBl6+9YchfbUjb5ahLSzUM3kPHmwFAsZ5rpai0S7E5xWzZ1j+fW7zsUWP2g5NXTw52ySCTrgG0+lbw60l2Y/CB185CoA8NK+tbRKxfjy6pm5hzQRRR+cMqv1Jbiw6STivtEvt3DRcy0QEh92JlUGo2PG4tSKHl00YD6xc8CK+YPYyy3io2lN8BcSjKRzrIV6ypOAobqxViJPaT9M9Hy5szY33mp7OX/Zu89L/7Ww5vqY2Y8b0pKgoiUhG5cPDPzq8qTV/WkzUOIvXVVA96kmjcBrr3HrYC/Wn+fYP6Z7T1rqy3zknbvqma/FvVk96fNXGkuaXrdHW5JGSxZT/2I/O73v+yNWafMdzc5NdxYurHs6h86e01sLKLz9EBrg+x36rxAaED7hRnAMx7Vzu+9wabh3zG8XLQjx0ablUJzmxdErxYT3kzQSd0SSafVqF5PXgpp0OyYJ1EyNHpGUZmvK575ySzd85JSqF7IBzSAbMM04+MbE58xF3/njXOGecSaermlw2y9PsSQdytLJVr8t+wg+rR8cZYoeNxVIzNdk3Bngi8U5LAlgTFoQnzJCa5EsCgYhCaGL+qPj7TdhG31p9tej3R04N//PXxNwJvyUqwaJqRPJY98TJ5TPndmflRAkAhBfe46sfKW5wizSge08Xb7Ca/GUVs55trngkKkrUS2WPzKttaaqq+idmahugkY+W6fN0I6i3gPt/x88U4wAAeJxjYGRgYADiGU9YXsXz23xl4GZnAIFH7fO+IdMc/WBxDgYmEAUASbMKwAB4nGNgZGBgZwABjj4Ghv//OfoZGBlQgT4ARicDZAAAAHicY2BgYGAfxJijD8Fmu4EqBwCSpgKpAAAAAAAADgBoAH4AzADgAQIBQgFsAZgB7gIuAooC0AL8A2IDjAOoA+AEMASwBNoFCAVaBcAGCAYuBnAGrAb2B04HigfSCCoIcAiGCJwIyAkkCVYJiAmsCfIKIApWCsQLknicY2BkYGDQZ2hmYGcAASYg5gJCBob/YD4DABqrAdAAeJxdkE1qg0AYhl8Tk9AIoVDaVSmzahcF87PMARLIMoFAl0ZHY1BHdBJIT9AT9AQ9RQ9Qeqy+yteNMzDzfM+88w0K4BY/cNAMB6N2bUaPPBLukybCLvleeAAPj8JD+hfhMV7hC3u4wxs7OO4NzQSZcI/8Ltwnfwi75E/hAR7wJTyk/xYeY49fYQ/PztM+jbTZ7LY6OWdBJdX/pqs6NYWa+zMxa13oKrA6Uoerqi/JwtpYxZXJ1coUVmeZUWVlTjq0/tHacjmdxuL90OR8O0UEDYMNdtiSEpz5XQGqzlm30kzUdAYFFOb8R7NOZk0q2lwAyz1i7oAr1xoXvrOgtYhZx8wY5KRV269JZ5yGpmzPTjQhvY9je6vEElPOuJP3mWKnP5M3V+YAAAB4nG2ReVPbMBDF/ULi2EkDBFqO3gdHLxUzDB9IkdexBllydRD49ihO3Ckz7B/a31utZnafkkGyiXnyclxhgB0MMUKKMTLkmGCKV5hhF3vYxxwHOMRrvMERjnGCU7zFO7zHB3zEJ3zGF3zFN5zhHBe4xHf8wE/8wm8w/MEVimTYKv44XR9MSCsUjVoeHE3vjQoNsSZ4mmxZmVWPjSz7jlou6/0qKOWEJdKMtCe793/hQfqxa6XWZHMXFl56RS4TvPXSaDeoy0zUUZB109KstDK8lHo5q6Qi1hcOnqkImubPS6aqRq7mlnaEWabub4iYblba3SRmgldS0+FWdhNtt04F14JUaqkl7tcpOpJtErvNt3Bd9HRT5JWxK25Ldjvp6br4hzfFiIdSmlzTg2fSUzNrLd1LE1ynxq4OVaVoKLjzJ60UPtj1RKzHzsbjly6inVnFBS2MucviPncU7Rr7lfTxRepDs1A2j3ZHRc7PuzFYSfE3ZOd4kjwBy227hA=="},80542(){}}]);