filecat 7.7.1 → 7.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/build/dist/1045.0e4bdc838c37771a7f50.js +1 -0
  2. package/build/dist/1075.493acb74297c1e753de2.js +1 -0
  3. package/build/dist/1128.b80776fbdbdda36034c3.js +1 -0
  4. package/build/dist/1388.1dcf844b452e3aae3dc0.js +1 -0
  5. package/build/dist/1671.fb137d27b5763953487e.js +1 -0
  6. package/build/dist/{6887.93191dae462af3692775.js → 1738.b8ab2bd79df131e60051.js} +1 -1
  7. package/build/dist/1802.e43e833638f6ba8e22d7.js +1 -0
  8. package/build/dist/1964.bd3d684b50aa5191b413.js +1 -0
  9. package/build/dist/200.bb7f6ce5543bd7ff6d97.js +1 -0
  10. package/build/dist/2105.e4ba1c1d506b3fe14e8e.js +1 -0
  11. package/build/dist/2122.bc10dcdbbfc38e0ef883.js +1 -0
  12. package/build/dist/{3457.18b45379d8bcf7f5f3b5.js → 2180.df641ebaead77c4ada71.js} +1 -1
  13. package/build/dist/2300.9e1baa1c0368abe53d96.js +2 -0
  14. package/build/dist/2479.15722ac55b05c521f4f7.js +1 -0
  15. package/build/dist/2572.8fdddfebb4da2f29dbd8.js +1 -0
  16. package/build/dist/259.81bb9e049e5ef587a96f.js +1 -0
  17. package/build/dist/2674.0c822a9c458f923a4eff.js +1 -0
  18. package/build/dist/{1001.44a1a25c7d6d3f294bf3.js → 2822.9417e764a14f8f5f57dc.js} +1 -1
  19. package/build/dist/2994.c492be0d907fa468a9be.js +1 -0
  20. package/build/dist/{3140.b078ec311f99170b7f4c.js → 3140.794a212da633caf38b3a.js} +2 -2
  21. package/build/dist/3230.7798ab546facfa058b34.js +1 -0
  22. package/build/dist/3233.fb6bffd5e097e4ac9423.js +1 -0
  23. package/build/dist/3283.9386fc7f67aef46604fb.js +1 -0
  24. package/build/dist/3299.d01f5a742d80f4e6e25b.js +1 -0
  25. package/build/dist/3300.b8a3bc571293a6280ed8.js +1 -0
  26. package/build/dist/{3402.d412940350051a52d7ac.js → 3402.b6dc28d2f9bace7cde85.js} +1 -1
  27. package/build/dist/3509.cbcb309fbf49db53229f.js +1 -0
  28. package/build/dist/{3727.b8d9cbae9de47bf8d49b.js → 3510.b975b8bfdee5e8518215.js} +1 -1
  29. package/build/dist/{587.c75ed69a8373139346f9.js → 3566.ba323afadcf41fad2fa7.js} +1 -1
  30. package/build/dist/3608.aff9429024b740ac5cd0.js +1 -0
  31. package/build/dist/3990.5e16453f57b90b01d539.js +1 -0
  32. package/build/dist/4004.de90f1192487a24a0a9a.js +1 -0
  33. package/build/dist/4061.c0eb5824eeb6a59fa827.js +1 -0
  34. package/build/dist/4220.b65b40382726a69ba0bc.js +1 -0
  35. package/build/dist/{3883.70d42c3a335d6833f07e.js → 4376.b022a792fb34fbe50398.js} +1 -1
  36. package/build/dist/4437.4d5a0965043471411a00.js +1 -0
  37. package/build/dist/4469.536491f90535e831ce3e.js +1 -0
  38. package/build/dist/453.8877eb10f13258c290bc.js +1 -0
  39. package/build/dist/4560.8ef2e4b60cc86d019dd6.js +1 -0
  40. package/build/dist/4735.838cd0f656bbf7d99ff6.js +1 -0
  41. package/build/dist/4772.9b95c402a4def0f576e3.js +1 -0
  42. package/build/dist/4985.44cb7d829ca477e368b8.js +1 -0
  43. package/build/dist/5516.645e4a900df9bdc1806c.js +1 -0
  44. package/build/dist/5526.6b4867751becda056ed8.js +1 -0
  45. package/build/dist/5614.fb6bffd5e097e4ac9423.js +1 -0
  46. package/build/dist/5617.8efc3b1d218f80df9b39.js +1 -0
  47. package/build/dist/5744.e9f1efb88a617b05b709.js +1 -0
  48. package/build/dist/583.cef46d6b21c6fa6454cf.js +1 -0
  49. package/build/dist/6089.6d5d19a327284ff3b11c.js +1 -0
  50. package/build/dist/6164.7dae9989dd129479f952.js +1 -0
  51. package/build/dist/6284.10deb80685728f50aa45.js +1 -0
  52. package/build/dist/629.b75b024aacc43e0d69cf.js +1 -0
  53. package/build/dist/6344.291e5dadc74e62739774.js +1 -0
  54. package/build/dist/6492.3ee4060598de873d8e8f.js +1 -0
  55. package/build/dist/6571.b381c44055704e3ba649.js +1 -0
  56. package/build/dist/6731.6763296ce5ae210bc0fe.js +1 -0
  57. package/build/dist/6759.f88b50c41207cb8345d1.js +1 -0
  58. package/build/dist/{4951.88718d978aea2dd40006.js → 6789.34921a30c8a81f0a6407.js} +1 -1
  59. package/build/dist/6800.ee99fd0a88b6acbaaf2c.js +1 -0
  60. package/build/dist/6803.fe4297b1e51c3bfc7f50.js +1 -0
  61. package/build/dist/{313.d51fc773856f078487ad.js → 6806.9ebf089eba60f3b8e946.js} +1 -1
  62. package/build/dist/7038.4e4fc8e405c56d3080e2.js +1 -0
  63. package/build/dist/7310.bf944d03f24fcf109680.js +1 -0
  64. package/build/dist/{359.1b95bd6368196ccaa731.js → 7430.25bf8437ad8f7c1fd36f.js} +1 -1
  65. package/build/dist/7483.5e26ada69b33418c31a8.js +1 -0
  66. package/build/dist/{4087.4796ff56340985c35542.js → 7486.fe0b5f867c08b40a3360.js} +1 -1
  67. package/build/dist/7567.09e1b34ad9bd3e463eb4.js +1 -0
  68. package/build/dist/7834.7a593dcb80ca09f58586.js +1 -0
  69. package/build/dist/784.48a3b71205680f427109.js +1 -0
  70. package/build/dist/7943.54c702542d55f576a576.js +1 -0
  71. package/build/dist/7954.6ce241a8ed27cb26efc6.js +1 -0
  72. package/build/dist/8079.f6f2be43e5d933ae1f6f.js +1 -0
  73. package/build/dist/8677.860320b7f36947e57d11.js +1 -0
  74. package/build/dist/8727.3628c746061aed7a4077.js +1 -0
  75. package/build/dist/9299.ed4de6cd4f4bfa0a966a.js +1 -0
  76. package/build/dist/9324.ef229da9b943484298ba.js +1 -0
  77. package/build/dist/9364.d2570d78afc50fe1b23e.js +1 -0
  78. package/build/dist/9463.2629a7daf4c2865b9b96.js +1 -0
  79. package/build/dist/index.html +1 -1
  80. package/build/dist/main.98bb29605335d9b2219f.js +2 -0
  81. package/build/main.js +1 -1
  82. package/build/threads.work.filecat.js +1 -1
  83. package/package.json +4 -5
  84. package/shell/config/webpack.web.config.js +2 -2
  85. package/build/dist/1075.3ef2e1902e9f7e9e37b1.js +0 -1
  86. package/build/dist/1312.199a506fb836a2412255.js +0 -1
  87. package/build/dist/136.e3bb3c50051edb17454d.js +0 -1
  88. package/build/dist/1478.c58a43bb24820a13eaed.js +0 -1
  89. package/build/dist/1491.901cce0168c42ad319fa.js +0 -1
  90. package/build/dist/1566.4f405afd26063b55129c.js +0 -1
  91. package/build/dist/161.98f6c2a50bf3824a6efb.js +0 -1
  92. package/build/dist/1654.a21a099e2749ef167ea9.js +0 -1
  93. package/build/dist/1875.46dd3a6cc071d45a32f1.js +0 -1
  94. package/build/dist/1883.14c90bbe93fe206906f0.js +0 -1
  95. package/build/dist/1924.c7bd2a2aa0e9bc78c9ba.js +0 -1
  96. package/build/dist/2000.f55ddba9e6313243f028.js +0 -1
  97. package/build/dist/2101.d4efa6a2c1e9169d9225.js +0 -1
  98. package/build/dist/2180.60fe32ab12c2fa1570a4.js +0 -1
  99. package/build/dist/2191.4c4f2fd5127168a81877.js +0 -1
  100. package/build/dist/2213.ceffb8fd7be66b35d079.js +0 -1
  101. package/build/dist/2463.6e530d1e9b5c58dba166.js +0 -1
  102. package/build/dist/2623.8b1e5e391dd4e05fc119.js +0 -1
  103. package/build/dist/2674.3713c09449bdd57b1066.js +0 -1
  104. package/build/dist/2894.8395ec5e280cc6b6c4dc.js +0 -1
  105. package/build/dist/3042.f490cfa4208208262398.js +0 -1
  106. package/build/dist/3096.d0b2c77a23418c545c01.js +0 -1
  107. package/build/dist/311.da79ace98b69a635c41c.js +0 -1
  108. package/build/dist/3166.088cf4a0356c3a6e30a0.js +0 -1
  109. package/build/dist/3233.80bcbba8a50c0f85ceee.js +0 -1
  110. package/build/dist/3357.4f1bf81ecc3c11a3f813.js +0 -1
  111. package/build/dist/3475.d10d21b637761d7d886d.js +0 -1
  112. package/build/dist/3708.04401b24d95214d641e5.js +0 -1
  113. package/build/dist/3752.01fc1f14b29f340e41fd.js +0 -1
  114. package/build/dist/3871.7a387a9dc21883d08423.js +0 -1
  115. package/build/dist/3994.19fb81947d65fc81b0a2.js +0 -1
  116. package/build/dist/4012.b516fdc981e55be2ebb2.js +0 -1
  117. package/build/dist/4122.9ea6b5dd8dc9d2265825.js +0 -1
  118. package/build/dist/4141.06960673a6a484e7b88d.js +0 -1
  119. package/build/dist/4190.ff72264b4f07f6542d33.js +0 -1
  120. package/build/dist/4239.1b49d7c26192fb637d57.js +0 -1
  121. package/build/dist/4288.8dc8f5d962720e084952.js +0 -1
  122. package/build/dist/434.04cdc2a05316f92d1d38.js +0 -1
  123. package/build/dist/4376.f3c60897f70dd4e33d2f.js +0 -1
  124. package/build/dist/4472.38816dfb835d527175d6.js +0 -1
  125. package/build/dist/4473.b42b37616f13be64199b.js +0 -1
  126. package/build/dist/449.3fd75e05da22fe1c5ecc.js +0 -1
  127. package/build/dist/452.4974390f4f4d991216e5.js +0 -1
  128. package/build/dist/4547.36b5848220c04c47bc80.js +0 -1
  129. package/build/dist/4605.ef0f4204b3bf3a18efa6.js +0 -1
  130. package/build/dist/4804.fbd0ffcf57d9dffc15b7.js +0 -1
  131. package/build/dist/482.0c7512372a1fbf61d704.js +0 -1
  132. package/build/dist/4963.22d7db9b376a42d3f00b.js +0 -1
  133. package/build/dist/5097.a0de16bf7b90a8b1157d.js +0 -1
  134. package/build/dist/5123.d9ed79af478b5cc4f1b2.js +0 -1
  135. package/build/dist/5332.8b6e85d8764e907a01d5.js +0 -1
  136. package/build/dist/536.660d866952b46ba53180.js +0 -1
  137. package/build/dist/548.d3d912d0c0c7e835e1dc.js +0 -1
  138. package/build/dist/5516.cc92dfbf06ddcd133dbc.js +0 -1
  139. package/build/dist/5590.585778da623ec71f7722.js +0 -1
  140. package/build/dist/5614.80bcbba8a50c0f85ceee.js +0 -1
  141. package/build/dist/5616.14df0fe505c4dadf4042.js +0 -1
  142. package/build/dist/5695.95dc69f3b02812eb9e93.js +0 -1
  143. package/build/dist/5697.6ac62f99ca19a979f1eb.js +0 -1
  144. package/build/dist/5741.237d817efc942de875e5.js +0 -1
  145. package/build/dist/5849.d26365d4b19533db6fd6.js +0 -1
  146. package/build/dist/5902.3969a79465383ff4bbb4.js +0 -1
  147. package/build/dist/5937.c3f14ccc441bfd06e13d.js +0 -1
  148. package/build/dist/5942.981e03467a3b2c653ab8.js +0 -1
  149. package/build/dist/6029.63e4beb66df7afc65a90.js +0 -1
  150. package/build/dist/6054.f91307b52046172fc5f8.js +0 -1
  151. package/build/dist/6089.0863a6a09be2b97e84e1.js +0 -1
  152. package/build/dist/6095.d845e356a4db8a241cdb.js +0 -1
  153. package/build/dist/6114.ca67e88c701691b3bb1e.js +0 -1
  154. package/build/dist/612.74d77e32957a5c6eb197.js +0 -1
  155. package/build/dist/625.d9e531476b3306e0b837.js +0 -1
  156. package/build/dist/6318.66541f9cef18d14ea3ea.js +0 -1
  157. package/build/dist/6455.5c950f6eb61015409eb6.js +0 -1
  158. package/build/dist/6527.436d2d5d81376e6a54ae.js +0 -1
  159. package/build/dist/6530.2f1b283a902603262048.js +0 -1
  160. package/build/dist/6610.b92f337fcc1b347350fb.js +0 -1
  161. package/build/dist/6926.2786af754adcdabfbede.js +0 -1
  162. package/build/dist/697.62f8b1ec6d2cd40ed316.js +0 -1
  163. package/build/dist/70.be2f9130c93c4175d12f.js +0 -1
  164. package/build/dist/7081.9e1e196fecfcccb4bfb9.js +0 -1
  165. package/build/dist/7128.3573ab2a5f28b79ba89e.js +0 -1
  166. package/build/dist/7163.ad09accaa87e565b8dc0.js +0 -1
  167. package/build/dist/72.a1d87dabb7f0615b3a21.js +0 -1
  168. package/build/dist/7229.50a1700104d1e4732735.js +0 -1
  169. package/build/dist/7332.d024ae75a3da2f7674a1.js +0 -1
  170. package/build/dist/7509.370c49d7ff43e289190c.js +0 -1
  171. package/build/dist/7514.dbf525bade6ffbd70af6.js +0 -2
  172. package/build/dist/7557.7d62939c56391a647067.js +0 -1
  173. package/build/dist/7588.2d840229f62de92b22e5.js +0 -1
  174. package/build/dist/7632.5660653552f755580adc.js +0 -1
  175. package/build/dist/7639.b3c6382de2fde652a40b.js +0 -1
  176. package/build/dist/779.91614fabf5c9eb3aafa0.js +0 -1
  177. package/build/dist/7810.979796e8a3aad6d4d72f.js +0 -1
  178. package/build/dist/7897.8b8070d6abe5c2327168.js +0 -1
  179. package/build/dist/7941.dbef0b0f412899800b13.js +0 -1
  180. package/build/dist/7953.5cd280effe2e967ea490.js +0 -1
  181. package/build/dist/7954.efecc100b407af204add.js +0 -1
  182. package/build/dist/7959.e31a21f28ff463d9d5e9.js +0 -1
  183. package/build/dist/8034.301f1099c4a7ce6c2829.js +0 -1
  184. package/build/dist/8080.e1c9af30bdd818b08c6e.js +0 -1
  185. package/build/dist/8087.6452b67614a0855535a4.js +0 -1
  186. package/build/dist/8140.bbccc589b007f9d410d1.js +0 -1
  187. package/build/dist/8162.e47cccbe327b26a2ea6f.js +0 -1
  188. package/build/dist/8177.d669c6337f8814781f49.js +0 -1
  189. package/build/dist/8322.56c8f4b4ad93b1a866c8.js +0 -1
  190. package/build/dist/8376.01a9f23ba06a78922364.js +0 -1
  191. package/build/dist/8433.e54d57e2cc9408e5e411.js +0 -1
  192. package/build/dist/8460.25f0859cb2266f764113.js +0 -1
  193. package/build/dist/8524.7945bff0063dc5c5903d.js +0 -1
  194. package/build/dist/8782.a5498372f1eb6bab41b7.js +0 -1
  195. package/build/dist/8953.23fe6fe13b28168428d3.js +0 -1
  196. package/build/dist/8964.bdf168262ab40956654a.js +0 -1
  197. package/build/dist/9003.69a0d15e722e1ed455b0.js +0 -1
  198. package/build/dist/9299.c2699815e5339e4045f8.js +0 -1
  199. package/build/dist/9385.2b1afe7b55d4c16f97ad.js +0 -1
  200. package/build/dist/9428.3176bab8f5780f060d51.js +0 -1
  201. package/build/dist/9456.506d55e351dec4f45566.js +0 -1
  202. package/build/dist/9465.8ff5871fb708cf7c1021.js +0 -1
  203. package/build/dist/9500.95d19d78b580734ec35e.js +0 -1
  204. package/build/dist/9512.03215278f26dc63c056d.js +0 -1
  205. package/build/dist/9614.cfdbe03d8e2960b0a53a.js +0 -1
  206. package/build/dist/9651.6bf3e34362f10c1aa35d.js +0 -1
  207. package/build/dist/9788.4a1c2f3626e532d3b44c.js +0 -1
  208. package/build/dist/9943.b62436bd9d0730c715a9.js +0 -1
  209. package/build/dist/9967.216bc8d26440bcbaf785.js +0 -1
  210. package/build/dist/9970.aa60aa700a790ba226f0.js +0 -1
  211. package/build/dist/main.401995af1fd441fa9164.js +0 -2
  212. /package/build/dist/{7514.dbf525bade6ffbd70af6.js.LICENSE.txt → 2300.9e1baa1c0368abe53d96.js.LICENSE.txt} +0 -0
  213. /package/build/dist/{3140.b078ec311f99170b7f4c.js.LICENSE.txt → 3140.794a212da633caf38b3a.js.LICENSE.txt} +0 -0
  214. /package/build/dist/{main.401995af1fd441fa9164.js.LICENSE.txt → main.98bb29605335d9b2219f.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4472,6010],{83277(e,s,t){t.d(s,{$j:()=>i,CP:()=>a,Lv:()=>n,cL:()=>o});class n{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,s){if(!e||!s?.length)return e;for(const t of s)if(t.value===e)return t.label;return e}static have_label_by_v(e,s){if(!e||!s?.length)return!1;for(const t of s)if(t.value===e)return!0;return!1}}const a='\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 o=JSON.stringify({stream:!0,thinking:{type:"disabled"}});function i(e){return"string"==typeof e?e:Array.isArray(e)?e.map(e=>"text"===e.type?e.text:"[图片]").join("\n"):""}},47713(e,s,t){t.r(s),t.d(s,{default:()=>ne});var n=t(96540),a=t(34843),o=t(22022),i=t(52671),c=t(92275),r=t(14284),l=t(7463),d=t(64694),u=t(78247),m=t(40505),h=t(62042),g=t(45907),p=t(53459),_=t(72693),x=t(82893),f=t(61443),j=t(83277);function v(e){return null==e||e<0?"0":e.toLocaleString()}function b(e){const s=[];if(e.attachments?.length&&s.push(e.attachments.map(e=>`[附件] ${e.name}`).join("\n")),e.content_list?.length)for(const t of e.content_list){const e=(0,j.$j)(t.content);if(e&&s.push(e),t.tool_call_ends?.length){const e=t.tool_call_ends.map(e=>{const s=e.tool_display_name||e.tool_name;return e.success?`[工具] ${s} 成功`:`[工具] ${s} 失败`});s.push(e.join("\n"))}}return e.text&&!s.length&&s.push(e.text),e.images?.length&&s.push(`[生成图片 ${e.images.length} 张]`),e.audio&&s.push("[音频]"),s.join("\n\n")}function y(e){const s=(0,j.$j)(e.content);if(s)return s;const t=e.content_list??[];return t.length?t.map(e=>(0,j.$j)(e.content)).filter(Boolean).join("\n\n"):""}function w(e=[]){return e.filter(e=>"user"===e.role||"assistant"===e.role).map((e,s)=>({id:Date.now()+s,sender:"assistant"===e.role?"bot":"user",text:y(e),attachments:e.attachments??[],content_list:e.content_list,images:e.images,audio:e.audio,embeddings:e.embeddings,elapsed_ms:e.elapsed_ms}))}const S=/\.(md|txt|json|js|jsx|ts|tsx|css|html?|xml|ya?ml|py|java|go|rs|c|cpp|h|hpp|sh|bat|cmd|ini|toml|csv|log|sql|env|gitignore|dockerfile)$/i;function N(e){return e.type?.startsWith("image/")?"image":e.type?.startsWith("text/")||S.test(e.name)?"text":"binary"}function k(e){return e.text()}function C(e){return new Promise((s,t)=>{const n=new FileReader;n.onload=()=>s(n.result),n.onerror=t,n.readAsDataURL(e)})}async function A(e){const s=[];for(const t of e){const e=N(t);let n="";if("text"===e)try{const e=await k(t),s=12e4;n=e.length>s?`${e.slice(0,s)}\n\n[内容已截断,原始长度 ${e.length} 字符]`:e}catch{n="[文本读取失败]"}else if("image"===e)try{n=await C(t)}catch{n=`[图片文件: ${t.name}]`}else n=`[二进制文件: ${t.name}]`;s.push({name:t.name,mime_type:t.type,size:t.size,kind:e,content:n})}return s}var $=t(14944);var I=t(85997),M=t(34299),D=t(74848);function R(e){const s=e.attachments&&e.attachments.length>0?(0,D.jsx)("div",{className:"chat-message-attachments",children:e.attachments.map((e,s)=>(0,D.jsxs)("div",{className:"chat-message-attachment",children:[(0,D.jsx)(I.In,{icon:"attach_file"}),(0,D.jsx)("span",{children:e.name}),(0,D.jsxs)("small",{children:[e.size," B"]})]},`${e.name}_${s}`))}):null,t=[];e.images&&"bot"===e.sender&&t.push((0,D.jsx)(n.Fragment,{children:(0,D.jsx)(B,{images:e.images,text:e.text})},"images")),e.audio&&"bot"===e.sender&&t.push((0,D.jsx)(n.Fragment,{children:(0,D.jsx)(K,{audio:e.audio,text:e.text})},"audio")),e.embeddings&&"bot"===e.sender&&t.push((0,D.jsx)(n.Fragment,{children:(0,D.jsx)(E,{embeddings:e.embeddings,text:e.text})},"embeddings"));const a=function(e){if("bot"!==e.sender||!e.content_list?.length)return e.text?(0,D.jsx)(M.default,{context:e.text}):null;return(0,D.jsxs)(D.Fragment,{children:[e.content_list.map((e,s)=>{const t=[],a=(0,j.$j)(e.content);return a&&t.push((0,D.jsx)(n.Fragment,{children:(0,D.jsx)(M.default,{context:a})},`content-${s}`)),e.tool_call_ends?.length&&t.push((0,D.jsx)(n.Fragment,{children:(0,D.jsx)(H,{callList:e.tool_call_ends})},`tool-${s}`)),(0,D.jsx)(n.Fragment,{children:t},`part-${s}`)}),!e.content_list.some(e=>e.content)&&e.text?(0,D.jsx)(M.default,{context:e.text}):null]})}(e);return 0===t.length?(0,D.jsxs)(D.Fragment,{children:[s,a]}):(0,D.jsxs)(D.Fragment,{children:[t,s,a]})}function H({callList:e}){const[s,t]=n.useState(!1);if(!e?.length)return null;e.filter(e=>e.success).length;const a=e.filter(e=>!e.success).length;return(0,D.jsxs)("div",{className:"chat-message-call-list",children:[(0,D.jsxs)("div",{className:"call-list-header",onClick:()=>t(!s),children:[(0,D.jsx)(I.In,{icon:s?"expand_less":"expand_more"}),(0,D.jsxs)("span",{className:"call-list-summary",children:["工具调用 (",e.length,")",a>0&&(0,D.jsx)("span",{className:"call-list-fail",children:" 失败 "})]})]}),s&&(0,D.jsx)("div",{className:"call-list-body",children:e.map((e,s)=>(0,D.jsxs)("div",{className:"call-list-item "+(e.success?"call-success":"call-fail"),children:[(0,D.jsxs)("div",{className:"call-list-item-header",children:[(0,D.jsx)(I.In,{icon:e.success?"check_circle":"error"}),(0,D.jsx)("span",{className:"call-list-tool-name",children:e.tool_display_name||e.tool_name}),(0,D.jsxs)("span",{className:"call-list-duration",children:[e.duration_ms,"ms"]})]}),e.tool_args&&(0,D.jsxs)("details",{className:"call-list-details",children:[(0,D.jsx)("summary",{children:"参数"}),(0,D.jsx)("pre",{className:"call-list-pre",children:JSON.stringify(e.tool_args,null,2)})]}),!e.success&&e.error&&(0,D.jsxs)("details",{className:"call-list-details",children:[(0,D.jsx)("summary",{children:"错误"}),(0,D.jsx)("pre",{className:"call-list-pre call-list-error-text",children:e.error})]}),e.success&&e.tool_result&&(0,D.jsxs)("details",{className:"call-list-details",children:[(0,D.jsx)("summary",{children:"结果"}),(0,D.jsx)("pre",{className:"call-list-pre",children:e.tool_result.length>500?e.tool_result.slice(0,500)+"...":e.tool_result})]})]},s))})]})}function B({images:e,text:s}){let t=e||[];if(!t.length&&s)try{t=JSON.parse(s).data||[]}catch{}return t.length?(0,D.jsxs)("div",{className:"image-generation-result",children:[t.map((e,s)=>(0,D.jsxs)("div",{className:"image-generation-item",children:[e.url&&(0,D.jsx)("div",{className:"image-generation-image-wrapper",children:(0,D.jsx)("img",{src:e.url,alt:e.revised_prompt||`生成的图片 ${s+1}`,loading:"lazy"})}),e.b64_json&&(0,D.jsx)("div",{className:"image-generation-image-wrapper",children:(0,D.jsx)("img",{src:`data:image/png;base64,${e.b64_json}`,alt:`生成的图片 ${s+1}`})}),e.revised_prompt&&(0,D.jsx)("p",{className:"image-generation-prompt",children:(0,D.jsx)("small",{children:e.revised_prompt})})]},s)),s&&!e&&(0,D.jsx)(M.default,{context:s})]}):(0,D.jsx)(M.default,{context:s||""})}function K({audio:e,text:s}){if(e){if(e.url)return(0,D.jsx)("div",{className:"audio-result",children:(0,D.jsx)("audio",{controls:!0,src:e.url,children:"您的浏览器不支持音频播放"})});if(e.data){const s=e.mime_type||"audio/mpeg";return(0,D.jsx)("div",{className:"audio-result",children:(0,D.jsx)("audio",{controls:!0,src:`data:${s};base64,${e.data}`,children:"您的浏览器不支持音频播放"})})}}const t=s||"";if(t.startsWith("http://")||t.startsWith("https://"))return(0,D.jsx)("div",{className:"audio-result",children:(0,D.jsx)("audio",{controls:!0,src:t,children:"您的浏览器不支持音频播放"})});try{const e=JSON.parse(t);if(e?.data||e?.audio_data){const s=e.data||e.audio_data;return(0,D.jsx)("div",{className:"audio-result",children:(0,D.jsx)("audio",{controls:!0,src:`data:audio/mpeg;base64,${s}`,children:"您的浏览器不支持音频播放"})})}}catch{}return(0,D.jsx)(M.default,{context:t})}function T({content:e,label:s}){const[t,a]=n.useState(!1);return(0,D.jsxs)("button",{className:"embeddings-copy-btn",onClick:()=>{(0,m.lW)(e),a(!0),setTimeout(()=>a(!1),1500)},children:[(0,D.jsx)(I.In,{icon:t?"check":"content_copy"}),t?"已复制":s||"复制"]})}function E({embeddings:e,text:s}){let t=e||null;if(!t&&s)try{t=JSON.parse(s)}catch{return(0,D.jsx)(M.default,{context:s})}if(!t)return(0,D.jsx)(M.default,{context:s||""});const n=t?.data||[],a=t?.usage,o=JSON.stringify(t,null,2);return(0,D.jsxs)("div",{className:"embeddings-result",children:[(0,D.jsxs)("div",{className:"embeddings-summary",children:[(0,D.jsx)("strong",{children:"向量嵌入结果"}),(0,D.jsxs)("span",{children:["维度: ",n[0]?.embedding?.length??"N/A"]}),(0,D.jsxs)("span",{children:["数量: ",n.length]}),a&&(0,D.jsxs)("span",{children:["使用 tokens: ",a.total_tokens??"N/A"]})]}),(0,D.jsxs)("div",{className:"embeddings-toolbar",children:[(0,D.jsx)(T,{content:o,label:"复制全部结果"}),n.length>0&&n[0]?.embedding&&(0,D.jsx)(T,{content:JSON.stringify(n[0].embedding,null,2),label:"复制第一条向量"}),n.length>0&&(0,D.jsx)(T,{content:JSON.stringify(n.map(e=>e.embedding),null,2),label:"复制所有向量数据"})]}),n.length>0&&n[0]?.embedding&&(0,D.jsx)("div",{className:"embeddings-preview",children:(0,D.jsxs)("span",{children:["向量预览: [",n[0].embedding.slice(0,5).join(", "),n[0].embedding.length>5?", ...":"","]"]})}),n.length>0&&(0,D.jsxs)("details",{children:[(0,D.jsx)("summary",{children:"查看详细数据"}),(0,D.jsx)("pre",{className:"embeddings-raw",children:o})]})]})}async function V(e,s,t,n){try{switch(e){case"images":{const e=await async function(e,s){const t={prompt:e,session_id:s},n=await r.jV.post("images/generations",t);if(0!==n.code)throw new Error(n.message||"图片生成失败");const a=n.data||{},o=(a.data||[]).map(e=>({url:e.url,b64_json:e.b64_json,revised_prompt:e.revised_prompt})),i=o.map((e,s)=>`![生成图片${s+1}](${e.url||`data:image/png;base64,${e.b64_json}`})${e.revised_prompt?`\n> ${e.revised_prompt}`:""}`).join("\n\n");return{session_id:a.session_id||s,images:o,text:i||`生成了 ${o.length} 张图片`}}(s,t);return e&&n(e.text,{images:e.images}),!0}case"audio_speech":{const e=await async function(e,s){const t={input:e,session_id:s};try{const e=localStorage.getItem("ai_audio_extra_params");if(e){const s=JSON.parse(e);s.voice&&(t.voice=s.voice),s.speed&&(t.speed=parseFloat(s.speed))}}catch{}const n=localStorage.getItem("token")||"",a=await fetch("/api/ai_agent/audio/speech",{method:"POST",headers:{"Content-Type":"application/json",Authorization:n},body:JSON.stringify(t)});if(!a.ok)throw new Error(`语音合成失败: ${a.statusText}`);const o=a.headers.get("X-Session-Id")||s,i=await a.arrayBuffer();return{session_id:o,audio:{data:btoa(String.fromCharCode(...Array.from(new Uint8Array(i)))),mime_type:a.headers.get("content-type")||"audio/mpeg"},text:`[音频文件: ${e.slice(0,50)}...]`}}(s,t);return e&&n(e.text,{audio:e.audio}),!0}case"embeddings":{const e=await async function(e,s){const t=await r.jV.post("embeddings",{input:e,session_id:s});if(0!==t.code)throw new Error(t.message||"Embeddings 请求失败");const n=t.data||{},a=n?.data??[],o=`向量维度: ${a[0]?.embedding?.length??0}, 数量: ${a.length}`;return{session_id:n.session_id||s,embeddings:n,text:`✅ Embeddings 结果 - ${o}\n\`\`\`json\n${JSON.stringify(n,null,2).slice(0,2e3)}\n\`\`\``}}(s,t);return e&&n(e.text,{embeddings:e.embeddings}),!0}default:return!1}}catch(e){return n(`请求失败: ${e?.message||JSON.stringify(e)}`),!0}}var P=t(4412),L=t(23430),F=t(87361),z=t(80389),O=t(7523),q=t(23496);const G=({currentModelName:e,setCurrentModelName:s,modelGroups:t,onModelChanged:c,sysPromptList:l,batchMode:d,selectedMsgCount:m,onToggleSessionPanel:g,onCreateSession:_,onToggleBatchMode:j,onBatchDeleteMessages:v,bgProcessVisible:b,bgProcessCount:y,onToggleBgProcess:w,selectedSysPromptId:S,setSelectedSysPromptId:N})=>{const{t:k}=(0,o.Bd)(),C=(0,i.Zp)(),{check_user_auth:A}=(0,u.MH)(),[,$]=(0,a.fp)(x.AG.ai_session_collapsed),{open:M}=function(){const{t:e}=(0,o.Bd)(),[,s]=(0,a.fp)(x.AG.prompt_card),[t,i]=(0,a.fp)(x.AG.ai_chat_zoom),{initUserInfo:c}=(0,n.useContext)(O.F);return{open:()=>{const n=t,a=()=>s({open:!1});s({open:!0,title:e("缩放调整"),context_div:(0,D.jsx)(z.p,{defaultValue:t,onChange:i,min:30,max:200}),cancel:()=>{i(n),a()},confirm:async()=>{let s=100;i(e=>(s=e<30||e>200?100:e,s)),await r.wm.post(q.s.user_save_private_attr,{is_ai_chat_zoom:!0,ai_chat_zoom:s}),(0,h.SK)(e("缩放调整成功")),c(),a()}})}}}(),R=A(L.oV.ai_model_switch)||A(L.oV.ai_agent_setting),H=[];for(const e of t)for(const s of e.models)H.push({title:s.label||s.value,value:`${e.index}::${s.value}`,group:e.note});const B=t.find(e=>e.active),K=B?`${B.index}::${e}`:"";return(0,D.jsxs)(P.aZ,{position:"right",children:[(0,D.jsx)(I.rA,{icon:"menu",title:k("会话"),onClick:g}),(0,D.jsx)(I.rA,{icon:"add",title:k("新会话"),onClick:()=>_()}),l.length>0&&(0,D.jsx)(f.l6,{value:S,options:[{title:k("选择系统提示词"),value:""},...l.map(e=>({title:e.note||e.prompt.slice(0,30),value:String(e.index)}))],onChange:e=>{N(e)},no_border:!0,width:"auto"}),R&&H.length>0&&(0,D.jsx)(f.l6,{value:K,options:[{title:k("选择模型"),value:""},...H],margin:"0 0 0 1em",onChange:e=>{const t=String(e??"");if(!t.includes("::"))return;const[n,...a]=t.split("::"),o=a.join("::");o&&(s(o),r.jV.post("set_active_model",{index:Number(n),model_name:o}).then(e=>{e?.code===p.m.Success?((0,h.SK)("success"),c()):(0,h.zN)(e?.message||"fail")}).catch(console.error))},no_border:!0,width:"auto"}),d&&m>0&&(0,D.jsx)(I.rA,{icon:"delete",title:k("删除选中消息"),onClick:v}),(0,D.jsx)(I.rA,{icon:"zoom_in",title:k("缩放调整"),onClick:M}),(0,D.jsx)(I.rA,{icon:"terminal",title:k("后台进程"),onClick:w,selected:b,tip:y||null}),A(L.oV.ai_agent_setting)&&(0,D.jsx)(I.rA,{icon:"smart_toy",title:"机器人配置",onClick:()=>{C(F.o.ai_rebot_setting_page)}}),A(L.oV.ai_agent_setting)&&(0,D.jsx)(I.rA,{icon:"settings",title:"ai setting",onClick:()=>{C(F.o.ai_agent_setting_page)}})]})};var J=t(83529);function W({sessions:e,activeSessionId:s,onSelectSession:t,onReorderSessions:i,onRenameSession:c,onDeleteSession:r,onToggleCmdAuto:l,onShowUsageStats:d,batchMode:u,selectedSessionIds:m,onToggleSessionSelect:h,onToggleBatchMode:g,onBatchDeleteSessions:p,onClearAllSessions:_}){const{t:f}=(0,o.Bd)(),[j,v]=(0,a.fp)(x.AG.ai_session_collapsed),[b,y]=(0,n.useState)(""),[w,S]=(0,n.useState)(null),[N,k]=(0,n.useState)(null),C=b.trim()?e.filter(e=>(e.title||"").toLowerCase().includes(b.toLowerCase())||(e.summary||"").toLowerCase().includes(b.toLowerCase())||(e.long_term_memory||"").toLowerCase().includes(b.toLowerCase())):e;return(0,D.jsxs)("aside",{className:`chat-session-list ${j?"active":""} ${j?"collapsed":""}`,children:[(0,D.jsx)("div",{className:"chat-session-search",children:(0,D.jsx)("input",{type:"text",className:"chat-session-search-input",placeholder:f("搜索会话"),value:b,onChange:e=>y(e.target.value)})}),(0,D.jsx)("div",{className:"chat-session-items-wrap",children:C.map((e,n)=>{return(0,D.jsx)("div",{children:(0,D.jsxs)("button",{className:`chat-session-item ${s===e.id?"active":""} ${u?"batch-mode":""} ${e.running?"is-running":""} ${w===n?"row-dragging":""} ${N===n&&null!==w&&w!==n?"row-drop-target":""}`,draggable:!!i,onDragStart:()=>S(n),onDragOver:e=>{null!==w&&(e.preventDefault(),N!==n&&k(n))},onDragEnd:()=>{S(null),k(null)},onDrop:e=>{e.preventDefault(),(e=>{const s=w;if(S(null),k(null),null===s||s===e||!i)return;const t=C[s]?.id,n=C[e]?.id;t&&n&&i(t,n)})(n)},onClick:()=>{u&&h?h(e.id):t(e.id)},title:e.summary||e.long_term_memory||e.title,children:[u&&(0,D.jsx)("input",{type:"checkbox",className:"chat-session-checkbox",checked:m?.has(e.id)??!1,onChange:()=>h?.(e.id),onClick:e=>e.stopPropagation()}),(0,D.jsx)("span",{children:(a=e.title,a||"新会话")}),e.running&&(0,D.jsx)("span",{className:"chat-session-running",title:f("正在执行中")}),(0,D.jsx)("small",{children:e.message_count}),"web"!==e.source&&(0,D.jsx)("em",{className:"chat-session-source",children:e.source}),!u&&(0,D.jsx)(J.MenuSelect,{list:[{name:f("重命名"),click:()=>c(e.id,e.title)},{name:e.cmd_auto_allow?f("命令检测关闭"):f("命令检测开启"),click:()=>l?.(e.id,!e.cmd_auto_allow)},{name:f("字符消耗统计"),click:()=>d(e.id)},{name:f("删除"),click:()=>r(e.id)}],children:(0,D.jsx)(I.In,{icon:"more_horiz"})})]})},e.id);var a})}),(0,D.jsxs)("div",{className:"chat-session-actions",children:[(0,D.jsx)(I.rA,{icon:u?"check_circle":"checklist",title:f(u?"取消批量选择":"批量选择"),onClick:g}),u&&(m?.size??0)>0&&(0,D.jsx)(I.rA,{icon:"delete",title:f("删除选中会话"),onClick:p}),!u&&(0,D.jsx)(I.rA,{icon:"delete_sweep",title:f("删除全部会话"),onClick:_})]})]})}var U=t(21499);function Q(e){const s=(e.text||"").split("\n").map(e=>e.trim()).find(Boolean)||"";return s.length>80?s.slice(0,80)+"…":s}const X=({messages:e,batchMode:s,selectedMsgIds:t,sending:a,chatContainerRef:o,messagesEndRef:i,onToggleMsgSelect:c,onDelete:r,onCopy:l,onCopyAll:d,onToggleBatchMode:u,onBatchCopy:m,onBatchDelete:h,showBatchBar:g,t:p})=>{const[_,x]=(0,n.useState)(new Set),f=(0,n.useMemo)(()=>e.filter(e=>!e.is_loading).map(e=>e.id),[e]),j=e=>{x(s=>{const t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},v=()=>{x(e=>e.size>0&&f.every(s=>e.has(s))?new Set:new Set(f))};return(0,D.jsxs)("div",{className:"chat-messages",ref:o,"data-sending":a?"true":"false",children:[g&&(0,D.jsxs)("div",{className:"chat-message-batch-bar",children:[(0,D.jsxs)("span",{className:"batch-bar-count",children:[p("已选")," ",t.size]}),(0,D.jsx)("button",{onClick:m,children:p("复制所选")}),(0,D.jsx)("button",{onClick:h,className:"danger",children:p("删除所选")}),(0,D.jsx)("button",{onClick:u,children:p("取消")})]}),e.map(e=>{const n=_.has(e.id);return(0,D.jsxs)("div",{className:`chat-message ${e.sender} ${s?"batch-mode":""} ${e.is_loading?"is-loading":""} ${n?"collapsed":""}`,children:[s&&(0,D.jsx)("input",{type:"checkbox",className:"chat-message-checkbox",checked:t.has(e.id),onChange:()=>c(e.id)}),e.is_loading?(0,D.jsxs)("div",{className:"ai-loading-bubble",children:[(0,D.jsxs)("div",{className:"ai-loading-dots",children:[(0,D.jsx)("span",{className:"ai-loading-dot"}),(0,D.jsx)("span",{className:"ai-loading-dot"}),(0,D.jsx)("span",{className:"ai-loading-dot"})]}),(0,D.jsx)("span",{className:"ai-loading-text",children:e.text})]}):(0,D.jsxs)(D.Fragment,{children:[n?(0,D.jsxs)("div",{className:"chat-message-summary",title:e.text,onClick:()=>j(e.id),children:[(0,D.jsx)("span",{className:"chat-message-summary-icon",children:"▸"}),(0,D.jsx)("span",{className:"chat-message-summary-text",children:Q(e)||p("(无内容)")})]}):(0,D.jsx)("div",{className:"chat-message-body",children:R(e)}),(0,D.jsxs)("div",{className:"message-collapse-bar",children:[(0,D.jsx)("button",{onClick:()=>j(e.id),children:p(n?"展开":"折叠")}),(0,D.jsx)("button",{onClick:v,children:p("全部折叠")}),"bot"===e.sender&&null!=e.elapsed_ms&&(0,D.jsx)("span",{className:"message-elapsed",children:(0,U.kf)(e.elapsed_ms)})]}),(0,D.jsx)("div",{className:"message-actions",children:s?(0,D.jsx)("button",{onClick:()=>c(e.id),children:t.has(e.id)?p("取消选择"):p("选择")}):(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)("button",{onClick:()=>r(e.id),children:p("删除")}),(0,D.jsx)("button",{onClick:()=>l(e),children:p("复制")}),(0,D.jsx)("button",{onClick:d,children:p("全部复制")}),(0,D.jsx)("button",{onClick:u,children:p("多选")})]})})]})]},e.id)}),(0,D.jsx)("div",{ref:i})]})},Z=(0,n.forwardRef)(function({placeholder:e="",disabled:s=!1,className:t,style:a,onEnter:o,onPaste:i,onChange:c},r){const l=(0,n.useRef)(null),[d,u]=(0,n.useState)(!0),[m,h]=(0,n.useState)(!1),g=(0,n.useCallback)(()=>{const e=l.current;return e?(e.textContent??"").replace(/\u00A0/g," ").trimEnd():""},[]);(0,n.useImperativeHandle)(r,()=>({getValue:()=>g(),setValue:e=>{const s=l.current;if(!s)return;s.textContent=e,u(!e);const t=document.createRange();t.selectNodeContents(s),t.collapse(!1);const n=window.getSelection();n?.removeAllRanges(),n?.addRange(t)},clear:()=>{const e=l.current;e&&(e.textContent="",u(!0))},focus:()=>l.current?.focus()})),(0,n.useEffect)(()=>{const e=l.current;if(!e)return;const s=()=>u(!e.textContent);return e.addEventListener("input",s),()=>e.removeEventListener("input",s)},[]);return(0,D.jsx)("div",{ref:l,contentEditable:!s,suppressContentEditableWarning:!0,className:"rich-textarea"+(t?" "+t:""),style:a,onKeyDown:e=>{m||"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey||e.altKey||(e.preventDefault(),o?.())},onPaste:i,onInput:()=>c?.(g()),onCompositionStart:()=>h(!0),onCompositionEnd:()=>h(!1),"data-placeholder":d?e:void 0})});function Y({pendingAttachments:e,onRemove:s}){return 0===e.length?null:(0,D.jsx)("div",{className:"chat-attachment-strip",children:e.map((e,t)=>(0,D.jsxs)("div",{className:"chat-attachment-chip",children:[(0,D.jsx)(I.In,{icon:"attach_file"}),(0,D.jsx)("span",{title:e.name,children:e.name}),(0,D.jsx)("button",{type:"button",onClick:()=>s(t),children:(0,D.jsx)(I.In,{icon:"close"})})]},`${e.name}_${t}`))})}const ee=(0,n.forwardRef)(({onSend:e,sending:s,onAbort:t,pendingAttachments:i,onRemoveAttachment:c,onOpenFilePicker:r,onAddFiles:l,onDrop:d,onDragOver:u,fileInputRef:m},h)=>{const{t:g}=(0,o.Bd)(),p=(0,n.useRef)(null),[_,f]=(0,n.useState)(!1),j=(0,n.useRef)(null),[v,b]=(0,a.fp)(x.AG.ai_chat_input_height);(0,n.useImperativeHandle)(h,()=>({getValue:()=>p.current?.getValue()??"",setValue:e=>p.current?.setValue(e),clear:()=>p.current?.clear()}));const y=(0,n.useCallback)(e=>{const s=j.current;if(!s)return;const t=s.getBoundingClientRect().bottom-e.clientY;let n=Math.round(t/21.375);n=Math.max(2,Math.min(20,n)),b(n)},[b]),w=(0,n.useCallback)(()=>f(!0),[]),S=(0,n.useCallback)(()=>f(!1),[]);(0,n.useEffect)(()=>{if(!_)return;const e=y;return window.addEventListener("pointermove",e),window.addEventListener("pointerup",S),()=>{window.removeEventListener("pointermove",e),window.removeEventListener("pointerup",S)}},[_,y,S]);const N={minHeight:`${v}em`,maxHeight:`${v}em`};return(0,D.jsxs)("div",{ref:j,className:"chat-input-area",onDrop:d,onDragOver:u,children:[(0,D.jsx)("div",{className:"chat-input-resize-handle"+(_?" dragging":""),onPointerDown:w}),(0,D.jsx)("input",{ref:m,type:"file",multiple:!0,style:{display:"none"},onChange:e=>{e.target.files?.length&&(l(e.target.files),e.currentTarget.value="")}}),(0,D.jsxs)("div",{className:"chat-input-shell",style:N,children:[(0,D.jsx)(Y,{pendingAttachments:i,onRemove:c}),(0,D.jsx)(Z,{ref:p,placeholder:g("输入消息"),onEnter:()=>e(),onPaste:e=>{const s=e.clipboardData?.files;s&&s.length>0&&(e.preventDefault(),l(s))},className:"chat-input",style:N})]}),(0,D.jsx)(I.rA,{title:g("添加文件"),icon:"attach_file",onClick:r}),s?(0,D.jsx)(I.Vi,{color:"var( --icon-red)",text:g("暂停"),clickFun:t}):(0,D.jsx)(I.Vi,{text:g("发送"),clickFun:e}),_&&(0,D.jsx)("div",{className:"chat-input-overlay",onPointerUp:S})]})}),se={},te=function(){const{t:e}=(0,o.Bd)(),[s,t]=(0,n.useState)([]),[i,r]=(0,n.useState)(!1),[l,d]=(0,n.useState)(null),[u,m]=(0,n.useState)(null),[g,p]=(0,n.useState)(!1),[_,f]=(0,a.fp)(x.AG.ai_bg_expanded),[,j]=(0,a.fp)(x.AG.ai_session_collapsed),v=()=>{f(!1)},b=(0,n.useCallback)(async()=>{r(!0);try{const e=new c.hf(c.HK.ai_bg_process_list_req);e.context={};const s=await $.ws.send(e);s?.context?.processes&&(t(s.context.processes),se.onCountChange?.(s.context.processes.length))}catch(e){console.error("获取后台进程列表失败",e)}finally{r(!1)}},[]);se.refresh=b;const y=(0,n.useCallback)(async e=>{p(!0),d(e);try{const s=new c.hf(c.HK.ai_bg_process_output_req);s.context={pid:e};const t=await $.ws.send(s);m(t.context)}catch(e){console.error("获取进程输出失败",e),(0,h.zN)("获取进程输出失败")}finally{p(!1)}},[]),w=(0,n.useCallback)(async e=>{try{const s=new c.hf(c.HK.ai_bg_process_kill_req);s.context={pid:e};const t=await $.ws.send(s);t?.context?.success?((0,h.SK)("进程已终止"),b(),l===e&&(d(null),m(null))):(0,h.zN)(t?.context?.message||"终止失败")}catch(e){console.error("终止进程失败",e),(0,h.zN)("终止进程失败")}},[b,l]);(0,n.useEffect)(()=>{b();const e=setInterval(b,5e3);return()=>clearInterval(e)},[b]);const S=s.filter(e=>e.running),N=s.filter(e=>!e.running);return(0,D.jsxs)(D.Fragment,{children:[_&&(0,D.jsx)("div",{className:"chat-session-overlay",onClick:v}),(0,D.jsxs)("aside",{className:"chat-bg-process-panel "+(_?"expanded":""),children:[(0,D.jsxs)("div",{className:"chat-bg-process-header",children:[(0,D.jsx)("span",{className:"chat-bg-process-title",children:e("后台进程")}),(0,D.jsx)(I.rA,{icon:"close",title:e("关闭"),onClick:v})]}),(0,D.jsxs)("div",{className:"chat-bg-process-toolbar",children:[(0,D.jsx)(I.rA,{icon:"refresh",title:e("刷新"),onClick:b}),(0,D.jsxs)("span",{className:"chat-bg-process-count",children:[S.length," ",e("个运行中"),N.length>0&&` / ${N.length} ${e("个已退出")}`]})]}),(0,D.jsxs)("div",{className:"chat-bg-process-list",children:[i&&0===s.length&&(0,D.jsx)("div",{className:"chat-bg-process-empty",children:e("加载中...")}),!i&&0===s.length&&(0,D.jsx)("div",{className:"chat-bg-process-empty",children:e("暂无后台进程")}),S.map(s=>(0,D.jsxs)("div",{className:`chat-bg-process-item ${l===s.pid?"active":""} running`,children:[(0,D.jsxs)("div",{className:"chat-bg-process-item-main",onClick:()=>y(s.pid),children:[(0,D.jsxs)("span",{className:"chat-bg-process-pid",children:["PID: ",s.pid]}),(0,D.jsx)("span",{className:"chat-bg-process-cmd",title:s.cmd,children:s.cmd.length>40?s.cmd.slice(0,40)+"...":s.cmd}),(0,D.jsx)("span",{className:"chat-bg-process-time",children:new Date(s.start_time).toLocaleTimeString()}),(0,D.jsx)("span",{className:"chat-bg-process-status running-dot",title:e("运行中"),children:"●"})]}),(0,D.jsxs)("div",{className:"chat-bg-process-item-actions",children:[(0,D.jsx)(I.rA,{icon:"terminal",title:e("查看输出"),onClick:()=>y(s.pid)}),(0,D.jsx)(I.rA,{icon:"stop",title:e("终止进程"),onClick:()=>w(s.pid)})]})]},s.pid)),N.map(e=>(0,D.jsx)("div",{className:`chat-bg-process-item ${l===e.pid?"active":""} finished`,children:(0,D.jsxs)("div",{className:"chat-bg-process-item-main",onClick:()=>y(e.pid),children:[(0,D.jsxs)("span",{className:"chat-bg-process-pid",children:["PID: ",e.pid]}),(0,D.jsx)("span",{className:"chat-bg-process-cmd",title:e.cmd,children:e.cmd.length>30?e.cmd.slice(0,30)+"...":e.cmd}),(0,D.jsx)("span",{className:"chat-bg-process-time",children:new Date(e.start_time).toLocaleTimeString()}),(0,D.jsxs)("span",{className:"chat-bg-process-exit-code",children:["exit: ",e.exit_code]})]})},e.pid))]}),null!==l&&(0,D.jsxs)("div",{className:"chat-bg-process-output",children:[(0,D.jsxs)("div",{className:"chat-bg-process-output-header",children:[(0,D.jsxs)("span",{children:["PID: ",l," ",e("输出")]}),(0,D.jsx)(I.rA,{icon:"close",title:e("关闭"),onClick:()=>{d(null),m(null)}})]}),(0,D.jsx)("div",{className:"chat-bg-process-output-content",children:g?(0,D.jsx)("div",{className:"chat-bg-process-empty",children:e("加载中...")}):u?(0,D.jsx)("pre",{className:"chat-bg-process-output-pre",children:u.output||e("(无输出)")}):null})]})]})]})};function ne(){const{t:e}=(0,o.Bd)(),[s,t]=(0,i.ok)(),j=s.get("session")||"",y=(0,g.y)(),{check_user_auth:S}=(0,u.MH)();(0,_.w)();const[N,k]=(0,n.useState)([]),[C,I]=(0,n.useState)([]),[M,R]=(0,n.useState)(""),[H,B]=(0,n.useState)(null),[K,T]=(0,n.useState)(!1),E=(0,n.useRef)(null),[P,L]=(0,n.useState)([]),[F,z]=(0,a.fp)(x.AG.ai_session_collapsed),[O,q]=(0,a.fp)(x.AG.ai_bg_expanded),[J,U]=(0,a.fp)(x.AG.prompt_card),[Q]=(0,a.fp)(x.AG.ai_chat_zoom),[Z,Y]=(0,n.useState)(!1),[ne,ae]=(0,n.useState)(new Set),[oe,ie]=(0,n.useState)(new Set),[ce,re]=(0,n.useState)(""),le=(0,n.useRef)(null),de=(0,n.useRef)(null),ue=(0,n.useRef)(null),me=(0,n.useRef)(!0),he=(0,n.useRef)(null),ge=(0,n.useRef)(0),pe=(0,n.useRef)(null),_e=(0,n.useRef)(M),xe=(0,n.useRef)(H);(0,n.useEffect)(()=>{_e.current=M},[M]),(0,n.useEffect)(()=>{xe.current=H},[H]);const fe=(0,n.useRef)({}),[je,ve]=(0,n.useState)([]),[be,ye]=(0,n.useState)(""),[we,Se]=(0,n.useState)([]),Ne=async()=>{try{const e=await r.jV.get("public_models");e.code===p.m.Success&&Se(e.data?.groups??[])}catch{Se([])}},ke=e=>{ye(e?.ai_config?.model??"")},[Ce,Ae]=(0,n.useState)(0),$e=(0,n.useRef)((0,l.sg)(e=>{k(e),me.current&&Ie(!1)},50)).current,Ie=(e=!1)=>{const s=ue.current;s&&s.scrollTo({top:s.scrollHeight,behavior:e?"smooth":"auto"})},Me=async()=>{const e=await r.jV.get("sessions");e.code===p.m.Success&&I(e.data??[])},De=function(e){const{getMessages:s,setMessages:t,setMessagesDebounced:a,setSending:o,getActiveSessionId:i,setActiveSessionId:r,refreshSessions:l,scrollToBottom:d,buildRequestMessages:u,getSelectedSysPromptId:m}=e,h=(0,n.useRef)([]),g=(0,n.useRef)(null),p=(e,n,r)=>{const h=[...s(),n];t(h),o(e),g.current={abort:()=>{}};const p={id:n.id+1,sender:"bot",text:"AI思考中...",is_loading:!0};h.push(p),t([...h]);const _=new Map;let x=!0,f=p;const j=s=>{const t=s.context||{};if(t.session_id!==e)return;const n=t.text||"",o=t.tool_call_ends,c=t.chunk_index??0;if("[DONE]"!==n)if(x)x=!1,f.text=n,o&&(f.content_list=[{tool_call_ends:o,content:f.text,role:"assistant"}]),f.is_loading=!1,f.chunk_index=c,_.set(c,f),i()===e&&a([...h]);else{const s=_.get(c);if(s)s.text+=n,o&&(s.content_list=[{tool_call_ends:o,content:s.text,role:"assistant"}]),i()===e&&a([...h]);else{const s={id:Date.now()+Math.random(),sender:"bot",text:n,chunk_index:c};o&&(s.content_list=[{tool_call_ends:o,content:s.text,role:"assistant"}]),h.push(s),_.set(c,s),i()===e&&a([...h])}}},v=s=>{const n=s.context||{};if(n.session_id===e){if(y(),g.current=null,o(s=>s===e?null:s),f.is_loading=!1,i()===e)if(n.once_messages_list?.length){const e=w(n.once_messages_list);t(s=>{const t=s[s.length-1];return"bot"===t?.sender?[...s.slice(0,-1),...e]:[...s,...e]})}else t([...h]);l(),d(!0),r()}},b=s=>{const n=s.context||{};n.session_id===e&&(y(),g.current=null,o(s=>s===e?null:s),f.text="AI请求出错: "+(n.message||"未知错误"),f.is_loading=!1,i()===e&&t([...h]),r())},y=()=>{$.ws.off_message(`message_${c.HK.ai_chat_msg}`,j),$.ws.off_message(`message_${c.HK.ai_chat_end}`,v),$.ws.off_message(`message_${c.HK.ai_chat_error}`,b)};$.ws.addMsg(c.HK.ai_chat_msg,j),$.ws.addMsg(c.HK.ai_chat_end,v),$.ws.addMsg(c.HK.ai_chat_error,b),$.ws.sendData(c.HK.ai_chat_req,{messages:u(n),session_id:e,sys_prompt_id:m()})},_=()=>{const e=h.current;if(0===e.length)return;const s=e.shift();if(!s)return;t(e=>e.map(e=>"user"===e.sender&&e.text.includes("⏳(排队中...)")?{...e,text:e.text.replace(" ⏳(排队中...)","")}:e));const n={id:Date.now(),sender:"user",text:s.text,attachments:s.attachments};p(i(),n,_)};return{startChatStream:p,processPendingQueue:_,enqueueMessage:(e,s)=>{h.current.push({text:e,attachments:s})},getQueueLength:()=>h.current.length,abort:()=>{const e=i();e&&($.ws.sendData(c.HK.ai_chat_abort,{session_id:e}),g.current&&(g.current=null,o(s=>s===e?null:s)))}}}({getMessages:()=>N,setMessages:k,setMessagesDebounced:$e,setSending:B,getActiveSessionId:()=>_e.current,setActiveSessionId:R,refreshSessions:Me,scrollToBottom:Ie,buildRequestMessages:e=>{const s=(e.attachments??[]).filter(e=>"image"===e.kind);if(s.length>0){const t=[];e.text&&t.push({type:"text",text:e.text});for(const e of s)t.push({type:"image_url",image_url:{url:e.content}});return[{content:t,role:"user",attachments:e.attachments??[]}]}return[{content:e.text,role:"bot"===e.sender?"assistant":"user",attachments:e.attachments??[]}]},getSelectedSysPromptId:()=>ce}),Re=async e=>{const s=await r.jV.get("sessions");if(s.code!==p.m.Success)return!1;const n=s.data??[];I(n);const a=null===e?n[0]?.id??"":e||M||n[0]?.id||"";return a?await He(a):(k([]),R(""),t(e=>{const s=new URLSearchParams(e);return s.delete("session"),s},{replace:!0}),!1)},He=async(e,s=!1)=>{const n=await r.jV.post("session/get",{session_id:e});if(n.code!==p.m.Success||!n.data)return!1;const a=n.data;R(a.id),j!==a.id&&t(e=>{const s=new URLSearchParams(e);return s.set("session",a.id),s},{replace:!0}),T(!!a.running),pe.current&&pe.current!==a.id&&$.ws.sendData(c.HK.ai_chat_subscribe,{session_id:pe.current,subscribe:!1}),pe.current=a.running?a.id:null,pe.current&&$.ws.sendData(c.HK.ai_chat_subscribe,{session_id:pe.current,subscribe:!0});const o=w(a.messages);return a.running&&a.live_messages?.length?k([...o,...w(a.live_messages)]):k(o),re(a.sys_prompt_id??""),s&&z(!1),se.refresh?.(),requestAnimationFrame(()=>Ie(!1)),!0},Be=e=>{const s=Array.from(e??[]).filter(Boolean);s.length&&L(e=>[...e,...s])},Ke=()=>{Z&&(ae(new Set),ie(new Set)),Y(e=>!e)},Te=()=>{0!==ne.size&&y({sub_title:e("cf_msgs"),confirm_fun:async()=>{const e=[];N.forEach((s,t)=>{ne.has(s.id)&&e.push(t)}),k(N.filter(e=>!ne.has(e.id))),ae(new Set),Y(!1),M&&e.length>0&&r.jV.post("session/message/delete",{session_id:M,indices:e}).catch(console.error)}})};(0,n.useEffect)(()=>((async()=>{const e=await r.XO.get("ai_agent_setting/env");e.code===p.m.Success&&(fe.current=e.data,ke(e.data)),await Ne(),j&&await Re(j)||await Re();const s=await r.jV.get("system_prompts");s.code===p.m.Success&&ve(s.data??[])})(),requestAnimationFrame(()=>Ie(!1)),se.onCountChange=Ae,se.refresh?.(),$.ws.addMsg(c.HK.ai_bg_process_count_notify,e=>{const s=e?.context?.count;"number"==typeof s&&Ae(s)}),()=>{$.ws.removeMsg(c.HK.ai_bg_process_count_notify)}),[]),(0,n.useEffect)(()=>{const e=ue.current;if(!e)return;const s=()=>{me.current=((e,s=120)=>{const{scrollTop:t,scrollHeight:n,clientHeight:a}=e;return n-(t+a)<s})(e)};return e.addEventListener("scroll",s),()=>e.removeEventListener("scroll",s)},[]),(0,n.useEffect)(()=>{const e=()=>_e.current,s=()=>xe.current,t=(t,n)=>{if(e()&&e()===t){if(he.current=null,T(!1),pe.current===t&&($.ws.sendData(c.HK.ai_chat_subscribe,{session_id:t,subscribe:!1}),pe.current=null),s()===t)return;n?.length?k(e=>{const s=w(n),t=e[e.length-1];return"bot"===t?.sender?[...e.slice(0,-1),...s]:[...e,...s]}):He(t).catch(()=>{}),Me()}},n=t=>{const n=t?.context||{};if(!n.session_id)return;var a,o,i;a=n.session_id,o=n.text||"",i=n.tool_call_ends,e()&&e()===a&&s()!==a&&k(e=>{const s=e[e.length-1];if(s&&"bot"===s.sender){const t=[...e],n={...s};return n.text+=o,i&&(n.content_list=[{tool_call_ends:i,content:n.text,role:"assistant"}]),t[t.length-1]=n,he.current=n.id,me.current&&requestAnimationFrame(()=>Ie(!1)),t}const t={id:Date.now()+Math.random(),sender:"bot",text:o};return i&&(t.content_list=[{tool_call_ends:i,content:o,role:"assistant"}]),he.current=t.id,me.current&&requestAnimationFrame(()=>Ie(!1)),[...e,t]});const c=Date.now();c-ge.current>1500&&(ge.current=c,Me())},a=e=>{const s=e?.context||{};s.session_id&&t(s.session_id,s.once_messages_list)},o=e=>{const s=e?.context||{};s.session_id&&t(s.session_id)};return $.ws.addMsg(c.HK.ai_chat_msg,n),$.ws.addMsg(c.HK.ai_chat_end,a),$.ws.addMsg(c.HK.ai_chat_error,o),()=>{$.ws.off_message(`message_${c.HK.ai_chat_msg}`,n),$.ws.off_message(`message_${c.HK.ai_chat_end}`,a),$.ws.off_message(`message_${c.HK.ai_chat_error}`,o),pe.current&&($.ws.sendData(c.HK.ai_chat_subscribe,{session_id:pe.current,subscribe:!1}),pe.current=null)}},[]),(0,n.useLayoutEffect)(()=>{me.current&&Ie(!1)},[N]);return(0,D.jsxs)(n.Fragment,{children:[(0,D.jsx)(G,{currentModelName:be,setCurrentModelName:ye,modelGroups:we,onModelChanged:async()=>{await Ne();const e=await r.XO.get("ai_agent_setting/env");e.code===p.m.Success&&(fe.current=e.data,ke(e.data))},sysPromptList:je,batchMode:Z,selectedMsgCount:ne.size,onToggleSessionPanel:()=>{z(e=>!e)},onCreateSession:async e=>{const s=void 0!==e?e:ce,t=await r.jV.post("session",{title:"新会话",sys_prompt_id:s||void 0});if(t.code!==p.m.Success)return;const n=t.data;R(n.id),k([]),re(n.sys_prompt_id??""),z(!1),await Re(n.id),requestAnimationFrame(()=>{const e=document.querySelector(".chat-input");e&&(e.style.height="auto",e.style.height=Math.min(e.scrollHeight,200)+"px")})},onBatchDeleteMessages:Te,bgProcessVisible:O,bgProcessCount:Ce,onToggleBgProcess:()=>q(e=>!e),selectedSysPromptId:ce,setSelectedSysPromptId:e=>{re(e),M&&r.jV.post("session/sys_prompt",{session_id:M,sys_prompt_id:e||void 0}).catch(console.error)}}),(0,D.jsxs)("div",{className:"chat-page chat-page-with-sessions",style:{"--ai-chat-zoom":Q},children:[F&&(0,D.jsx)("div",{className:"chat-session-overlay",onClick:()=>z(!1)}),(0,D.jsx)(W,{sessions:C,activeSessionId:M,onSelectSession:e=>He(e,!1),onReorderSessions:(e,s)=>{const t=C.findIndex(s=>s.id===e),n=C.findIndex(e=>e.id===s);if(t<0||n<0||t===n)return;const a=(0,d.TI)(C,t,n);I(a),r.jV.post("sessions/update/sort",{session_ids:a.map(e=>e.id)}).catch(()=>{})},onRenameSession:(e,s)=>{let t=s;y({confirm_fun:async()=>{await r.jV.post("sessions/update/meta",{id:e,title:t}),await Re(M)},context_div:(0,D.jsx)("div",{className:"card-content",children:(0,D.jsx)(f.Sm,{value:t,handleInputChange:e=>{t=e}})})})},onDeleteSession:e=>{y({sub_title:"确认删除这个会话吗?",confirm_fun:async()=>{await r.jV.post("session/delete",{session_id:e}),M===e?(R(""),await Re(null)):await Re(M)}})},onToggleCmdAuto:async(s,t)=>{await r.jV.post("session/cmd_auto_allow",{session_id:s,allow:t}),(0,h.SK)(e(t?"命令检测已开启":"命令检测已关闭")),await Re(M)},onShowUsageStats:async s=>{U({open:!0,title:e("Token消耗统计"),context_div:(0,D.jsx)("div",{className:"usage-stats-loading",children:e("加载中...")}),cancel:()=>U({open:!1})});try{const t=await r.jV.post("session/usage_stats",{session_id:s});if(t.code===p.m.Success&&t.data){const s=t.data;U({open:!0,title:e("Token消耗统计"),context_div:(0,D.jsxs)("div",{className:"usage-stats-panel",children:[[{l:e("对话轮次"),v:(s.turns??0).toString()},{l:e("AI输入Token"),v:v(s.input_tokens)},{l:e("AI输出Token"),v:v(s.output_tokens)},{l:e("AI输入Token(最近一轮)"),v:v(s.recent_input_tokens)},{l:e("AI输出Token(最近一轮)"),v:v(s.recent_output_tokens)}].map((e,s)=>(0,D.jsxs)("div",{className:"usage-stats-row",children:[(0,D.jsx)("span",{className:"usage-stats-label",children:e.l}),(0,D.jsx)("span",{className:"usage-stats-value",children:e.v})]},s)),(0,D.jsxs)("div",{className:"usage-stats-row usage-stats-total",children:[(0,D.jsx)("span",{className:"usage-stats-label",children:e("AI Token总计消耗")}),(0,D.jsx)("span",{className:"usage-stats-value",children:v((s.input_tokens||0)+(s.output_tokens||0))})]})]}),cancel:()=>U({open:!1})})}else U({open:!0,title:e("Token消耗统计"),context_div:(0,D.jsx)("div",{className:"usage-stats-empty",children:e("暂无统计数据")}),cancel:()=>U({open:!1})})}catch{U({open:!0,title:e("Token消耗统计"),context_div:(0,D.jsx)("div",{className:"usage-stats-empty",children:e("暂无统计数据")}),cancel:()=>U({open:!1})})}},batchMode:Z,selectedSessionIds:oe,onToggleSessionSelect:e=>{ie(s=>{const t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},onToggleBatchMode:Ke,onBatchDeleteSessions:()=>{0!==oe.size&&y({sub_title:e("cf_ses"),confirm_fun:async()=>{for(const e of oe)await r.jV.post("session/delete",{session_id:e});ie(new Set),Y(!1),oe.has(M)?(R(""),await Re(null)):await Re(M)}})},onClearAllSessions:()=>{y({sub_title:e("cf_all"),confirm_fun:async()=>{await r.jV.post("sessions/clear",{}),R(""),k([]),await Re(null)}})}}),(0,D.jsx)(te,{}),(0,D.jsxs)("section",{className:"chat-main",children:[0===N?.length&&(0,D.jsx)("div",{className:"chat-header",children:(0,D.jsx)("div",{children:e("ai_ask")})}),(0,D.jsx)(X,{messages:N,batchMode:Z,selectedMsgIds:ne,sending:H===M||K,chatContainerRef:ue,messagesEndRef:de,onToggleMsgSelect:e=>{ae(s=>{const t=new Set(s);return t.has(e)?t.delete(e):t.add(e),t})},onDelete:s=>{y({sub_title:e("cf_one"),confirm_fun:async()=>{const e=N.findIndex(e=>e.id===s);if(e<0)return;const t=N.filter(e=>e.id!==s);k(t),M&&r.jV.post("session/message/delete",{session_id:M,indices:[e]}).catch(console.error)}})},onCopy:async e=>{(0,m.lW)(b(e)),(0,h.SK)("复制成功")},onCopyAll:async()=>{if(!C.length)return void(0,h.SK)("暂无聊天记录");const e=[];for(const s of C){const t=await r.jV.post("session/get",{session_id:s.id});if(t.code!==p.m.Success||!t.data)continue;const n=t.data,a=w([...n.messages??[],...n.live_messages??[]]).map(b).filter(Boolean).join("\n\n\n");a&&e.push(a)}e.length?((0,m.lW)(e.join("\n\n\n")),(0,h.SK)("复制成功")):(0,h.SK)("暂无聊天记录")},onToggleBatchMode:Ke,onBatchCopy:()=>{const e=N.filter(e=>ne.has(e.id)).map(b).filter(Boolean).join("\n\n\n");e?((0,m.lW)(e),(0,h.SK)("复制成功")):(0,h.SK)("暂无内容")},onBatchDelete:Te,showBatchBar:Z&&ne.size>0&&0===oe.size,t:e}),(0,D.jsx)(ee,{ref:E,onSend:async()=>{const e=(E.current?.getValue()??"").trim();if(!e&&0===P.length)return;if(H===M){const s=await A(P);De.enqueueMessage(e,s),E.current?.clear(),L([]);const t={id:Date.now(),sender:"user",text:e+(De.getQueueLength()>1?" ⏳(排队中...)":""),attachments:s};return void k(e=>[...e,t])}let s=M;if(!s){const t=await r.jV.post("session",{title:(e||P[0]?.name||"新会话").slice(0,28),sys_prompt_id:ce||void 0});if(t.code!==p.m.Success)return;s=t.data.id,R(s),await Re(s)}const t=await A(P),n={id:Date.now(),sender:"user",text:e,attachments:t};E.current?.clear(),L([]);const a=fe?.current?.ai_config?.request_type||"completions";if("completions"!==a){const t={id:n.id+1,sender:"bot",text:"处理中...",is_loading:!0},o=[...N,n,t];k(o),B(s);return void(await V(a,e,s,async(e,s)=>{t.text=e,t.is_loading=!1,s?.images&&(t.images=s.images),s?.audio&&(t.audio=s.audio),s?.embeddings&&(t.embeddings=s.embeddings),k([...o]),B(null),Me(),Ie(!0),De.processPendingQueue()})||(t.text=`请求类型 "${a}" 的专用处理器尚未实现,请使用 completions 类型。`,t.is_loading=!1,k([...o]),B(null),De.processPendingQueue()))}De.startChatStream(s,n,()=>De.processPendingQueue())},sending:H===M||K,onAbort:De.abort,pendingAttachments:P,onRemoveAttachment:e=>{L(s=>s.filter((s,t)=>t!==e))},onOpenFilePicker:()=>{le.current?.click()},onAddFiles:Be,onDrop:e=>{const s=e.dataTransfer?.files;s&&s.length>0&&(e.preventDefault(),Be(s))},onDragOver:e=>{e.dataTransfer?.types?.includes("Files")&&e.preventDefault()},fileInputRef:le})]})]})]})}},72693(e,s,t){t.d(s,{w:()=>h});var n=t(96540),a=t(22022),o=t(14944),i=t(92275),c=t(34843),r=t(82893),l=t(85997),d=t(14284),u=t(74848);function m(e){const{t:s}=(0,a.Bd)(),[t,o]=(0,n.useState)(!1),i=!!e.sessionId;return(0,u.jsxs)("div",{children:[(0,u.jsx)("div",{style:{maxHeight:"60vh",overflow:"auto",whiteSpace:"pre-wrap",wordBreak:"break-all",background:"var(--surfaceSecondary)",padding:"0.75em",borderRadius:"0.5em",marginBottom:"0.75em",fontFamily:"monospace",fontSize:"0.9em",lineHeight:"1.5"},children:e.cmd}),i&&(0,u.jsxs)("div",{style:{display:"flex",alignItems:"center",gap:"0.5em",marginBottom:"0.75em",color:t?"var(--icon-blue)":"var(--textSecondary)"},children:[(0,u.jsx)(l.Ay,{checked:t,onChange:s=>{o(s),s&&e.onAutoAllow()},title:s("此会话不再询问")}),(0,u.jsx)("span",{children:s("此会话不再询问")})]}),(0,u.jsxs)("div",{style:{display:"flex",gap:"0.5em",justifyContent:"flex-end"},children:[(0,u.jsx)(l.$n,{text:s("拒绝"),color:"var(--red)",clickFun:e.onDeny}),(0,u.jsx)(l.$n,{text:s("允许"),clickFun:e.onAllow})]})]})}function h(){const[e,s]=(0,c.fp)(r.AG.prompt_card),{t}=(0,a.Bd)(),l=(0,n.useRef)([]),h=(0,n.useRef)(!1),g=(0,n.useRef)(null),p=(0,n.useRef)(void 0),_=(0,n.useRef)(()=>{}),x=(0,n.useCallback)(e=>{s({open:!1}),h.current=!1,g.current&&(o.ws.sendData(i.HK.ai_confirm_cmd,{askId:g.current,approved:e}),g.current=null),_.current()},[s]),f=(0,n.useCallback)(()=>{if(h.current)return;if(0===l.current.length)return h.current=!1,void s({open:!1});h.current=!0;const e=l.current.shift();e?(g.current=e.askId,p.current=e.session_id,s({open:!0,title:t("命令确认"),cancel:()=>x(!1),context_div:(0,u.jsx)(m,{cmd:e.cmd,sessionId:e.session_id,onDeny:()=>x(!1),onAllow:()=>x(!0),onAutoAllow:async()=>{if(p.current)try{await d.jV.post("session/cmd_auto_allow",{session_id:p.current,allow:!0})}catch(e){console.error("设置会话命令免确认失败",e)}x(!0)}})})):h.current=!1},[t,x,s]);_.current=f;const j=(0,n.useCallback)(e=>{l.current.push(e),f()},[f]);(0,n.useEffect)(()=>(o.ws.addMsg(i.HK.ai_confirm_cmd,e=>{const t=e.context||{};if(t.dismiss&&t.askId)return l.current=l.current.filter(e=>e.askId!==t.askId),void(h.current&&g.current===t.askId&&(g.current=null,h.current=!1,s({open:!1}),f()));t.askId&&t.cmd&&j({askId:t.askId,cmd:t.cmd,session_id:t.session_id})}),()=>{o.ws.removeMsg(i.HK.ai_confirm_cmd)}),[j]),(0,n.useEffect)(()=>()=>{l.current=[],h.current=!1,g.current=null},[])}},34299(e,s,t){t.r(s),t.d(s,{default:()=>b});var n=t(96540),a=t(23802),o=t(53995),i=t(18569),c=t(77979),r=t(8263),l=t(69428),d=t.n(l),u=(t(3775),t(21499)),m=t(99214),h=t(89117),g=t(89334),p=t(41105),_=t(52388),x=t(19878),f=(t(72411),t(74848));const j=new a.A({html:!0,highlight:function(e,s){if(s&&x.A.getLanguage(s))try{return`<pre class="hljs code-block-with-copy"><code class="hljs language-${s}">${x.A.highlight(e,{language:s}).value}</code></pre>`}catch(e){}try{return`<pre class="hljs code-block-with-copy"><code class="hljs">${x.A.highlightAuto(e).value}</code></pre>`}catch(e){}return`<pre class="hljs code-block-with-copy"><code>${j.utils.escapeHtml(e)}</code></pre>`}});function v(e){const s=e.className.match(/language-([\w-]+)/);return s?s[1]:""}function b(e){const s=(0,n.useRef)(null);return(0,m.VD)(),(0,n.useEffect)(()=>{s.current&&(!async function(e){const s=e.querySelectorAll("pre > code[class*='language-']");for(const e of Array.from(s)){const s=v(e);if(!(0,h.Hm)(s))continue;const t=e.closest(".code-block-with-copy")??e.parentElement;if(!t)continue;const n=e.textContent??"",a=document.createElement("div");a.className="md-graph md-graph--loading",a.textContent=_.A.t("rendering"),t.replaceWith(a);const o=await(0,h.U6)(s,n);a.isConnected&&(o.error?(a.className="md-graph md-graph--error",a.textContent=o.error):(a.className="md-graph",a.innerHTML=o.svg))}}(s.current),(0,g.rg)(s.current))},[e.context]),(0,f.jsx)("div",{ref:s,dangerouslySetInnerHTML:{__html:j.render(e.context)}})}j.use(o.A).use(i.A).use(c.A).use(r.A).use(d()).use(e=>{e.renderer.rules.fence;e.renderer.rules.fence=(s,t,n,a,o)=>{const i=s[t],c=i.content.trim(),r=i.info.trim();let l="";if(r&&x.A.getLanguage(r))try{l=x.A.highlight(c,{language:r}).value}catch(s){l=e.utils.escapeHtml(c)}else try{l=x.A.highlightAuto(c).value}catch(s){l=e.utils.escapeHtml(c)}return`\n <div class="code-block-with-copy">\n <div class="code-header">\n <span class="code-language">${r||"code"}</span>\n <button class="copy-btn" data-code="${e.utils.escapeHtml(c)}">复制</button>\n </div>\n <pre><code class="hljs ${r?`language-${r}`:""}">${l}</code></pre>\n </div>`}}).use(e=>{const s=e.renderer.rules.link_open||function(e,s,t,n,a){return a.renderToken(e,s,t)};e.renderer.rules.link_open=(e,t,n,a,o)=>{const i=e[t],c=i.attrIndex("href");if(c>=0){const e=i.attrs[c][1];i.attrs[c][1]=(0,u.bi)(window.location.href,e)}return s(e,t,n,a,o)}}),(0,g.Rh)(j,p.pC)},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([[4473],{24473(e,t,r){r.r(t),r.d(t,{applyDagreLayoutResult:()=>C,getEdgesToRender:()=>b,measureDagreLayout:()=>v,prepareLayoutForDagre:()=>T,render:()=>I,runDagreLayoutCore:()=>K});var a=r(89970),n=r(99257),o=r(24832),i=r(36870),d=r(84076),s=(r(36155),r(57588),r(54912),r(92941),r(51255),r(89983)),g=r(31293),l=r(86827),h=r(84193),p=r(697),c=(0,l.K)((e,t,r)=>Math.max(t,Math.min(r,e)),"clamp"),u=(0,l.K)((e="TB")=>{switch(e){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";default:return"top"}},"getDefaultSelfLoopSide"),f=(0,l.K)(e=>"flowchart"===e||"flowchart-v2"===e||"stateDiagram"===e||"er"===e||"classDiagram"===e,"shouldMergeSelfLoopSegments"),y=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],m=(0,l.K)((e,t,r,a,n)=>{const o=[],i=new Set;if(r.forEach(({start:e,end:t})=>{e!==a&&i.add(e),t!==a&&i.add(t)}),i.forEach(t=>{const r=e.node(t);"number"==typeof r?.x&&"number"==typeof r?.y&&o.push(r)}),0===o.length&&r.forEach(({edge:e})=>{(e.points??[]).forEach(e=>{"number"==typeof e?.x&&"number"==typeof e?.y&&o.push(e)})}),0===o.length)return u(n);const d=o.reduce((e,t)=>({x:e.x+t.x/o.length,y:e.y+t.y/o.length}),{x:0,y:0}),s=d.x-t.x,g=d.y-t.y;return Math.abs(s)>Math.abs(g)?s>0?"right":"left":Math.abs(g)>0?g>0?"bottom":"top":u(n)},"getSelfLoopSide"),L=(0,l.K)((e,t="top",r=0,a=0)=>{const n=e.x,o=e.y-r,i=e.width/2,d=e.height/2,s=Math.max(36,Math.min(100,.8*e.width)),g=c(Math.max(a,.35*e.width),36,s),l=c(.45*Math.min(e.width,e.height),24,48);switch(t){case"bottom":{const e=o+d;return[{x:n-g/2,y:e},{x:n-g/2,y:e+l},{x:n+g/2,y:e+l},{x:n+g/2,y:e}]}case"right":{const e=n+i;return[{x:e,y:o-g/2},{x:e+l,y:o-g/2},{x:e+l,y:o+g/2},{x:e,y:o+g/2}]}case"left":{const e=n-i;return[{x:e,y:o-g/2},{x:e-l,y:o-g/2},{x:e-l,y:o+g/2},{x:e,y:o+g/2}]}default:{const e=o-d;return[{x:n-g/2,y:e},{x:n-g/2,y:e-l},{x:n+g/2,y:e-l},{x:n+g/2,y:e}]}}},"getSelfLoopPoints"),w=(0,l.K)((e,t,r="top",a=0,n={})=>{const o=e.x,i=e.y-a,d=n.width??0,s=n.height??0;switch(r){case"bottom":return{x:o,y:Math.max(...t.map(e=>e.y))+s/2+4};case"right":return{x:Math.max(...t.map(e=>e.x))+d/2+4,y:i};case"left":return{x:Math.min(...t.map(e=>e.x))-d/2-4,y:i};default:return{x:o,y:Math.min(...t.map(e=>e.y))-s/2-4}}},"getSelfLoopLabelPosition"),b=(0,l.K)((e,t=0,{mergeSelfLoops:r=!0}={})=>{const a=new Map,n=[],o=e.graph()?.rankdir;return e.edges().forEach(t=>{const o=e.edge(t);if(r&&o.selfLoop){const e=o.selfLoop.id;a.has(e)||a.set(e,[]),a.get(e).push({edge:o,start:t.v,end:t.w})}else n.push({edge:o,start:t.v,end:t.w})}),a.forEach(r=>{if(3!==r.length)return void r.forEach(e=>n.push(e));r.sort((e,t)=>e.edge.selfLoop.order-t.edge.selfLoop.order);const[a,i,d]=r,s=a.edge.originalEdge??i.edge.originalEdge??d.edge.originalEdge??i.edge,g=e.node(s.start);if(!g)return void r.forEach(e=>n.push(e));const l={width:i.edge.width,height:i.edge.height},h=m(e,g,r,s.start,o),p=L(g,h,t,l.width??0),c=w(g,p,h,t,l),u={...i.edge,...s,id:s.id,points:p,start:s.start,end:s.end,x:c.x,y:c.y,width:l.width,height:l.height,labelStyle:i.edge.labelStyle,fromCluster:a.edge.fromCluster??i.edge.fromCluster??d.edge.fromCluster,toCluster:a.edge.toCluster??i.edge.toCluster??d.edge.toCluster};delete u.selfLoop,delete u.originalEdge,n.push({edge:u,start:u.start,end:u.end})}),n},"getEdgesToRender"),x=(0,l.K)(async({element:e,graph:t,diagramType:r,id:n,parentCluster:s,siteConfig:h})=>{const p=t.graph().rankdir;g.R.trace("Dir in recursive render - dir:",p);const{clusters:c,edgePaths:u,edgeLabels:y,nodes:m,rootGroups:L}=(0,a.B)(e,{edgePathsClass:"edgePaths"});t.nodes()?g.R.info("Recursive render XXX",t.nodes()):g.R.info("No nodes found for",t),t.edges().length>0&&g.R.info("Recursive edges",t.edge(t.edges()[0]));const w=f(r);await Promise.all(t.nodes().map(async function(e){const o=t.node(e);if(void 0!==s){const r=JSON.parse(JSON.stringify(s.clusterData));g.R.trace("Setting data for parent cluster XXX\n Node.id = ",e,"\n data=",r.height,"\nParent cluster",s.height),t.setNode(s.id,r),t.parent(e)||(g.R.trace("Setting parent",e,s.id),t.setParent(e,s.id,r))}if(g.R.info("(Insert) Node XXX"+e+": "+JSON.stringify(t.node(e))),o?.clusterNode){g.R.info("Cluster identified XBX",e,o.width,t.node(e));const{ranksep:a,nodesep:s}=t.graph();o.graph.setGraph({...o.graph.graph(),ranksep:a+25,nodesep:s});const l=await D({element:m,graph:o.graph,diagramType:r,id:n,parentCluster:t.node(e),siteConfig:h}),p=l.elem;(0,d.lC)(o,p),o.diff=l.diff||0,g.R.info("New compound node after recursive render XAX",e,"width",o.width,"height",o.height),(0,i.U7)(p,o)}else t.children(e).length>0?(g.R.trace("Cluster - the non recursive path XBX",e,o.id,o,o.width,"Graph:",t),g.R.trace((0,a.dc)(o.id,t)),a.ju.set(o.id,{id:(0,a.dc)(o.id,t),node:o})):(g.R.trace("Node - the non recursive path XAX",e,m,t.node(e),p),await(0,a.sv)(m,t.node(e),{config:h,dir:p}))}));const b=(0,l.K)(async()=>{const e=t.edges().map(async function(e){const r=t.edge(e.v,e.w,e.name);if(g.R.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),g.R.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(t.edge(e))),g.R.info("Fix",a.ju,"ids:",e.v,e.w,"Translating: ",a.ju.get(e.v),a.ju.get(e.w)),w&&r.selfLoop){if(1!==r.selfLoop.order)return;const e={...r.originalEdge,...r,id:r.selfLoop.id,startLabelLeft:r.originalEdge?.startLabelLeft??r.startLabelLeft,startLabelRight:r.originalEdge?.startLabelRight??r.startLabelRight,endLabelLeft:r.originalEdge?.endLabelLeft??r.endLabelLeft,endLabelRight:r.originalEdge?.endLabelRight??r.endLabelRight};return await(0,o.jP)(y,e),r.width=e.width,r.height=e.height,void(r.labelStyle=e.labelStyle)}await(0,o.jP)(y,r)});await Promise.all(e)},"processEdges");await b();const{subGraphTitleTotalMargin:x}=(0,i.Oi)(h);return{elem:L,graph:t,groups:{clusters:c,edgePaths:u,edgeLabels:y,nodes:m,rootGroups:L},diagramType:r,id:n,mergeSelfLoops:w,subGraphTitleTotalMargin:x}},"measureDagreGraph"),R=(0,l.K)(e=>{g.R.info("############################################# XXX"),g.R.info("### Layout ### XXX"),g.R.info("############################################# XXX"),(0,h.Zp)(e)},"runDagreGraphLayout"),E=(0,l.K)((e,t,r)=>{const a=e.node(t);if(!a)return;const n={...a};return a?.clusterNode?n.y=(a.y??0)+r:e.children(t).length>0?n.height=(a.height??0)+r:n.y=(a.y??0)+r/2,n},"normalizeDagreNode"),S=(0,l.K)((e,t)=>{y.forEach(r=>{void 0!==t[r]&&(e[r]=t[r])})},"applyDagreNodeLayout"),X=(0,l.K)((e,t,r,a)=>({...e,start:e.start??t,end:e.end??r,points:(e.points??[]).map(e=>({...e,y:"number"==typeof e.y?e.y+a:e.y}))}),"normalizeDagreEdge"),C=(0,l.K)((e,t)=>{const{graph:r,mergeSelfLoops:n,subGraphTitleTotalMargin:o=0}=t,i=new Map(e.nodes.map(e=>[e.id,e]));(0,a.sc)(r).forEach(e=>{const t=E(r,e,o);if(!t)return;S(r.node(e),t);const a=i.get(e);a&&S(a,t)});const d=o/2;return e.edges=b(r,d,{mergeSelfLoops:n}).map(({edge:e,start:t,end:r})=>X(e,t,r,d)),e},"applyDagreLayoutResult"),N=(0,l.K)(async({elem:e,graph:t,groups:{clusters:r,edgePaths:d},diagramType:s,id:l,mergeSelfLoops:h,subGraphTitleTotalMargin:p})=>{let c=0;await Promise.all((0,a.sc)(t).map(async function(e){const o=t.node(e);if(g.R.info("Position XBX => "+e+": ("+o.x,","+o.y,") width: ",o.width," height: ",o.height),o?.clusterNode)o.y+=p,g.R.info("A tainted cluster node XBX1",e,o.id,o.width,o.height,o.x,o.y,t.parent(e)),a.ju.get(o.id).node=o,(0,i.U_)(o);else if(t.children(e).length>0){g.R.info("A pure cluster node XBX1",e,o.id,o.x,o.y,o.width,o.height,t.parent(e)),o.height+=p,t.node(o.parentId);const i=o?.padding/2||0,d=o?.labelBBox?.height||0,s=d-i||0;g.R.debug("OffsetY",s,"labelHeight",d,"halfPadding",i),await(0,n.U)(r,o),a.ju.get(o.id).node=o}else{const e=t.node(o.parentId);o.y+=p/2,g.R.info("A regular node XBX1 - using the padding",o.id,"parent",o.parentId,o.width,o.height,o.x,o.y,"offsetY",o.offsetY,"parent",e,e?.offsetY,o),(0,i.U_)(o)}}));const u=p/2;return b(t,u,{mergeSelfLoops:h}).forEach(function({edge:e,start:r,end:n}){g.R.info("Edge "+r+" -> "+n+": "+JSON.stringify(e),e),e.points.forEach(e=>e.y+=u);const i=t.node(r),h=t.node(n),p=(0,o.Jo)(d,e,a.ju,s,i,h,l);(0,o.T_)(e,p)}),t.nodes().forEach(function(e){const r=t.node(e);g.R.info(e,r.type,r.diff),r.isGroup&&(c=r.diff)}),g.R.warn("Returning from recursive render XAX",e,c),{elem:e,diff:c}},"paintDagreLayoutCore"),D=(0,l.K)(async e=>{const t=await x(e);return R(t.graph),await N(t)},"renderDagreSubgraph"),T=(0,l.K)(e=>{const t=new p.T({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(e=>{t.setNode(e.id,{...e}),e.parentId&&t.setParent(e.id,e.parentId)}),g.R.debug("Edges:",e.edges),e.edges.forEach(e=>{if(e.start===e.end){const r=e.start,a=r+"---"+r+"---1",n=r+"---"+r+"---2",o=t.node(r);t.setNode(a,{domId:a,id:a,parentId:o.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),t.setParent(a,o.parentId),t.setNode(n,{domId:n,id:n,parentId:o.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),t.setParent(n,o.parentId);const i=structuredClone(e),d=structuredClone(e),s=structuredClone(e),g=structuredClone(e);d.originalEdge=i,d.selfLoop={id:i.id,order:0},s.originalEdge=i,s.selfLoop={id:i.id,order:1},g.originalEdge=i,g.selfLoop={id:i.id,order:2},d.label="",d.arrowTypeEnd="none",d.endLabelLeft="",d.endLabelRight="",d.startLabelLeft="",d.id=r+"-cyclic-special-1",s.startLabelRight="",s.startLabelLeft="",s.endLabelLeft="",s.endLabelRight="",s.arrowTypeStart="none",s.arrowTypeEnd="none",s.id=r+"-cyclic-special-mid",g.label="",g.startLabelRight="",g.startLabelLeft="",g.arrowTypeStart="none",o.isGroup&&(d.fromCluster=r,g.toCluster=r),g.id=r+"-cyclic-special-2",g.arrowTypeStart="none",t.setEdge(r,a,d,r+"-cyclic-special-0"),t.setEdge(a,n,s,r+"-cyclic-special-1"),t.setEdge(n,r,g,r+"-cyclic-special-2")}else t.setEdge(e.start,e.end,{...e},e.id)}),(0,a.OS)(t),{graph:t}},"prepareLayoutForDagre"),v=(0,l.K)(async(e,{element:t,preparedLayout:r})=>{const a=r??T(e),n=(0,s.D7)(),o=await x({element:t,graph:a.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:n});return a.measuredLayout=o,o},"measureDagreLayout"),K=(0,l.K)((e,t)=>{const r=t.preparedLayout?.measuredLayout;if(!r)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return R(r.graph),C(e,r),r},"runDagreLayoutCore"),M=(0,l.K)((e,{measure:t})=>(0,a.sc)(t.graph).map(e=>t.graph.node(e)).filter(Boolean),"getDagrePaintNodes"),P=(0,l.K)((e,t,{measure:r})=>e?r.graph.node(e):void 0,"getDagreEdgeNode"),I=(0,a.xY)({prepareLayout:T,measureLayout:v,runLayoutCore:K,paintOptions:{clusterDb:a.ju,getNodes:M,getEdgeNode:P,skipNode:(0,l.K)((e,{measure:t})=>!t.graph.hasNode(e.id),"skipNode"),isCluster:(0,l.K)((e,{measure:t})=>t.graph.hasNode(e.id)&&(t.graph.children(e.id)??[]).length>0,"isCluster")}})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[449],{40449(e,c,t){t.d(c,{createArchitectureServices:()=>a.S});var a=t(98148);t(17946)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[452],{90452(e,a,c){c.d(a,{createRailroadServices:()=>l.l});var l=c(55498);c(41303)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4547],{74547(e,c,a){a.d(c,{createPacketServices:()=>s.$});var s=a(6211);a(41303)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4605],{74605(e,c,a){a.d(c,{createInfoServices:()=>s.v});var s=a(21206);a(17946)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4804],{84804(e,c,a){a.d(c,{createCynefinServices:()=>s.t});var s=a(38559);a(17946)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[482],{50482(e,a,c){c.d(a,{createRailroadPegServices:()=>s.P});var s=c(7845);c(41303)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[4963],{34826(t,n,e){function i(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e>n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let r of t)null!=(r=n(r,++i,t))&&(e>r||void 0===e&&r>=r)&&(e=r)}return e}e.d(n,{A:()=>i})},19818(t,n,e){e.d(n,{gX:()=>a,kb:()=>s,pD:()=>l,pG:()=>o});var i=e(34826);function r(t){return t.target.depth}function s(t){return t.depth}function o(t,n){return n-1-t.height}function l(t,n){return t.sourceLinks.length?t.depth:n-1}function a(t){return t.targetLinks.length?t.depth:t.sourceLinks.length?(0,i.A)(t.sourceLinks,r)-1:0}},39375(t,n,e){function i(t,n){let e=0;if(void 0===n)for(let n of t)(n=+n)&&(e+=n);else{let i=-1;for(let r of t)(r=+n(r,++i,t))&&(e+=r)}return e}function r(t,n){let e;if(void 0===n)for(const n of t)null!=n&&(e<n||void 0===e&&n>=n)&&(e=n);else{let i=-1;for(let r of t)null!=(r=n(r,++i,t))&&(e<r||void 0===e&&r>=r)&&(e=r)}return e}e.d(n,{A:()=>_});var s=e(34826),o=e(19818);function l(t){return function(){return t}}function a(t,n){return h(t.source,n.source)||t.index-n.index}function c(t,n){return h(t.target,n.target)||t.index-n.index}function h(t,n){return t.y0-n.y0}function u(t){return t.value}function f(t){return t.index}function y(t){return t.nodes}function d(t){return t.links}function g(t,n){const e=t.get(n);if(!e)throw new Error("missing: "+n);return e}function p({nodes:t}){for(const n of t){let t=n.y0,e=t;for(const e of n.sourceLinks)e.y0=t+e.width/2,t+=e.width;for(const t of n.targetLinks)t.y1=e+t.width/2,e+=t.width}}function _(){let t,n,e,_=0,k=0,x=1,m=1,b=24,v=8,w=f,L=o.pD,S=y,A=d,E=6;function K(){const o={nodes:S.apply(null,arguments),links:A.apply(null,arguments)};return function({nodes:t,links:n}){for(const[n,e]of t.entries())e.index=n,e.sourceLinks=[],e.targetLinks=[];const i=new Map(t.map((n,e)=>[w(n,e,t),n]));for(const[t,e]of n.entries()){e.index=t;let{source:n,target:r}=e;"object"!=typeof n&&(n=e.source=g(i,n)),"object"!=typeof r&&(r=e.target=g(i,r)),n.sourceLinks.push(e),r.targetLinks.push(e)}if(null!=e)for(const{sourceLinks:n,targetLinks:i}of t)n.sort(e),i.sort(e)}(o),function({nodes:t}){for(const n of t)n.value=void 0===n.fixedValue?Math.max(i(n.sourceLinks,u),i(n.targetLinks,u)):n.fixedValue}(o),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.depth=r;for(const{target:n}of t.sourceLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(o),function({nodes:t}){const n=t.length;let e=new Set(t),i=new Set,r=0;for(;e.size;){for(const t of e){t.height=r;for(const{source:n}of t.targetLinks)i.add(n)}if(++r>n)throw new Error("circular link");e=i,i=new Set}}(o),function(e){const o=function({nodes:t}){const e=r(t,t=>t.depth)+1,i=(x-_-b)/(e-1),s=new Array(e);for(const n of t){const t=Math.max(0,Math.min(e-1,Math.floor(L.call(null,n,e))));n.layer=t,n.x0=_+t*i,n.x1=n.x0+b,s[t]?s[t].push(n):s[t]=[n]}if(n)for(const t of s)t.sort(n);return s}(e);t=Math.min(v,(m-k)/(r(o,t=>t.length)-1)),function(n){const e=(0,s.A)(n,n=>(m-k-(n.length-1)*t)/i(n,u));for(const i of n){let n=k;for(const r of i){r.y0=n,r.y1=n+r.value*e,n=r.y1+t;for(const t of r.sourceLinks)t.width=t.value*e}n=(m-n+t)/(i.length+1);for(let t=0;t<i.length;++t){const e=i[t];e.y0+=n*(t+1),e.y1+=n*(t+1)}P(i)}}(o);for(let t=0;t<E;++t){const n=Math.pow(.99,t),e=Math.max(1-n,(t+1)/E);I(o,n,e),M(o,n,e)}}(o),p(o),o}function M(t,e,i){for(let r=1,s=t.length;r<s;++r){const s=t[r];for(const t of s){let n=0,i=0;for(const{source:e,value:r}of t.targetLinks){let s=r*(t.layer-e.layer);n+=$(e,t)*s,i+=s}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,N(t)}void 0===n&&s.sort(h),T(s,i)}}function I(t,e,i){for(let r=t.length-2;r>=0;--r){const s=t[r];for(const t of s){let n=0,i=0;for(const{target:e,value:r}of t.sourceLinks){let s=r*(e.layer-t.layer);n+=O(t,e)*s,i+=s}if(!(i>0))continue;let r=(n/i-t.y0)*e;t.y0+=r,t.y1+=r,N(t)}void 0===n&&s.sort(h),T(s,i)}}function T(n,e){const i=n.length>>1,r=n[i];D(n,r.y0-t,i-1,e),C(n,r.y1+t,i+1,e),D(n,m,n.length-1,e),C(n,k,0,e)}function C(n,e,i,r){for(;i<n.length;++i){const s=n[i],o=(e-s.y0)*r;o>1e-6&&(s.y0+=o,s.y1+=o),e=s.y1+t}}function D(n,e,i,r){for(;i>=0;--i){const s=n[i],o=(s.y1-e)*r;o>1e-6&&(s.y0-=o,s.y1-=o),e=s.y0-t}}function N({sourceLinks:t,targetLinks:n}){if(void 0===e){for(const{source:{sourceLinks:t}}of n)t.sort(c);for(const{target:{targetLinks:n}}of t)n.sort(a)}}function P(t){if(void 0===e)for(const{sourceLinks:n,targetLinks:e}of t)n.sort(c),e.sort(a)}function $(n,e){let i=n.y0-(n.sourceLinks.length-1)*t/2;for(const{target:r,width:s}of n.sourceLinks){if(r===e)break;i+=s+t}for(const{source:t,width:r}of e.targetLinks){if(t===n)break;i-=r}return i}function O(n,e){let i=e.y0-(e.targetLinks.length-1)*t/2;for(const{source:r,width:s}of e.targetLinks){if(r===n)break;i+=s+t}for(const{target:t,width:r}of n.sourceLinks){if(t===e)break;i-=r}return i}return K.update=function(t){return p(t),t},K.nodeId=function(t){return arguments.length?(w="function"==typeof t?t:l(t),K):w},K.nodeAlign=function(t){return arguments.length?(L="function"==typeof t?t:l(t),K):L},K.nodeSort=function(t){return arguments.length?(n=t,K):n},K.nodeWidth=function(t){return arguments.length?(b=+t,K):b},K.nodePadding=function(n){return arguments.length?(v=t=+n,K):v},K.nodes=function(t){return arguments.length?(S="function"==typeof t?t:l(t),K):S},K.links=function(t){return arguments.length?(A="function"==typeof t?t:l(t),K):A},K.linkSort=function(t){return arguments.length?(e=t,K):e},K.size=function(t){return arguments.length?(_=k=0,x=+t[0],m=+t[1],K):[x-_,m-k]},K.extent=function(t){return arguments.length?(_=+t[0][0],x=+t[1][0],k=+t[0][1],m=+t[1][1],K):[[_,k],[x,m]]},K.iterations=function(t){return arguments.length?(E=+t,K):E},K}},18754(t,n,e){e.d(n,{A:()=>m});var i=Math.PI,r=2*i,s=1e-6,o=r-s;function l(){this._x0=this._y0=this._x1=this._y1=null,this._=""}function a(){return new l}l.prototype=a.prototype={constructor:l,moveTo:function(t,n){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)},closePath:function(){null!==this._x1&&(this._x1=this._x0,this._y1=this._y0,this._+="Z")},lineTo:function(t,n){this._+="L"+(this._x1=+t)+","+(this._y1=+n)},quadraticCurveTo:function(t,n,e,i){this._+="Q"+ +t+","+ +n+","+(this._x1=+e)+","+(this._y1=+i)},bezierCurveTo:function(t,n,e,i,r,s){this._+="C"+ +t+","+ +n+","+ +e+","+ +i+","+(this._x1=+r)+","+(this._y1=+s)},arcTo:function(t,n,e,r,o){t=+t,n=+n,e=+e,r=+r,o=+o;var l=this._x1,a=this._y1,c=e-t,h=r-n,u=l-t,f=a-n,y=u*u+f*f;if(o<0)throw new Error("negative radius: "+o);if(null===this._x1)this._+="M"+(this._x1=t)+","+(this._y1=n);else if(y>s)if(Math.abs(f*c-h*u)>s&&o){var d=e-l,g=r-a,p=c*c+h*h,_=d*d+g*g,k=Math.sqrt(p),x=Math.sqrt(y),m=o*Math.tan((i-Math.acos((p+y-_)/(2*k*x)))/2),b=m/x,v=m/k;Math.abs(b-1)>s&&(this._+="L"+(t+b*u)+","+(n+b*f)),this._+="A"+o+","+o+",0,0,"+ +(f*d>u*g)+","+(this._x1=t+v*c)+","+(this._y1=n+v*h)}else this._+="L"+(this._x1=t)+","+(this._y1=n);else;},arc:function(t,n,e,l,a,c){t=+t,n=+n,c=!!c;var h=(e=+e)*Math.cos(l),u=e*Math.sin(l),f=t+h,y=n+u,d=1^c,g=c?l-a:a-l;if(e<0)throw new Error("negative radius: "+e);null===this._x1?this._+="M"+f+","+y:(Math.abs(this._x1-f)>s||Math.abs(this._y1-y)>s)&&(this._+="L"+f+","+y),e&&(g<0&&(g=g%r+r),g>o?this._+="A"+e+","+e+",0,1,"+d+","+(t-h)+","+(n-u)+"A"+e+","+e+",0,1,"+d+","+(this._x1=f)+","+(this._y1=y):g>s&&(this._+="A"+e+","+e+",0,"+ +(g>=i)+","+d+","+(this._x1=t+e*Math.cos(a))+","+(this._y1=n+e*Math.sin(a))))},rect:function(t,n,e,i){this._+="M"+(this._x0=this._x1=+t)+","+(this._y0=this._y1=+n)+"h"+ +e+"v"+ +i+"h"+-e+"Z"},toString:function(){return this._}};const c=a;var h=Array.prototype.slice;function u(t){return function(){return t}}function f(t){return t[0]}function y(t){return t[1]}function d(t){return t.source}function g(t){return t.target}function p(t){var n=d,e=g,i=f,r=y,s=null;function o(){var o,l=h.call(arguments),a=n.apply(this,l),u=e.apply(this,l);if(s||(s=o=c()),t(s,+i.apply(this,(l[0]=a,l)),+r.apply(this,l),+i.apply(this,(l[0]=u,l)),+r.apply(this,l)),o)return s=null,o+""||null}return o.source=function(t){return arguments.length?(n=t,o):n},o.target=function(t){return arguments.length?(e=t,o):e},o.x=function(t){return arguments.length?(i="function"==typeof t?t:u(+t),o):i},o.y=function(t){return arguments.length?(r="function"==typeof t?t:u(+t),o):r},o.context=function(t){return arguments.length?(s=t??null,o):s},o}function _(t,n,e,i,r){t.moveTo(n,e),t.bezierCurveTo(n=(n+i)/2,e,n,r,i,r)}function k(t){return[t.source.x1,t.y0]}function x(t){return[t.target.x0,t.y1]}function m(){return p(_).source(k).target(x)}e.dn(u),e.dn(m)},74963(t,n,e){e.d(n,{diagram:()=>I});var i=e(89983),r=(e(31293),e(86827)),s=e(51444),o=e(39375),l=e(19818),a=e(18754),c=function(){var t=(0,r.K)(function(t,n,e,i){for(e=e||{},i=t.length;i--;e[t[i]]=n);return e},"o"),n=[1,9],e=[1,10],i=[1,5,10,12],s={trace:(0,r.K)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SANKEY:4,NEWLINE:5,csv:6,opt_eof:7,record:8,csv_tail:9,EOF:10,"field[source]":11,COMMA:12,"field[target]":13,"field[value]":14,field:15,escaped:16,non_escaped:17,DQUOTE:18,ESCAPED_TEXT:19,NON_ESCAPED_TEXT:20,$accept:0,$end:1},terminals_:{2:"error",4:"SANKEY",5:"NEWLINE",10:"EOF",11:"field[source]",12:"COMMA",13:"field[target]",14:"field[value]",18:"DQUOTE",19:"ESCAPED_TEXT",20:"NON_ESCAPED_TEXT"},productions_:[0,[3,4],[6,2],[9,2],[9,0],[7,1],[7,0],[8,5],[15,1],[15,1],[16,3],[17,1]],performAction:(0,r.K)(function(t,n,e,i,r,s,o){var l=s.length-1;switch(r){case 7:const t=i.findOrCreateNode(s[l-4].trim().replaceAll('""','"')),n=i.findOrCreateNode(s[l-2].trim().replaceAll('""','"')),e=parseFloat(s[l].trim());i.addLink(t,n,e);break;case 8:case 9:case 11:this.$=s[l];break;case 10:this.$=s[l-1]}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},{5:[1,3]},{6:4,8:5,15:6,16:7,17:8,18:n,20:e},{1:[2,6],7:11,10:[1,12]},t(e,[2,4],{9:13,5:[1,14]}),{12:[1,15]},t(i,[2,8]),t(i,[2,9]),{19:[1,16]},t(i,[2,11]),{1:[2,1]},{1:[2,5]},t(e,[2,2]),{6:17,8:5,15:6,16:7,17:8,18:n,20:e},{15:18,16:7,17:8,18:n,20:e},{18:[1,19]},t(e,[2,3]),{12:[1,20]},t(i,[2,10]),{15:21,16:7,17:8,18:n,20:e},t([1,5,10],[2,7])],defaultActions:{11:[2,1],12:[2,5]},parseError:(0,r.K)(function(t,n){if(!n.recoverable){var e=new Error(t);throw e.hash=n,e}this.trace(t)},"parseError"),parse:(0,r.K)(function(t){var n=this,e=[0],i=[],s=[null],o=[],l=this.table,a="",c=0,h=0,u=0,f=o.slice.call(arguments,1),y=Object.create(this.lexer),d={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(d.yy[g]=this.yy[g]);y.setInput(t,d.yy),d.yy.lexer=y,d.yy.parser=this,void 0===y.yylloc&&(y.yylloc={});var p=y.yylloc;o.push(p);var _=y.options&&y.options.ranges;function k(){var t;return"number"!=typeof(t=i.pop()||y.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,r.K)(function(t){e.length=e.length-2*t,s.length=s.length-t,o.length=o.length-t},"popStack"),(0,r.K)(k,"lex");for(var x,m,b,v,w,L,S,A,E,K={};;){if(b=e[e.length-1],this.defaultActions[b]?v=this.defaultActions[b]:(null==x&&(x=k()),v=l[b]&&l[b][x]),void 0===v||!v.length||!v[0]){var M="";for(L in E=[],l[b])this.terminals_[L]&&L>2&&E.push("'"+this.terminals_[L]+"'");M=y.showPosition?"Parse error on line "+(c+1)+":\n"+y.showPosition()+"\nExpecting "+E.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(M,{text:y.match,token:this.terminals_[x]||x,line:y.yylineno,loc:p,expected:E})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+x);switch(v[0]){case 1:e.push(x),s.push(y.yytext),o.push(y.yylloc),e.push(v[1]),x=null,m?(x=m,m=null):(h=y.yyleng,a=y.yytext,c=y.yylineno,p=y.yylloc,u>0&&u--);break;case 2:if(S=this.productions_[v[1]][1],K.$=s[s.length-S],K._$={first_line:o[o.length-(S||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(S||1)].first_column,last_column:o[o.length-1].last_column},_&&(K._$.range=[o[o.length-(S||1)].range[0],o[o.length-1].range[1]]),void 0!==(w=this.performAction.apply(K,[a,h,c,d.yy,v[1],s,o].concat(f))))return w;S&&(e=e.slice(0,-1*S*2),s=s.slice(0,-1*S),o=o.slice(0,-1*S)),e.push(this.productions_[v[1]][0]),s.push(K.$),o.push(K._$),A=l[e[e.length-2]][e[e.length-1]],e.push(A);break;case 3:return!0}}return!0},"parse")},o=function(){return{EOF:1,parseError:(0,r.K)(function(t,n){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,n)},"parseError"),setInput:(0,r.K)(function(t,n){return this.yy=n||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,r.K)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:(0,r.K)(function(t){var n=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),e.length-1&&(this.yylineno-=e.length-1);var r=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:e?(e.length===i.length?this.yylloc.first_column:0)+i[i.length-e.length].length-e[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[r[0],r[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:(0,r.K)(function(){return this._more=!0,this},"more"),reject:(0,r.K)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,r.K)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,r.K)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,r.K)(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,r.K)(function(){var t=this.pastInput(),n=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+n+"^"},"showPosition"),test_match:(0,r.K)(function(t,n){var e,i,r;if(this.options.backtrack_lexer&&(r={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(r.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var s in r)this[s]=r[s];return!1}return!1},"test_match"),next:(0,r.K)(function(){if(this.done)return this.EOF;var t,n,e,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),s=0;s<r.length;s++)if((e=this._input.match(this.rules[r[s]]))&&(!n||e[0].length>n[0].length)){if(n=e,i=s,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,r[s])))return t;if(this._backtrack){n=!1;continue}return!1}if(!this.options.flex)break}return n?!1!==(t=this.test_match(n,r[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,r.K)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,r.K)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,r.K)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,r.K)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,r.K)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,r.K)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,r.K)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,r.K)(function(t,n,e,i){switch(e){case 0:case 1:return this.pushState("csv"),4;case 2:return 10;case 3:return 5;case 4:return 12;case 5:return this.pushState("escaped_text"),18;case 6:return 20;case 7:return this.popState("escaped_text"),18;case 8:return 19}},"anonymous"),rules:[/^(?:sankey-beta\b)/i,/^(?:sankey\b)/i,/^(?:$)/i,/^(?:((\u000D\u000A)|(\u000A)))/i,/^(?:(\u002C))/i,/^(?:(\u0022))/i,/^(?:([\u0020-\u0021\u0023-\u002B\u002D-\u007E])*)/i,/^(?:(\u0022)(?!(\u0022)))/i,/^(?:(([\u0020-\u0021\u0023-\u002B\u002D-\u007E])|(\u002C)|(\u000D)|(\u000A)|(\u0022)(\u0022))*)/i],conditions:{csv:{rules:[2,3,4,5,6,7,8],inclusive:!1},escaped_text:{rules:[7,8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8],inclusive:!0}}}}();function l(){this.yy={}}return s.lexer=o,(0,r.K)(l,"Parser"),l.prototype=s,s.Parser=l,new l}();c.parser=c;var h=c,u=[],f=[],y=new Map,d=(0,r.K)(()=>{u=[],f=[],y=new Map,(0,i.IU)()},"clear"),g=class{constructor(t,n,e=0){this.source=t,this.target=n,this.value=e}static{(0,r.K)(this,"SankeyLink")}},p=(0,r.K)((t,n,e)=>{u.push(new g(t,n,e))},"addLink"),_=class{constructor(t){this.ID=t}static{(0,r.K)(this,"SankeyNode")}},k=(0,r.K)(t=>{t=i.Y2.sanitizeText(t,(0,i.D7)());let n=y.get(t);return void 0===n&&(n=new _(t),y.set(t,n),f.push(n)),n},"findOrCreateNode"),x=(0,r.K)(()=>f,"getNodes"),m=(0,r.K)(()=>u,"getLinks"),b=(0,r.K)(()=>({nodes:f.map(t=>({id:t.ID})),links:u.map(t=>({source:t.source.ID,target:t.target.ID,value:t.value}))}),"getGraph"),v={nodesMap:y,getConfig:(0,r.K)(()=>(0,i.D7)().sankey,"getConfig"),getNodes:x,getLinks:m,getGraph:b,addLink:p,findOrCreateNode:k,getAccTitle:i.iN,setAccTitle:i.SV,getAccDescription:i.m7,setAccDescription:i.EI,getDiagramTitle:i.ab,setDiagramTitle:i.ke,clear:d},w=class t{static{(0,r.K)(this,"Uid")}static{this.count=0}static next(n){return new t(n+ ++t.count)}constructor(t){this.id=t,this.href=`#${t}`}toString(){return"url("+this.href+")"}},L={left:l.kb,right:l.pG,center:l.gX,justify:l.pD},S=(0,r.K)(t=>{let n=0,e=0;for(const i of t){const t=i.value??0;t>n&&(n=t,e=i.layer??0)}return e},"findCentralNodeLayer"),A={draw:(0,r.K)(function(t,n,e,l){const{securityLevel:c,sankey:h}=(0,i.D7)(),u=i.ME.sankey;let f;"sandbox"===c&&(f=(0,s.Ltv)("#i"+n));const y="sandbox"===c?(0,s.Ltv)(f.nodes()[0].contentDocument.body):(0,s.Ltv)("body"),d="sandbox"===c?y.select(`[id="${n}"]`):(0,s.Ltv)(`[id="${n}"]`),g=h?.width??u.width,p=h?.height??u.width,_=h?.useMaxWidth??u.useMaxWidth,k=h?.nodeAlignment??u.nodeAlignment,x=h?.prefix??u.prefix,m=h?.suffix??u.suffix,b=h?.showValues??u.showValues,v=h?.nodeWidth??u.nodeWidth??10,A=h?.nodePadding??u.nodePadding??12,E=h?.labelStyle??u.labelStyle??"legacy",K=h?.nodeColors??{},M=l.db.getGraph(),I=L[k];(0,o.A)().nodeId(t=>t.id).nodeWidth(v).nodePadding(A+(b?15:0)).nodeAlign(I).extent([[0,0],[g,p]])(M);const T=S(M.nodes),C=(0,s.UMr)(s.zt),D=(0,r.K)(t=>K[t]??C(t),"getNodeColor");d.append("g").attr("class","nodes").selectAll(".node").data(M.nodes).join("g").attr("class","node").attr("id",t=>(t.uid=w.next("node-")).id).attr("transform",function(t){return"translate("+t.x0+","+t.y0+")"}).attr("x",t=>t.x0).attr("y",t=>t.y0).append("rect").attr("height",t=>t.y1-t.y0).attr("width",t=>t.x1-t.x0).attr("fill",t=>D(t.id));const N=(0,r.K)(({id:t,value:n})=>b?`${t}\n${x}${Math.round(100*n)/100}${m}`:t,"getText"),P=(0,r.K)(t=>{if("outlined"===E){return(t.layer??0)<T?{x:t.x0-6,anchor:"end"}:{x:t.x1+6,anchor:"start"}}return t.x0<g/2?{x:t.x1+6,anchor:"start"}:{x:t.x0-6,anchor:"end"}},"getLabelPosition"),$=d.append("g").attr("class","node-labels").attr("font-size",14),O=(0,r.K)(t=>$.selectAll(t?`.${t}`:"text").data(M.nodes).join("text").attr("class",t??null).attr("x",t=>P(t).x).attr("y",t=>(t.y1+t.y0)/2).attr("dy",(b?"0":"0.35")+"em").attr("text-anchor",t=>P(t).anchor).text(N),"appendLabel");"outlined"===E?(O("sankey-label-bg"),O("sankey-label-fg")):O();const j=d.append("g").attr("class","links").attr("fill","none").attr("stroke-opacity",.5).selectAll(".link").data(M.links).join("g").attr("class","link").style("mix-blend-mode","multiply"),z=h?.linkColor??"gradient";if("gradient"===z){const t=j.append("linearGradient").attr("id",t=>(t.uid=w.next("linearGradient-")).id).attr("gradientUnits","userSpaceOnUse").attr("x1",t=>t.source.x1).attr("x2",t=>t.target.x0);t.append("stop").attr("offset","0%").attr("stop-color",t=>D(t.source.id)),t.append("stop").attr("offset","100%").attr("stop-color",t=>D(t.target.id))}let F;switch(z){case"gradient":F=(0,r.K)(t=>t.uid,"coloring");break;case"source":F=(0,r.K)(t=>D(t.source.id),"coloring");break;case"target":F=(0,r.K)(t=>D(t.target.id),"coloring");break;default:F=z}j.append("path").attr("d",(0,a.A)()).attr("stroke",F).attr("stroke-width",t=>Math.max(1,t.width)),(0,i.ot)(void 0,d,0,_)},"draw")},E=(0,r.K)(t=>t.replaceAll(/^[^\S\n\r]+|[^\S\n\r]+$/g,"").replaceAll(/([\n\r])+/g,"\n").trim(),"prepareTextForParsing"),K=(0,r.K)(t=>`.label {\n font-family: ${t.fontFamily};\n }\n\n .node-labels {\n font-family: ${t.fontFamily};\n }\n\n /* Outlined label style - background stroke for better readability */\n .sankey-label-bg {\n stroke: ${t.mainBkg||t.background||"#fff"};\n stroke-width: 4px;\n stroke-linejoin: round;\n paint-order: stroke;\n }\n\n /* Foreground label text */\n .sankey-label-fg {\n fill: ${t.textColor};\n }\n\n /* Node styling */\n .node rect {\n shape-rendering: crispEdges;\n }\n\n /* Link styling */\n .link {\n fill: none;\n stroke-opacity: 0.5;\n mix-blend-mode: multiply;\n }\n`,"getStyles"),M=h.parse.bind(h);h.parse=t=>M(E(t));var I={styles:K,parser:h,db:v,renderer:A}}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5097],{15097(e,a,c){c.d(a,{createGitGraphServices:()=>s.b});var s=c(65721);c(17946)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5123],{75279(t,e,s){s.d(e,{CP:()=>d,Ck:()=>y,HT:()=>p,PB:()=>u,aC:()=>h,lC:()=>l,m:()=>c,tk:()=>a});var i=s(20886),n=s(27698),r=s(84301),o=s(51444),a=(0,n.K)((t,e)=>{const s=t.append("rect");if(s.attr("x",e.x),s.attr("y",e.y),s.attr("fill",e.fill),s.attr("stroke",e.stroke),s.attr("width",e.width),s.attr("height",e.height),e.name&&s.attr("name",e.name),e.rx&&s.attr("rx",e.rx),e.ry&&s.attr("ry",e.ry),void 0!==e.attrs)for(const t in e.attrs)s.attr(t,e.attrs[t]);return e.class&&s.attr("class",e.class),s},"drawRect"),l=(0,n.K)((t,e)=>{const s={x:e.startx,y:e.starty,width:e.stopx-e.startx,height:e.stopy-e.starty,fill:e.fill,stroke:e.stroke,class:"rect"};a(t,s).lower()},"drawBackgroundRect"),c=(0,n.K)((t,e)=>{const s=e.text.replace(i.H1," "),n=t.append("text");n.attr("x",e.x),n.attr("y",e.y),n.attr("class","legend"),n.style("text-anchor",e.anchor),e.class&&n.attr("class",e.class);const r=n.append("tspan");return r.attr("x",e.x+2*e.textMargin),r.text(s),n},"drawText"),h=(0,n.K)((t,e,s,i)=>{const n=t.append("image");n.attr("x",e),n.attr("y",s);const o=(0,r.J)(i);n.attr("xlink:href",o)},"drawImage"),d=(0,n.K)((t,e,s,i)=>{const n=t.append("use");n.attr("x",e),n.attr("y",s);const o=(0,r.J)(i);n.attr("xlink:href",`#${o}`)},"drawEmbeddedImage"),u=(0,n.K)(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),p=(0,n.K)(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),y=(0,n.K)(()=>{let t=(0,o.Ltv)(".mermaidTooltip");return t.empty()&&(t=(0,o.Ltv)("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),t},"createTooltip")},95123(t,e,s){s.d(e,{Zk:()=>y,q7:()=>G,tM:()=>ht,u4:()=>ct});var i=s(79762),n=s(98889),r=s(89008),o=s(75279),a=s(73145),l=s(20886),c=s(84828),h=s(27698),d=s(51444),u=s(99418),p=function(){var t=(0,h.K)(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,2],s=[1,3],i=[1,4],n=[2,4],r=[1,9],o=[1,11],a=[1,16],l=[1,17],c=[1,18],d=[1,19],u=[1,33],p=[1,20],y=[1,21],g=[1,22],f=[1,23],m=[1,24],S=[1,26],k=[1,27],b=[1,28],T=[1,29],_=[1,30],x=[1,31],E=[1,32],D=[1,35],$=[1,36],C=[1,37],v=[1,38],w=[1,34],I=[1,4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],A=[1,4,5,14,15,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,39,40,41,45,48,51,52,53,54,57],L=[4,5,16,17,19,21,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],R={trace:(0,h.K)(function(){},"trace"),yy:{},symbols_:{error:2,start:3,SPACE:4,NL:5,SD:6,document:7,line:8,statement:9,classDefStatement:10,styleStatement:11,cssClassStatement:12,idStatement:13,DESCR:14,"--\x3e":15,HIDE_EMPTY:16,scale:17,WIDTH:18,COMPOSIT_STATE:19,STRUCT_START:20,STRUCT_STOP:21,STATE_DESCR:22,AS:23,ID:24,FORK:25,JOIN:26,CHOICE:27,CONCURRENT:28,note:29,notePosition:30,NOTE_TEXT:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,CLICK:38,STRING:39,HREF:40,classDef:41,CLASSDEF_ID:42,CLASSDEF_STYLEOPTS:43,DEFAULT:44,style:45,STYLE_IDS:46,STYLEDEF_STYLEOPTS:47,class:48,CLASSENTITY_IDS:49,STYLECLASS:50,direction_tb:51,direction_bt:52,direction_rl:53,direction_lr:54,eol:55,";":56,EDGE_STATE:57,STYLE_SEPARATOR:58,left_of:59,right_of:60,$accept:0,$end:1},terminals_:{2:"error",4:"SPACE",5:"NL",6:"SD",14:"DESCR",15:"--\x3e",16:"HIDE_EMPTY",17:"scale",18:"WIDTH",19:"COMPOSIT_STATE",20:"STRUCT_START",21:"STRUCT_STOP",22:"STATE_DESCR",23:"AS",24:"ID",25:"FORK",26:"JOIN",27:"CHOICE",28:"CONCURRENT",29:"note",31:"NOTE_TEXT",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",38:"CLICK",39:"STRING",40:"HREF",41:"classDef",42:"CLASSDEF_ID",43:"CLASSDEF_STYLEOPTS",44:"DEFAULT",45:"style",46:"STYLE_IDS",47:"STYLEDEF_STYLEOPTS",48:"class",49:"CLASSENTITY_IDS",50:"STYLECLASS",51:"direction_tb",52:"direction_bt",53:"direction_rl",54:"direction_lr",56:";",57:"EDGE_STATE",58:"STYLE_SEPARATOR",59:"left_of",60:"right_of"},productions_:[0,[3,2],[3,2],[3,2],[7,0],[7,2],[8,2],[8,1],[8,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,3],[9,4],[9,1],[9,2],[9,1],[9,4],[9,3],[9,6],[9,1],[9,1],[9,1],[9,1],[9,4],[9,4],[9,1],[9,2],[9,2],[9,1],[9,5],[9,5],[10,3],[10,3],[11,3],[12,3],[32,1],[32,1],[32,1],[32,1],[55,1],[55,1],[13,1],[13,1],[13,3],[13,3],[30,1],[30,1]],performAction:(0,h.K)(function(t,e,s,i,n,r,o){var a=r.length-1;switch(n){case 3:return i.setRootDoc(r[a]),r[a];case 4:this.$=[];break;case 5:"nl"!=r[a]&&(r[a-1].push(r[a]),this.$=r[a-1]);break;case 6:case 7:case 12:this.$=r[a];break;case 8:this.$="nl";break;case 13:const t=r[a-1];t.description=i.trimColon(r[a]),this.$=t;break;case 14:this.$={stmt:"relation",state1:r[a-2],state2:r[a]};break;case 15:const e=i.trimColon(r[a]);this.$={stmt:"relation",state1:r[a-3],state2:r[a-1],description:e};break;case 19:this.$={stmt:"state",id:r[a-3],type:"default",description:"",doc:r[a-1]};break;case 20:var l=r[a],c=r[a-2].trim();if(r[a].match(":")){var h=r[a].split(":");l=h[0],c=[c,h[1]]}this.$={stmt:"state",id:l,type:"default",description:c};break;case 21:this.$={stmt:"state",id:r[a-3],type:"default",description:r[a-5],doc:r[a-1]};break;case 22:this.$={stmt:"state",id:r[a],type:"fork"};break;case 23:this.$={stmt:"state",id:r[a],type:"join"};break;case 24:this.$={stmt:"state",id:r[a],type:"choice"};break;case 25:this.$={stmt:"state",id:i.getDividerId(),type:"divider"};break;case 26:this.$={stmt:"state",id:r[a-1].trim(),note:{position:r[a-2].trim(),text:r[a].trim()}};break;case 29:this.$=r[a].trim(),i.setAccTitle(this.$);break;case 30:case 31:this.$=r[a].trim(),i.setAccDescription(this.$);break;case 32:this.$={stmt:"click",id:r[a-3],url:r[a-2],tooltip:r[a-1]};break;case 33:this.$={stmt:"click",id:r[a-3],url:r[a-1],tooltip:""};break;case 34:case 35:this.$={stmt:"classDef",id:r[a-1].trim(),classes:r[a].trim()};break;case 36:this.$={stmt:"style",id:r[a-1].trim(),styleClass:r[a].trim()};break;case 37:this.$={stmt:"applyClass",id:r[a-1].trim(),styleClass:r[a].trim()};break;case 38:i.setDirection("TB"),this.$={stmt:"dir",value:"TB"};break;case 39:i.setDirection("BT"),this.$={stmt:"dir",value:"BT"};break;case 40:i.setDirection("RL"),this.$={stmt:"dir",value:"RL"};break;case 41:i.setDirection("LR"),this.$={stmt:"dir",value:"LR"};break;case 44:case 45:this.$={stmt:"state",id:r[a].trim(),type:"default",description:""};break;case 46:case 47:this.$={stmt:"state",id:r[a-2].trim(),classes:[r[a].trim()],type:"default",description:""}}},"anonymous"),table:[{3:1,4:e,5:s,6:i},{1:[3]},{3:5,4:e,5:s,6:i},{3:6,4:e,5:s,6:i},t([1,4,5,16,17,19,22,24,25,26,27,28,29,33,35,37,38,41,45,48,51,52,53,54,57],n,{7:7}),{1:[2,1]},{1:[2,2]},{1:[2,3],4:r,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:a,17:l,19:c,22:d,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:x,48:E,51:D,52:$,53:C,54:v,57:w},t(I,[2,5]),{9:39,10:12,11:13,12:14,13:15,16:a,17:l,19:c,22:d,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:x,48:E,51:D,52:$,53:C,54:v,57:w},t(I,[2,7]),t(I,[2,8]),t(I,[2,9]),t(I,[2,10]),t(I,[2,11]),t(I,[2,12],{14:[1,40],15:[1,41]}),t(I,[2,16]),{18:[1,42]},t(I,[2,18],{20:[1,43]}),{23:[1,44]},t(I,[2,22]),t(I,[2,23]),t(I,[2,24]),t(I,[2,25]),{30:45,31:[1,46],59:[1,47],60:[1,48]},t(I,[2,28]),{34:[1,49]},{36:[1,50]},t(I,[2,31]),{13:51,24:u,57:w},{42:[1,52],44:[1,53]},{46:[1,54]},{49:[1,55]},t(A,[2,44],{58:[1,56]}),t(A,[2,45],{58:[1,57]}),t(I,[2,38]),t(I,[2,39]),t(I,[2,40]),t(I,[2,41]),t(I,[2,6]),t(I,[2,13]),{13:58,24:u,57:w},t(I,[2,17]),t(L,n,{7:59}),{24:[1,60]},{24:[1,61]},{23:[1,62]},{24:[2,48]},{24:[2,49]},t(I,[2,29]),t(I,[2,30]),{39:[1,63],40:[1,64]},{43:[1,65]},{43:[1,66]},{47:[1,67]},{50:[1,68]},{24:[1,69]},{24:[1,70]},t(I,[2,14],{14:[1,71]}),{4:r,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:a,17:l,19:c,21:[1,72],22:d,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:x,48:E,51:D,52:$,53:C,54:v,57:w},t(I,[2,20],{20:[1,73]}),{31:[1,74]},{24:[1,75]},{39:[1,76]},{39:[1,77]},t(I,[2,34]),t(I,[2,35]),t(I,[2,36]),t(I,[2,37]),t(A,[2,46]),t(A,[2,47]),t(I,[2,15]),t(I,[2,19]),t(L,n,{7:78}),t(I,[2,26]),t(I,[2,27]),{5:[1,79]},{5:[1,80]},{4:r,5:o,8:8,9:10,10:12,11:13,12:14,13:15,16:a,17:l,19:c,21:[1,81],22:d,24:u,25:p,26:y,27:g,28:f,29:m,32:25,33:S,35:k,37:b,38:T,41:_,45:x,48:E,51:D,52:$,53:C,54:v,57:w},t(I,[2,32]),t(I,[2,33]),t(I,[2,21])],defaultActions:{5:[2,1],6:[2,2],47:[2,48],48:[2,49]},parseError:(0,h.K)(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:(0,h.K)(function(t){var e=this,s=[0],i=[],n=[null],r=[],o=this.table,a="",l=0,c=0,d=0,u=r.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(y.yy[g]=this.yy[g]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var f=p.yylloc;r.push(f);var m=p.options&&p.options.ranges;function S(){var t;return"number"!=typeof(t=i.pop()||p.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,h.K)(function(t){s.length=s.length-2*t,n.length=n.length-t,r.length=r.length-t},"popStack"),(0,h.K)(S,"lex");for(var k,b,T,_,x,E,D,$,C,v={};;){if(T=s[s.length-1],this.defaultActions[T]?_=this.defaultActions[T]:(null==k&&(k=S()),_=o[T]&&o[T][k]),void 0===_||!_.length||!_[0]){var w="";for(E in C=[],o[T])this.terminals_[E]&&E>2&&C.push("'"+this.terminals_[E]+"'");w=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+C.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==k?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(w,{text:p.match,token:this.terminals_[k]||k,line:p.yylineno,loc:f,expected:C})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+T+", token: "+k);switch(_[0]){case 1:s.push(k),n.push(p.yytext),r.push(p.yylloc),s.push(_[1]),k=null,b?(k=b,b=null):(c=p.yyleng,a=p.yytext,l=p.yylineno,f=p.yylloc,d>0&&d--);break;case 2:if(D=this.productions_[_[1]][1],v.$=n[n.length-D],v._$={first_line:r[r.length-(D||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(D||1)].first_column,last_column:r[r.length-1].last_column},m&&(v._$.range=[r[r.length-(D||1)].range[0],r[r.length-1].range[1]]),void 0!==(x=this.performAction.apply(v,[a,c,l,y.yy,_[1],n,r].concat(u))))return x;D&&(s=s.slice(0,-1*D*2),n=n.slice(0,-1*D),r=r.slice(0,-1*D)),s.push(this.productions_[_[1]][0]),n.push(v.$),r.push(v._$),$=o[s[s.length-2]][s[s.length-1]],s.push($);break;case 3:return!0}}return!0},"parse")},N=function(){return{EOF:1,parseError:(0,h.K)(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:(0,h.K)(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,h.K)(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:(0,h.K)(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:(0,h.K)(function(){return this._more=!0,this},"more"),reject:(0,h.K)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,h.K)(function(t){this.unput(this.match.slice(t))},"less"),pastInput:(0,h.K)(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,h.K)(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,h.K)(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:(0,h.K)(function(t,e){var s,i,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},"test_match"),next:(0,h.K)(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((s=this._input.match(this.rules[n[r]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,h.K)(function(){var t=this.next();return t||this.lex()},"lex"),begin:(0,h.K)(function(t){this.conditionStack.push(t)},"begin"),popState:(0,h.K)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,h.K)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,h.K)(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:(0,h.K)(function(t){this.begin(t)},"pushState"),stateStackSize:(0,h.K)(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:(0,h.K)(function(t,e,s,i){function n(){const s=e.yytext.indexOf("%%");if(0===s)return!1;if(s>0){const i=e.yytext.slice(0,s),n=e.yytext.slice(s);n&&t.lexer.unput(n),e.yytext=i}return!0}(0,h.K)(n,"processId");switch(s){case 0:return 38;case 1:return 40;case 2:return 39;case 3:return 44;case 4:case 43:return 51;case 5:case 44:return 52;case 6:case 45:return 53;case 7:case 46:return 54;case 8:case 78:return 5;case 9:case 10:case 11:case 12:case 57:case 63:break;case 13:case 33:return this.pushState("SCALE"),17;case 14:case 34:return 18;case 15:case 21:case 35:case 50:case 54:this.popState();break;case 16:return this.begin("acc_title"),33;case 17:return this.popState(),"acc_title_value";case 18:return this.begin("acc_descr"),35;case 19:return this.popState(),"acc_descr_value";case 20:this.begin("acc_descr_multiline");break;case 22:return"acc_descr_multiline_value";case 23:return this.pushState("CLASSDEF"),41;case 24:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 25:return this.popState(),this.pushState("CLASSDEFID"),42;case 26:return this.popState(),43;case 27:return this.pushState("CLASS"),48;case 28:return this.popState(),this.pushState("CLASS_STYLE"),49;case 29:return this.popState(),50;case 30:return this.pushState("STYLE"),45;case 31:return this.popState(),this.pushState("STYLEDEF_STYLES"),46;case 32:return this.popState(),47;case 36:this.pushState("STATE");break;case 37:case 40:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),25;case 38:case 41:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),26;case 39:case 42:return this.popState(),e.yytext=e.yytext.slice(0,-10).trim(),27;case 47:this.pushState("STATE_STRING");break;case 48:return this.pushState("STATE_ID"),"AS";case 49:case 65:if(!n())return;return this.popState(),"ID";case 51:return"STATE_DESCR";case 52:throw new Error('Error: State name must be a single word. Found: "'+e.yytext.trim()+'"');case 53:return 19;case 55:return this.popState(),this.pushState("struct"),20;case 56:return this.popState(),21;case 58:return this.begin("NOTE"),29;case 59:return this.popState(),this.pushState("NOTE_ID"),59;case 60:return this.popState(),this.pushState("NOTE_ID"),60;case 61:this.popState(),this.pushState("FLOATING_NOTE");break;case 62:return this.popState(),this.pushState("FLOATING_NOTE_ID"),"AS";case 64:return"NOTE_TEXT";case 66:if(!n())return;return this.popState(),this.pushState("NOTE_TEXT"),24;case 67:return this.popState(),e.yytext=e.yytext.substr(2).trim(),31;case 68:return this.popState(),e.yytext=e.yytext.slice(0,-8).trim(),31;case 69:case 70:return 6;case 71:return 16;case 72:return 57;case 73:if(!n())return;return 24;case 74:return e.yytext=e.yytext.trim(),14;case 75:return 15;case 76:return 28;case 77:return 58;case 79:return"INVALID"}},"anonymous"),rules:[/^(?:click\b)/i,/^(?:href\b)/i,/^(?:"[^"]*")/i,/^(?:default\b)/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:((?!\n)\s)+)/i,/^(?:#[^\n]*)/i,/^(?:%%(?!\{)[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:classDef\s+)/i,/^(?:DEFAULT\s+)/i,/^(?:\w+\s+)/i,/^(?:[^\n]*)/i,/^(?:class\s+)/i,/^(?:(\w+)+((,\s*\w+)*))/i,/^(?:[^\n]*)/i,/^(?:style\s+)/i,/^(?:[\w,]+\s+)/i,/^(?:[^\n]*)/i,/^(?:scale\s+)/i,/^(?:\d+)/i,/^(?:\s+width\b)/i,/^(?:state\s+)/i,/^(?:.*<<fork>>)/i,/^(?:.*<<join>>)/i,/^(?:.*<<choice>>)/i,/^(?:.*\[\[fork\]\])/i,/^(?:.*\[\[join\]\])/i,/^(?:.*\[\[choice\]\])/i,/^(?:.*direction\s+TB[^\n]*)/i,/^(?:.*direction\s+BT[^\n]*)/i,/^(?:.*direction\s+RL[^\n]*)/i,/^(?:.*direction\s+LR[^\n]*)/i,/^(?:["])/i,/^(?:\s*as\s+)/i,/^(?:[^\n\{]*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\w+\s+\w+.*?\{)/i,/^(?:[^\n\s\{]+)/i,/^(?:\n)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:[\n])/i,/^(?:note\s+)/i,/^(?:left of\b)/i,/^(?:right of\b)/i,/^(?:")/i,/^(?:\s*as\s*)/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:[^\n]*)/i,/^(?:\s*[^:\n\s\-]+)/i,/^(?:\s*:[^:\n;]+)/i,/^(?:[\s\S]*?\n\s*end note\b)/i,/^(?:stateDiagram\s+)/i,/^(?:stateDiagram-v2\s+)/i,/^(?:hide empty description\b)/i,/^(?:\[\*\])/i,/^(?:[^:\n\s\-\{]+)/i,/^(?:\s*:(?:[^:\n;]|:[^:\n;])+)/i,/^(?:-->)/i,/^(?:--)/i,/^(?::::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{LINE:{rules:[10,11,12],inclusive:!1},struct:{rules:[10,11,12,23,27,30,36,43,44,45,46,56,57,58,72,73,74,75,76,77],inclusive:!1},FLOATING_NOTE_ID:{rules:[65],inclusive:!1},FLOATING_NOTE:{rules:[62,63,64],inclusive:!1},NOTE_TEXT:{rules:[67,68],inclusive:!1},NOTE_ID:{rules:[66],inclusive:!1},NOTE:{rules:[59,60,61],inclusive:!1},STYLEDEF_STYLEOPTS:{rules:[],inclusive:!1},STYLEDEF_STYLES:{rules:[32],inclusive:!1},STYLE_IDS:{rules:[],inclusive:!1},STYLE:{rules:[31],inclusive:!1},CLASS_STYLE:{rules:[29],inclusive:!1},CLASS:{rules:[28],inclusive:!1},CLASSDEFID:{rules:[26],inclusive:!1},CLASSDEF:{rules:[24,25],inclusive:!1},acc_descr_multiline:{rules:[21,22],inclusive:!1},acc_descr:{rules:[19],inclusive:!1},acc_title:{rules:[17],inclusive:!1},SCALE:{rules:[14,15,34,35],inclusive:!1},ALIAS:{rules:[],inclusive:!1},STATE_ID:{rules:[49],inclusive:!1},STATE_STRING:{rules:[50,51],inclusive:!1},FORK_STATE:{rules:[],inclusive:!1},STATE:{rules:[10,11,12,37,38,39,40,41,42,47,48,52,53,54,55],inclusive:!1},ID:{rules:[10,11,12],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,11,12,13,16,18,20,23,27,30,33,36,55,58,69,70,71,72,73,74,75,77,78,79],inclusive:!0}}}}();function K(){this.yy={}}return R.lexer=N,(0,h.K)(K,"Parser"),K.prototype=R,R.Parser=K,new K}();p.parser=p;var y=p,g="state",f="root",m="relation",S="default",k="divider",b="fill:none",T="fill: #333",_="markdown",x="normal",E="rect",D="rectWithTitle",$="divider",C="roundedWithTitle",v="statediagram",w=`${v}-state`,I="transition",A=`${I} note-edge`,L=`${v}-note`,R=`${v}-cluster`,N=`${v}-cluster-alt`,K="parent",O="note",B="----",F=`${B}${O}`,P=`${B}${K}`,Y=(0,h.K)((t,e="TB")=>{if(!t.doc)return e;let s=e;for(const e of t.doc)"dir"===e.stmt&&(s=e.value);return s},"getDir"),G={getClasses:(0,h.K)(function(t,e){return e.db.getClasses()},"getClasses"),draw:(0,h.K)(async function(t,e,s,o){c.R.info("REF0:"),c.R.info("Drawing state diagram (v2)",e);const{securityLevel:h,state:d,layout:u}=(0,l.D7)();o.db.extract(o.db.getRootDocV2());const p=o.db.getData(),y=(0,i.A)(e,h);p.type=o.type,p.layoutAlgorithm=u,p.nodeSpacing=d?.nodeSpacing||50,p.rankSpacing=d?.rankSpacing||50;"neo"===(0,l.D7)().look?p.markers=["barbNeo"]:p.markers=["barb"],p.diagramId=e,await(0,r.XX)(p,y);try{("function"==typeof o.db.getLinks?o.db.getLinks():new Map).forEach((t,e)=>{const s="string"==typeof e?e:"string"==typeof e?.id?e.id:"",i=p.nodes.find(t=>t.id===s);if(!s)return void c.R.warn("⚠️ Invalid or missing stateId from key:",JSON.stringify(e));const n=y.node()?.querySelectorAll("g.node, g.rough-node");let r;if(n?.forEach(t=>{const e=t.textContent?.trim();t.id!==i?.domId&&e!==s||(r=t)}),!r)return void c.R.warn("⚠️ Could not find node matching text:",s);const o=r.parentNode;if(!o)return void c.R.warn("⚠️ Node has no parent, cannot wrap:",s);const a=document.createElementNS("http://www.w3.org/2000/svg","a"),l=t.url.replace(/^"+|"+$/g,"");if(a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l),a.setAttribute("target","_blank"),t.tooltip){const e=t.tooltip.replace(/^"+|"+$/g,"");a.setAttribute("title",e),r.setAttribute("title",e)}o.replaceChild(a,r),a.appendChild(r),c.R.info("🔗 Wrapped node in <a> tag for:",s,t.url)})}catch(t){c.R.error("❌ Error injecting clickable links:",t)}a._K.insertTitle(y,"statediagramTitleText",d?.titleTopMargin??25,o.db.getDiagramTitle()),(0,n.P)(y,8,v,d?.useMaxWidth??!0)},"draw"),getDir:Y},j=new Map,z=0;function M(t="",e=0,s="",i=B){return`state-${t}${null!==s&&s.length>0?`${i}${s}`:""}-${e}`}(0,h.K)(M,"stateDomId");var W=(0,h.K)((t,e,s,i,n,r,o,a)=>{c.R.trace("items",e),e.forEach(e=>{switch(e.stmt){case g:case S:J(t,e,s,i,n,r,o,a);break;case m:{J(t,e.state1,s,i,n,r,o,a),J(t,e.state2,s,i,n,r,o,a);const c="neo"===o,h={id:"edge"+z,start:e.state1.id,end:e.state2.id,arrowhead:"normal",arrowTypeEnd:c?"arrow_barb_neo":"arrow_barb",style:b,labelStyle:"",label:l.Y2.sanitizeText(e.description??"",(0,l.D7)()),arrowheadStyle:T,labelpos:"c",labelType:_,thickness:x,classes:I,look:o};n.push(h),z++}}})},"setupDoc"),U=(0,h.K)((t,e="TB")=>{let s=e;if(t.doc)for(const e of t.doc)"dir"===e.stmt&&(s=e.value);return s},"getDir");function X(t,e,s){if(!e.id||"</join></fork>"===e.id||"</choice>"===e.id)return;e.cssClasses&&(Array.isArray(e.cssCompiledStyles)||(e.cssCompiledStyles=[]),e.cssClasses.split(" ").forEach(t=>{const i=s.get(t);i&&(e.cssCompiledStyles=[...e.cssCompiledStyles??[],...i.styles])}));const i=t.find(t=>t.id===e.id);i?Object.assign(i,e):t.push(e)}function H(t){return t?.classes?.join(" ")??""}function V(t){return t?.styles??[]}(0,h.K)(X,"insertOrUpdateNode"),(0,h.K)(H,"getClassesFromDbInfo"),(0,h.K)(V,"getStylesFromDbInfo");var J=(0,h.K)((t,e,s,i,n,r,o,a)=>{const h=e.id,d=s.get(h),u=H(d),p=V(d),y=(0,l.D7)();if(c.R.info("dataFetcher parsedItem",e,d,p),"root"!==h){let s=E;!0===e.start?s="stateStart":!1===e.start&&(s="stateEnd"),e.type!==S&&(s=e.type),j.get(h)||j.set(h,{id:h,shape:s,description:l.Y2.sanitizeText(h,y),cssClasses:`${u} ${w}`,cssStyles:p});const d=j.get(h);e.description&&(Array.isArray(d.description)?(d.shape=D,d.description.push(e.description)):d.description?.length&&d.description.length>0?(d.shape=D,d.description===h?d.description=[e.description]:d.description=[d.description,e.description]):(d.shape=E,d.description=e.description),d.description=l.Y2.sanitizeTextOrArray(d.description,y)),1===d.description?.length&&d.shape===D&&("group"===d.type?d.shape=C:d.shape=E),!d.type&&e.doc&&(c.R.info("Setting cluster for XCX",h,U(e)),d.type="group",d.isGroup=!0,d.dir=U(e),d.shape=e.type===k?$:C,d.cssClasses=`${d.cssClasses} ${R} ${r?N:""}`);const g={labelStyle:"",shape:d.shape,label:d.description,cssClasses:d.cssClasses,cssCompiledStyles:[],cssStyles:d.cssStyles,id:h,dir:d.dir,domId:M(h,z),type:d.type,isGroup:"group"===d.type,padding:8,rx:10,ry:10,look:o,labelType:"markdown"};if(g.shape===$&&(g.label=""),t&&"root"!==t.id&&(c.R.trace("Setting node ",h," to be child of its parent ",t.id),g.parentId=t.id),g.centerLabel=!0,e.note){const t={labelStyle:"",shape:"note",label:e.note.text,labelType:"markdown",cssClasses:L,cssStyles:[],cssCompiledStyles:[],id:h+F+"-"+z,domId:M(h,z,O),type:d.type,isGroup:"group"===d.type,padding:y.flowchart?.padding,look:o,position:e.note.position},s=h+P,r={labelStyle:"",shape:"noteGroup",label:e.note.text,cssClasses:d.cssClasses,cssStyles:[],id:h+P,domId:M(h,z,K),type:"group",isGroup:!0,padding:16,look:o,position:e.note.position};z++,r.id=s,t.parentId=s,X(i,r,a),X(i,t,a),X(i,g,a);let l=h,c=t.id;"left of"===e.note.position&&(l=t.id,c=h),n.push({id:l+"-"+c,start:l,end:c,arrowhead:"none",arrowTypeEnd:"",style:b,labelStyle:"",classes:A,arrowheadStyle:T,labelpos:"c",labelType:_,thickness:x,look:o})}else X(i,g,a)}e.doc&&(c.R.trace("Adding nodes children "),W(e,e.doc,s,i,n,!r,o,a))},"dataFetcher"),q=(0,h.K)(()=>{j.clear(),z=0},"reset"),Z="[*]",Q="start",tt="[*]",et="end",st="color",it="fill",nt="bgFill",rt=",",ot=(0,h.K)(()=>new Map,"newClassesList"),at=(0,h.K)(()=>({relations:[],states:new Map,documents:{}}),"newDoc"),lt=(0,h.K)(t=>JSON.parse(JSON.stringify(t)),"clone"),ct=class{constructor(t){this.version=t,this.nodes=[],this.edges=[],this.rootDoc=[],this.classes=ot(),this.documents={root:at()},this.currentDocument=this.documents.root,this.startEndCount=0,this.dividerCnt=0,this.links=new Map,this.funs=[],this.getAccTitle=l.iN,this.setAccTitle=l.SV,this.getAccDescription=l.m7,this.setAccDescription=l.EI,this.setDiagramTitle=l.ke,this.getDiagramTitle=l.ab,this.clear(),this.setRootDoc=this.setRootDoc.bind(this),this.getDividerId=this.getDividerId.bind(this),this.setDirection=this.setDirection.bind(this),this.trimColon=this.trimColon.bind(this),this.bindFunctions=this.bindFunctions.bind(this)}static{(0,h.K)(this,"StateDB")}static{this.relationType={AGGREGATION:0,EXTENSION:1,COMPOSITION:2,DEPENDENCY:3}}extract(t){this.clear(!0);for(const e of Array.isArray(t)?t:t.doc)switch(e.stmt){case g:this.addState(e.id.trim(),e.type,e.doc,e.description,e.note);break;case m:this.addRelation(e.state1,e.state2,e.description);break;case"classDef":this.addStyleClass(e.id.trim(),e.classes);break;case"style":this.handleStyleDef(e);break;case"applyClass":this.setCssClass(e.id.trim(),e.styleClass);break;case"click":this.addLink(e.id,e.url,e.tooltip)}const e=this.getStates(),s=(0,l.D7)();q(),J(void 0,this.getRootDocV2(),e,this.nodes,this.edges,!0,s.look,this.classes);for(const t of this.nodes)if(Array.isArray(t.label)){if(t.description=t.label.slice(1),t.isGroup&&t.description.length>0)throw new Error(`Group nodes can only have label. Remove the additional description for node [${t.id}]`);t.label=t.label[0]}}handleStyleDef(t){const e=t.id.trim().split(","),s=t.styleClass.split(",");for(const t of e){let e=this.getState(t);if(!e){const s=t.trim();this.addState(s),e=this.getState(s)}e&&(e.styles=s.map(t=>t.replace(/;/g,"")?.trim()))}}setRootDoc(t){c.R.info("Setting root doc",t),this.rootDoc=t,1===this.version?this.extract(t):this.extract(this.getRootDocV2())}docTranslator(t,e,s){if(e.stmt===m)return this.docTranslator(t,e.state1,!0),void this.docTranslator(t,e.state2,!1);if(e.stmt===g&&(e.id===Z?(e.id=t.id+(s?"_start":"_end"),e.start=s):e.id=e.id.trim()),e.stmt!==f&&e.stmt!==g||!e.doc)return;const i=[];let n=[];for(const t of e.doc)if(t.type===k){const e=lt(t);e.doc=lt(n),i.push(e),n=[]}else n.push(t);if(i.length>0&&n.length>0){const t={stmt:g,id:(0,a.$C)(),type:"divider",doc:lt(n)};i.push(lt(t)),e.doc=i}e.doc.forEach(t=>this.docTranslator(e,t,!0))}getRootDocV2(){return this.docTranslator({id:f,stmt:f},{id:f,stmt:f,doc:this.rootDoc},!0),{id:f,doc:this.rootDoc}}addState(t,e=S,s=void 0,i=void 0,n=void 0,r=void 0,o=void 0,a=void 0){const h=t?.trim();if(this.currentDocument.states.has(h)){const t=this.currentDocument.states.get(h);if(!t)throw new Error(`State not found: ${h}`);t.doc||(t.doc=s),t.type||(t.type=e)}else c.R.info("Adding state ",h,i),this.currentDocument.states.set(h,{stmt:g,id:h,descriptions:[],type:e,doc:s,note:n,classes:[],styles:[],textStyles:[]});if(i){c.R.info("Setting state description",h,i);(Array.isArray(i)?i:[i]).forEach(t=>this.addDescription(h,t.trim()))}if(n){const t=this.currentDocument.states.get(h);if(!t)throw new Error(`State not found: ${h}`);t.note=n,t.note.text=l.Y2.sanitizeText(t.note.text,(0,l.D7)())}if(r){c.R.info("Setting state classes",h,r);(Array.isArray(r)?r:[r]).forEach(t=>this.setCssClass(h,t.trim()))}if(o){c.R.info("Setting state styles",h,o);(Array.isArray(o)?o:[o]).forEach(t=>this.setStyle(h,t.trim()))}if(a){c.R.info("Setting state styles",h,o);(Array.isArray(a)?a:[a]).forEach(t=>this.setTextStyle(h,t.trim()))}}clear(t){this.nodes=[],this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.documents={root:at()},this.currentDocument=this.documents.root,this.startEndCount=0,this.classes=ot(),t||(this.links=new Map,(0,l.IU)())}getState(t){return this.currentDocument.states.get(t)}getStates(){return this.currentDocument.states}logDocuments(){c.R.info("Documents = ",this.documents)}getRelations(){return this.currentDocument.relations}addLink(t,e,s){this.links.set(t,{url:e,tooltip:s}),c.R.warn("Adding link",t,e,s)}getLinks(){return this.links}startIdIfNeeded(t=""){return t===Z?(this.startEndCount++,`${Q}${this.startEndCount}`):t}startTypeIfNeeded(t="",e=S){return t===Z?Q:e}endIdIfNeeded(t=""){return t===tt?(this.startEndCount++,`${et}${this.startEndCount}`):t}endTypeIfNeeded(t="",e=S){return t===tt?et:e}addRelationObjs(t,e,s=""){const i=this.startIdIfNeeded(t.id.trim()),n=this.startTypeIfNeeded(t.id.trim(),t.type),r=this.startIdIfNeeded(e.id.trim()),o=this.startTypeIfNeeded(e.id.trim(),e.type);this.addState(i,n,t.doc,t.description,t.note,t.classes,t.styles,t.textStyles),this.addState(r,o,e.doc,e.description,e.note,e.classes,e.styles,e.textStyles),this.currentDocument.relations.push({id1:i,id2:r,relationTitle:l.Y2.sanitizeText(s,(0,l.D7)())})}addRelation(t,e,s){if("object"==typeof t&&"object"==typeof e)this.addRelationObjs(t,e,s);else if("string"==typeof t&&"string"==typeof e){const i=this.startIdIfNeeded(t.trim()),n=this.startTypeIfNeeded(t),r=this.endIdIfNeeded(e.trim()),o=this.endTypeIfNeeded(e);this.addState(i,n),this.addState(r,o),this.currentDocument.relations.push({id1:i,id2:r,relationTitle:s?l.Y2.sanitizeText(s,(0,l.D7)()):void 0})}}addDescription(t,e){const s=this.currentDocument.states.get(t),i=e.startsWith(":")?e.replace(":","").trim():e;s?.descriptions?.push(l.Y2.sanitizeText(i,(0,l.D7)()))}cleanupLabel(t){return t.startsWith(":")?t.slice(2).trim():t.trim()}getDividerId(){return this.dividerCnt++,`divider-id-${this.dividerCnt}`}addStyleClass(t,e=""){this.classes.has(t)||this.classes.set(t,{id:t,styles:[],textStyles:[]});const s=this.classes.get(t);e&&s&&e.split(rt).forEach(t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(st).exec(t)){const t=e.replace(it,nt).replace(st,it);s.textStyles.push(t)}s.styles.push(e)})}getClasses(){return this.classes}setupToolTips(t){const e=(0,o.Ck)();(0,d.Ltv)(t).select("svg").selectAll("g.node, g.rough-node").on("mouseover",t=>{const s=(0,d.Ltv)(t.currentTarget),i=s.attr("title");if(null===i)return;const n=t.currentTarget?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.style("left",window.scrollX+n.left+(n.right-n.left)/2+"px").style("top",window.scrollY+n.bottom+"px"),e.html(u.A.sanitize(i)),s.classed("hover",!0)}).on("mouseout",t=>{e.transition().duration(500).style("opacity",0);(0,d.Ltv)(t.currentTarget).classed("hover",!1)})}setCssClass(t,e){t.split(",").forEach(t=>{let s=this.getState(t);if(!s){const e=t.trim();this.addState(e),s=this.getState(e)}s?.classes?.push(e)})}setStyle(t,e){this.getState(t)?.styles?.push(e)}setTextStyle(t,e){this.getState(t)?.textStyles?.push(e)}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirectionStatement(){return this.rootDoc.find(t=>"dir"===t.stmt)}getDirection(){return this.getDirectionStatement()?.value??"TB"}setDirection(t){const e=this.getDirectionStatement();e?e.value=t:this.rootDoc.unshift({stmt:"dir",value:t})}trimColon(t){return t.startsWith(":")?t.slice(1).trim():t.trim()}getData(){const t=(0,l.D7)();return{nodes:this.nodes,edges:this.edges,other:{},config:t,direction:Y(this.getRootDocV2())}}getConfig(){return(0,l.D7)().state}},ht=(0,h.K)(t=>`\ndefs [id$="-barbEnd"] {\n fill: ${t.transitionColor};\n stroke: ${t.transitionColor};\n }\ng.stateGroup text {\n fill: ${t.nodeBorder};\n stroke: none;\n font-size: 10px;\n}\ng.stateGroup text {\n fill: ${t.textColor};\n stroke: none;\n font-size: 10px;\n\n}\ng.stateGroup .state-title {\n font-weight: bolder;\n fill: ${t.stateLabelColor};\n}\n\ng.stateGroup rect {\n fill: ${t.mainBkg};\n stroke: ${t.nodeBorder};\n}\n\ng.stateGroup line {\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.transition {\n stroke: ${t.transitionColor};\n stroke-width: ${t.strokeWidth||1};\n fill: none;\n}\n\n.stateGroup .composit {\n fill: ${t.background};\n border-bottom: 1px\n}\n\n.stateGroup .alt-composit {\n fill: #e0e0e0;\n border-bottom: 1px\n}\n\n.state-note {\n stroke: ${t.noteBorderColor};\n fill: ${t.noteBkgColor};\n\n text {\n fill: ${t.noteTextColor};\n stroke: none;\n font-size: 10px;\n }\n}\n\n.stateLabel .box {\n stroke: none;\n stroke-width: 0;\n fill: ${t.mainBkg};\n opacity: 0.5;\n}\n\n.edgeLabel .label rect {\n fill: ${t.labelBackgroundColor};\n opacity: 0.5;\n}\n.edgeLabel {\n background-color: ${t.edgeLabelBackground};\n p {\n background-color: ${t.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${t.edgeLabelBackground};\n fill: ${t.edgeLabelBackground};\n }\n text-align: center;\n}\n.edgeLabel .label text {\n fill: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n.label div .edgeLabel {\n color: ${t.transitionLabelColor||t.tertiaryTextColor};\n}\n\n.stateLabel text {\n fill: ${t.stateLabelColor};\n font-size: 10px;\n font-weight: bold;\n}\n\n.node circle.state-start {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node .fork-join {\n fill: ${t.specialStateColor};\n stroke: ${t.specialStateColor};\n}\n\n.node circle.state-end {\n fill: ${t.innerEndBackground};\n stroke: ${t.background};\n stroke-width: 1.5\n}\n.end-state-inner {\n fill: ${t.compositeBackground||t.background};\n // stroke: ${t.background};\n stroke-width: 1.5\n}\n\n.node rect {\n fill: ${t.stateBkg||t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n.node polygon {\n fill: ${t.mainBkg};\n stroke: ${t.stateBorder||t.nodeBorder};;\n stroke-width: ${t.strokeWidth||1}px;\n}\n[id$="-barbEnd"] {\n fill: ${t.lineColor};\n}\n\n.statediagram-cluster rect {\n fill: ${t.compositeTitleBackground};\n stroke: ${t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth||1}px;\n}\n\n.cluster-label, .nodeLabel {\n color: ${t.stateLabelColor};\n // line-height: 1;\n}\n\n.statediagram-cluster rect.outer {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state .divider {\n stroke: ${t.stateBorder||t.nodeBorder};\n}\n\n.statediagram-state .title-state {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-cluster.statediagram-cluster .inner {\n fill: ${t.compositeBackground||t.background};\n}\n.statediagram-cluster.statediagram-cluster-alt .inner {\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.statediagram-cluster .inner {\n rx:0;\n ry:0;\n}\n\n.statediagram-state rect.basic {\n rx: 5px;\n ry: 5px;\n}\n.statediagram-state rect.divider {\n stroke-dasharray: 10,10;\n fill: ${t.altBackground?t.altBackground:"#efefef"};\n}\n\n.note-edge {\n stroke-dasharray: 5;\n}\n\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n.statediagram-note rect {\n fill: ${t.noteBkgColor};\n stroke: ${t.noteBorderColor};\n stroke-width: 1px;\n rx: 0;\n ry: 0;\n}\n\n.statediagram-note text {\n fill: ${t.noteTextColor};\n}\n\n.statediagram-note .nodeLabel {\n color: ${t.noteTextColor};\n}\n.statediagram .edgeLabel {\n color: red; // ${t.noteTextColor};\n}\n\n[id$="-dependencyStart"], [id$="-dependencyEnd"] {\n fill: ${t.lineColor};\n stroke: ${t.lineColor};\n stroke-width: ${t.strokeWidth||1};\n}\n\n.statediagramTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${t.textColor};\n}\n\n[data-look="neo"].statediagram-cluster rect {\n fill: ${t.mainBkg};\n stroke: ${t.useGradient?"url("+t.svgId+"-gradient)":t.stateBorder||t.nodeBorder};\n stroke-width: ${t.strokeWidth??1};\n}\n[data-look="neo"].statediagram-cluster rect.outer {\n rx: ${t.radius}px;\n ry: ${t.radius}px;\n filter: ${t.dropShadow?t.dropShadow.replace("url(#drop-shadow)",`url(${t.svgId}-drop-shadow)`):"none"}\n}\n`,"getStyles")},98889(t,e,s){s.d(e,{P:()=>o});var i=s(20886),n=s(84828),r=s(27698),o=(0,r.K)((t,e,s,r)=>{t.attr("class",s);const{width:o,height:c,x:h,y:d}=a(t,e);(0,i.a$)(t,c,o,r);const u=l(h,d,o,c,e);t.attr("viewBox",u),n.R.debug(`viewBox configured: ${u} with padding: ${e}`)},"setupViewPortForSVG"),a=(0,r.K)((t,e)=>{const s=t.node()?.getBBox()||{width:0,height:0,x:0,y:0};return{width:s.width+2*e,height:s.height+2*e,x:s.x,y:s.y}},"calculateDimensionsWithPadding"),l=(0,r.K)((t,e,s,i,n)=>`${t-n} ${e-n} ${s} ${i}`,"createViewBox")},79762(t,e,s){s.d(e,{A:()=>r});var i=s(27698),n=s(51444),r=(0,i.K)((t,e)=>{let s;"sandbox"===e&&(s=(0,n.Ltv)("#i"+t));return("sandbox"===e?(0,n.Ltv)(s.nodes()[0].contentDocument.body):(0,n.Ltv)("body")).select(`[id="${t}"]`)},"getDiagramElement")}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[5332],{35332(e,a,c){c.d(a,{createTreemapServices:()=>s.d});var s=c(97871);c(17946)}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunkfilecat=self.webpackChunkfilecat||[]).push([[536],{33778(e,t,s){s.d(t,{o:()=>a});var n=s(37110),i=s(99125),r=s(89826);var o=s(19663);function a(e){if((0,n.s)(e))return e;const t=(0,i.b)(e);if(!function(e){switch((0,i.b)(e)){case r.R_:case r.Uw:case r.cT:case r.iq:case r.$V:case r.vC:case r.ri:case r.ML:case r.XZ:case r.i1:case r._u:case r.pj:case r.kj:case r.GX:case r.Av:case r.NA:case r.OG:case r.VP:case r.Qb:case r.q:case r.x6:case r.ZR:return!0;default:return!1}}(e))return{};if(s=e,Array.isArray(s)){const t=Array.from(e);return e.length>0&&"string"==typeof e[0]&&Object.hasOwn(e,"index")&&(t.index=e.index,t.input=e.input),t}var s;if((0,o.i)(e)){const t=e;return new(0,t.constructor)(t.buffer,t.byteOffset,t.length)}if("[object ArrayBuffer]"===t)return new ArrayBuffer(e.byteLength);if("[object DataView]"===t){const t=e,s=t.buffer,n=t.byteOffset,i=t.byteLength,r=new ArrayBuffer(i),o=new Uint8Array(s,n,i);return new Uint8Array(r).set(o),new DataView(r)}if("[object Boolean]"===t||"[object Number]"===t||"[object String]"===t){const s=new(0,e.constructor)(e.valueOf());return"[object String]"===t?function(e,t){const s=t.valueOf().length;for(const n in t)Object.hasOwn(t,n)&&(Number.isNaN(Number(n))||Number(n)>=s)&&(e[n]=t[n])}(s,e):c(s,e),s}if("[object Date]"===t)return new Date(Number(e));if("[object RegExp]"===t){const t=e,s=new RegExp(t.source,t.flags);return s.lastIndex=t.lastIndex,s}if("[object Symbol]"===t)return Object(Symbol.prototype.valueOf.call(e));if("[object Map]"===t){const t=e,s=new Map;return t.forEach((e,t)=>{s.set(t,e)}),s}if("[object Set]"===t){const t=e,s=new Set;return t.forEach(e=>{s.add(e)}),s}if("[object Arguments]"===t){const t=e,s={};return c(s,t),s.length=t.length,s[Symbol.iterator]=t[Symbol.iterator],s}const a={};return function(e,t){const s=Object.getPrototypeOf(t);null!==s&&"function"==typeof t.constructor&&Object.setPrototypeOf(e,s)}(a,e),c(a,e),function(e,t){const s=Object.getOwnPropertySymbols(t);for(let n=0;n<s.length;n++){const i=s[n];Object.prototype.propertyIsEnumerable.call(t,i)&&(e[i]=t[i])}}(a,e),a}function c(e,t){for(const s in t)Object.hasOwn(t,s)&&(e[s]=t[s])}},75937(e,t,s){s.d(t,{A:()=>r});var n=s(86309),i=s(51931);const r=(e,t)=>n.A.lang.round(i.A.parse(e)[t])},10536(e,t,s){s.d(t,{diagram:()=>xe});var n=s(64918),i=s(43247),r=s(24832),o=s(36870),a=(s(84076),s(36155),s(57588),s(54912),s(92941)),c=s(51255),l=s(89983),h=s(31293),g=s(86827),u=s(33778),d=s(25582),y=s(75937),p=s(51444),b=s(697),f=function(){var e=(0,g.K)(function(e,t,s,n){for(s=s||{},n=e.length;n--;s[e[n]]=t);return s},"o"),t=[1,15],s=[1,7],n=[1,13],i=[1,14],r=[1,19],o=[1,16],a=[1,17],c=[1,18],l=[8,30],h=[8,10,21,28,29,30,31,39,43,46],u=[1,23],d=[1,24],y=[8,10,15,16,21,28,29,30,31,39,43,46],p=[8,10,15,16,21,27,28,29,30,31,39,43,46],b=[1,49],f={trace:(0,g.K)(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:(0,g.K)(function(e,t,s,n,i,r,o){var a=r.length-1;switch(i){case 4:n.getLogger().debug("Rule: separator (NL) ");break;case 5:n.getLogger().debug("Rule: separator (Space) ");break;case 6:n.getLogger().debug("Rule: separator (EOF) ");break;case 7:n.getLogger().debug("Rule: hierarchy: ",r[a-1]),n.setHierarchy(r[a-1]);break;case 8:n.getLogger().debug("Stop NL ");break;case 9:n.getLogger().debug("Stop EOF ");break;case 10:n.getLogger().debug("Stop NL2 ");break;case 11:n.getLogger().debug("Stop EOF2 ");break;case 12:n.getLogger().debug("Rule: statement: ",r[a]),"number"==typeof r[a].length?this.$=r[a]:this.$=[r[a]];break;case 13:n.getLogger().debug("Rule: statement #2: ",r[a-1]),this.$=[r[a-1]].concat(r[a]);break;case 14:n.getLogger().debug("Rule: link: ",r[a],e),this.$={edgeTypeStr:r[a],label:""};break;case 15:n.getLogger().debug("Rule: LABEL link: ",r[a-3],r[a-1],r[a]),this.$={edgeTypeStr:r[a],label:r[a-1]};break;case 18:const t=parseInt(r[a]),s=n.generateId();this.$={id:s,type:"space",label:"",width:t,children:[]};break;case 23:n.getLogger().debug("Rule: (nodeStatement link node) ",r[a-2],r[a-1],r[a]," typestr: ",r[a-1].edgeTypeStr);const i=n.edgeStrToEdgeData(r[a-1].edgeTypeStr),o=n.edgeStrToEdgeStartData(r[a-1].edgeTypeStr),c=n.edgeStrToThickness(r[a-1].edgeTypeStr),l=n.edgeStrToPattern(r[a-1].edgeTypeStr);this.$=[{id:r[a-2].id,label:r[a-2].label,type:r[a-2].type,directions:r[a-2].directions},{id:r[a-2].id+"-"+r[a].id,start:r[a-2].id,end:r[a].id,label:r[a-1].label,type:"edge",thickness:c,pattern:l,directions:r[a].directions,arrowTypeEnd:i,arrowTypeStart:o},{id:r[a].id,label:r[a].label,type:n.typeStr2Type(r[a].typeStr),directions:r[a].directions}];break;case 24:n.getLogger().debug("Rule: nodeStatement (abc88 node size) ",r[a-1],r[a]),this.$={id:r[a-1].id,label:r[a-1].label,type:n.typeStr2Type(r[a-1].typeStr),directions:r[a-1].directions,widthInColumns:parseInt(r[a],10)};break;case 25:n.getLogger().debug("Rule: nodeStatement (node) ",r[a]),this.$={id:r[a].id,label:r[a].label,type:n.typeStr2Type(r[a].typeStr),directions:r[a].directions,widthInColumns:1};break;case 26:n.getLogger().debug("APA123",this?this:"na"),n.getLogger().debug("COLUMNS: ",r[a]),this.$={type:"column-setting",columns:"auto"===r[a]?-1:parseInt(r[a])};break;case 27:n.getLogger().debug("Rule: id-block statement : ",r[a-2],r[a-1]);n.generateId();this.$={...r[a-2],type:"composite",children:r[a-1]};break;case 28:n.getLogger().debug("Rule: blockStatement : ",r[a-2],r[a-1],r[a]);const h=n.generateId();this.$={id:h,type:"composite",label:"",children:r[a-1]};break;case 29:n.getLogger().debug("Rule: node (NODE_ID separator): ",r[a]),this.$={id:r[a]};break;case 30:n.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",r[a-1],r[a]),this.$={id:r[a-1],label:r[a].label,typeStr:r[a].typeStr,directions:r[a].directions};break;case 31:n.getLogger().debug("Rule: dirList: ",r[a]),this.$=[r[a]];break;case 32:n.getLogger().debug("Rule: dirList: ",r[a-1],r[a]),this.$=[r[a-1]].concat(r[a]);break;case 33:n.getLogger().debug("Rule: nodeShapeNLabel: ",r[a-2],r[a-1],r[a]),this.$={typeStr:r[a-2]+r[a],label:r[a-1]};break;case 34:n.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",r[a-3],r[a-2]," #3:",r[a-1],r[a]),this.$={typeStr:r[a-3]+r[a],label:r[a-2],directions:r[a-1]};break;case 35:case 36:this.$={type:"classDef",id:r[a-1].trim(),css:r[a].trim()};break;case 37:this.$={type:"applyClass",id:r[a-1].trim(),styleClass:r[a].trim()};break;case 38:this.$={type:"applyStyles",id:r[a-1].trim(),stylesStr:r[a].trim()}}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:t,11:3,13:4,19:5,20:6,21:s,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:r,39:o,43:a,46:c},{8:[1,20]},e(l,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:t,21:s,28:n,29:i,31:r,39:o,43:a,46:c}),e(h,[2,16],{14:22,15:u,16:d}),e(h,[2,17]),e(h,[2,18]),e(h,[2,19]),e(h,[2,20]),e(h,[2,21]),e(h,[2,22]),e(y,[2,25],{27:[1,25]}),e(h,[2,26]),{19:26,26:12,31:r},{10:t,11:27,13:4,19:5,20:6,21:s,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:r,39:o,43:a,46:c},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(p,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(l,[2,13]),{26:35,31:r},{31:[2,14]},{17:[1,36]},e(y,[2,24]),{10:t,11:37,13:4,14:22,15:u,16:d,19:5,20:6,21:s,22:8,23:9,24:10,25:11,26:12,28:n,29:i,31:r,39:o,43:a,46:c},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(p,[2,30]),{18:[1,43]},{18:[1,44]},e(y,[2,23]),{18:[1,45]},{30:[1,46]},e(h,[2,28]),e(h,[2,35]),e(h,[2,36]),e(h,[2,37]),e(h,[2,38]),{36:[1,47]},{33:48,34:b},{15:[1,50]},e(h,[2,27]),e(p,[2,33]),{38:[1,51]},{33:52,34:b,38:[2,31]},{31:[2,15]},e(p,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:(0,g.K)(function(e,t){if(!t.recoverable){var s=new Error(e);throw s.hash=t,s}this.trace(e)},"parseError"),parse:(0,g.K)(function(e){var t=this,s=[0],n=[],i=[null],r=[],o=this.table,a="",c=0,l=0,h=0,u=r.slice.call(arguments,1),d=Object.create(this.lexer),y={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(y.yy[p]=this.yy[p]);d.setInput(e,y.yy),y.yy.lexer=d,y.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var b=d.yylloc;r.push(b);var f=d.options&&d.options.ranges;function x(){var e;return"number"!=typeof(e=n.pop()||d.lex()||1)&&(e instanceof Array&&(e=(n=e).pop()),e=t.symbols_[e]||e),e}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,(0,g.K)(function(e){s.length=s.length-2*e,i.length=i.length-e,r.length=r.length-e},"popStack"),(0,g.K)(x,"lex");for(var S,m,L,k,_,w,E,D,I,$={};;){if(L=s[s.length-1],this.defaultActions[L]?k=this.defaultActions[L]:(null==S&&(S=x()),k=o[L]&&o[L][S]),void 0===k||!k.length||!k[0]){var T="";for(w in I=[],o[L])this.terminals_[w]&&w>2&&I.push("'"+this.terminals_[w]+"'");T=d.showPosition?"Parse error on line "+(c+1)+":\n"+d.showPosition()+"\nExpecting "+I.join(", ")+", got '"+(this.terminals_[S]||S)+"'":"Parse error on line "+(c+1)+": Unexpected "+(1==S?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(T,{text:d.match,token:this.terminals_[S]||S,line:d.yylineno,loc:b,expected:I})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+L+", token: "+S);switch(k[0]){case 1:s.push(S),i.push(d.yytext),r.push(d.yylloc),s.push(k[1]),S=null,m?(S=m,m=null):(l=d.yyleng,a=d.yytext,c=d.yylineno,b=d.yylloc,h>0&&h--);break;case 2:if(E=this.productions_[k[1]][1],$.$=i[i.length-E],$._$={first_line:r[r.length-(E||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(E||1)].first_column,last_column:r[r.length-1].last_column},f&&($._$.range=[r[r.length-(E||1)].range[0],r[r.length-1].range[1]]),void 0!==(_=this.performAction.apply($,[a,l,c,y.yy,k[1],i,r].concat(u))))return _;E&&(s=s.slice(0,-1*E*2),i=i.slice(0,-1*E),r=r.slice(0,-1*E)),s.push(this.productions_[k[1]][0]),i.push($.$),r.push($._$),D=o[s[s.length-2]][s[s.length-1]],s.push(D);break;case 3:return!0}}return!0},"parse")},x=function(){return{EOF:1,parseError:(0,g.K)(function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},"parseError"),setInput:(0,g.K)(function(e,t){return this.yy=t||this.yy||{},this._input=e,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:(0,g.K)(function(){var e=this._input[0];return this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e,e.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},"input"),unput:(0,g.K)(function(e){var t=e.length,s=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===n.length?this.yylloc.first_column:0)+n[n.length-s.length].length-s[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:(0,g.K)(function(){return this._more=!0,this},"more"),reject:(0,g.K)(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:(0,g.K)(function(e){this.unput(this.match.slice(e))},"less"),pastInput:(0,g.K)(function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:(0,g.K)(function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:(0,g.K)(function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},"showPosition"),test_match:(0,g.K)(function(e,t){var s,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),(n=e[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+e[0].length},this.yytext+=e[0],this.match+=e[0],this.matches=e,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(e[0].length),this.matched+=e[0],s=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in i)this[r]=i[r];return!1}return!1},"test_match"),next:(0,g.K)(function(){if(this.done)return this.EOF;var e,t,s,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),r=0;r<i.length;r++)if((s=this._input.match(this.rules[i[r]]))&&(!t||s[0].length>t[0].length)){if(t=s,n=r,this.options.backtrack_lexer){if(!1!==(e=this.test_match(s,i[r])))return e;if(this._backtrack){t=!1;continue}return!1}if(!this.options.flex)break}return t?!1!==(e=this.test_match(t,i[n]))&&e:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:(0,g.K)(function(){var e=this.next();return e||this.lex()},"lex"),begin:(0,g.K)(function(e){this.conditionStack.push(e)},"begin"),popState:(0,g.K)(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:(0,g.K)(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:(0,g.K)(function(e){return(e=this.conditionStack.length-1-Math.abs(e||0))>=0?this.conditionStack[e]:"INITIAL"},"topState"),pushState:(0,g.K)(function(e){this.begin(e)},"pushState"),stateStackSize:(0,g.K)(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:(0,g.K)(function(e,t,s,n){switch(s){case 0:return e.getLogger().debug("Found block-beta"),10;case 1:return e.getLogger().debug("Found id-block"),29;case 2:return e.getLogger().debug("Found block"),10;case 3:e.getLogger().debug(".",t.yytext);break;case 4:e.getLogger().debug("_",t.yytext);break;case 5:return 5;case 6:return t.yytext=-1,28;case 7:return t.yytext=t.yytext.replace(/columns\s+/,""),e.getLogger().debug("COLUMNS (LEX)",t.yytext),28;case 8:case 76:case 77:case 99:this.pushState("md_string");break;case 9:return"MD_STR";case 10:case 34:case 79:this.popState();break;case 11:this.pushState("string");break;case 12:e.getLogger().debug("LEX: POPPING STR:",t.yytext),this.popState();break;case 13:return e.getLogger().debug("LEX: STR end:",t.yytext),"STR";case 14:return t.yytext=t.yytext.replace(/space\:/,""),e.getLogger().debug("SPACE NUM (LEX)",t.yytext),21;case 15:return t.yytext="1",e.getLogger().debug("COLUMNS (LEX)",t.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:case 38:case 40:case 41:case 44:return this.popState(),e.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),e.getLogger().debug("Lex: ))"),"NODE_DEND";case 42:return this.popState(),e.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),e.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),e.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),e.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),e.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:case 49:return this.popState(),e.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),e.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),e.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),e.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),e.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return e.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return e.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return e.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:case 59:case 60:case 61:case 64:return e.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return e.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 62:return e.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return e.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 65:case 66:case 67:case 68:case 69:case 70:case 71:return this.pushState("NODE"),35;case 72:return e.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),e.getLogger().debug("LEX ARR START"),37;case 74:return e.getLogger().debug("Lex: NODE_ID",t.yytext),31;case 75:return e.getLogger().debug("Lex: EOF",t.yytext),8;case 78:return"NODE_DESCR";case 80:e.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:e.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return e.getLogger().debug("LEX: NODE_DESCR:",t.yytext),"NODE_DESCR";case 83:e.getLogger().debug("LEX POPPING"),this.popState();break;case 84:e.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (right): dir:",t.yytext),"DIR";case 86:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (left):",t.yytext),"DIR";case 87:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (x):",t.yytext),"DIR";case 88:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (y):",t.yytext),"DIR";case 89:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (up):",t.yytext),"DIR";case 90:return t.yytext=t.yytext.replace(/^,\s*/,""),e.getLogger().debug("Lex (down):",t.yytext),"DIR";case 91:return t.yytext="]>",e.getLogger().debug("Lex (ARROW_DIR end):",t.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return e.getLogger().debug("Lex: LINK","#"+t.yytext+"#"),15;case 93:case 94:case 95:return e.getLogger().debug("Lex: LINK",t.yytext),15;case 96:case 97:case 98:return e.getLogger().debug("Lex: START_LINK",t.yytext),this.pushState("LLABEL"),16;case 100:return e.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),e.getLogger().debug("Lex: LINK","#"+t.yytext+"#"),15;case 102:case 103:return this.popState(),e.getLogger().debug("Lex: LINK",t.yytext),15;case 104:return e.getLogger().debug("Lex: COLON",t.yytext),t.yytext=t.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}}}();function S(){this.yy={}}return f.lexer=x,(0,g.K)(S,"Parser"),S.prototype=f,f.Parser=S,new S}();f.parser=f;var x=f,S=new Map,m=[],L=new Map,k="color",_="fill",w=new Map,E="",D=(0,g.K)(e=>l.Y2.sanitizeText(e,(0,l.D7)()),"sanitizeText"),I=(0,g.K)(function(e,t=""){let s=w.get(e);s||(s={id:e,styles:[],textStyles:[]},w.set(e,s)),null!=t&&t.split(",").forEach(e=>{const t=e.replace(/([^;]*);/,"$1").trim();if(RegExp(k).exec(e)){const e=t.replace(_,"bgFill").replace(k,_);s.textStyles.push(e)}s.styles.push(t)})},"addStyleClass"),$=(0,g.K)(function(e,t=""){const s=S.get(e);null!=t&&(s.styles=t.split(","))},"addStyle2Node"),T=(0,g.K)(function(e,t){e.split(",").forEach(function(e){let s=S.get(e);if(void 0===s){const t=e.trim();s={id:t,type:"na",children:[]},S.set(t,s)}s.classes||(s.classes=[]),s.classes.push(t)})},"setCssClass"),N=0,O=(0,g.K)((e,t)=>{const s=e.flat(),n=[],i=s.find(e=>"column-setting"===e?.type),r=i?.columns??-1;for(const e of s)if("number"==typeof r&&r>0&&"column-setting"!==e.type&&"number"==typeof e.widthInColumns&&e.widthInColumns>r&&h.R.warn(`Block ${e.id} width ${e.widthInColumns} exceeds configured column width ${r}`),e.label&&(e.label=D(e.label)),"classDef"!==e.type)if("applyClass"!==e.type)if("applyStyles"!==e.type)if("column-setting"===e.type)t.columns=e.columns??-1;else if("edge"===e.type){const t=(L.get(e.id)??0)+1;L.set(e.id,t),e.id=t+"-"+e.id,m.push(e)}else{e.label||("composite"===e.type?e.label="":e.label=e.id);const t=S.get(e.id);if(void 0===t?("composite"===e.type&&(e.colorIndex=N++),S.set(e.id,e)):("na"!==e.type&&(t.type=e.type),e.label!==e.id&&(t.label=e.label)),e.children&&O(e.children,e),"space"===e.type){const t=e.width??1;for(let s=0;s<t;s++){const t=(0,u.o)(e);t.id=t.id+"-"+s,S.set(t.id,t),n.push(t)}}else void 0===t&&n.push(e)}else e?.stylesStr&&$(e.id,e?.stylesStr);else T(e.id,e?.styleClass??"");else I(e.id,e.css);t.children=n},"populateBlockDatabase"),R=[],C={id:"root",type:"composite",children:[],columns:-1},z=(0,g.K)(()=>{h.R.debug("Clear called"),(0,l.IU)(),C={id:"root",type:"composite",children:[],columns:-1},S=new Map([["root",C]]),R=[],w=new Map,m=[],L=new Map,E="",N=0},"clear");function A(e){switch(h.R.debug("typeStr2Type",e),e){case"[]":return"square";case"()":return h.R.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}function K(e){return h.R.debug("typeStr2Type",e),"=="===e?"thick":"normal"}function v(e){switch(e.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}function B(e){switch(e.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}function P(e){return e.includes("==")?"thick":"normal"}function F(e){return e.includes(".-")?"dotted":"solid"}(0,g.K)(A,"typeStr2Type"),(0,g.K)(K,"edgeTypeStr2Type"),(0,g.K)(v,"edgeStrToEdgeData"),(0,g.K)(B,"edgeStrToEdgeStartData"),(0,g.K)(P,"edgeStrToThickness"),(0,g.K)(F,"edgeStrToPattern");var j=0,M=(0,g.K)(()=>(j++,"id-"+Math.random().toString(36).substr(2,12)+"-"+j),"generateId"),Y=(0,g.K)(e=>{C.children=e,O(e,C),R=C.children},"setHierarchy"),X=(0,g.K)(e=>{const t=S.get(e);return t?t.columns?t.columns:t.children?t.children.length:-1:-1},"getColumns"),W=(0,g.K)(()=>[...S.values()],"getBlocksFlat"),U=(0,g.K)(()=>R||[],"getBlocks"),H=(0,g.K)(()=>m,"getEdges"),G=(0,g.K)(e=>S.get(e),"getBlock"),q=(0,g.K)(e=>{S.set(e.id,e)},"setBlock"),V=(0,g.K)(e=>{E=e},"setDiagramId"),Z=(0,g.K)(()=>E,"getDiagramId"),J=(0,g.K)(()=>h.R,"getLogger"),Q=(0,g.K)(function(){return w},"getClasses"),ee={getConfig:(0,g.K)(()=>(0,l.zj)().block,"getConfig"),typeStr2Type:A,edgeTypeStr2Type:K,edgeStrToEdgeData:v,edgeStrToEdgeStartData:B,edgeStrToThickness:P,edgeStrToPattern:F,getLogger:J,getBlocksFlat:W,getBlocks:U,getEdges:H,setHierarchy:Y,getBlock:G,setBlock:q,getColumns:X,getClasses:Q,clear:z,generateId:M,setDiagramId:V,getDiagramId:Z},te=(0,g.K)(e=>{const{theme:t,bkgColorArray:s,borderColorArray:n}=e;if(!(0,a.P1)(t,n))return"";const i=(0,a.rq)(e.look),r=(0,a.Ic)(s);let o="";for(let t=0;t<(0,a.nw)(e.THEME_COLOR_LIMIT,n);t++){o+=`\n\n ${`[data-look="${i}"][data-color-id="color-${t}"]`}.node rect.composite {\n stroke: ${n[t%n.length]};\n ${r?`fill: ${s[t%s.length]};`:""}\n }\n`}return o},"genColor"),se=(0,g.K)((e,t)=>{const s=y.A,n=s(e,"r"),i=s(e,"g"),r=s(e,"b");return d.A(n,i,r,t)},"fade"),ne=(0,g.K)(e=>`${te(e)}\n .label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span {\n color: ${e.titleColor};\n }\n\n\n\n .label text,span {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n /* From the theme, as every other diagram does. Pinned at 1px here, so block drew a\n thinner border than an identical flowchart node under any theme asking for more --\n the neo theme asks for 2. Nothing downstream corrected it: the neo rules set stroke\n and filter, never stroke-width. */\n stroke-width: ${e.strokeWidth??1}px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePaths .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n /*\n * This is for backward compatibility with existing code that didn't\n * add a \`<p>\` around edge labels.\n *\n * TODO: We should probably remove this in a future release.\n */\n p {\n margin: 0;\n padding: 0;\n display: inline;\n }\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${e.edgeLabelBackground};\n }\n\n .node .cluster {\n // fill: ${se(e.mainBkg,.5)};\n fill: ${se(e.clusterBkg,.5)};\n stroke: ${se(e.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n ${(0,n.o)()}\n`,"getStyles");function ie(e,t){if(0===e||!Number.isInteger(e))throw new Error("Columns must be an integer !== 0.");if(t<0||!Number.isInteger(t))throw new Error("Position must be a non-negative integer."+t);if(e<0)return{px:t,py:0};if(1===e)return{px:0,py:t};return{px:t%e,py:Math.floor(t/e)}}(0,g.K)(ie,"calculateBlockPosition");var re=(0,g.K)(e=>{let t=0,s=0;for(const n of e.children){const{width:e,height:i,x:r,y:o}=n.size??{width:0,height:0,x:0,y:0};if(h.R.debug("getMaxChildSize abc95 child:",n.id,"width:",e,"height:",i,"x:",r,"y:",o,n.type),"space"===n.type)continue;const a=e/(n.widthInColumns??1);a>t&&(t=a),i>s&&(s=i)}return{width:t,height:s}},"getMaxChildSize");function oe(e,t,s=0,n=0,i=8){h.R.debug("setBlockSizes abc95 (start)",e.id,e?.size?.x,"block width =",e?.size,"siblingWidth",s),e?.size?.width||(e.size={width:s,height:n,x:0,y:0});let r=0,o=0;if(e.children?.length>0){for(const s of e.children)oe(s,t,0,0,i);const a=re(e);r=a.width,o=a.height,h.R.debug("setBlockSizes abc95 maxWidth of",e.id,":s children is ",r,o);for(const t of e.children)t.size&&(h.R.debug(`abc95 Setting size of children of ${e.id} id=${t.id} ${r} ${o} ${JSON.stringify(t.size)}`),t.size.width=r*(t.widthInColumns??1)+i*((t.widthInColumns??1)-1),t.size.height=o,t.size.x=0,t.size.y=0,h.R.debug(`abc95 updating size of ${e.id} children child:${t.id} maxWidth:${r} maxHeight:${o}`));for(const s of e.children)oe(s,t,r,o,i);const c=e.columns??-1;let l=0;for(const t of e.children)l+=t.widthInColumns??1;let g=e.children.length;c>0&&c<l&&(g=c);const u=Math.ceil(l/g);let d=g*(r+i)+i,y=u*(o+i)+i;if(d<s){h.R.debug(`Detected to small sibling: abc95 ${e.id} siblingWidth ${s} siblingHeight ${n} width ${d}`),d=s,y=n;const t=(s-g*i-i)/g,a=(n-u*i-i)/u;h.R.debug("Size indata abc88",e.id,"childWidth",t,"maxWidth",r),h.R.debug("Size indata abc88",e.id,"childHeight",a,"maxHeight",o),h.R.debug("Size indata abc88 xSize",g,"padding",i);for(const s of e.children)s.size&&(s.size.width=t,s.size.height=a,s.size.x=0,s.size.y=0)}if(h.R.debug(`abc95 (finale calc) ${e.id} xSize ${g} ySize ${u} columns ${c}${e.children.length} width=${Math.max(d,e.size?.width||0)}`),d<(e?.size?.width||0)){d=e?.size?.width||0;const t=c>0?Math.min(e.children.length,c):e.children.length;if(t>0){const s=(d-t*i-i)/t;h.R.debug("abc95 (growing to fit) width",e.id,d,e.size?.width,s);for(const t of e.children)t.size&&(t.size.width=s)}}e.size={width:d,height:y,x:0,y:0}}h.R.debug("setBlockSizes abc94 (done)",e.id,e?.size?.x,e?.size?.width,e?.size?.y,e?.size?.height)}function ae(e,t,s=8){h.R.debug(`abc85 layout blocks (=>layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`);const n=e.columns??-1;if(h.R.debug("layoutBlocks columns abc95",e.id,"=>",n,e),e.children&&e.children.length>0){const i=e?.children[0]?.size?.width??0,r=e.children.length*i+(e.children.length-1)*s;h.R.debug("widthOfChildren 88",r,"posX");const o=new Map;{let t=0;for(const s of e.children){if(!s.size)continue;const{py:e}=ie(n,t),i=o.get(e)??0;s.size.height>i&&o.set(e,s.size.height);let r=s?.widthInColumns??1;n>0&&(r=Math.min(r,n-t%n)),t+=r}}const a=new Map;{let e=0;const t=[...o.keys()].sort((e,t)=>e-t);for(const n of t)a.set(n,e),e+=(o.get(n)??0)+s}let c=0;h.R.debug("abc91 block?.size?.x",e.id,e?.size?.x);let l=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-s,g=0;for(const i of e.children){const r=e;if(!i.size)continue;const{width:u,height:d}=i.size,{px:y,py:p}=ie(n,c);if(p!=g&&(g=p,l=e?.size?.x?e?.size?.x+(-e?.size?.width/2||0):-s,h.R.debug("New row in layout for block",e.id," and child ",i.id,g)),h.R.debug(`abc89 layout blocks (child) id: ${i.id} Pos: ${c} (px, py) ${y},${p} (${r?.size?.x},${r?.size?.y}) parent: ${r.id} width: ${u}${s}`),r.size){const e=u/2;i.size.x=l+s+e,h.R.debug(`abc91 layout blocks (calc) px, pyid:${i.id} startingPos=X${l} new startingPosX${i.size.x} ${e} padding=${s} width=${u} halfWidth=${e} => x:${i.size.x} y:${i.size.y} ${i.widthInColumns} (width * (child?.w || 1)) / 2 ${u*(i?.widthInColumns??1)/2}`),l=i.size.x+e;const t=a.get(p)??0,n=o.get(p)??d;i.size.y=r.size.y-r.size.height/2+t+n/2+s,h.R.debug(`abc88 layout blocks (calc) px, pyid:${i.id}startingPosX${l}${s}${e}=>x:${i.size.x}y:${i.size.y}${i.widthInColumns}(width * (child?.w || 1)) / 2${u*(i?.widthInColumns??1)/2}`)}i.children&&ae(i,t,s);let b=i?.widthInColumns??1;n>0&&(b=Math.min(b,n-c%n)),c+=b,h.R.debug("abc88 columnsPos",i,c)}}h.R.debug(`layout blocks (<==layoutBlocks) ${e.id} x: ${e?.size?.x} y: ${e?.size?.y} width: ${e?.size?.width}`)}function ce(e,{minX:t,minY:s,maxX:n,maxY:i}={minX:0,minY:0,maxX:0,maxY:0}){if(e.size&&"root"!==e.id){const{x:r,y:o,width:a,height:c}=e.size;r-a/2<t&&(t=r-a/2),o-c/2<s&&(s=o-c/2),r+a/2>n&&(n=r+a/2),o+c/2>i&&(i=o+c/2)}if(e.children)for(const r of e.children)({minX:t,minY:s,maxX:n,maxY:i}=ce(r,{minX:t,minY:s,maxX:n,maxY:i}));return{minX:t,minY:s,maxX:n,maxY:i}}function le(e){const t=e.getBlock("root");if(!t)return;const s=(0,l.D7)()?.block?.padding??8;oe(t,e,0,0,s),ae(t,e,s),h.R.debug("getBlocks",JSON.stringify(t,null,2));const{minX:n,minY:i,maxX:r,maxY:o}=ce(t);return{x:n,y:i,width:r-n,height:o-i}}function he(e,t,s=!1){const n=e;let i="default";(n?.classes?.length||0)>0&&(i=(n?.classes??[]).join(" ")),i+=" flowchart-label";const r=(n?.classes??[]).flatMap(e=>t.getClasses().get(e)?.styles??[]);let o,a=0,h="rect";switch(n.type){case"round":a=5,h="rect";break;case"composite":a=0,h="composite",o=0;break;case"square":case"group":default:h="rect";break;case"diamond":h="question";break;case"hexagon":h="hexagon";break;case"block_arrow":h="block_arrow";break;case"odd":case"rect_left_inv_arrow":h="rect_left_inv_arrow";break;case"lean_right":h="lean_right";break;case"lean_left":h="lean_left";break;case"trapezoid":h="trapezoid";break;case"inv_trapezoid":h="inv_trapezoid";break;case"circle":h="circle";break;case"ellipse":h="ellipse";break;case"stadium":h="stadium";break;case"subroutine":h="subroutine";break;case"cylinder":h="cylinder";break;case"doublecircle":h="doublecircle"}const g=(0,c.sM)(n?.styles??[]),u=n.label,d=n.size??{width:0,height:0,x:0,y:0},y=t.getDiagramId();return{labelStyle:g.labelStyle,shape:h,label:u,labelText:u,rx:a,ry:a,class:i,cssClasses:i,cssStyles:n?.styles??[],cssCompiledStyles:r,style:g.style,id:n.id,domId:y?`${y}-${n.id}`:n.id,isGroup:!1,directions:n.directions,width:d.width||void 0,height:d.height||void 0,wrappingWidth:d.width||Number.POSITIVE_INFINITY,x:d.x,y:d.y,positioned:s,intersect:void 0,padding:o??(0,l.zj)()?.block?.padding??0,widthInColumns:n.widthInColumns??1,colorIndex:n.colorIndex,look:(0,l.zj)().look}}async function ge(e,t,s){const n=he(t,s,!1);if("group"===t.type)return;const i=(0,l.zj)(),r=await(0,o.on)(e,n,{config:i}),a=r.node()?.getBBox()??{width:0,height:0},c=s.getBlock(n.id);c.size={width:a.width,height:a.height,x:0,y:0,node:r},s.setBlock(c),r.remove()}async function ue(e,t,s){const n=he(t,s,!0);if("space"!==s.getBlock(n.id).type){const s=(0,l.zj)(),i=await(0,o.on)(e,n,{config:s});void 0!==n.colorIndex&&(0,a.XE)(i,n.colorIndex,s.theme,s.themeVariables?.borderColorArray),t.intersect=n?.intersect,(0,o.U_)(n)}}async function de(e,t,s,n){for(const i of t)await n(e,i,s),i.children&&await de(e,i.children,s,n)}async function ye(e,t,s){await de(e,t,s,ge)}async function pe(e,t,s){await de(e,t,s,ue)}async function be(e,t,s,n,i){const o=new b.T({multigraph:!0,compound:!0});o.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const e of s)e.size&&o.setNode(e.id,{width:e.size.width,height:e.size.height,intersect:e.intersect});for(const s of t)if(s.start&&s.end){const t=n.getBlock(s.start),a=n.getBlock(s.end);if(t?.size&&a?.size){const n=t.size,c=a.size,l=[{x:n.x,y:n.y},{x:n.x+(c.x-n.x)/2,y:n.y+(c.y-n.y)/2},{x:c.x,y:c.y}],h=i?`${i}-${s.id}`:s.id,g=`${"thick"===s.thickness?"edge-thickness-thick":"edge-thickness-normal"} ${"dotted"===s.pattern?"edge-pattern-dotted":"edge-pattern-solid"} flowchart-link LS-a1 LE-b1`;(0,r.Jo)(e,{...s,id:h,arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:l,classes:g},{},"block",o.node(s.start),o.node(s.end),i),s.label&&(await(0,r.jP)(e,{...s,label:s.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:s.arrowTypeEnd,arrowTypeStart:s.arrowTypeStart,points:l,classes:g}),(0,r.T_)({...s,x:l[1].x,y:l[1].y},{originalPath:l}))}}}(0,g.K)(oe,"setBlockSizes"),(0,g.K)(ae,"layoutBlocks"),(0,g.K)(ce,"findBounds"),(0,g.K)(le,"layout"),(0,g.K)(he,"getNodeFromBlock"),(0,g.K)(ge,"calculateBlockSize"),(0,g.K)(ue,"insertBlockPositioned"),(0,g.K)(de,"performOperations"),(0,g.K)(ye,"calculateBlockSizes"),(0,g.K)(pe,"insertBlocks"),(0,g.K)(be,"insertEdges");var fe=(0,g.K)(function(e,t){return t.db.getClasses()},"getClasses"),xe={parser:x,db:ee,renderer:{draw:(0,g.K)(async function(e,t,s,n){const{securityLevel:o,block:a}=(0,l.zj)(),c=n.db;let g;c.setDiagramId(t),"sandbox"===o&&(g=(0,p.Ltv)("#i"+t));const u="sandbox"===o?(0,p.Ltv)(g.nodes()[0].contentDocument.body):(0,p.Ltv)("body"),d="sandbox"===o?u.select(`[id="${t}"]`):(0,p.Ltv)(`[id="${t}"]`);(0,i.F)(d,(0,l.zj)());(0,r.g0)(d,["point","circle","cross"],n.type,t);const y=c.getBlocks(),b=c.getBlocksFlat(),f=c.getEdges(),x=d.insert("g").attr("class","block");await ye(x,y,c);const S=le(c);await pe(x,y,c),await be(x,f,b,c,t);const m=x.node()?.getBBox(),L=m&&Number.isFinite(m.width)&&Number.isFinite(m.height)?m:S;if(L){const e=Math.max(1,Math.round(L.width/L.height*.125)),t=L.height+e+10,s=L.width+10,{useMaxWidth:n}=a;(0,l.a$)(d,t,s,!!n),h.R.debug("Here Bounds",S,L),d.attr("viewBox",`${L.x-5} ${L.y-5} ${L.width+10} ${L.height+10}`)}},"draw"),getClasses:fe},styles:ne}},64918(e,t,s){s.d(t,{o:()=>n});var n=(0,s(86827).K)(()=>"\n /* Font Awesome icon styling - consolidated */\n .label-icon {\n display: inline-block;\n height: 1em;\n overflow: visible;\n vertical-align: -0.125em;\n }\n \n .node .label-icon path {\n fill: currentColor;\n stroke: revert;\n stroke-width: revert;\n }\n","getIconStyles")}}]);