filecat 7.9.0 → 7.10.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 (125) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +182 -182
  3. package/build/dist/{4967.3fd3bd40a2b5a3b52428.js → 1060.198d91e2dfc174317c3a.js} +1 -1
  4. package/build/dist/1075.05eed88707339ca32044.js +1 -0
  5. package/build/dist/{1142.121454b1de53689b7367.js → 1142.bc43fae2e5e38d9359df.js} +1 -1
  6. package/build/dist/1384.edbad9c24d883a59724d.js +1 -0
  7. package/build/dist/1417.d390b18dd58ff5c28160.js +1 -0
  8. package/build/dist/1448.4db495e1389c0c8445b3.js +1 -0
  9. package/build/dist/{3324.22efcb1c431177b1cf5f.js → 1455.26a021eb94e5bdd5bec2.js} +1 -1
  10. package/build/dist/{1636.b6a17252dfd0d22f09a7.js → 1636.b80b1883358e132d3424.js} +1 -1
  11. package/build/dist/{1832.8ea5c3e8288df0b7fd5c.js → 1832.a01933ba5df99576ecc2.js} +1 -1
  12. package/build/dist/2300.c99b1dd4e752cdfd5e32.js +2 -0
  13. package/build/dist/{2300.9e1baa1c0368abe53d96.js.LICENSE.txt → 2300.c99b1dd4e752cdfd5e32.js.LICENSE.txt} +1 -1
  14. package/build/dist/239.f570f06d4b9c020f1013.js +1 -0
  15. package/build/dist/{2479.dcc88b3370f0f1d66e02.js → 2479.294792ef5d360ad64abc.js} +1 -1
  16. package/build/dist/2542.26cb302b60de23166227.js +1 -0
  17. package/build/dist/{259.81bb9e049e5ef587a96f.js → 259.3c0eb22e9b43ffb63c9c.js} +1 -1
  18. package/build/dist/2626.3bcfe1f26d9cb796a925.js +1 -0
  19. package/build/dist/{2674.7fd28dae86ccdb247851.js → 2674.15ca3c6ac911cf6e6e2f.js} +1 -1
  20. package/build/dist/3233.43bdd7c12ca829d56116.js +1 -0
  21. package/build/dist/3299.6ab0d94f02171cd762cc.js +1 -0
  22. package/build/dist/{6992.f6a07311a638794c24f7.js → 3471.ef3b5dcfe37963034187.js} +1 -1
  23. package/build/dist/{3528.56eeefab6fca5884e2a6.js → 3528.0f8f34028d92fa87c518.js} +1 -1
  24. package/build/dist/{3659.8a31495bb8f38c0ffa7c.js → 3659.dd03dc2ac52a3ff19105.js} +1 -1
  25. package/build/dist/4004.f0193c43fb891fdfb0e4.js +1 -0
  26. package/build/dist/{4560.8ef2e4b60cc86d019dd6.js → 4560.fd9f8cf2d6022b1d3a94.js} +1 -1
  27. package/build/dist/{4903.b5451ed0802b3f7c07b2.js → 4903.070aaa53a243baf05133.js} +1 -1
  28. package/build/dist/{4946.c95d4f426146e0180172.js → 4946.d578f6ba367a742d80bf.js} +2 -2
  29. package/build/dist/4986.f244efce9cf6be21f846.js +1 -0
  30. package/build/dist/5272.1f0dfac07ba202e7d323.js +1 -0
  31. package/build/dist/{5308.052f45c15785487b3766.js → 5308.d1e5ccb49396fc1b026d.js} +1 -1
  32. package/build/dist/{5516.645e4a900df9bdc1806c.js → 5516.88521f3a3c7101c46df3.js} +1 -1
  33. package/build/dist/5614.43bdd7c12ca829d56116.js +1 -0
  34. package/build/dist/{5139.adf9574d9b54a216e041.js → 5709.81f43e3c021fafdfe36f.js} +1 -1
  35. package/build/dist/{5744.e9f1efb88a617b05b709.js → 5744.0f8a0432b73b2eb0a7ff.js} +1 -1
  36. package/build/dist/{5877.ca081c4798194230243c.js → 5877.98d0475aaf4058b9a715.js} +1 -1
  37. package/build/dist/{6247.917e3fbef5dc5fbaf937.js → 6247.525b0b68872036ac2fa6.js} +1 -1
  38. package/build/dist/{7520.fbb0bc2a05cf94e15418.js → 6322.552511b5cb12cd0c821c.js} +1 -1
  39. package/build/dist/6492.17ecd8515fa512ce9306.js +1 -0
  40. package/build/dist/{676.a75318a8b598d8daadf0.js → 676.356039ef6f28f96b8c8b.js} +1 -1
  41. package/build/dist/{6805.bf0c964ab84f0fcc78be.js → 6805.373ac0e7d6555e4a6459.js} +1 -1
  42. package/build/dist/{6919.8cf13c01184b7148b28e.js → 6919.c7cc8617b658198d4924.js} +1 -1
  43. package/build/dist/{7038.4e4fc8e405c56d3080e2.js → 7038.166f915547d27e4dc5e4.js} +1 -1
  44. package/build/dist/{7759.0b68912ff9ef10869f59.js → 7759.7cd3fe8e5d37df25804c.js} +1 -1
  45. package/build/dist/7873.e3098bc6f510e5bea55f.js +1 -0
  46. package/build/dist/7923.d44556578af4d3d7cea3.js +2 -0
  47. package/build/dist/{7943.19d2de387eeb7f513d8e.js → 7943.acf25a5e98dd13290985.js} +1 -1
  48. package/build/dist/8090.8977224618a14ae42159.js +2 -0
  49. package/build/dist/8302.ce97557b7cf7c8387942.js +1 -0
  50. package/build/dist/8319.6a6b9651c87a1bb4cbb9.js +1 -0
  51. package/build/dist/{8603.4142ce42c1635f493eca.js → 8603.f1cbcfd64cde885f9809.js} +1 -1
  52. package/build/dist/8649.d6055ad75975b803bbc1.js +1 -0
  53. package/build/dist/{8727.3628c746061aed7a4077.js → 8727.8658835acb7e0b6e5acc.js} +1 -1
  54. package/build/dist/{8765.a5633d054abb67142fc3.js → 8765.8758c290a6b132f2ce7f.js} +1 -1
  55. package/build/dist/8772.2c35012c25ac9eb5f74d.js +2 -0
  56. package/build/dist/{8772.e8f9731c1c061f1cdf56.js.LICENSE.txt → 8772.2c35012c25ac9eb5f74d.js.LICENSE.txt} +1 -1
  57. package/build/dist/8781.6bd14487d172e004e3d3.js +1 -0
  58. package/build/dist/{9299.6c06dad1abe098b61766.js → 9299.7358ccf05b1415ed7959.js} +1 -1
  59. package/build/dist/9334.a25983aafdcbde63ae5e.js +1 -0
  60. package/build/dist/{9546.e7206c968e92371ae2b1.js → 9546.2cecad04cf676a6616cd.js} +1 -1
  61. package/build/dist/dark.css +839 -839
  62. package/build/dist/filerobot-image-editor.min.js +42445 -42445
  63. package/build/dist/google-dark.css +2032 -2032
  64. package/build/dist/google.css +1719 -1719
  65. package/build/dist/index.html +1 -1
  66. package/build/dist/main.ab3398f34c41e61310ae.js +2 -0
  67. package/build/dist/{main.3a12152528aff6ae213a.js.LICENSE.txt → main.ab3398f34c41e61310ae.js.LICENSE.txt} +1 -1
  68. package/build/dist/rle.js +17867 -17867
  69. package/build/main.js +1 -1
  70. package/build/plugin/core.type.d.ts +62 -0
  71. package/build/threads.work.filecat.js +1 -1
  72. package/env +26 -26
  73. package/package.json +211 -211
  74. package/shell/build.js +161 -161
  75. package/shell/config/.babelrc +14 -14
  76. package/shell/config/base.webpack.config.js +78 -78
  77. package/shell/config/common-bin.config.js +44 -44
  78. package/shell/config/env.js +10 -10
  79. package/shell/config/prebuild-file-path.js +17 -17
  80. package/shell/config/webpack.exe.config.js +36 -36
  81. package/shell/config/webpack.npm.config.js +44 -44
  82. package/shell/config/webpack.web.config.js +152 -152
  83. package/shell/dev.js +51 -51
  84. package/shell/docker-build.sh +2 -2
  85. package/shell/filecat +1 -1
  86. package/shell/filecat-watch +1 -1
  87. package/shell/install.js +48 -48
  88. package/shell/net-agent/git-clone.bat +23 -23
  89. package/shell/net-agent/git-pull.bat +17 -17
  90. package/shell/net-agent/git-push.bat +17 -17
  91. package/shell/pkg.ts +50 -50
  92. package/shell/postinstall-optional.js +29 -29
  93. package/shell/start/filecat-install.sh +22 -22
  94. package/shell/start/filecat-run.sh +2 -2
  95. package/shell/start/windows-install.js +178 -178
  96. package/shell/start/windows-uninstall.js +131 -131
  97. package/shell/util/file.js +46 -46
  98. package/build/dist/1075.40103ec059c6b23b056e.js +0 -1
  99. package/build/dist/1384.0d0fc5faa899c9eddcbe.js +0 -1
  100. package/build/dist/1417.7e511043474084a2a65b.js +0 -1
  101. package/build/dist/1448.0710f04bed1c52e6a5db.js +0 -1
  102. package/build/dist/2300.9e1baa1c0368abe53d96.js +0 -2
  103. package/build/dist/2542.23fb13b1623c9f7c3fc1.js +0 -1
  104. package/build/dist/2626.05d1faa293e0a3318b9b.js +0 -1
  105. package/build/dist/2851.2195b5906b2c224c7bf7.js +0 -1
  106. package/build/dist/3140.794a212da633caf38b3a.js +0 -2
  107. package/build/dist/3233.fb6bffd5e097e4ac9423.js +0 -1
  108. package/build/dist/3299.f37767d30b6999df4014.js +0 -1
  109. package/build/dist/4004.5d68418ad5c2321cb11f.js +0 -1
  110. package/build/dist/4986.78047106f3a0d2d71199.js +0 -1
  111. package/build/dist/5272.0b70ee8ec5f083fb9f5b.js +0 -1
  112. package/build/dist/5614.fb6bffd5e097e4ac9423.js +0 -1
  113. package/build/dist/6492.3ee4060598de873d8e8f.js +0 -1
  114. package/build/dist/7756.2f851693ba030c42dde8.js +0 -1
  115. package/build/dist/7873.11d04b741d2b499d9cb9.js +0 -1
  116. package/build/dist/7923.861345fd55941e8089a1.js +0 -2
  117. package/build/dist/8014.28b5cf8c3787dc829aa4.js +0 -1
  118. package/build/dist/8302.5ae5bfe8baa0084204bb.js +0 -1
  119. package/build/dist/8319.c15a3674ec7abc493595.js +0 -1
  120. package/build/dist/8772.e8f9731c1c061f1cdf56.js +0 -2
  121. package/build/dist/8781.58f0c51870d3dd2689d7.js +0 -1
  122. package/build/dist/main.3a12152528aff6ae213a.js +0 -2
  123. /package/build/dist/{4946.c95d4f426146e0180172.js.LICENSE.txt → 4946.d578f6ba367a742d80bf.js.LICENSE.txt} +0 -0
  124. /package/build/dist/{7923.861345fd55941e8089a1.js.LICENSE.txt → 7923.d44556578af4d3d7cea3.js.LICENSE.txt} +0 -0
  125. /package/build/dist/{3140.794a212da633caf38b3a.js.LICENSE.txt → 8090.8977224618a14ae42159.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[7756],{57756(e,t,a){a.r(t),a.d(t,{default:()=>i});var i=async(e,t=[{}],a=null,i=!1,s=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";const c=[];let n=null;if(e instanceof Blob&&e.type?n=e.type:e.headers&&e.headers.get("content-type")&&(n=e.headers.get("content-type")),t.forEach((e,t)=>{c[t]={description:e.description||"",accept:{}},e.mimeTypes?(0===t&&n&&e.mimeTypes.push(n),e.mimeTypes.map(a=>{c[t].accept[a]=e.extensions||[]})):n&&(c[t].accept[n]=e.extensions||[])}),a)try{await a.getFile()}catch(e){if(a=null,i)throw e}const l=a||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:c,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!a&&s&&s();const r=await l.createWritable();if("stream"in e){const t=e.stream();return await t.pipeTo(r),l}return"body"in e?(await e.body.pipeTo(r),l):(await r.write(await e),await r.close(),l)}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[7873],{26559(e,n,t){t.d(n,{A:()=>l});var i=t(96540),o=t(34843),d=t(82893),r=t(76118),s=t(69918),a=t(8332),m=t(74848);const l=i.memo(function(e){const[n]=(0,o.fp)(d.AG.md_editor_last_context),[t]=(0,i.useState)(n?.trim()?n:a.$);return(0,m.jsx)("div",{className:e.className,ref:n=>e.setting&&(0,s.Ce)(n,e.setting),children:(0,m.jsx)("div",{className:"md-editor-scroll",children:(0,m.jsx)("div",{className:"md-editor-sheet",children:(0,m.jsx)(r.A,{value:t})})})})})},8332(e,n,t){t.d(n,{$:()=>o,V:()=>i});const i='/* ===== md 主题 =====\n 选择器请从 .md-editor-sheet 开始写 —— 它是正文容器的类名,\n 编辑器与右侧预览用的是同一个类名,一处书写、两处生效。\n\n 注意:css 原样注入页面,不做任何改写。\n 写成 body、h1 这种全局选择器会真的作用到整个后台界面,不要这么写。\n\n 下面每一组都可以直接改,不需要的整段删掉即可。\n ============================================ */\n\n/* ---------- 正文 ---------- */\n.md-editor-sheet {\n font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; /* 字体 */\n font-size: 16px; /* 字号 */\n line-height: 1.7; /* 行高:1.7 约为字号的 1.7 倍 */\n color: #333333; /* 文字颜色 */\n}\n\n/* ---------- 整页底色 ----------\n 底色必须写在 .md-editor-scroll(滚动容器)上,不要写在 .md-editor-sheet。\n 纸张高度只有一屏,写在纸张上的底色长文档一滚就露底(上半截有色、下半截变回灰)。\n 深色主题尤其要注意:这一条不写,滚动时就会白一半黑一半。 */\n.md-editor-scroll {\n background: #ffffff;\n}\n\n/* ---------- 标题 h1 ~ h6 ---------- */\n.md-editor-sheet h1 {\n font-size: 2em; /* 相对正文字号的倍数 */\n font-weight: 600; /* 字重:400 常规 / 600 半粗 / 700 粗 */\n color: #1a1a1a;\n margin-top: 1.4em;\n margin-bottom: 0.6em;\n padding-bottom: 0.3em;\n border-bottom: 1px solid #eaecef; /* 标题下划线,不需要就删掉这行 */\n}\n.md-editor-sheet h2 { font-size: 1.5em; font-weight: 600; margin-top: 1.3em; margin-bottom: 0.6em; }\n.md-editor-sheet h3 { font-size: 1.25em; font-weight: 600; margin-top: 1.2em; margin-bottom: 0.5em; }\n.md-editor-sheet h4 { font-size: 1em; font-weight: 600; margin-top: 1.1em; margin-bottom: 0.5em; }\n.md-editor-sheet h5 { font-size: 0.9em; font-weight: 600; margin-top: 1em; margin-bottom: 0.5em; }\n.md-editor-sheet h6 { font-size: 0.85em; font-weight: 600; color: #6a737d; margin-top: 1em; margin-bottom: 0.5em; }\n\n/* ---------- 段落与行内元素 ---------- */\n.md-editor-sheet p {\n margin: 0 0 1em; /* 段落间距:上 右 下 左,下边距控制段与段的距离 */\n}\n.md-editor-sheet strong { font-weight: 600; } /* 加粗文字 */\n.md-editor-sheet em { font-style: italic; } /* 斜体文字 */\n.md-editor-sheet a { color: #0366d6; text-decoration: none; } /* 链接颜色;加下划线写 underline */\n.md-editor-sheet a:hover { text-decoration: underline; } /* 鼠标悬停时的链接样式 */\n.md-editor-sheet del { color: #999999; } /* 删除线文字 */\n\n/* ---------- 引用 ---------- */\n.md-editor-sheet blockquote {\n margin: 0 0 1em;\n padding: 0.4em 1em;\n color: #6a737d; /* 引用文字颜色 */\n border-left: 4px solid #dfe2e5; /* 左侧竖线,这是引用最明显的特征 */\n background: #f6f8fa; /* 引用底色,不需要就删掉 */\n}\n\n/* ---------- 代码 ---------- */\n.md-editor-sheet code {\n font-family: Consolas, Monaco, "Courier New", monospace; /* 等宽字体 */\n font-size: 0.88em;\n color: #476582; /* 行内代码文字色 */\n background: rgba(27, 31, 35, 0.05); /* 行内代码底色 */\n padding: 0.2em 0.4em;\n border-radius: 3px; /* 圆角 */\n}\n.md-editor-sheet pre {\n padding: 1em;\n overflow: auto; /* 内容太宽时出现横向滚动条 */\n background: #f6f8fa; /* 代码块底色 */\n border-radius: 6px;\n margin: 0 0 1em;\n}\n.md-editor-sheet pre code {\n background: transparent; /* 代码块里的 code 不要再叠一层底色 */\n padding: 0;\n}\n\n/* ---------- 列表 ---------- */\n.md-editor-sheet ul, .md-editor-sheet ol {\n padding-left: 2em; /* 缩进 */\n margin: 0 0 1em;\n}\n.md-editor-sheet li { margin: 0.25em 0; } /* 列表项之间的间距 */\n\n/* ---------- 表格 ---------- */\n.md-editor-sheet table {\n width: 100%;\n border-collapse: collapse; /* 相邻边框合并成一条线 */\n margin: 0 0 1em;\n}\n.md-editor-sheet table th, .md-editor-sheet table td {\n padding: 6px 13px;\n border: 1px solid #dfe2e5; /* 单元格边框 */\n}\n.md-editor-sheet table th {\n font-weight: 600;\n background: #f6f8fa; /* 表头底色 */\n}\n\n/* ---------- 分割线 ---------- */\n.md-editor-sheet hr {\n height: 1px; /* 线的粗细 */\n border: 0;\n background: #e1e4e8; /* 线的颜色 */\n margin: 1.6em 0;\n}\n\n/* ---------- 图片 ---------- */\n.md-editor-sheet img {\n max-width: 100%; /* 防止大图撑破版面 */\n border-radius: 4px;\n}\n',o='# 一级标题 Heading 1\n\n## 二级标题 Heading 2\n\n### 三级标题 Heading 3\n\n#### 四级标题 Heading 4\n\n##### 五级标题 Heading 5\n\n###### 六级标题 Heading 6\n\n这是一段普通正文,用来观察字体、字号、行高和文字颜色。中间可以包含 **加粗文字**、*斜体文字*、~~删除线~~、`行内代码` 以及 [一个链接](https://github.com/xiaobaidadada/filecat)。\n\n> 这是一段引用文字。\n> 引用通常用来强调摘录的内容,左侧一般会有一条竖线。\n\n- 无序列表第一项\n- 无序列表第二项\n - 嵌套的子项\n- 无序列表第三项\n\n1. 有序列表第一项\n2. 有序列表第二项\n3. 有序列表第三项\n\n```javascript\n// 代码块\nfunction greet(name) {\n console.log(`Hello, ${name}!`);\n}\ngreet("filecat");\n```\n\n| 列一 | 列二 | 列三 |\n| --- | --- | --- |\n| 内容 A | 内容 B | 内容 C |\n| 内容 D | 内容 E | 内容 F |\n\n---\n\n最后一段正文,用于观察段落之间的间距。\n'},57873(e,n,t){t.r(n),t.d(n,{default:()=>F});var i=t(96540),o=t(22022),d=t(52671),r=t(85997),s=t(4412),a=t(75725),m=t(70447),l=t(61443),c=t(62042),h=t(78247),g=t(23430);const f=/^(\d+(?:\.\d+)?)(px|%|rem|em|vw|vh|ch)$/,u=/^\d+(\.\d+)?$/,p=/^\d+$/,x=/[\\/:*?"<>|\u0000-\u001f]/,_={size(e,n=!1){const t=String(e??"").trim();if(!t)return null;let i;if(n&&u.test(t))i=t;else{const e=f.exec(t);if(!e)return null;i=e[1]}const o=Number(i);return Number.isFinite(o)&&o>0&&o<=1e4?t:null},uint(e){const n=String(e??"").trim();return p.test(n)?Number(n):null},filename(e,n=!0){const t=String(e??"").trim();return""===t?n?"":null:"."===t||".."===t||x.test(t)||t.length>64?null:t}},b={content_max_width:_.size,content_padding:_.size,font_size:_.size,line_height:e=>_.size(e,!0),theme:_.filename,auto_save_interval:_.uint};var k=t(87361),v=t(69918),y=t(26559),j=t(96763),w=t(45907),z=t(34843),C=t(82893),S=t(74848);const N=[{key:"content_max_width",label:"正文最大宽度"},{key:"content_padding",label:"正文左右边距"},{key:"font_size",label:"正文字号"},{key:"line_height",label:"行高"},{key:"auto_save_interval",label:"as_iv"}];function F(){const{t:e}=(0,o.Bd)(),n=(0,d.Zp)(),{check_user_auth:t}=(0,h.MH)(),f=(0,w.y)(),u=t(g.oV.md_editor_setting),[,p]=(0,z.fp)(C.AG.md_editor_setting),[,x]=(0,z.fp)(C.AG.md_theme_css),[_,F]=(0,i.useState)({}),[A,$]=(0,i.useState)(!0),[G,H]=(0,i.useState)(!1),[P,E]=(0,i.useState)([]),[B,I]=(0,i.useState)(v.FG.theme);(0,i.useEffect)(()=>{Promise.all([(0,v.gC)(),(0,j.Kz)()]).then(([e,n])=>{const t={};N.forEach(n=>t[n.key]=String(e[n.key]??"")),F(t),I(e.theme??v.FG.theme),E(n)}).finally(()=>$(!1))},[]);const K=P.find(e=>e.id===B),V=e=>{const n=b[e]((_[e]??"").trim());return null===n?v.FG[e]:n};return(0,S.jsxs)("div",{children:[(0,S.jsx)(s.aZ,{position:"right",children:(0,S.jsx)(r.rA,{icon:"arrow_back",title:e("上一页"),onClick:()=>n(-1)})}),(0,S.jsx)(a.jW,{isFull:!0,more:!0,children:(0,S.jsx)(a.NN,{children:(0,S.jsx)(a.xh,{children:(0,S.jsxs)(a.fI,{children:[(0,S.jsx)(a.VP,{widthPer:33,maxWidth:"30rem",children:(0,S.jsx)(m.Zp,{title:e("编辑器设置"),titleCom:(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(r.C3,{text:e("恢复默认"),clickFun:()=>{const e={};N.forEach(n=>e[n.key]=String(v.FG[n.key])),F(e)}}),u&&(0,S.jsx)(r.$n,{text:e(G?"保存中":"保存"),clickFun:()=>{G||(async()=>{const n={theme:B};for(const t of N){const i=(_[t.key]??"").trim(),o=b[t.key](i);if(null===o)return void(0,c.zN)(`${e(t.label)}: ${e("auto_save_interval"===t.key?"as_num":"请输入合法的 CSS 值,例如 10px、3rem、80%")}`);n[t.key]=o}H(!0);try{const t=await(0,v.fy)(n);if(t){(0,c.SK)(e("保存成功"));const n={};N.forEach(e=>n[e.key]=String(t[e.key]??"")),F(n),I(t.theme??v.FG.theme),p({...t}),(0,j.sO)().then(x)}else(0,c.zN)(e("保存失败"))}finally{H(!1)}})()}})]}),children:A?(0,S.jsxs)("div",{className:"common-box common-box-center",children:[e("加载中"),"..."]}):(0,S.jsxs)("div",{className:"md-setting-form",children:[(0,S.jsx)(l.BC,{vertical:!0,label:e("主题"),children:(0,S.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.4rem"},children:[(0,S.jsx)(l.l6,{value:B,onChange:e=>I(e),disabled:!u,options:[{title:e("不使用主题"),value:""},...P.map(e=>({title:e.id,value:e.id}))]}),(0,S.jsx)(r.rA,{icon:"add",title:e("新建主题"),onClick:()=>n(k.o.md_theme_editor_page)}),(0,S.jsx)(r.rA,{icon:"edit",title:e("编辑主题"),onClick:()=>n(`${k.o.md_theme_editor_page}?id=${encodeURIComponent(B)}`)}),K&&(0,S.jsx)(r.rA,{icon:"delete",title:e("删除主题"),onClick:()=>{return n=K,void f({sub_title:e("确认删除这个主题吗?"),confirm_fun:async()=>{await(0,j._8)(n.id)?((0,c.SK)(e("删除成功")),E(await(0,j.Kz)()),B===n.id&&I(v.FG.theme)):(0,c.zN)(e("删除失败"))}});var n}})]})}),N.map(n=>(0,S.jsx)(l.BC,{vertical:!0,label:e(n.label),children:(0,S.jsx)(l.Sm,{disabled:!u,placeholder:String(v.FG[n.key]),value:_[n.key]??"",handleInputChange:e=>F(t=>({...t,[n.key]:e}))})},n.key)),!u&&(0,S.jsx)("p",{className:"md-editor-setting-page__desc",children:e("nprmtp")})]})})}),(0,S.jsx)(a.VP,{widthPer:50,maxWidth:"60rem",children:(0,S.jsx)(m.Zp,{title:e("预览"),children:(0,S.jsx)(y.A,{className:"md-editor-setting-page__preview",setting:{content_max_width:V("content_max_width"),content_padding:V("content_padding"),font_size:V("font_size"),line_height:V("line_height")}})})})]})})})})]})}}}]);
@@ -1,2 +0,0 @@
1
- /*! For license information please see 7923.861345fd55941e8089a1.js.LICENSE.txt */
2
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[7923],{77923(t,e,r){r.d(e,{default:()=>g});function n(t,e){var r={};return e.forEach(function(e){Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=t[e])}),r}var i={assign:function(t){for(var e,r=1;r<arguments.length;r++)for(var n in e=Object(arguments[r]))Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},pick:n,pick_pica_resize_options:function(t){return n(t,["alpha","unsharpAmount","unsharpRadius","unsharpThreshold","cancelToken"])}};function a(t){var e={exports:{}};return t(e,e.exports),e.exports}function o(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets option of @rollup/plugin-commonjs appropriately for this require call to behave properly.')}var s=a(function(t,e){t.exports=function(){function t(e,r,n){function i(s,A){if(!r[s]){if(!e[s]){if(!A&&o)return o(s);if(a)return a(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var h=r[s]={exports:{}};e[s][0].call(h.exports,function(t){return i(e[s][1][t]||t)},h,h.exports,t,e,r,n)}return r[s].exports}for(var a=o,s=0;s<n.length;s++)i(n[s]);return i}return t}()({1:[function(t,e,r){var n=t("inherits"),i=t("multimath"),a=t("./mm_unsharp_mask"),o=t("./mm_resize");function s(t){var e=t||[],r={js:e.indexOf("js")>=0,wasm:e.indexOf("wasm")>=0};i.call(this,r),this.features={js:r.js,wasm:r.wasm&&this.has_wasm()},this.use(a),this.use(o)}n(s,i),s.prototype.resizeAndUnsharp=function(t,e){var r=this.resize(t,e);return t.unsharpAmount&&this.unsharp_mask(r,t.toWidth,t.toHeight,t.unsharpAmount,t.unsharpRadius,t.unsharpThreshold),r},e.exports=s},{"./mm_resize":4,"./mm_unsharp_mask":9,inherits:19,multimath:20}],2:[function(t,e,r){function n(t){return t<0?0:t>255?255:t}function i(t,e,r,i,a,o){var s,A,u,h,f,c,l,g,p,d,m,_=0,w=0;for(p=0;p<i;p++){for(f=0,d=0;d<a;d++){for(c=o[f++],l=o[f++],g=_+4*c|0,s=A=u=h=0;l>0;l--)h=h+(m=o[f++])*t[g+3]|0,u=u+m*t[g+2]|0,A=A+m*t[g+1]|0,s=s+m*t[g]|0,g=g+4|0;e[w+3]=n(h+8192>>14),e[w+2]=n(u+8192>>14),e[w+1]=n(A+8192>>14),e[w]=n(s+8192>>14),w=w+4*i|0}w=4*(p+1)|0,_=(p+1)*r*4|0}}function a(t,e,r,i,a,o){var s,A,u,h,f,c,l,g,p,d,m,_=0,w=0;for(p=0;p<i;p++){for(f=0,d=0;d<a;d++){for(c=o[f++],l=o[f++],g=_+4*c|0,s=A=u=h=0;l>0;l--)h=h+(m=o[f++])*t[g+3]|0,u=u+m*t[g+2]|0,A=A+m*t[g+1]|0,s=s+m*t[g]|0,g=g+4|0;e[w+3]=n(h+8192>>14),e[w+2]=n(u+8192>>14),e[w+1]=n(A+8192>>14),e[w]=n(s+8192>>14),w=w+4*i|0}w=4*(p+1)|0,_=(p+1)*r*4|0}}e.exports={convolveHorizontally:i,convolveVertically:a}},{}],3:[function(t,e,r){e.exports="AGFzbQEAAAAADAZkeWxpbmsAAAAAAAEXA2AAAGAGf39/f39/AGAHf39/f39/fwACDwEDZW52Bm1lbW9yeQIAAAMEAwABAgYGAX8AQQALB1cFEV9fd2FzbV9jYWxsX2N0b3JzAAAIY29udm9sdmUAAQpjb252b2x2ZUhWAAIMX19kc29faGFuZGxlAwAYX193YXNtX2FwcGx5X2RhdGFfcmVsb2NzAAAK7AMDAwABC8YDAQ9/AkAgA0UNACAERQ0AA0AgDCENQQAhE0EAIQcDQCAHQQJqIQYCfyAHQQF0IAVqIgcuAQIiFEUEQEGAwAAhCEGAwAAhCUGAwAAhCkGAwAAhCyAGDAELIBIgBy4BAGohCEEAIQsgFCEHQQAhDiAGIQlBACEPQQAhEANAIAUgCUEBdGouAQAiESAAIAhBAnRqKAIAIgpBGHZsIBBqIRAgCkH/AXEgEWwgC2ohCyAKQRB2Qf8BcSARbCAPaiEPIApBCHZB/wFxIBFsIA5qIQ4gCEEBaiEIIAlBAWohCSAHQQFrIgcNAAsgC0GAQGshCCAOQYBAayEJIA9BgEBrIQogEEGAQGshCyAGIBRqCyEHIAEgDUECdGogCUEOdSIGQf8BIAZB/wFIGyIGQQAgBkEAShtBCHRBgP4DcSAKQQ51IgZB/wEgBkH/AUgbIgZBACAGQQBKG0EQdEGAgPwHcSALQQ51IgZB/wEgBkH/AUgbIgZBACAGQQBKG0EYdHJyIAhBDnUiBkH/ASAGQf8BSBsiBkEAIAZBAEobcjYCACADIA1qIQ0gE0EBaiITIARHDQALIAxBAWoiDCACbCESIAMgDEcNAAsLCx4AQQAgAiADIAQgBSAAEAEgAkEAIAQgBSAGIAEQAQs="},{}],4:[function(t,e,r){e.exports={name:"resize",fn:t("./resize"),wasm_fn:t("./resize_wasm"),wasm_src:t("./convolve_wasm_base64")}},{"./convolve_wasm_base64":3,"./resize":5,"./resize_wasm":8}],5:[function(t,e,r){var n=t("./resize_filter_gen"),i=t("./convolve").convolveHorizontally,a=t("./convolve").convolveVertically;function o(t,e,r){for(var n=3,i=e*r*4|0;n<i;)t[n]=255,n=n+4|0}e.exports=function(t){var e=t.src,r=t.width,s=t.height,A=t.toWidth,u=t.toHeight,h=t.scaleX||t.toWidth/t.width,f=t.scaleY||t.toHeight/t.height,c=t.offsetX||0,l=t.offsetY||0,g=t.dest||new Uint8Array(A*u*4),p=void 0===t.quality?3:t.quality,d=t.alpha||!1,m=n(p,r,A,h,c),_=n(p,s,u,f,l),w=new Uint8Array(A*s*4);return i(e,w,r,s,A,m),a(w,g,s,A,u,_),d||o(g,A,u),g}},{"./convolve":2,"./resize_filter_gen":6}],6:[function(t,e,r){var n=t("./resize_filter_info"),i=14;function a(t){return Math.round(t*((1<<i)-1))}e.exports=function(t,e,r,i,o){var s,A,u,h,f,c,l,g,p,d,m,_,w,I,b,v,y,B=n[t].filter,E=1/i,C=Math.min(1,i),Q=n[t].win/C,x=Math.floor(2*(Q+1)),M=new Int16Array((x+2)*r),D=0,j=!M.subarray||!M.set;for(s=0;s<r;s++){for(A=(s+.5)*E+o,u=Math.max(0,Math.floor(A-Q)),f=(h=Math.min(e-1,Math.ceil(A+Q)))-u+1,c=new Float32Array(f),l=new Int16Array(f),g=0,p=u,d=0;p<=h;p++,d++)g+=m=B((p+.5-A)*C),c[d]=m;for(_=0,d=0;d<c.length;d++)_+=w=c[d]/g,l[d]=a(w);for(l[r>>1]+=a(1-_),I=0;I<l.length&&0===l[I];)I++;if(I<l.length){for(b=l.length-1;b>0&&0===l[b];)b--;if(v=u+I,y=b-I+1,M[D++]=v,M[D++]=y,j)for(d=I;d<=b;d++)M[D++]=l[d];else M.set(l.subarray(I,b+1),D),D+=y}else M[D++]=0,M[D++]=0}return M}},{"./resize_filter_info":7}],7:[function(t,e,r){e.exports=[{win:.5,filter:function(t){return t>=-.5&&t<.5?1:0}},{win:1,filter:function(t){if(t<=-1||t>=1)return 0;if(t>-1.1920929e-7&&t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*(.54+.46*Math.cos(e/1))}},{win:2,filter:function(t){if(t<=-2||t>=2)return 0;if(t>-1.1920929e-7&&t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*Math.sin(e/2)/(e/2)}},{win:3,filter:function(t){if(t<=-3||t>=3)return 0;if(t>-1.1920929e-7&&t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*Math.sin(e/3)/(e/3)}}]},{}],8:[function(t,e,r){var n=t("./resize_filter_gen");function i(t,e,r){for(var n=3,i=e*r*4|0;n<i;)t[n]=255,n=n+4|0}function a(t){return new Uint8Array(t.buffer,0,t.byteLength)}var o=!0;try{o=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0]}catch(t){}function s(t,e,r){if(o)e.set(a(t),r);else for(var n=r,i=0;i<t.length;i++){var s=t[i];e[n++]=255&s,e[n++]=s>>8&255}}e.exports=function(t){var e=t.src,r=t.width,a=t.height,o=t.toWidth,A=t.toHeight,u=t.scaleX||t.toWidth/t.width,h=t.scaleY||t.toHeight/t.height,f=t.offsetX||0,c=t.offsetY||0,l=t.dest||new Uint8Array(o*A*4),g=void 0===t.quality?3:t.quality,p=t.alpha||!1,d=n(g,r,o,u,f),m=n(g,a,A,h,c),_=0,w=this.__align(_+Math.max(e.byteLength,l.byteLength)),I=this.__align(w+a*o*4),b=this.__align(I+d.byteLength),v=b+m.byteLength,y=this.__instance("resize",v),B=new Uint8Array(this.__memory.buffer),E=new Uint32Array(this.__memory.buffer),C=new Uint32Array(e.buffer);return E.set(C),s(d,B,I),s(m,B,b),(y.exports.convolveHV||y.exports._convolveHV)(I,b,w,r,a,o,A),new Uint32Array(l.buffer).set(new Uint32Array(this.__memory.buffer,0,A*o)),p||i(l,o,A),l}},{"./resize_filter_gen":6}],9:[function(t,e,r){e.exports={name:"unsharp_mask",fn:t("./unsharp_mask"),wasm_fn:t("./unsharp_mask_wasm"),wasm_src:t("./unsharp_mask_wasm_base64")}},{"./unsharp_mask":10,"./unsharp_mask_wasm":11,"./unsharp_mask_wasm_base64":12}],10:[function(t,e,r){var n=t("glur/mono16");function i(t,e,r){for(var n,i,a,o,s=e*r,A=new Uint16Array(s),u=0;u<s;u++)n=t[4*u],i=t[4*u+1],a=t[4*u+2],o=n>=i&&n>=a?n:i>=a&&i>=n?i:a,A[u]=o<<8;return A}e.exports=function(t,e,r,a,o,s){var A,u,h,f,c;if(!(0===a||o<.5)){o>2&&(o=2);var l=i(t,e,r),g=new Uint16Array(l);n(g,e,r,o);for(var p=a/100*4096+.5|0,d=s<<8,m=e*r,_=0;_<m;_++)f=(A=l[_])-g[_],Math.abs(f)>=d&&(h=((u=(u=(u=A+(p*f+2048>>12))>65280?65280:u)<0?0:u)<<12)/(A=0!==A?A:1)|0,t[c=4*_]=t[c]*h+2048>>12,t[c+1]=t[c+1]*h+2048>>12,t[c+2]=t[c+2]*h+2048>>12)}}},{"glur/mono16":18}],11:[function(t,e,r){e.exports=function(t,e,r,n,i,a){if(!(0===n||i<.5)){i>2&&(i=2);var o=e*r,s=4*o,A=2*o,u=2*o,h=4*Math.max(e,r),f=32,c=0,l=s,g=l+A,p=g+u,d=p+u,m=d+h,_=this.__instance("unsharp_mask",s+A+2*u+h+f,{exp:Math.exp}),w=new Uint32Array(t.buffer);new Uint32Array(this.__memory.buffer).set(w);var I=_.exports.hsv_v16||_.exports._hsv_v16;I(c,l,e,r),(I=_.exports.blurMono16||_.exports._blurMono16)(l,g,p,d,m,e,r,i),(I=_.exports.unsharp||_.exports._unsharp)(c,c,l,g,e,r,n,a),w.set(new Uint32Array(this.__memory.buffer,0,o))}}},{}],12:[function(t,e,r){e.exports="AGFzbQEAAAAADAZkeWxpbmsAAAAAAAE0B2AAAGAEf39/fwBgBn9/f39/fwBgCH9/f39/f39/AGAIf39/f39/f30AYAJ9fwBgAXwBfAIZAgNlbnYDZXhwAAYDZW52Bm1lbW9yeQIAAAMHBgAFAgQBAwYGAX8AQQALB4oBCBFfX3dhc21fY2FsbF9jdG9ycwABFl9fYnVpbGRfZ2F1c3NpYW5fY29lZnMAAg5fX2dhdXNzMTZfbGluZQADCmJsdXJNb25vMTYABAdoc3ZfdjE2AAUHdW5zaGFycAAGDF9fZHNvX2hhbmRsZQMAGF9fd2FzbV9hcHBseV9kYXRhX3JlbG9jcwABCsUMBgMAAQvWAQEHfCABRNuGukOCGvs/IAC7oyICRAAAAAAAAADAohAAIgW2jDgCFCABIAKaEAAiAyADoCIGtjgCECABRAAAAAAAAPA/IAOhIgQgBKIgAyACIAKgokQAAAAAAADwP6AgBaGjIgS2OAIAIAEgBSAEmqIiB7Y4AgwgASADIAJEAAAAAAAA8D+gIASioiIItjgCCCABIAMgAkQAAAAAAADwv6AgBKKiIgK2OAIEIAEgByAIoCAFRAAAAAAAAPA/IAahoCIDo7Y4AhwgASAEIAKgIAOjtjgCGAuGBQMGfwl8An0gAyoCDCEVIAMqAgghFiADKgIUuyERIAMqAhC7IRACQCAEQQFrIghBAEgiCQRAIAIhByAAIQYMAQsgAiAALwEAuCIPIAMqAhi7oiIMIBGiIg0gDCAQoiAPIAMqAgS7IhOiIhQgAyoCALsiEiAPoqCgoCIOtjgCACACQQRqIQcgAEECaiEGIAhFDQAgCEEBIAhBAUgbIgpBf3MhCwJ/IAQgCmtBAXFFBEAgDiENIAgMAQsgAiANIA4gEKIgFCASIAAvAQK4Ig+ioKCgIg22OAIEIAJBCGohByAAQQRqIQYgDiEMIARBAmsLIQIgC0EAIARrRg0AA0AgByAMIBGiIA0gEKIgDyAToiASIAYvAQC4Ig6ioKCgIgy2OAIAIAcgDSARoiAMIBCiIA4gE6IgEiAGLwECuCIPoqCgoCINtjgCBCAHQQhqIQcgBkEEaiEGIAJBAkohACACQQJrIQIgAA0ACwsCQCAJDQAgASAFIAhsQQF0aiIAAn8gBkECay8BACICuCINIBW7IhKiIA0gFrsiE6KgIA0gAyoCHLuiIgwgEKKgIAwgEaKgIg8gB0EEayIHKgIAu6AiDkQAAAAAAADwQWMgDkQAAAAAAAAAAGZxBEAgDqsMAQtBAAs7AQAgCEUNACAGQQRrIQZBACAFa0EBdCEBA0ACfyANIBKiIAJB//8DcbgiDSAToqAgDyIOIBCioCAMIBGioCIPIAdBBGsiByoCALugIgxEAAAAAAAA8EFjIAxEAAAAAAAAAABmcQRAIAyrDAELQQALIQMgBi8BACECIAAgAWoiACADOwEAIAZBAmshBiAIQQFKIQMgDiEMIAhBAWshCCADDQALCwvRAgIBfwd8AkAgB0MAAAAAWw0AIARE24a6Q4Ia+z8gB0MAAAA/l7ujIglEAAAAAAAAAMCiEAAiDLaMOAIUIAQgCZoQACIKIAqgIg22OAIQIAREAAAAAAAA8D8gCqEiCyALoiAKIAkgCaCiRAAAAAAAAPA/oCAMoaMiC7Y4AgAgBCAMIAuaoiIOtjgCDCAEIAogCUQAAAAAAADwP6AgC6KiIg+2OAIIIAQgCiAJRAAAAAAAAPC/oCALoqIiCbY4AgQgBCAOIA+gIAxEAAAAAAAA8D8gDaGgIgqjtjgCHCAEIAsgCaAgCqO2OAIYIAYEQANAIAAgBSAIbEEBdGogAiAIQQF0aiADIAQgBSAGEAMgCEEBaiIIIAZHDQALCyAFRQ0AQQAhCANAIAIgBiAIbEEBdGogASAIQQF0aiADIAQgBiAFEAMgCEEBaiIIIAVHDQALCwtxAQN/IAIgA2wiBQRAA0AgASAAKAIAIgRBEHZB/wFxIgIgAiAEQQh2Qf8BcSIDIAMgBEH/AXEiBEkbIAIgA0sbIgYgBiAEIAIgBEsbIAMgBEsbQQh0OwEAIAFBAmohASAAQQRqIQAgBUEBayIFDQALCwuZAgIDfwF8IAQgBWwhBAJ/IAazQwAAgEWUQwAAyEKVu0QAAAAAAADgP6AiC5lEAAAAAAAA4EFjBEAgC6oMAQtBgICAgHgLIQUgBARAIAdBCHQhCUEAIQYDQCAJIAIgBkEBdCIHai8BACIBIAMgB2ovAQBrIgcgB0EfdSIIaiAIc00EQCAAIAZBAnQiCGoiCiAFIAdsQYAQakEMdSABaiIHQYD+AyAHQYD+A0gbIgdBACAHQQBKG0EMdCABQQEgARtuIgEgCi0AAGxBgBBqQQx2OgAAIAAgCEEBcmoiByABIActAABsQYAQakEMdjoAACAAIAhBAnJqIgcgASAHLQAAbEGAEGpBDHY6AAALIAZBAWoiBiAERw0ACwsL"},{}],13:[function(t,e,r){var n=100;function i(t,e){this.create=t,this.available=[],this.acquired={},this.lastId=1,this.timeoutId=0,this.idle=e||2e3}i.prototype.acquire=function(){var t,e=this;return 0!==this.available.length?t=this.available.pop():((t=this.create()).id=this.lastId++,t.release=function(){return e.release(t)}),this.acquired[t.id]=t,t},i.prototype.release=function(t){var e=this;delete this.acquired[t.id],t.lastUsed=Date.now(),this.available.push(t),0===this.timeoutId&&(this.timeoutId=setTimeout(function(){return e.gc()},n))},i.prototype.gc=function(){var t=this,e=Date.now();this.available=this.available.filter(function(r){return!(e-r.lastUsed>t.idle&&(r.destroy(),1))}),0!==this.available.length?this.timeoutId=setTimeout(function(){return t.gc()},n):this.timeoutId=0},e.exports=i},{}],14:[function(t,e,r){var n=2;e.exports=function(t,e,r,i,a,o){var s=r/t,A=i/e,u=(2*o+n+1)/a;if(u>.5)return[[r,i]];var h=Math.ceil(Math.log(Math.min(s,A))/Math.log(u));if(h<=1)return[[r,i]];for(var f=[],c=0;c<h;c++){var l=Math.round(Math.pow(Math.pow(t,h-c-1)*Math.pow(r,c+1),1/h)),g=Math.round(Math.pow(Math.pow(e,h-c-1)*Math.pow(i,c+1),1/h));f.push([l,g])}return f}},{}],15:[function(t,e,r){var n=1e-5;function i(t){var e=Math.round(t);return Math.abs(t-e)<n?e:Math.floor(t)}function a(t){var e=Math.round(t);return Math.abs(t-e)<n?e:Math.ceil(t)}e.exports=function(t){var e,r,n,o,s,A,u=t.toWidth/t.width,h=t.toHeight/t.height,f=i(t.srcTileSize*u)-2*t.destTileBorder,c=i(t.srcTileSize*h)-2*t.destTileBorder;if(f<1||c<1)throw new Error("Internal error in pica: target tile width/height is too small.");var l,g=[];for(o=0;o<t.toHeight;o+=c)for(n=0;n<t.toWidth;n+=f)(e=n-t.destTileBorder)<0&&(e=0),e+(s=n+f+t.destTileBorder-e)>=t.toWidth&&(s=t.toWidth-e),(r=o-t.destTileBorder)<0&&(r=0),r+(A=o+c+t.destTileBorder-r)>=t.toHeight&&(A=t.toHeight-r),l={toX:e,toY:r,toWidth:s,toHeight:A,toInnerX:n,toInnerY:o,toInnerWidth:f,toInnerHeight:c,offsetX:e/u-i(e/u),offsetY:r/h-i(r/h),scaleX:u,scaleY:h,x:i(e/u),y:i(r/h),width:a(s/u),height:a(A/h)},g.push(l);return g}},{}],16:[function(t,e,r){function n(t){return Object.prototype.toString.call(t)}e.exports.isCanvas=function(t){var e=n(t);return"[object HTMLCanvasElement]"===e||"[object OffscreenCanvas]"===e||"[object Canvas]"===e},e.exports.isImage=function(t){return"[object HTMLImageElement]"===n(t)},e.exports.isImageBitmap=function(t){return"[object ImageBitmap]"===n(t)},e.exports.limiter=function(t){var e=0,r=[];function n(){e<t&&r.length&&(e++,r.shift()())}return function(t){return new Promise(function(i,a){r.push(function(){t().then(function(t){i(t),e--,n()},function(t){a(t),e--,n()})}),n()})}},e.exports.cib_quality_name=function(t){switch(t){case 0:return"pixelated";case 1:return"low";case 2:return"medium"}return"high"},e.exports.cib_support=function(t){return Promise.resolve().then(function(){if("undefined"==typeof createImageBitmap)return!1;var e=t(100,100);return createImageBitmap(e,0,0,100,100,{resizeWidth:10,resizeHeight:10,resizeQuality:"high"}).then(function(t){var r=10===t.width;return t.close(),e=null,r})}).catch(function(){return!1})},e.exports.worker_offscreen_canvas_support=function(){return new Promise(function(t,e){if("undefined"!=typeof OffscreenCanvas){var r=btoa("(".concat(i.toString(),")(self);")),n=new Worker("data:text/javascript;base64,".concat(r));n.onmessage=function(e){return t(e.data)},n.onerror=e}else t(!1);function i(t){"undefined"!=typeof createImageBitmap?Promise.resolve().then(function(){var t=new OffscreenCanvas(10,10);return t.getContext("2d").rect(0,0,1,1),createImageBitmap(t,0,0,1,1)}).then(function(){return t.postMessage(!0)},function(){return t.postMessage(!1)}):t.postMessage(!1)}}).then(function(t){return t},function(){return!1})},e.exports.can_use_canvas=function(t){var e=!1;try{var r=t(2,1).getContext("2d"),n=r.createImageData(2,1);n.data[0]=12,n.data[1]=23,n.data[2]=34,n.data[3]=255,n.data[4]=45,n.data[5]=56,n.data[6]=67,n.data[7]=255,r.putImageData(n,0,0),n=null,12===(n=r.getImageData(0,0,2,1)).data[0]&&23===n.data[1]&&34===n.data[2]&&255===n.data[3]&&45===n.data[4]&&56===n.data[5]&&67===n.data[6]&&255===n.data[7]&&(e=!0)}catch(t){}return e},e.exports.cib_can_use_region=function(){return new Promise(function(t){if("undefined"!=typeof createImageBitmap){var e=new Image;e.src="data:image/jpeg;base64,/9j/4QBiRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAYAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAAAAABIAAAAAQAAAEgAAAAB/9sAQwAEAwMEAwMEBAMEBQQEBQYKBwYGBgYNCQoICg8NEBAPDQ8OERMYFBESFxIODxUcFRcZGRsbGxAUHR8dGh8YGhsa/9sAQwEEBQUGBQYMBwcMGhEPERoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoa/8IAEQgAAQACAwERAAIRAQMRAf/EABQAAQAAAAAAAAAAAAAAAAAAAAf/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIQAxAAAAF/P//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAQUCf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQMBAT8Bf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQIBAT8Bf//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEABj8Cf//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAT8hf//aAAwDAQACAAMAAAAQH//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQMBAT8Qf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQIBAT8Qf//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAT8Qf//Z",e.onload=function(){createImageBitmap(e,0,0,e.width,e.height).then(function(r){r.width===e.width&&r.height===e.height?t(!0):t(!1)},function(){return t(!1)})},e.onerror=function(){return t(!1)}}else t(!1)})}},{}],17:[function(t,e,r){e.exports=function(){var e,r=t("./mathlib");onmessage=function(t){var n=t.data.opts,i=!1;if(!n.src&&n.srcBitmap){var a=new OffscreenCanvas(n.width,n.height),o=a.getContext("2d",{alpha:Boolean(n.alpha)});o.drawImage(n.srcBitmap,0,0),n.src=o.getImageData(0,0,n.width,n.height).data,a.width=a.height=0,a=null,n.srcBitmap.close(),n.srcBitmap=null,i=!0}e||(e=new r(t.data.features));var s=e.resizeAndUnsharp(n);if(i){var A=new ImageData(new Uint8ClampedArray(s),n.toWidth,n.toHeight),u=new OffscreenCanvas(n.toWidth,n.toHeight);u.getContext("2d",{alpha:Boolean(n.alpha)}).putImageData(A,0,0),createImageBitmap(u).then(function(t){postMessage({bitmap:t},[t])})}else postMessage({data:s},[s.buffer])}}},{"./mathlib":1}],18:[function(t,e,r){var n,i,a,o,s,A;function u(t){t<.5&&(t=.5);var e=Math.exp(.527076)/t,r=Math.exp(-e),u=Math.exp(-2*e),h=(1-r)*(1-r)/(1+2*e*r-u);return n=h,i=h*(e-1)*r,a=h*(e+1)*r,o=-h*u,s=2*r,A=-u,new Float32Array([n,i,a,o,s,A,(n+i)/(1-s-A),(a+o)/(1-s-A)])}function h(t,e,r,n,i,a){var o,s,A,u,h,f,c,l,g,p,d,m,_,w;for(g=0;g<a;g++){for(c=g,l=0,u=h=(o=t[f=g*i])*n[6],d=n[0],m=n[1],_=n[4],w=n[5],p=0;p<i;p++)A=(s=t[f])*d+o*m+u*_+h*w,h=u,u=A,o=s,r[l]=u,l++,f++;for(l--,c+=a*(i-1),u=h=(o=t[--f])*n[7],s=o,d=n[2],m=n[3],p=i-1;p>=0;p--)A=s*d+o*m+u*_+h*w,h=u,u=A,o=s,s=t[f],e[c]=r[l]+u,f--,l--,c-=a}}function f(t,e,r,n){if(n){var i=new Uint16Array(t.length),a=new Float32Array(Math.max(e,r)),o=u(n);h(t,i,a,o,e,r),h(i,t,a,o,r,e)}}e.exports=f},{}],19:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],20:[function(t,e,r){var n=t("object-assign"),i=t("./lib/base64decode"),a=t("./lib/wa_detect"),o={js:!0,wasm:!0};function s(t){if(!(this instanceof s))return new s(t);var e=n({},o,t||{});if(this.options=e,this.__cache={},this.__init_promise=null,this.__modules=e.modules||{},this.__memory=null,this.__wasm={},this.__isLE=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0],!this.options.js&&!this.options.wasm)throw new Error('mathlib: at least "js" or "wasm" should be enabled')}s.prototype.has_wasm=a,s.prototype.use=function(t){return this.__modules[t.name]=t,this.options.wasm&&this.has_wasm()&&t.wasm_fn?this[t.name]=t.wasm_fn:this[t.name]=t.fn,this},s.prototype.init=function(){if(this.__init_promise)return this.__init_promise;if(!this.options.js&&this.options.wasm&&!this.has_wasm())return Promise.reject(new Error('mathlib: only "wasm" was enabled, but it\'s not supported'));var t=this;return this.__init_promise=Promise.all(Object.keys(t.__modules).map(function(e){var r=t.__modules[e];return t.options.wasm&&t.has_wasm()&&r.wasm_fn?t.__wasm[e]?null:WebAssembly.compile(t.__base64decode(r.wasm_src)).then(function(r){t.__wasm[e]=r}):null})).then(function(){return t}),this.__init_promise},s.prototype.__base64decode=i,s.prototype.__reallocate=function(t){if(!this.__memory)return this.__memory=new WebAssembly.Memory({initial:Math.ceil(t/65536)}),this.__memory;var e=this.__memory.buffer.byteLength;return e<t&&this.__memory.grow(Math.ceil((t-e)/65536)),this.__memory},s.prototype.__instance=function(t,e,r){if(e&&this.__reallocate(e),!this.__wasm[t]){var i=this.__modules[t];this.__wasm[t]=new WebAssembly.Module(this.__base64decode(i.wasm_src))}if(!this.__cache[t]){var a={memoryBase:0,memory:this.__memory,tableBase:0,table:new WebAssembly.Table({initial:0,element:"anyfunc"})};this.__cache[t]=new WebAssembly.Instance(this.__wasm[t],{env:n(a,r||{})})}return this.__cache[t]},s.prototype.__align=function(t,e){var r=t%(e=e||8);return t+(r?e-r:0)},e.exports=s},{"./lib/base64decode":21,"./lib/wa_detect":22,"object-assign":23}],21:[function(t,e,r){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";e.exports=function(t){for(var e=t.replace(/[\r\n=]/g,""),r=e.length,i=new Uint8Array(3*r>>2),a=0,o=0,s=0;s<r;s++)s%4==0&&s&&(i[o++]=a>>16&255,i[o++]=a>>8&255,i[o++]=255&a),a=a<<6|n.indexOf(e.charAt(s));var A=r%4*6;return 0===A?(i[o++]=a>>16&255,i[o++]=a>>8&255,i[o++]=255&a):18===A?(i[o++]=a>>10&255,i[o++]=a>>2&255):12===A&&(i[o++]=a>>4&255),i}},{}],22:[function(t,e,r){var n;e.exports=function(){if(void 0!==n)return n;if(n=!1,"undefined"==typeof WebAssembly)return n;try{var t=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),e=new WebAssembly.Module(t);return 0!==new WebAssembly.Instance(e,{}).exports.test(4)&&(n=!0),n}catch(t){}return n}},{}],23:[function(t,e,r){var n=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function o(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}function s(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},r=0;r<10;r++)e["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(e).map(function(t){return e[t]}).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(t){n[t]=t}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}e.exports=s()?Object.assign:function(t,e){for(var r,s,A=o(t),u=1;u<arguments.length;u++){for(var h in r=Object(arguments[u]))i.call(r,h)&&(A[h]=r[h]);if(n){s=n(r);for(var f=0;f<s.length;f++)a.call(r,s[f])&&(A[s[f]]=r[s[f]])}}return A}},{}],24:[function(t,e,r){var n=arguments[3],i=arguments[4],a=arguments[5],o=JSON.stringify;e.exports=function(t,e){for(var r,s=Object.keys(a),A=0,u=s.length;A<u;A++){var h=s[A],f=a[h].exports;if(f===t||f&&f.default===t){r=h;break}}if(!r){r=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var c={};for(A=0,u=s.length;A<u;A++)c[h=s[A]]=h;i[r]=["function(require,module,exports){"+t+"(self); }",c]}var l=Math.floor(Math.pow(16,8)*Math.random()).toString(16),g={};g[r]=r,i[l]=["function(require,module,exports){var f = require("+o(r)+");(f.default ? f.default : f)(self);}",g];var p={};function d(t){for(var e in p[t]=!0,i[t][1]){var r=i[t][1][e];p[r]||d(r)}}d(l);var m="("+n+")({"+Object.keys(p).map(function(t){return o(t)+":["+i[t][0]+","+o(i[t][1])+"]"}).join(",")+"},{},["+o(l)+"])",_=window.URL||window.webkitURL||window.mozURL||window.msURL,w=new Blob([m],{type:"text/javascript"});if(e&&e.bare)return w;var I=_.createObjectURL(w),b=new Worker(I);return b.objectURL=I,b}},{}],"/index.js":[function(t,e,r){function n(t,e){return A(t)||s(t,e)||a(t,e)||i()}function i(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(t,e){if(t){if("string"==typeof t)return o(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?o(t,e):void 0}}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function s(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,i,a=[],o=!0,s=!1;try{for(r=r.call(t);!(o=(n=r.next()).done)&&(a.push(n.value),!e||a.length!==e);o=!0);}catch(t){s=!0,i=t}finally{try{o||null==r.return||r.return()}finally{if(s)throw i}}return a}}function A(t){if(Array.isArray(t))return t}var u=t("object-assign"),h=t("webworkify"),f=t("./lib/mathlib"),c=t("./lib/pool"),l=t("./lib/utils"),g=t("./lib/worker"),p=t("./lib/stepper"),d=t("./lib/tiler"),m={},_=!1;try{"undefined"!=typeof navigator&&navigator.userAgent&&(_=navigator.userAgent.indexOf("Safari")>=0)}catch(t){}var w=1;"undefined"!=typeof navigator&&(w=Math.min(navigator.hardwareConcurrency||1,4));var I={tile:1024,concurrency:w,features:["js","wasm","ww"],idle:2e3,createCanvas:function(t,e){var r=document.createElement("canvas");return r.width=t,r.height=e,r}},b={quality:3,alpha:!1,unsharpAmount:0,unsharpRadius:0,unsharpThreshold:0},v=!1,y=!1,B=!1,E=!1,C=!1;function Q(){return{value:h(g),destroy:function(){if(this.value.terminate(),"undefined"!=typeof window){var t=window.URL||window.webkitURL||window.mozURL||window.msURL;t&&t.revokeObjectURL&&this.value.objectURL&&t.revokeObjectURL(this.value.objectURL)}}}}function x(t){if(!(this instanceof x))return new x(t);this.options=u({},I,t||{});var e="lk_".concat(this.options.concurrency);this.__limit=m[e]||l.limiter(this.options.concurrency),m[e]||(m[e]=this.__limit),this.features={js:!1,wasm:!1,cib:!1,ww:!1},this.__workersPool=null,this.__requested_features=[],this.__mathlib=null}x.prototype.init=function(){var e=this;if(this.__initPromise)return this.__initPromise;if("undefined"!=typeof ImageData&&"undefined"!=typeof Uint8ClampedArray)try{new ImageData(new Uint8ClampedArray(400),10,10),v=!0}catch(t){}"undefined"!=typeof ImageBitmap&&(ImageBitmap.prototype&&ImageBitmap.prototype.close?y=!0:this.debug("ImageBitmap does not support .close(), disabled"));var r=this.options.features.slice();if(r.indexOf("all")>=0&&(r=["cib","wasm","js","ww"]),this.__requested_features=r,this.__mathlib=new f(r),r.indexOf("ww")>=0&&"undefined"!=typeof window&&"Worker"in window)try{t("webworkify")(function(){}).terminate(),this.features.ww=!0;var n="wp_".concat(JSON.stringify(this.options));m[n]?this.__workersPool=m[n]:(this.__workersPool=new c(Q,this.options.idle),m[n]=this.__workersPool)}catch(t){}var i,a,o=this.__mathlib.init().then(function(t){u(e.features,t.features)});i=y?l.cib_support(this.options.createCanvas).then(function(t){e.features.cib&&r.indexOf("cib")<0?e.debug("createImageBitmap() resize supported, but disabled by config"):r.indexOf("cib")>=0&&(e.features.cib=t)}):Promise.resolve(!1),B=l.can_use_canvas(this.options.createCanvas),a=(a=y&&v&&-1!==r.indexOf("ww")?l.worker_offscreen_canvas_support():Promise.resolve(!1)).then(function(t){E=t});var s=l.cib_can_use_region().then(function(t){C=t});return this.__initPromise=Promise.all([o,i,a,s]).then(function(){return e}),this.__initPromise},x.prototype.__invokeResize=function(t,e){var r=this;return e.__mathCache=e.__mathCache||{},Promise.resolve().then(function(){return r.features.ww?new Promise(function(n,i){var a=r.__workersPool.acquire();e.cancelToken&&e.cancelToken.catch(function(t){return i(t)}),a.value.onmessage=function(t){a.release(),t.data.err?i(t.data.err):n(t.data)};var o=[];t.src&&o.push(t.src.buffer),t.srcBitmap&&o.push(t.srcBitmap),a.value.postMessage({opts:t,features:r.__requested_features,preload:{wasm_nodule:r.__mathlib.__}},o)}):{data:r.__mathlib.resizeAndUnsharp(t,e.__mathCache)}})},x.prototype.__extractTileData=function(t,e,r,n,i){if(this.features.ww&&E&&(l.isCanvas(e)||C))return this.debug("Create tile for OffscreenCanvas"),createImageBitmap(n.srcImageBitmap||e,t.x,t.y,t.width,t.height).then(function(t){return i.srcBitmap=t,i});if(l.isCanvas(e))return n.srcCtx||(n.srcCtx=e.getContext("2d",{alpha:Boolean(r.alpha)})),this.debug("Get tile pixel data"),i.src=n.srcCtx.getImageData(t.x,t.y,t.width,t.height).data,i;this.debug("Draw tile imageBitmap/image to temporary canvas");var a=this.options.createCanvas(t.width,t.height),o=a.getContext("2d",{alpha:Boolean(r.alpha)});return o.globalCompositeOperation="copy",o.drawImage(n.srcImageBitmap||e,t.x,t.y,t.width,t.height,0,0,t.width,t.height),this.debug("Get tile pixel data"),i.src=o.getImageData(0,0,t.width,t.height).data,a.width=a.height=0,i},x.prototype.__landTileData=function(t,e,r){var n;if(this.debug("Convert raw rgba tile result to ImageData"),e.bitmap)return r.toCtx.drawImage(e.bitmap,t.toX,t.toY),null;if(v)n=new ImageData(new Uint8ClampedArray(e.data),t.toWidth,t.toHeight);else if((n=r.toCtx.createImageData(t.toWidth,t.toHeight)).data.set)n.data.set(e.data);else for(var i=n.data.length-1;i>=0;i--)n.data[i]=e.data[i];return this.debug("Draw tile"),_?r.toCtx.putImageData(n,t.toX,t.toY,t.toInnerX-t.toX,t.toInnerY-t.toY,t.toInnerWidth+1e-5,t.toInnerHeight+1e-5):r.toCtx.putImageData(n,t.toX,t.toY,t.toInnerX-t.toX,t.toInnerY-t.toY,t.toInnerWidth,t.toInnerHeight),null},x.prototype.__tileAndResize=function(t,e,r){var n=this,i={srcCtx:null,srcImageBitmap:null,isImageBitmapReused:!1,toCtx:null},a=function(e){return n.__limit(function(){if(r.canceled)return r.cancelToken;var a={width:e.width,height:e.height,toWidth:e.toWidth,toHeight:e.toHeight,scaleX:e.scaleX,scaleY:e.scaleY,offsetX:e.offsetX,offsetY:e.offsetY,quality:r.quality,alpha:r.alpha,unsharpAmount:r.unsharpAmount,unsharpRadius:r.unsharpRadius,unsharpThreshold:r.unsharpThreshold};return n.debug("Invoke resize math"),Promise.resolve(a).then(function(a){return n.__extractTileData(e,t,r,i,a)}).then(function(t){return n.debug("Invoke resize math"),n.__invokeResize(t,r)}).then(function(t){return r.canceled?r.cancelToken:(i.srcImageData=null,n.__landTileData(e,t,i))})})};return Promise.resolve().then(function(){if(i.toCtx=e.getContext("2d",{alpha:Boolean(r.alpha)}),l.isCanvas(t))return null;if(l.isImageBitmap(t))return i.srcImageBitmap=t,i.isImageBitmapReused=!0,null;if(l.isImage(t))return y?(n.debug("Decode image via createImageBitmap"),createImageBitmap(t).then(function(t){i.srcImageBitmap=t}).catch(function(t){return null})):null;throw new Error('Pica: ".from" should be Image, Canvas or ImageBitmap')}).then(function(){if(r.canceled)return r.cancelToken;n.debug("Calculate tiles");var t=d({width:r.width,height:r.height,srcTileSize:n.options.tile,toWidth:r.toWidth,toHeight:r.toHeight,destTileBorder:r.__destTileBorder}).map(function(t){return a(t)});function o(t){t.srcImageBitmap&&(t.isImageBitmapReused||t.srcImageBitmap.close(),t.srcImageBitmap=null)}return n.debug("Process tiles"),Promise.all(t).then(function(){return n.debug("Finished!"),o(i),e},function(t){throw o(i),t})})},x.prototype.__processStages=function(t,e,r,i){var a=this;if(i.canceled)return i.cancelToken;var o,s=n(t.shift(),2),A=s[0],h=s[1],f=0===t.length;return i=u({},i,{toWidth:A,toHeight:h,quality:f?i.quality:Math.min(1,i.quality)}),f||(o=this.options.createCanvas(A,h)),this.__tileAndResize(e,f?r:o,i).then(function(){return f?r:(i.width=A,i.height=h,a.__processStages(t,o,r,i))}).then(function(t){return o&&(o.width=o.height=0),t})},x.prototype.__resizeViaCreateImageBitmap=function(t,e,r){var n=this,i=e.getContext("2d",{alpha:Boolean(r.alpha)});return this.debug("Resize via createImageBitmap()"),createImageBitmap(t,{resizeWidth:r.toWidth,resizeHeight:r.toHeight,resizeQuality:l.cib_quality_name(r.quality)}).then(function(t){if(r.canceled)return r.cancelToken;if(!r.unsharpAmount)return i.drawImage(t,0,0),t.close(),i=null,n.debug("Finished!"),e;n.debug("Unsharp result");var a=n.options.createCanvas(r.toWidth,r.toHeight),o=a.getContext("2d",{alpha:Boolean(r.alpha)});o.drawImage(t,0,0),t.close();var s=o.getImageData(0,0,r.toWidth,r.toHeight);return n.__mathlib.unsharp_mask(s.data,r.toWidth,r.toHeight,r.unsharpAmount,r.unsharpRadius,r.unsharpThreshold),i.putImageData(s,0,0),a.width=a.height=0,s=o=a=i=null,n.debug("Finished!"),e})},x.prototype.resize=function(t,e,r){var n=this;this.debug("Start resize...");var i=u({},b);if(isNaN(r)?r&&(i=u(i,r)):i=u(i,{quality:r}),i.toWidth=e.width,i.toHeight=e.height,i.width=t.naturalWidth||t.width,i.height=t.naturalHeight||t.height,0===e.width||0===e.height)return Promise.reject(new Error("Invalid output size: ".concat(e.width,"x").concat(e.height)));i.unsharpRadius>2&&(i.unsharpRadius=2),i.canceled=!1,i.cancelToken&&(i.cancelToken=i.cancelToken.then(function(t){throw i.canceled=!0,t},function(t){throw i.canceled=!0,t}));var a=3;return i.__destTileBorder=Math.ceil(Math.max(a,2.5*i.unsharpRadius|0)),this.init().then(function(){if(i.canceled)return i.cancelToken;if(n.features.cib)return n.__resizeViaCreateImageBitmap(t,e,i);if(!B){var r=new Error("Pica: cannot use getImageData on canvas, make sure fingerprinting protection isn't enabled");throw r.code="ERR_GET_IMAGE_DATA",r}var a=p(i.width,i.height,i.toWidth,i.toHeight,n.options.tile,i.__destTileBorder);return n.__processStages(a,t,e,i)})},x.prototype.resizeBuffer=function(t){var e=this,r=u({},b,t);return this.init().then(function(){return e.__mathlib.resizeAndUnsharp(r)})},x.prototype.toBlob=function(t,e,r){return e=e||"image/png",new Promise(function(n){if(t.toBlob)t.toBlob(function(t){return n(t)},e,r);else if(t.convertToBlob)n(t.convertToBlob({type:e,quality:r}));else{for(var i=atob(t.toDataURL(e,r).split(",")[1]),a=i.length,o=new Uint8Array(a),s=0;s<a;s++)o[s]=i.charCodeAt(s);n(new Blob([o],{type:e}))}})},x.prototype.debug=function(){},e.exports=x},{"./lib/mathlib":1,"./lib/pool":13,"./lib/stepper":14,"./lib/tiler":15,"./lib/utils":16,"./lib/worker":17,"object-assign":23,webworkify:24}]},{},[])("/index.js")}),A=a(function(t){function e(t,e){var r=new Error(t);return r.code=e,r}function r(t){for(var e=t.toString(16).toUpperCase(),r=2-e.length;r>0;r--)e="0"+e;return"0x"+e}function n(t){try{return decodeURIComponent(escape(t))}catch(e){return t}}function i(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)}function a(t,r,n){this.input=t.subarray(r,n),this.start=r;var i=String.fromCharCode.apply(null,this.input.subarray(0,4));if("II*\0"!==i&&"MM\0*"!==i)throw e("invalid TIFF signature","EBADDATA");this.big_endian="M"===i[0]}a.prototype.each=function(t){this.aborted=!1;var e=this.read_uint32(4);for(this.ifds_to_read=[{id:0,offset:e}];this.ifds_to_read.length>0&&!this.aborted;){var r=this.ifds_to_read.shift();r.offset&&this.scan_ifd(r.id,r.offset,t)}},a.prototype.filter=function(t){var r={ifd0:{id:0,entries:[]}};this.each(function(e){(!1!==t(e)||e.is_subifd_link)&&(e.is_subifd_link&&1!==e.count&&4!==e.format||(r["ifd"+e.ifd]||(r["ifd"+e.ifd]={id:e.ifd,entries:[]}),r["ifd"+e.ifd].entries.push(e)))}),delete r.ifd1;var n=8;Object.keys(r).forEach(function(t){n+=2,r[t].entries.forEach(function(t){n+=12+(t.data_length>4?2*Math.ceil(t.data_length/2):0)}),n+=4}),this.output=new Uint8Array(n),this.output[0]=this.output[1]=(this.big_endian?"M":"I").charCodeAt(0),this.write_uint16(2,42);var i=8,a=this;if(this.write_uint32(4,i),Object.keys(r).forEach(function(t){r[t].written_offset=i;var e=i,n=e+2+12*r[t].entries.length+4;i=n,a.write_uint16(e,r[t].entries.length),r[t].entries.sort(function(t,e){return t.tag-e.tag}).forEach(function(t,n){var o=e+2+12*n;a.write_uint16(o,t.tag),a.write_uint16(o+2,t.format),a.write_uint32(o+4,t.count),t.is_subifd_link?r["ifd"+t.tag]&&(r["ifd"+t.tag].link_offset=o+8):t.data_length<=4?a.output.set(a.input.subarray(t.data_offset-a.start,t.data_offset-a.start+4),o+8):(a.write_uint32(o+8,i),a.output.set(a.input.subarray(t.data_offset-a.start,t.data_offset-a.start+t.data_length),i),i+=2*Math.ceil(t.data_length/2))});var o=r["ifd"+(r[t].id+1)];o&&(o.link_offset=n-4)}),Object.keys(r).forEach(function(t){r[t].written_offset&&r[t].link_offset&&a.write_uint32(r[t].link_offset,r[t].written_offset)}),this.output.length!==i)throw e("internal error: incorrect buffer size allocated");return this.output},a.prototype.read_uint16=function(t){var r=this.input;if(t+2>r.length)throw e("unexpected EOF","EBADDATA");return this.big_endian?256*r[t]+r[t+1]:r[t]+256*r[t+1]},a.prototype.read_uint32=function(t){var r=this.input;if(t+4>r.length)throw e("unexpected EOF","EBADDATA");return this.big_endian?16777216*r[t]+65536*r[t+1]+256*r[t+2]+r[t+3]:r[t]+256*r[t+1]+65536*r[t+2]+16777216*r[t+3]},a.prototype.write_uint16=function(t,e){var r=this.output;this.big_endian?(r[t]=e>>>8&255,r[t+1]=255&e):(r[t]=255&e,r[t+1]=e>>>8&255)},a.prototype.write_uint32=function(t,e){var r=this.output;this.big_endian?(r[t]=e>>>24&255,r[t+1]=e>>>16&255,r[t+2]=e>>>8&255,r[t+3]=255&e):(r[t]=255&e,r[t+1]=e>>>8&255,r[t+2]=e>>>16&255,r[t+3]=e>>>24&255)},a.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},a.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},a.prototype.exif_format_read=function(t,e){var r;switch(t){case 1:case 2:return r=this.input[e];case 6:return(r=this.input[e])|33554430*(128&r);case 3:return r=this.read_uint16(e);case 8:return(r=this.read_uint16(e))|131070*(32768&r);case 4:return r=this.read_uint32(e);case 9:return 0|(r=this.read_uint32(e));default:return null}},a.prototype.scan_ifd=function(t,r,i){var a=this.read_uint16(r);r+=2;for(var o=0;o<a;o++){var s=this.read_uint16(r),A=this.read_uint16(r+2),u=this.read_uint32(r+4),h=this.exif_format_length(A),f=u*h,c=f<=4?r+8:this.read_uint32(r+8),l=!1;if(c+f>this.input.length)throw e("unexpected EOF","EBADDATA");for(var g=[],p=c,d=0;d<u;d++,p+=h){var m=this.exif_format_read(A,p);if(null===m){g=null;break}g.push(m)}if(Array.isArray(g)&&2===A){try{g=n(String.fromCharCode.apply(null,g))}catch(t){g=null}g&&"\0"===g[g.length-1]&&(g=g.slice(0,-1))}if(this.is_subifd_link(t,s)&&Array.isArray(g)&&Number.isInteger(g[0])&&g[0]>0&&(this.ifds_to_read.push({id:s,offset:g[0]}),l=!0),!1===i({is_big_endian:this.big_endian,ifd:t,tag:s,format:A,count:u,entry_offset:r+this.start,data_length:f,data_offset:c+this.start,value:g,is_subifd_link:l}))return void(this.aborted=!0);r+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(r)})},t.exports.is_jpeg=function(t){return t.length>=4&&255===t[0]&&216===t[1]&&255===t[2]},t.exports.jpeg_segments_each=function(n,a){if(!i(n))throw e("Invalid argument (jpeg_bin), Uint8Array expected","EINVAL");if("function"!=typeof a)throw e("Invalid argument (on_segment), Function expected","EINVAL");if(!t.exports.is_jpeg(n))throw e("Unknown file format","ENOTJPEG");for(var o=0,s=n.length,A=!1;;){var u,h;if(o+1>=s)throw e("Unexpected EOF","EBADDATA");var f=n[o],c=n[o+1];if(255===f&&255===c)u=255,h=1;else if(255===f&&0!==c){if(h=2,208<=(u=c)&&u<=217||1===u);else{if(o+3>=s)throw e("Unexpected EOF","EBADDATA");if((h+=256*n[o+2]+n[o+3])<2)throw e("Invalid segment length","EBADDATA");if(o+h-1>=s)throw e("Unexpected EOF","EBADDATA")}A&&(u>=208&&u<=215||(A=!1)),218===u&&(A=!0)}else{if(!A)throw e("Unexpected byte at segment start: "+r(f)+" (offset "+r(o)+")","EBADDATA");for(var l=o+1;;l++){if(l>=s)throw e("Unexpected EOF","EBADDATA");if(255===n[l]){if(l+1>=s)throw e("Unexpected EOF","EBADDATA");if(0!==n[l+1]){u=0,h=l-o;break}}}}if(!1===a({code:u,offset:o,length:h}))break;if(217===u)break;o+=h}},t.exports.jpeg_segments_filter=function(r,n){if(!i(r))throw e("Invalid argument (jpeg_bin), Uint8Array expected","EINVAL");if("function"!=typeof n)throw e("Invalid argument (on_segment), Function expected","EINVAL");var a=[],o=0;t.exports.jpeg_segments_each(r,function(t){var e=n(t);if(i(e))a.push({data:e}),o+=e.length;else if(Array.isArray(e))e.filter(i).forEach(function(t){a.push({data:t}),o+=t.length});else if(!1!==e){var r={start:t.offset,end:t.offset+t.length};a.length>0&&a[a.length-1].end===r.start?a[a.length-1].end=r.end:a.push(r),o+=t.length}});var s=new Uint8Array(o),A=0;return a.forEach(function(t){var e=t.data||r.subarray(t.start,t.end);s.set(e,A),A+=e.length}),s},t.exports.jpeg_exif_tags_each=function(r,n){if(!i(r))throw e("Invalid argument (jpeg_bin), Uint8Array expected","EINVAL");if("function"!=typeof n)throw e("Invalid argument (on_exif_entry), Function expected","EINVAL");t.exports.jpeg_segments_each(r,function(t){return 218!==t.code&&(225===t.code&&t.length>=10&&69===r[t.offset+4]&&120===r[t.offset+5]&&105===r[t.offset+6]&&102===r[t.offset+7]&&0===r[t.offset+8]&&0===r[t.offset+9]?(new a(r,t.offset+10,t.offset+t.length).each(n),!1):void 0)})},t.exports.jpeg_exif_tags_filter=function(r,n){if(!i(r))throw e("Invalid argument (jpeg_bin), Uint8Array expected","EINVAL");if("function"!=typeof n)throw e("Invalid argument (on_exif_entry), Function expected","EINVAL");var o=!1;return t.exports.jpeg_segments_filter(r,function(t){if(!o&&(218===t.code&&(o=!0),225===t.code&&t.length>=10&&69===r[t.offset+4]&&120===r[t.offset+5]&&105===r[t.offset+6]&&102===r[t.offset+7]&&0===r[t.offset+8]&&0===r[t.offset+9])){var e=new a(r,t.offset+10,t.offset+t.length).filter(n);if(!e)return!1;var i=new Uint8Array(10);return i.set(r.slice(t.offset,t.offset+10)),i[2]=e.length+8>>>8&255,i[3]=e.length+8&255,o=!0,[i,e]}})},t.exports.jpeg_add_comment=function(e,r){var n=!1,i=0;return t.exports.jpeg_segments_filter(e,function(t){if(!(1===++i&&216===t.code||2===i&&224===t.code||n)){r=function(t){try{return unescape(encodeURIComponent(t))}catch(e){return t}}(r);var a=new Uint8Array(5+r.length),o=0;return a[o++]=255,a[o++]=254,a[o++]=r.length+3>>>8&255,a[o++]=r.length+3&255,r.split("").forEach(function(t){a[o++]=255&t.charCodeAt(0)}),a[o++]=0,n=!0,[a,e.subarray(t.offset,t.offset+t.length)]}})}});function u(t){return this._getUint8Array(t.blob).then(function(e){if(t.is_jpeg=A.is_jpeg(e),!t.is_jpeg)return Promise.resolve(t);t.orig_blob=t.blob;try{var r,n;if(A.jpeg_exif_tags_each(e,function(e){if(0===e.ifd&&274===e.tag&&Array.isArray(e.value))return t.orientation=e.value[0]||1,r=e.is_big_endian,n=e.data_offset,!1}),n){var i=r?new Uint8Array([0,1]):new Uint8Array([1,0]);t.blob=new Blob([e.slice(0,n),i,e.slice(n+2)],{type:"image/jpeg"})}}catch(t){}return t})}function h(t){if(!t.is_jpeg)return Promise.resolve(t);var e,r=t.orientation-1;if(!r)return Promise.resolve(t);var n=(e=4&r?this.pica.options.createCanvas(t.out_canvas.height,t.out_canvas.width):this.pica.options.createCanvas(t.out_canvas.width,t.out_canvas.height)).getContext("2d");return n.save(),1&r&&n.transform(-1,0,0,1,e.width,0),2&r&&n.transform(-1,0,0,-1,e.width,e.height),4&r&&n.transform(0,1,1,0,0,0),n.drawImage(t.out_canvas,0,0),n.restore(),t.out_canvas.width=t.out_canvas.height=0,t.out_canvas=e,Promise.resolve(t)}function f(t){return t.is_jpeg?Promise.all([this._getUint8Array(t.blob),this._getUint8Array(t.out_blob)]).then(function(e){var r=e[0],n=e[1];if(!A.is_jpeg(r))return Promise.resolve(t);var i=[];return A.jpeg_segments_each(r,function(t){if(218===t.code)return!1;i.push(t)}),i=i.filter(function(t){return 226!==t.code&&(t.code>=224&&t.code<240||254===t.code)}).map(function(t){return r.slice(t.offset,t.offset+t.length)}),t.out_blob=new Blob([n.slice(0,2)].concat(i).concat([n.slice(20)]),{type:"image/jpeg"}),t}):Promise.resolve(t)}var c={jpeg_patch_exif:u,jpeg_rotate_canvas:h,jpeg_attach_orig_segments:f,assign:function(t){t.before("_blob_to_image",u),t.after("_transform",h),t.after("_create_blob",f)}};function l(t){if(!(this instanceof l))return new l(t);t=t||{},this.pica=t.pica||s({}),this.initialized=!1,this.utils=i}l.prototype.use=function(t){var e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},l.prototype.init=function(){this.use(c.assign)},l.prototype.toBlob=function(t,e){var r={blob:t,opts:i.assign({max:1/0},e)};return this.initialized||(this.init(),this.initialized=!0),Promise.resolve(r).then(this._blob_to_image).then(this._calculate_size).then(this._transform).then(this._cleanup).then(this._create_blob).then(function(t){return t.out_canvas.width=t.out_canvas.height=0,t.out_blob})},l.prototype.toCanvas=function(t,e){var r={blob:t,opts:i.assign({max:1/0},e)};return this.initialized||(this.init(),this.initialized=!0),Promise.resolve(r).then(this._blob_to_image).then(this._calculate_size).then(this._transform).then(this._cleanup).then(function(t){return t.out_canvas})},l.prototype.before=function(t,e){if(!this[t])throw new Error('Method "'+t+'" does not exist');if("function"!=typeof e)throw new Error('Invalid argument "fn", function expected');var r=this[t],n=this;return this[t]=function(t){return e.call(n,t).then(function(t){return r.call(n,t)})},this},l.prototype.after=function(t,e){if(!this[t])throw new Error('Method "'+t+'" does not exist');if("function"!=typeof e)throw new Error('Invalid argument "fn", function expected');var r=this[t],n=this;return this[t]=function(t){return r.call(n,t).then(function(t){return e.call(n,t)})},this},l.prototype._blob_to_image=function(t){var e=window.URL||window.webkitURL||window.mozURL||window.msURL;return t.image=document.createElement("img"),t.image_url=e.createObjectURL(t.blob),t.image.src=t.image_url,new Promise(function(e,r){t.image.onerror=function(){r(new Error("ImageBlobReduce: failed to create Image() from blob"))},t.image.onload=function(){e(t)}})},l.prototype._calculate_size=function(t){var e=t.opts.max/Math.max(t.image.width,t.image.height);return e>1&&(e=1),t.transform_width=Math.max(Math.round(t.image.width*e),1),t.transform_height=Math.max(Math.round(t.image.height*e),1),t.scale_factor=e,Promise.resolve(t)},l.prototype._transform=function(t){t.out_canvas=this.pica.options.createCanvas(t.transform_width,t.transform_height),t.transform_width=null,t.transform_height=null;var e={alpha:"image/png"===t.blob.type};return this.utils.assign(e,this.utils.pick_pica_resize_options(t.opts)),this.pica.resize(t.image,t.out_canvas,e).then(function(){return t})},l.prototype._cleanup=function(t){t.image.src="",t.image=null;var e=window.URL||window.webkitURL||window.mozURL||window.msURL;return e.revokeObjectURL&&e.revokeObjectURL(t.image_url),t.image_url=null,Promise.resolve(t)},l.prototype._create_blob=function(t){return this.pica.toBlob(t.out_canvas,t.blob.type).then(function(e){return t.out_blob=e,t})},l.prototype._getUint8Array=function(t){return t.arrayBuffer?t.arrayBuffer().then(function(t){return new Uint8Array(t)}):new Promise(function(e,r){var n=new FileReader;n.readAsArrayBuffer(t),n.onload=function(){e(new Uint8Array(n.result))},n.onerror=function(){r(new Error("ImageBlobReduce: failed to load data from input blob")),n.abort()},n.onabort=function(){r(new Error("ImageBlobReduce: failed to load data from input blob (aborted)"))}})},l.pica=s;const g=l}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8014],{89117(t,e,n){n.d(e,{Hm:()=>o,U6:()=>c});const r=["mermaid","svg"];function o(t){return r.includes(t)}let s=null;let i=0;async function a(t){const e=t.trim();if(!e)return{svg:"",error:null};const r=await(s||(s=n.e(2300).then(n.bind(n,62300)).then(t=>{const e=t.default;return e.initialize({startOnLoad:!1,securityLevel:"loose",theme:"default",fontFamily:"inherit",suppressErrorRendering:!0}),e})),s),o="md-mermaid-"+ ++i;try{const{svg:t}=await r.render(o,e);return{svg:t,error:null}}catch(t){return document.getElementById(o)?.remove(),document.getElementById(`d${o}`)?.remove(),{svg:"",error:t?.message??String(t)}}}async function c(t,e){return"svg"===t?function(t){const e=t.trim();if(!e)return{svg:"",error:null};const n=(new DOMParser).parseFromString(e,"image/svg+xml").querySelector("parsererror");return n?{svg:"",error:n.textContent?.trim()||"SVG 解析失败"}:{svg:e,error:null}}(e):a(e)}},41105(t,e,n){n.d(e,{KR:()=>l,Ne:()=>i,op:()=>f,pC:()=>s,sL:()=>c});var r=n(14284),o=n(19878);function s(t){return btoa(unescape(encodeURIComponent(t)))}function i(t){return decodeURIComponent(escape(atob(t)))}let a="";function c(t){a=t||""}function l(t){if(/^(https?:|data:|blob:|\/\/|\/)/i.test(t))return t;const e=t.replace(/^\.\//,"");return r.$M.getDownloadUrl(a+e)}const u=new Set(["a","abbr","b","blockquote","br","code","dd","del","details","div","dl","dt","em","h1","h2","h3","h4","h5","h6","hr","i","img","ins","kbd","li","mark","ol","p","pre","q","s","samp","small","span","strong","sub","summary","sup","table","tbody","td","tfoot","th","thead","tr","u","ul","var","wbr"]),d=new Set(["align","alt","border","cellpadding","cellspacing","class","colspan","height","href","id","rowspan","src","style","target","title","valign","width"]);function h(t){const e=(new DOMParser).parseFromString(`<div>${t}</div>`,"text/html").body.firstElementChild,n=document.createDocumentFragment();if(!e)return n;const r=(t,e)=>{t.childNodes.forEach(t=>{if(t.nodeType===Node.TEXT_NODE)return void e.appendChild(document.createTextNode(t.textContent??""));if(t.nodeType!==Node.ELEMENT_NODE)return;const n=t;if(!u.has(n.tagName.toLowerCase()))return void r(n,e);const o=document.createElement(n.tagName.toLowerCase());for(const t of Array.from(n.attributes)){const e=t.name.toLowerCase();e.startsWith("on")||(d.has(e)||e.startsWith("data-"))&&("href"!==e&&"src"!==e||!/^\s*javascript:/i.test(t.value))&&("src"!==e?o.setAttribute(e,t.value):o.setAttribute(e,l(t.value)))}r(n,o),e.appendChild(o)})};return r(e,n),n}class m{dom;node;view;get_pos;render_box;source_box;source_input;source_hl;source_hl_code;mode="preview";draft=null;constructor(t,e,n){this.node=t,this.view=e,this.get_pos=n,this.dom=document.createElement("div"),this.dom.className="md-html-block",this.dom.setAttribute("data-mode","preview"),this.render_box=document.createElement("div"),this.render_box.className="md-html-block__render",this.source_box=document.createElement("div"),this.source_box.className="md-html-block__source",this.source_input=document.createElement("textarea"),this.source_input.className="md-html-block__input",this.source_input.setAttribute("spellcheck","false"),this.source_input.setAttribute("wrap","off"),this.source_hl=document.createElement("pre"),this.source_hl.className="md-html-block__highlight",this.source_hl.setAttribute("aria-hidden","true");const r=document.createElement("code");this.source_hl.appendChild(r),this.source_hl_code=r,this.source_box.append(this.source_hl,this.source_input);const o=document.createElement("span");o.className="md-html-block__toggle",o.setAttribute("contenteditable","false"),o.textContent="HTML",o.addEventListener("mousedown",t=>{t.preventDefault(),t.stopPropagation(),this.toggle_mode()}),this.source_input.addEventListener("blur",()=>this.commit()),this.source_input.addEventListener("keydown",t=>{"Escape"===t.key&&(t.preventDefault(),this.draft=null,this.toggle_mode()),t.stopPropagation()}),this.source_input.addEventListener("input",()=>{this.draft=this.source_input.value,this.paint_highlight(),this.source_hl.scrollLeft=this.source_input.scrollLeft}),this.source_hl.addEventListener("scroll",()=>{this.source_input.scrollLeft=this.source_hl.scrollLeft});for(const t of["beforeinput","paste","input","keyup","keypress"])this.source_input.addEventListener(t,t=>t.stopPropagation());this.dom.append(this.render_box,this.source_box,o),this.render_box.replaceChildren(h(t.attrs.value)),this.set_source_value(t.attrs.value)}set_source_value(t){this.source_input.value=t,this.paint_highlight()}paint_highlight(){const t=this.source_input.value;this.source_hl_code.innerHTML=o.A.highlight(t+"\n",{language:"xml",ignoreIllegals:!0}).value}toggle_mode(){if("source"===this.mode)return this.commit(),this.mode="preview",void this.dom.setAttribute("data-mode","preview");this.mode="source",this.dom.setAttribute("data-mode","source"),this.set_source_value(this.node.attrs.value),this.draft=null,this.source_input.focus()}commit(){if(null===this.draft)return;const t=this.draft;if(this.draft=null,t===this.node.attrs.value)return;const e=this.get_pos(),n=this.view.state.doc.nodeAt(e);n&&this.view.dispatch(this.view.state.tr.setNodeMarkup(e,void 0,{...n.attrs,value:t}))}update(t){return t.type===this.node.type&&(this.node=t,null===this.draft&&(this.render_box.replaceChildren(h(t.attrs.value)),"preview"===this.mode&&this.set_source_value(t.attrs.value)),!0)}stopEvent(t){return this.dom.contains(t.target)}ignoreMutation(){return!0}}class p{dom;node;view;get_pos;constructor(t,e,n){this.node=t,this.view=e,this.get_pos=n,this.dom=document.createElement("span"),this.dom.className="md-html-inline",this.dom.setAttribute("contenteditable","true"),this.dom.textContent=t.attrs.value,this.dom.addEventListener("blur",()=>this.commit());for(const t of["beforeinput","paste","input"])this.dom.addEventListener(t,t=>t.stopPropagation())}commit(){const t=this.dom.textContent??"";if(t===this.node.attrs.value)return;const e=this.get_pos(),n=this.view.state.doc.nodeAt(e);n&&this.view.dispatch(this.view.state.tr.setNodeMarkup(e,void 0,{...n.attrs,value:t}))}update(t){return t.type===this.node.type&&(this.node=t,!0)}stopEvent(t){return this.dom.contains(t.target)}ignoreMutation(){return!0}}function f(){return{html_block:(t,e,n)=>new m(t,e,n),html_inline:(t,e,n)=>new p(t,e,n)}}},89334(t,e,n){n.d(e,{Rh:()=>p,V:()=>a,lG:()=>s,rg:()=>f,z$:()=>d});var r=n(41105);n(6704);const o=["math","latex","katex"];function s(t){return o.includes(t.toLowerCase())}const i=[{open:"$$",close:"$$",mode:"block"},{open:"\\[",close:"\\]",mode:"block"},{open:"\\(",close:"\\)",mode:"inline"},{open:"$",close:"$",mode:"inline"}];function a(t){const e=t.trim();if(!e)return null;for(const t of i){if(e.length<=t.open.length+t.close.length)continue;if(!e.startsWith(t.open)||!e.endsWith(t.close))continue;const n=e.slice(t.open.length,e.length-t.close.length);if(("$"!==t.open||!e.startsWith("$$"))&&n.trim())return{tex:n,mode:t.mode,raw:e}}return null}let c=null;const l=new Map;async function u(t,e){const r=t.trim();if(!r)return{html:"",error:null};const o=`${e}\0${r}`,s=l.get(o);if(s)return s;let i;try{const{renderToString:t}=await(c||(c=n.e(2130).then(n.bind(n,99749))),c);i={html:t(r,{displayMode:"block"===e,throwOnError:!1,strict:!1,trust:!1,output:"html"}),error:null}}catch(t){i={html:"",error:t?.message??String(t)}}return l.size>=500&&l.clear(),l.set(o,i),i}async function d(t,e,n,r){const o=await u(e,n);if(t.isConnected){if(t.classList.remove("md-math--loading","md-math--error"),o.error)return t.classList.add("md-math--error"),t.textContent=r,void(t.title=o.error);t.innerHTML=o.html}}function h(t,e){const n=t.pos,r=t.src;if(r.startsWith("$$",n))return!1;const o=[{open:"\\(",close:"\\)"},{open:"$",close:"$"}];for(const s of o){if(!r.startsWith(s.open,n))continue;const o=n+s.open.length,i=r.indexOf(s.close,o);if(i<0)continue;const a=r.slice(o,i);if(a.trim()){if("$"===s.open){const t=r[i+1];if(void 0!==t&&/\d/.test(t))continue}if(!e){const e=t.push("math_inline","span",0);e.content=a,e.markup=s.open,e.meta={raw:r.slice(n,i+s.close.length)}}return t.pos=i+s.close.length,!0}}return!1}function m(t,e,n,r){const o=t.bMarks[e]+t.tShift[e],s=t.eMarks[e],i=t.src.slice(o,s).trim(),a=[{open:"\\[",close:"\\]"},{open:"$$",close:"$$"}];for(const s of a){if(!i.startsWith(s.open))continue;if(i.endsWith(s.close)&&i.length>s.open.length+s.close.length){if(r)return!0;const n=t.push("math_block","div",0);return n.content=i.slice(s.open.length,i.length-s.close.length),n.markup=s.open,n.meta={raw:i},n.map=[e,e+1],t.line=e+1,!0}const a=i.slice(s.open.length);for(let i=e+1;i<n;i++){const n=t.bMarks[i]+t.tShift[i],c=t.eMarks[i],l=t.src.slice(n,c);if(!l.trimEnd().endsWith(s.close))continue;if(r)return!0;const u=[];a.trim()&&u.push(a),t.getLines(e+1,i,t.tShift[e],!1).split("\n").forEach(t=>u.push(t)),u.push(l.trimEnd().slice(0,-s.close.length));const d=t.push("math_block","div",0);return d.content=u.join("\n").trim(),d.markup=s.open,d.meta={raw:t.src.slice(o,t.eMarks[i]).trimEnd()},d.map=[e,i+1],t.line=i+1,!0}}return!1}function p(t,e){t.inline.ruler.before("escape","math_inline",h),t.block.ruler.before("fence","math_block",m,{alt:["paragraph","reference","blockquote","list"]}),t.renderer.rules.math_inline=(t,n)=>`<span data-math-inline="${e(t[n].meta.raw)}"></span>`,t.renderer.rules.math_block=(t,n)=>`<div data-math-block="${e(t[n].meta.raw)}"></div>`;const n=t.renderer.rules.fence||function(t,e,n,r,o){return o.renderToken(t,e,n)};t.renderer.rules.fence=(t,r,o,i,a)=>s(t[r].info.trim())?`<div data-math-block="${e(`$$\n${t[r].content.trim()}\n$$`)}"></div>`:n(t,r,o,i,a)}async function f(t){const e=t.querySelectorAll("[data-math-inline], [data-math-block]");for(const t of Array.from(e)){const e=t.getAttribute("data-math-inline"),n=t.getAttribute("data-math-block"),o=e??n;if(null===o)continue;const s=a((0,r.Ne)(o));if(!s)continue;const i=null!==e?"inline":"block";t.classList.add("md-math","block"===i?"md-math--block":"md-math--inline"),await d(t,s.tex,i,s.raw)}}},86063(t,e,n){function r(t){return"smm-mind"===t}n.d(e,{Hn:()=>u,hj:()=>r,k$:()=>o,tW:()=>i});const o={mousewheelMoveStep:35,scaleRatio:.08};let s=null;function i(t){return t&&"object"==typeof t?t.data?.nodeData?a(t.data.nodeData):t.root&&"object"==typeof t.root?t.root.data?t.root:c(t.root):t.data&&"object"==typeof t.data?t:c(t):null}function a(t){return{data:{text:"string"==typeof t?.topic?t.topic:"string"==typeof t?.data?.text?t.data.text:""},children:Array.isArray(t?.children)?t.children.map(a):[]}}function c(t){return{data:{text:"string"==typeof t?.text?t.text:"",...t?.note?{note:t.note}:{}},children:Array.isArray(t?.children)?t.children.map(c):[]}}function l(t){t.stopPropagation()}async function u(t){const e=function(t){const e=t.trim();if(!e)return null;let n=null;try{n=JSON.parse(e)}catch{return null}return i(n)}(t),r=await(s||(s=Promise.all([n.e(1417).then(n.bind(n,21417)),n.e(8781).then(n.bind(n,88781))]).then(([t])=>t.default)),s);return{data:e,async mount(t,n){let s=!1;const i=await function(t,e){return new Promise(n=>{const r=()=>{e()?n(!1):t.isConnected&&t.clientWidth&&t.clientHeight?n(!0):window.setTimeout(r,16)};r()})}(t,()=>s);if(!i)return{destroy:()=>{},get_data:()=>null};const a=document.createElement("div");a.className="md-graph__mind-host",!1!==n?.release_wheel&&t.addEventListener("wheel",l,{capture:!0,passive:!0}),t.append(a);const c=new r({el:a,data:e??{data:{text:""}},readonly:!n?.editable,fit:!0,...o});return{destroy:()=>{s=!0,t.removeEventListener("wheel",l,{capture:!0}),c?.destroy?.()},get_data:()=>c?.getData?.(!1)}}}}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[6010,8302],{83277(e,t,n){n.d(t,{$j:()=>r,CP:()=>o,Lv:()=>s,cL:()=>a});class s{token;open=!1;note;index;url;model;request_type;json_params;sys_prompt;dotenv="";tool_mode=!1;show_options;static get_label_by_v(e,t){if(!e||!t?.length)return e;for(const n of t)if(n.value===e)return n.label;return e}static have_label_by_v(e,t){if(!e||!t?.length)return!1;for(const n of t)if(n.value===e)return!0;return!1}}const o='\n\n\n\n# 聊天循环最大次数\ntool_call_max=500\n# 是否允许AI直接执行命令而不需要用户确认,默认为false,需要用户手动确认,如果使用 workflow 这里等价于为 true\nallow_exec_cmd_directly=false\n\n# 可选的代理 url,如果指定了所有访问大模型的请求将会走代理\n#proxy_url=\n\n# 可选的多个url 以数组分割\n# options_agent_url_list=[{"value":"http://..","label":"openai"}]\n\n# 可选的多个 key\n# options_agent_key_list=[{"value":"sh-aaa","label":"option1"}]\n\n# 可选的多个 model\n# options_agent_model_list=[{"value":"gpt-5.5","label":"gpt"}]\n\n# 存放本地的 prompt 文件 用于每次聊天的时候自动读取并加载\n# options_local_file_path_prompt_list=["/prompt/a.txt"]\n\n# 开启切换模型 ,开启以后,你可以自己写 prompt 提供多个模型让 ai 自己根据每次聊天切换下一步调用其他模型的次数\n# open_pick_model=false\n\n# 压缩后仍然完整保留的最近消息数\nmax_recent_messages=12\n# 当单个会话累计消息条数超过该值时,触发历史消息裁剪\ncompress_message_count=16\n# 历史消息中 tool 输出的最大字符数,只保留调用形式让 AI 知道调用了就行\nmax_tool_content_chars=200\n\n# ===== 模型类型(request_type)=====\n# 必填项,不同类型的 model 接口格式不同,默认 completions。\n# 可选值:\n# completions 标准对话/聊天补全 (chat/completions)\n# images 图片生成 (images/generations)\n# audio_speech 文本转语音 (audio/speech)\n# audio_transcription 语音转文字 (audio/transcriptions)\n# audio_translation 语音翻译 (audio/translations)\n# embeddings 向量嵌入 (embeddings)\n#request_type=completions\n\n# ===== 成为 tool(tool_mode)=====\n# 开启后该模型会作为一个工具被加载,可实现不同模型担任不同角色/能力,供 AI agent 在对话中动态调用。\n# 注意:不能与「是否开启」(open) 同时为 true。\n#tool_mode=false\n\n# ===== 是否支持图片(support_image)=====\n# 开启后:1) 注册 read_image 工具,让 AI 能读取本地图片;\n# 2) 工具读到的图片会以 OpenAI 多模态格式 image_url 随消息发给模型,模型就能真正"看图"。\n# 关闭后:AI 看不到图片,read_image 只会返回一句文字说明。\n# 主流模型(gpt-4o、豆包、qwen-vl、deepseek-vl 等)都支持,默认开启。\nsupport_image=true\n';const a=JSON.stringify({stream:!0,thinking:{type:"disabled"}});function r(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>"text"===e.type?e.text:"[图片]").join("\n"):""}},77481(e,t,n){n.d(t,{S:()=>i,X:()=>r});var s=n(96540),o=n(61443),a=n(74848);function r(e){const[t,n]=s.useState([]),r=(0,s.useRef)(-1),[i,l]=(0,s.useState)(-1),[c,d]=(0,s.useState)(-1);(0,s.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]);const p=()=>{r.current=-1,l(-1),d(-1)};return(0,a.jsxs)("table",{children:[(0,a.jsx)("thead",{children:(0,a.jsx)("tr",{children:e.headers?.map((t,n)=>{const s=!!e.filter&&(e.filter.column??0)===n;let r=t;if(s){const n=e.filter,s=n.options.find(e=>e.value===n.value);null!=n.value&&s&&(r=`${t} (${s.label})`)}return(0,a.jsx)("th",{className:s?"table-filter-col":"",children:s?(0,a.jsx)(o.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:r}):t},n)})})}),(0,a.jsx)("tbody",{children:t.map((t,n)=>{const s=!!e.onRowDrag;return(0,a.jsx)("tr",{className:s?(i===n?"row-dragging":"")+(c===n?" row-drop-target":""):"",draggable:s,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{s&&(r.current=n,l(n),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!s||r.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(n))},onDrop:t=>{s&&(t.preventDefault(),(()=>{const t=r.current,n=c;p(),t<0||n<0||t===n||e.onRowDrag?.(t,n)})())},onDragEnd:p,children:t.map((n,s)=>{const o=s===t.length-1?"small":"";return(0,a.jsx)("td",{className:o,style:{width:e.width??"auto"},children:n},s)})},n)})})]})}function i(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))})}},29591(e,t,n){n.r(t),n.d(t,{default:()=>$});var s=n(22022),o=n(96540),a=n(85997),r=n(4412),i=n(34843),l=n(82893),c=n(75725),d=n(77481),p=n(61443),m=n(70447),u=n(34299),h=n(74848);var _=n(14284),x=n(53459),g=n(62042),v=n(7523),f=n(78247),j=n(23430),y=n(52671),w=n(14944),C=n(92275),b=n(88815),A=n(64694),k=n(45907),S=n(12721),I=n(24659),N=n(83277);function $(){const{t:e}=(0,s.Bd)(),{initUserInfo:t}=(0,o.useContext)(v.F),n=[e("编号"),e("url"),e("是否开启"),e("key"),"model",e("更多属性"),e("备注")],$=[e("编号"),e("本地目录"),e("自动加载"),e("备注")],[K,O]=(0,o.useState)([]),[L,M]=(0,o.useState)([]),[P,X]=(0,o.useState)([]),[D,T]=(0,o.useState)(null),H=(0,o.useRef)(),R=(0,o.useRef)(!1),q=(0,o.useRef)(!1),[F,V]=(0,o.useState)([]),[E,Y]=(0,o.useState)(!1),[B,G]=(0,o.useState)({}),[J,W]=(0,i.fp)(l.AG.prompt_card),[z,U]=(0,i.fp)(l.AG.user_base_info),[Z,Q]=(0,o.useState)(!1),ee=P.filter(e=>"http"!==(e.transport??"stdio")),te=P.filter(e=>"http"===e.transport),ne=[e("编号"),e("名称"),e("是否开启"),e("状态"),"command","args","cwd",e("tools|env"),e("备注")],se=[e("编号"),e("名称"),e("是否开启"),e("状态"),e("endpoint"),e("tools|headers"),e("备注")],oe=[e("编号"),e("提示词"),e("LLM编辑开关"),e("llm_pmt"),e("编辑规则"),e("备注")],[ae,re]=(0,o.useState)([]),[ie,le]=(0,o.useState)(!1),ce=function(){const[e,t]=(0,i.fp)(l.AG.prompt_card);return e=>{t({open:!0,title:"信息",context_div:(0,h.jsx)("div",{children:(0,h.jsx)(u.default,{context:e})})})}}(),{check_user_auth:de}=(0,f.MH)(),[pe,me]=(0,i.fp)(l.AG.editorSetting),ue=(0,y.Zp)(),he=(0,k.y)(),_e=(0,I.K)(),xe=async()=>{const e=await _.jV.get("docs_on_get");e.code===x.m.Success&&Q(e.data)};(0,o.useEffect)(()=>{(async()=>{const e=await _.XO.get("ai_agent_setting");e.code===x.m.Success&&O(e.data.models),await w.ws.addMsg(C.HK.ai_load_info,e=>{T(e.context)});const t=await w.ws.sendData(C.HK.ai_load_info,{});t?.context&&T(t.context);const n=await _.XO.get("ai_docs_setting");n.code===x.m.Success&&(H.current=n.data.param,n.data.list?.length&&M(n.data.list));const s=await _.XO.get("ai_mcp_setting");s.code===x.m.Success&&X(s.data.list??[]),await we(),xe();const o=await _.XO.get("ai_system_prompts");o.code===x.m.Success&&re(o.data??[]);const a=await _.XO.get("ai_long_term_memory_setting");a.code===x.m.Success&&le(a.data?.open??!1)})()},[]),(0,o.useEffect)(()=>{w.ws.addMsg(C.HK.mcp_status,e=>{const t=e.context??{},n={};for(const e of t.status??[])n[e.index]={state:e.state,error:e.error,tool_count:e.tool_count};G(n),t.done&&we()})},[]);const ge=(e="stdio")=>{const t="http"===e?{name:"",open:!1,note:"",transport:"http",endpoint:"",headers:"",stream:!1,timeout_ms:1e4}:{name:"",open:!1,command:"",args:"",cwd:"",env:"",note:"",transport:"stdio",timeout_ms:1e4};X([...P,t]),R.current=!0},ve=e=>{const t=P.indexOf(e);t<0||(P.splice(t,1),X([...P]),R.current=!0)},fe=e=>{X([...P,{...e,open:!1}]),R.current=!0},je=async e=>{for(let e=0;e<K.length;e++)K[e].index=e;(await _.XO.post("ai_agent_setting/save",{models:e??K})).code===x.m.Success&&(0,g.SK)("保存成功")},ye=async e=>{for(let e=0;e<P.length;e++)P[e].index=e;(await _.XO.post("ai_mcp_setting/save",{list:e??P})).code===x.m.Success&&((0,g.SK)("保存成功"),R.current=!1,w.ws.sendData(C.HK.mcp_reload,{}))},we=async()=>{const e=await _.XO.get("ai_mcp_tools");return e.code===x.m.Success?(V(e.data??[]),e.data??[]):[]},Ce=async e=>{Y(!0);try{const t=await _.XO.post("ai_mcp_tools/reload",{index:e});if(t.code===x.m.Success)return await we(),(0,g.SK)("MCP工具加载成功"),t.data??null}finally{Y(!1)}return null},be=async(t,n,s,o)=>{const a=o??F.find(e=>e.index===n)??{index:n,key:`${n}`,name:t.name??"",note:t.note,transport:t.transport??"stdio",open:!!t.open,loaded:!1,tool_count:0,tools:[]},r=(a.tools??[]).map(t=>({id:t.runtime_name,title:t.tool_name,subtitle:t.description||e("无描述"),detail:t.display_name,meta:t.runtime_name}));W({open:!0,title:`${t.name||t.note||n} MCP工具`,context_div:(0,h.jsx)(S.O,{title:`${t.name||t.note||n} MCP工具`,subtitle:`${a.transport??"stdio"} | ${a.open?e("是"):e("否")} | ${a.loaded?"loaded":"idle"} | ${a.tool_count} tools`,pages:r,initialPageId:s,onRefresh:async()=>{const e=await Ce(n);e&&await be(t,n,s,e)},renderPage:t=>{if(!t)return(0,h.jsx)("div",{className:"prompt-switch-page__empty",children:e("暂无工具")});const n=a.tools?.find(e=>e.runtime_name===t.id);return n?(0,h.jsxs)("div",{className:"prompt-switch-page__detail",children:[(0,h.jsx)("div",{className:"prompt-switch-page__detail-title",children:n.display_name}),(0,h.jsx)("div",{className:"prompt-switch-page__detail-desc",children:n.description||e("无描述")}),(0,h.jsxs)("div",{className:"prompt-switch-page__detail-row",children:[(0,h.jsx)("strong",{children:"runtime:"})," ",n.runtime_name]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("strong",{children:"schema:"}),(0,h.jsx)("pre",{className:"prompt-switch-page__schema",children:JSON.stringify(n.input_schema??{},null,2)})]})]}):(0,h.jsx)("div",{className:"prompt-switch-page__empty",children:e("暂无工具")})}}),cancel:()=>W({open:!1})})},Ae=t=>{const n=B[t];let s=n?.state,o=n?.error,a=n?.tool_count;if(!s){const e=F.find(e=>e.index===t);s=e?.state,o=e?.error,a=e?.tool_count}switch(s){case"loading":return(0,h.jsx)(m.fq,{loading:!0,text:e("加载中")});case"success":return(0,h.jsx)(m.fq,{success:!0,text:`${a??0} ${e("个工具")}`});case"failed":return(0,h.jsx)("span",{title:o??e("加载失败"),children:(0,h.jsx)(m.fq,{success:!1,text:e("加载失败")})});default:return(0,h.jsx)(m.fq,{text:e("未加载")})}},ke=async e=>{for(let e=0;e<K.length;e++)K[e].index=e;let t={list:L,docs_update_tag:q.current};null!=e&&(t={param:e}),q.current=!1;(await _.XO.post("ai_docs_setting_save",t)).code===x.m.Success&&(0,g.SK)("保存成功")},Se=async()=>{for(let e=0;e<ae.length;e++)ae[e].index=e;(await _.XO.post("ai_system_prompts/save",{list:ae})).code===x.m.Success&&(0,g.SK)("保存成功")};return(0,h.jsxs)("div",{children:[(0,h.jsx)(r.aZ,{position:"right",children:de(j.oV.ai_agent_setting)&&(0,h.jsx)(a.rA,{icon:"arrow_back",title:e("上一页"),onClick:()=>{ue(-1)}})}),(0,h.jsx)(c.jW,{isFull:!0,more:!0,children:(0,h.jsx)(c.NN,{children:(0,h.jsxs)(c.xh,{children:[(0,h.jsx)(c.fI,{children:(0,h.jsx)(c.VP,{widthPer:100,children:(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsx)("h2",{children:e("Model")+" "+e("设置")})," ",(0,h.jsx)(a.rA,{icon:"info",onClick:()=>{ce('\n1. Only OpenAI-style AI APIs are supported. Fill in the FULL endpoint path (not just the domain), e.g. https://ark.cn-beijing.volces.com/api/v3/chat/completions\n2. The longer the conversation history, the more expensive the LLM token cost. Currently, there is no long-term memory simplification capability. You can set the system prompt to make the AI answer more concisely to save tokens\n3. When writing the model request parameter JSON, you can only write JSON in it, to configure the attributes supported by OpenAI-style AI, such as temperature, thinking (Doubao\'s deep thinking toggle), etc.\n4. You can enable "stream": true in the model request parameters to improve response speed.\n5. Deep thinking currently affects output speed. It is recommended to set { "thinking" : { "type":"disabled" } } to disable it (Doubao example).\n6. To use the AI feature to query server information, the AI needs to be able to know some commands. You need to first set command permissions for the user in user settings. It is recommended to set * to allow all commands, and then set the dangerous commands that are not allowed to be executed in the settings\n7. The model type and Become Tool are now both configured in "More Attributes → Extra Parameter Settings" using request_type / tool_mode (comments are already provided in the editor).\n8. After becoming a tool, the model will be loaded as a tool, enabling different models to serve as different roles; please do not set both it and "Enabled" to true at the same time.\n')},title:"信息"})]}),titleCom:(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{O([...K,{note:"",open:!1,path:"",dotenv:N.CP,json_params:N.cL}])}}),(0,h.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:async()=>{await je()}})]}),children:(0,h.jsx)(d.X,{headers:n,onRowDrag:(e,t)=>{O((0,A.TI)(K,e,t))},rows:K.map((t,n)=>{const s=[(0,h.jsx)("div",{children:n}),(0,h.jsx)(p.Sm,{value:N.Lv.get_label_by_v(t.url,t.show_options?.options_agent_url_list),options:t.show_options?.options_agent_url_list,handleInputChange:e=>{t.url=e},no_border:!0}),(0,h.jsx)(p.l6,{value:t.open,onChange:e=>{((e,t,n)=>{const s=[];for(let e=0;e<K.length;e++)K[e].open=e===n&&t,s.push(K[e]);O(s)})(0,e,n)},options:_e,no_border:!0}),(0,h.jsx)(p.Sm,{type:N.Lv.have_label_by_v(t.token,t.show_options?.options_agent_key_list)?null:"password",value:N.Lv.get_label_by_v(t.token,t.show_options?.options_agent_key_list),options:t.show_options?.options_agent_key_list,handleInputChange:e=>{t.token=e},no_border:!0}),(0,h.jsx)(p.Sm,{value:N.Lv.get_label_by_v(t.model,t.show_options?.options_agent_model_list),options:t.show_options?.options_agent_model_list,handleInputChange:e=>{t.model=e},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"short_text",title:"prompt",onClick:()=>{f.xK.set_value_temp(K[n].sys_prompt??""),me({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{K[n].sys_prompt=e,O(K),f.xK.set_value_temp(""),je(K)}})}}),(0,h.jsx)(a.rA,{icon:"edit_attributes",title:"model请求参数json编写",onClick:()=>{f.xK.set_value_temp(K[n].json_params),me({model:"ace/mode/json",open:!0,fileName:"",save:async e=>{K[n].json_params=e,O(K),f.xK.set_value_temp(""),je(K)},can_format:!0})}}),(0,h.jsx)(a.rA,{icon:"settings",title:"额外参数设置",onClick:()=>{f.xK.set_value_temp(K[n].dotenv),me({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{K[n].dotenv=e,O(K),f.xK.set_value_temp(""),je(K)}})}})]}),(0,h.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{K.splice(e,1),O([...K])})(n)}),(0,h.jsx)(a.rA,{icon:"copy_all",title:e("复制"),onClick:()=>(e=>{O([...K,{...K[e],open:!1}])})(n)})]})];return s}),width:"10rem"})})})}),(0,h.jsx)(c.fI,{children:(0,h.jsx)(c.VP,{widthPer:70,children:(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsxs)("h2",{children:[e("MCP")+" "+e("设置")," - stdio"]})," ",(0,h.jsx)(a.rA,{icon:"info",onClick:()=>{ce("\n1. 这里配置的是 MCP Client 启动参数,当前实现的是 stdio 模式,也就是通过 command + args 启动本地 MCP Server\n2. 例如可以填 npx / uvx / python 等命令,再配合对应的 MCP server 包参数\n3. 保存后会自动重新加载 MCP 工具,agent 聊天时会把这些工具一起带给模型\n4. 建议把 cwd 配到具体项目目录,避免 server 在错误目录里运行\n")},title:"信息"})]}),titleCom:(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>ge("stdio")}),(0,h.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:()=>{ye()}})]}),children:(0,h.jsx)(d.X,{headers:ne,onRowDrag:(e,t)=>{X((0,A.TI)(P,P.indexOf(ee[e]),P.indexOf(ee[t]))),R.current=!0},rows:ee.map((t,n)=>{const s=P.indexOf(t);return[(0,h.jsx)("div",{children:n}),(0,h.jsx)(p.Sm,{value:t.name,handleInputChange:e=>{t.name=e,R.current=!0},no_border:!0}),(0,h.jsx)(p.l6,{value:t.open,onChange:e=>{t.open=e,X([...P]),R.current=!0},options:_e,no_border:!0}),Ae(P.indexOf(t)),(0,h.jsx)(p.Sm,{value:t.command,handleInputChange:e=>{t.command=e,R.current=!0},no_border:!0}),(0,h.jsx)(p.Sm,{value:t.args,handleInputChange:e=>{t.args=e,R.current=!0},no_border:!0}),(0,h.jsx)(p.Sm,{value:t.cwd,handleInputChange:e=>{t.cwd=e,R.current=!0},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"visibility",title:"查看工具",onClick:()=>{be(t,s)}}),(0,h.jsx)(a.rA,{icon:"settings",title:"env",onClick:()=>{f.xK.set_value_temp(t.env??""),me({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{t.env=e,X([...P]),f.xK.set_value_temp(""),R.current=!0,ye()}})}})]}),(0,h.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e,R.current=!0},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>ve(t)}),(0,h.jsx)(a.rA,{icon:"copy_all",title:e("复制"),onClick:()=>fe(t)})]})]}),width:"10rem"})})})}),(0,h.jsx)(c.fI,{children:(0,h.jsxs)(c.VP,{widthPer:70,children:[(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsxs)("h2",{children:[e("MCP")+" "+e("设置")," - HTTP"]})," "]}),titleCom:(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>ge("http")}),(0,h.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:()=>{ye()}})]}),children:(0,h.jsx)(d.X,{headers:se,onRowDrag:(e,t)=>{X((0,A.TI)(P,P.indexOf(te[e]),P.indexOf(te[t]))),R.current=!0},rows:te.map((t,n)=>{const s=P.indexOf(t);return[(0,h.jsx)("div",{children:n}),(0,h.jsx)(p.Sm,{value:t.name,handleInputChange:e=>{t.name=e,R.current=!0},no_border:!0}),(0,h.jsx)(p.l6,{value:t.open,onChange:e=>{t.open=e,X([...P]),R.current=!0},options:_e,no_border:!0}),Ae(P.indexOf(t)),(0,h.jsx)(p.Sm,{value:t.endpoint,handleInputChange:e=>{t.endpoint=e,R.current=!0},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"visibility",title:"查看工具",onClick:()=>{be(t,s)}}),(0,h.jsx)(a.rA,{icon:"settings",title:"headers",onClick:()=>{f.xK.set_value_temp(t.headers??""),me({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{t.headers=e,X([...P]),f.xK.set_value_temp(""),R.current=!0,ye()}})}})]}),(0,h.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e,R.current=!0},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>ve(t)}),(0,h.jsx)(a.rA,{icon:"copy_all",title:e("复制"),onClick:()=>fe(t)})]})]}),width:"10rem"})}),(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsx)("h2",{children:e("系统会话提示词")})," ",(0,h.jsx)(a.rA,{icon:"info",onClick:()=>{ce('\n1. 系统会话提示词,在 AI 聊天页创建会话时可以选择,选中的提示词会自动填入聊天框作为第一条系统消息\n2. 适用于预先设定常用的会话场景模板,如"代码审查"、"翻译助手"、"运维诊断"等\n3. "LLM编辑开关":开启后,当用户选择了该系统提示词发起对话时,AI 将会获得一个"更新会话提示词"工具,允许 AI 在对话中对当前会话进行总结,并写入到本提示词的"LLM编辑提示词"字段(全局保存,供之后的新会话沿用),使 AI 能自我维护长期上下文。\n4. "LLM编辑提示词":可选。AI 编辑后写回的内容(可预填初始方向)。仅在"LLM编辑开关"开启时生效。\n5. "编辑规则":可选。给 LLM 的编辑要求,例如"总结时不要超过 300 token"、"用简洁的项目要点记录"等。仅在"LLM编辑开关"开启时生效。\n')},title:"信息"})]}),titleCom:(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{re([...ae,{prompt:"",note:"",llm_prompt_enable:!1}])}}),(0,h.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:()=>{Se()}})]}),children:(0,h.jsx)(d.X,{headers:oe,onRowDrag:(e,t)=>{re((0,A.TI)(ae,e,t))},rows:ae.map((t,n)=>{const s=[(0,h.jsx)("div",{children:n}),(0,h.jsx)("div",{children:(0,h.jsx)(a.rA,{icon:"short_text",title:e("提示词"),onClick:()=>{f.xK.set_value_temp(t.prompt??""),me({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{t.prompt=e,re([...ae]),f.xK.set_value_temp(""),Se()}})}})}),(0,h.jsx)(a.Ay,{checked:!!t.llm_prompt_enable,onChange:e=>{t.llm_prompt_enable=e,re([...ae])},title:e("LLM编辑开关")}),(0,h.jsx)("div",{children:(0,h.jsx)(a.rA,{icon:"edit_note",title:e("llm_pmt"),onClick:()=>{f.xK.set_value_temp(t.llm_prompt??""),me({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{t.llm_prompt=e,re([...ae]),f.xK.set_value_temp(""),Se()}})}})}),(0,h.jsx)("div",{children:(0,h.jsx)(a.rA,{icon:"rule",title:e("编辑规则"),onClick:()=>{f.xK.set_value_temp(t.llm_prompt_tip??""),me({model:"ace/mode/text",open:!0,fileName:"",save:async e=>{t.llm_prompt_tip=e,re([...ae]),f.xK.set_value_temp(""),Se()}})}})}),(0,h.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,h.jsx)("div",{children:(0,h.jsx)(a.rA,{icon:"delete",title:e("删除"),onClick:()=>(e=>{ae.splice(e,1),re([...ae])})(n)})})];return s}),width:"10rem"})}),(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsx)("h2",{children:e("长期记忆")})," ",(0,h.jsx)(a.rA,{icon:"info",onClick:()=>{ce(e("开启后跨会话保存记忆。四个固定文件:周/月/年/永久。每周结束自动压缩周→月,每月结束自动压缩月→年,每年结束自动压缩年→永久。编辑按钮可手动查看和修改。"))},title:"信息"})]}),titleCom:(0,h.jsx)("div",{children:(0,h.jsx)(a.Ay,{checked:ie,onChange:async t=>{le(t),await _.XO.post("ai_long_term_memory_setting/save",{open:t}),(0,g.SK)(e("长期记忆设置已保存"))},title:e("开关")})}),children:(0,h.jsx)("div",{style:{display:"flex",gap:"0.5rem",padding:"0.5rem 0",flexWrap:"wrap"},children:[{type:"week",label:e("周记忆"),tip:e("上限3000字")},{type:"month",label:e("月记忆"),tip:e("上限6000字")},{type:"year",label:e("年记忆"),tip:e("上限9000字")},{type:"forever",label:e("永久记忆"),tip:e("上限12000字")}].map(({type:t,label:n,tip:s})=>(0,h.jsx)(a.rA,{icon:"edit",title:`${e("编辑")} ${n} (${s})`,onClick:async()=>{const s=await _.XO.get(`ai_long_term_memory_bucket/${t}`),o=s.code===x.m.Success?s.data??"":"";f.xK.set_value_temp(o),me({model:"ace/mode/text",open:!0,fileName:`long_term_memory_${t}.txt`,save:async s=>{await _.XO.post(`ai_long_term_memory_bucket/${t}/save`,{data:s}),f.xK.set_value_temp(""),(0,g.SK)(`${n} ${e("已保存")}`)}})}},t))})})]})}),(0,h.jsxs)(c.fI,{children:[(0,h.jsx)(c.VP,{widthPer:50,children:(0,h.jsx)(m.uF,{self_title:(0,h.jsxs)("span",{className:" div-row ",children:[(0,h.jsx)("h2",{children:e("本地知识库")})," ",(0,h.jsx)(a.rA,{icon:"info",onClick:()=>{ce("\n1. 本地知识库用于为AI增强理解能力,或者分析本地文件,原理读取本地的文件,对文件在内存中建立全文索引,为AI提供额外数据(需要有模型开启才能使用)\n2. 该功能只能用于小型知识库,作为本地小型或者公司内部资料使用还是没有问题的\n3. 每次保存都会重新加载知识库中的文件,不会全部重新加载,而是检测哪些文件有变更\n")},title:"信息"})]}),titleCom:(0,h.jsxs)("div",{children:[(0,h.jsx)(a.Ay,{checked:Z,onChange:async e=>{await _.jV.post("docs_on_set",{status:e}),xe(),t()},title:e("知识库开关")}),(0,h.jsx)(a.rA,{icon:"settings",title:"额外参数设置",onClick:()=>{f.xK.set_value_temp(H.current),me({model:"ace/mode/ini",open:!0,fileName:"",save:async e=>{H.current=e,f.xK.set_value_temp(""),ke(H.current)}})}}),(0,h.jsx)(a.rA,{icon:"add",title:e("添加"),onClick:()=>{M([...L,{note:"",auto_load:!1,dir:""}]),q.current=!0}}),(0,h.jsx)(a.rA,{icon:"save",title:e("保存"),onClick:()=>{ke()}})]}),children:(0,h.jsx)(d.X,{headers:$,onRowDrag:(e,t)=>{M((0,A.TI)(L,e,t)),q.current=!0},rows:L.map((t,n)=>{const s=[(0,h.jsx)("div",{children:n}),(0,h.jsx)(p.Sm,{value:t.dir,handleInputChange:e=>{t.dir=e,q.current=!0},no_border:!0}),(0,h.jsx)(p.l6,{value:t.auto_load,onChange:e=>{t.auto_load=e,M([...L]),q.current=!0},options:_e,no_border:!0}),(0,h.jsx)(p.Sm,{value:t.note,handleInputChange:e=>{t.note=e},no_border:!0}),(0,h.jsxs)("div",{children:[(0,h.jsx)(a.rA,{icon:"delete",title:e("删除记录"),onClick:()=>(e=>{L.splice(e,1),M([...L]),q.current=!0})(n)}),(0,h.jsx)(a.rA,{icon:"restore",title:e("手动加载"),onClick:()=>{he({sub_title:"手动加载",confirm_fun:()=>{_.jV.post("ai_load_one_file",{param_path:t.dir}),(0,g.SK)("ok")}})}}),(0,h.jsx)(a.rA,{icon:"delete_forever",title:e("从索引删除"),onClick:()=>{he({sub_title:"从索引删除",confirm_fun:()=>{_.jV.post("ai_del",{param_path:t.dir}),(0,g.SK)("ok")}})}})]})];return s}),width:"10rem"})})}),D&&(0,h.jsx)(c.VP,{widthPer:50,children:(0,h.jsxs)(m.Zp,{title:e("知识库加载信息"),children:[(0,h.jsx)(c.Yh,{left:e("最近一次加载")+","+e("加载进度"),right:D?.progress}),(0,h.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件数量")}`,right:D?.num}),(0,h.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件字符数量")}`,right:D?.char_num}),(0,h.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总文件大小")}`,right:(0,b.v7)(D?.size)}),(0,h.jsx)(c.Yh,{left:`${e("最近一次加载")},${e("总耗时")}`,right:(0,b.a3)(D?.consume_time_ms_len)}),(0,h.jsx)(c.Yh,{left:`${e("总文件数量")}`,right:D?.total_num})]})})]})]})})})]})}},34299(e,t,n){n.r(t),n.d(t,{default:()=>C});var s=n(96540),o=n(23802),a=n(53995),r=n(18569),i=n(77979),l=n(8263),c=n(69428),d=n.n(c),p=(n(3775),n(21499)),m=n(99214),u=n(89117),h=n(86063),_=n(89334),x=n(41105),g=n(52388),v=n(19878),f=(n(72411),n(74848));const j=new o.A({html:!0,highlight:function(e,t){if(t&&v.A.getLanguage(t))try{return`<pre class="hljs code-block-with-copy"><code class="hljs language-${t}">${v.A.highlight(e,{language:t}).value}</code></pre>`}catch(e){}try{return`<pre class="hljs code-block-with-copy"><code class="hljs">${v.A.highlightAuto(e).value}</code></pre>`}catch(e){}return`<pre class="hljs code-block-with-copy"><code>${j.utils.escapeHtml(e)}</code></pre>`}});async function y(e,t){e.className="md-graph md-graph--mind md-graph--loading",e.textContent=g.A.t("rendering");const n=await(0,h.Hn)(t);e.isConnected&&(e.className="md-graph md-graph--mind",e.textContent="",await n.mount(e))}function w(e){const t=e.className.match(/language-([\w-]+)/);return t?t[1]:""}function C(e){const t=(0,s.useRef)(null);return(0,m.VD)(),(0,s.useEffect)(()=>{t.current&&(t.current.innerHTML=j.render(e.context??""),async function(e){const t=e.querySelectorAll("pre > code[class*='language-']");for(const e of Array.from(t)){const t=w(e),n=(0,u.Hm)(t),s=(0,h.hj)(t);if(!n&&!s)continue;const o=e.closest(".code-block-with-copy")??e.parentElement;if(!o)continue;const a=e.textContent??"",r=document.createElement("div");if(o.replaceWith(r),s){try{await y(r,a)}catch(e){console.error("[mind] render failed",e),r.className="md-graph md-graph--mind",r.textContent=String(e)}continue}r.className="md-graph md-graph--loading",r.textContent=g.A.t("rendering");const i=await(0,u.U6)(t,a);r.isConnected&&(i.error?(r.className="md-graph md-graph--error",r.textContent=i.error):(r.className="md-graph",r.innerHTML=i.svg))}}(t.current),(0,_.rg)(t.current))},[e.context]),(0,f.jsx)("div",{ref:t})}j.use(a.A).use(r.A).use(i.A).use(l.A).use(d()).use(e=>{e.renderer.rules.fence;e.renderer.rules.fence=(t,n,s,o,a)=>{const r=t[n],i=r.content.trim(),l=r.info.trim();let c="";if(l&&v.A.getLanguage(l))try{c=v.A.highlight(i,{language:l}).value}catch(t){c=e.utils.escapeHtml(i)}else try{c=v.A.highlightAuto(i).value}catch(t){c=e.utils.escapeHtml(i)}return`\n <div class="code-block-with-copy">\n <div class="code-header">\n <span class="code-language">${l||"code"}</span>\n <button class="copy-btn" data-code="${e.utils.escapeHtml(i)}">复制</button>\n </div>\n <pre><code class="hljs ${l?`language-${l}`:""}">${c}</code></pre>\n </div>`}}).use(e=>{const t=e.renderer.rules.link_open||function(e,t,n,s,o){return o.renderToken(e,t,n)};e.renderer.rules.link_open=(e,n,s,o,a)=>{const r=e[n],i=r.attrIndex("href");if(i>=0){const e=r.attrs[i][1];r.attrs[i][1]=(0,p.bi)(window.location.href,e)}return t(e,n,s,o,a)}}),(0,_.Rh)(j,x.pC)},24659(e,t,n){n.d(t,{K:()=>o});var s=n(22022);const o=()=>{const{t:e}=(0,s.Bd)();return[{title:e("是"),value:!0,color:"#28a745"},{title:e("否"),value:!1,color:"#666666"}]}},60840(e){e.exports="data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 16 16%27 version=%271.1%27 aria-hidden=%27true%27><path fill-rule=%27evenodd%27 d=%27M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z%27></path></svg>"}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[8319],{77481(e,t,n){n.d(t,{S:()=>a,X:()=>i});var s=n(96540),r=n(61443),l=n(74848);function i(e){const[t,n]=s.useState([]),i=(0,s.useRef)(-1),[a,c]=(0,s.useState)(-1),[o,d]=(0,s.useState)(-1);(0,s.useEffect)(()=>{e.children?n(Array.isArray(e.children)?e.children:[e.children]):n(e.rows)},[e.rows,e.children]);const u=()=>{i.current=-1,c(-1),d(-1)};return(0,l.jsxs)("table",{children:[(0,l.jsx)("thead",{children:(0,l.jsx)("tr",{children:e.headers?.map((t,n)=>{const s=!!e.filter&&(e.filter.column??0)===n;let i=t;if(s){const n=e.filter,s=n.options.find(e=>e.value===n.value);null!=n.value&&s&&(i=`${t} (${s.label})`)}return(0,l.jsx)("th",{className:s?"table-filter-col":"",children:s?(0,l.jsx)(r.l6,{value:e.filter.value,options:e.filter.options,onChange:e.filter.onChange,bare:!0,trigger_label:i}):t},n)})})}),(0,l.jsx)("tbody",{children:t.map((t,n)=>{const s=!!e.onRowDrag;return(0,l.jsx)("tr",{className:s?(a===n?"row-dragging":"")+(o===n?" row-drop-target":""):"",draggable:s,onContextMenu:()=>{e.handleContextMenu&&e.handleContextMenu(t)},onDragStart:e=>{s&&(i.current=n,c(n),e.dataTransfer.effectAllowed="move")},onDragOver:e=>{!s||i.current<0||(e.preventDefault(),e.dataTransfer.dropEffect="move",d(n))},onDrop:t=>{s&&(t.preventDefault(),(()=>{const t=i.current,n=o;u(),t<0||n<0||t===n||e.onRowDrag?.(t,n)})())},onDragEnd:u,children:t.map((n,s)=>{const r=s===t.length-1?"small":"";return(0,l.jsx)("td",{className:r,style:{width:e.width??"auto"},children:n},s)})},n)})})]})}function a(e){return(0,l.jsx)("div",{style:{display:e.isFlex?"flex":"block"},children:e.columns.map((e,t)=>(0,l.jsx)("div",{children:e},t))})}},28319(e,t,n){n.r(t),n.d(t,{default:()=>C,defaultSqlPreset:()=>w,sqlEnvDefault:()=>S});var s=n(96540),r=n(22022),l=n(4412),i=n(85997),a=n(75725),c=n(77481),o=n(70447),d=n(61443),u=n(34843),h=n(82893),x=n(14284),f=n(23496),p=n(53459),j=n(62042),v=n(7523),m=n(78247),_=n(52671),g=n(74848);function w(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 C(){const{t:e}=(0,r.Bd)(),{initUserInfo:t}=(0,s.useContext)(v.F),[,n]=(0,u.fp)(h.AG.editorSetting),[C]=(0,u.fp)(h.AG.user_base_info),b=(0,_.Zp)(),q=s.useRef(-1),[E,k]=(0,s.useState)([]);(0,s.useEffect)(()=>{const t=C?.user_data?.sql_preset_list;k(t?.length?[...t]:[w(e)])},[e,C?.user_data?.sql_preset_list]);const y=async()=>{const n=E.map((e,t)=>({...e,index:t})),s=await x.wm.post(f.s.user_save_private_attr,{is_sql_preset:!0,sql_preset_list:n});s?.code===p.m.Success&&(await t(),(0,j.SK)(e("保存成功")))},A=(e,t)=>{q.current=e;const s=E[e][t]??"";m.xK.set_value_temp(s),n({model:"sql"===t?"ace/mode/sql":"ace/mode/ini",open:!0,fileName:"",save:async e=>{E[q.current][t]=e,k([...E]),m.xK.set_value_temp(""),y()}})},D=[e("编号"),e("备注"),e("SQL代码"),e("env编辑"),e("操作")];return(0,g.jsxs)("div",{children:[(0,g.jsx)(l.aZ,{position:"right",children:(0,g.jsx)(i.rA,{icon:"arrow_back",title:e("返回"),onClick:()=>b(-1)})}),(0,g.jsx)(a.jW,{isFull:!0,more:!0,children:(0,g.jsx)(a.NN,{children:(0,g.jsx)(a.xh,{children:(0,g.jsx)(a.fI,{children:(0,g.jsx)(a.VP,{widthPer:60,children:(0,g.jsx)(o.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([...E,{note:"",sql:"",env:S}])}),(0,g.jsx)(i.rA,{icon:"save",title:e("保存"),onClick:()=>y()})]}),children:(0,g.jsx)(c.X,{headers:D,rows:E.map((t,n)=>[(0,g.jsx)("div",{children:n+1}),(0,g.jsx)(d.Sm,{value:t.note,no_border:!0,placeholder:e("备注"),handleInputChange:e=>{t.note=e,k([...E])}}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"short_text",title:e("编辑SQL"),onClick:()=>A(n,"sql")})}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"settings",title:e("env编辑"),onClick:()=>A(n,"env")})}),(0,g.jsx)("div",{children:(0,g.jsx)(i.rA,{icon:"delete",title:e("删除"),onClick:()=>{E.splice(n,1),k([...E])}})})]),width:"8rem"})})})})})})})]})}}}]);