report-QuUxcPRx.js 66 KB

1
  1. import{J as r,K as we,r as ee,o as l,N as n,a as e,O as W,Q as R,V as ce,W as L,X as q,Y as b,b as S,w as Z,Z as te,c as nt,$,a0 as Yt,a1 as U,v as B,d as ut,a2 as Ht,a3 as ue,H as dt,a4 as vt,a5 as Oe,a6 as Se,a7 as Qt,a8 as xe,a9 as Be,aa as fe,ab as jt,ac as Zt,ad as H,ae as it,af as Xt,ag as es,ah as ts,ai as rt,aj as ss,ak as as,al as os,am as ls,an as ns,ao as is}from"./vendor-BfKWghV4.js";import{_ as de}from"./index-bEeCHtmf.js";const rs="/assets/logoc-yCLvmkFc.png",cs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAyBJREFUWEftlkmojmEUx3//naRYmRVRZIiiDCVTRBky3UwLd8MGa4pcQ7F2bdiQTBnLEBaGUrhFkUth4ZZrXLkb7I733J7v9tzXO9zvpVh46u3re9/nnPN/znPO/3/EX16qGt/MZgP++Lon6V4VX78L4G4IOuc/gD+aATNbDewHVkpqrXK3NRszGwucA/ZIOp/2lVkDZvYGGAW8ANbEIMysPzAeGAdMDQ5bwt5WSV8ygvve15JG9xSAo74IjEkCnZfU4IZm1gxsKcnIYUlbw34/uWfzFbAqK5u5XRBS1+TBzWw5cAzoGwVv8/YL/70dh0ffOoBGSZcTPw5ib95VlrahmU0GHkfOr3l9SPK0dy0z8+vYmexdHL2eIulJUcZ6AuA9MDg4acgqpBQQT7mf2tcHSUMqAzAzP9G+4KD0NFHxxVnbJck7KnMV1cBA4GOwOippc0nxdftsZkeSDGwKLwdJ+pRlXwRgYdJmN4LRDEkP6wQwHXgQbBZJupkLIAhL13dnNTPbDhwA2iUNqyd4dBXvgKHADkkHs+J0ZsDMmpKf3TVDSTKzM05CwBlJ6yoCOJ1wwNqET85KWmtJoMiPM2NTEYCTwPqkv49LaqwIwLljI3BK0oYiADVd74wTrsDZ7FDioE3SiIoA3gaC2iapOfcKspyb2Vzgdvg2LU08ZYACMT0K++ZJulNvF7jofA5G1xJGW1IWNP6eMOjViBUHxCIV7ytkwpT4lLJgVP0xG3aJU10ZiJx9jUSolA1T2tEhqV9R5nqiBa6ElyInR0NndCMmM3Pi8YqvsZ+brABaJH3IA1EmxwckLQunuhKJkvtrB+4HxzMD4dTieMClyUT1HLjuhFZXEUZjlE8y8UASi1PeoTrFx8xcS04A84HvXpBZIH7JQCq4j2RefC+jmnDHk8IzMbx/Bjz1JxYdM5sF+PzQB/gBjExfR95MWBskuwVPtVkvSe7Uqby3pG85fOIgXIg8AzVe6dpaWAPxydPOQ6ZqI9ncounZr6NuOS4jnQDAr8jXhKrje2kb5gH5FwAsCCO3Y7wg6VZZ1ioxYRWn9dj8BApzYTC98kdgAAAAAElFTkSuQmCC",us="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABFNJREFUWEe1V12IVVUU/taeh6keegismEwmGCPP3ntyKMpRoUas6A+xKCoxKmkyLdLChwizP0KiVBSnsohoaKQ/kQiL0hSissCXu9eemPGlUIgiCqa3GWav7rqcO4zjnTlnxtuGy92c++1vfXud9XcJJVeWZQ8R0TYiOsTMG0seK4TRTAhr7UUAHgTwFBG1K1ZEBmKMawqZSwKmFeC9f0BEtgO4POd6C8B6AMuY+YeS/IWwhgK894+JiBrUVUkp3WmM+QXAMDN3FbLOAnCWAO/90yLyRs7Rp+/bWruJiHYCeI6ZX50FfyH0DAHe+60i8lJ+6kVmfkH31to9RPSEiPTGGN8pZJ0FYEJAZ2fnkpTSj3mgbY8xPlvncc59CuBuIlodQjg4C/5C6IQA59wHANY2inLn3NcAbgJwCzPrvmmrJsBau4KIjujeGLOkUqn8NNmCc24/gPs0JZm5v2nWAdQEOOc+q0b7XUQ0EEI4K8frMQBgCzO/3lQB3vuVIvJNTnozM9f3E3accxqM2wD0M7MWpqYtstZuIKK9InIkxriyEbO1NiOiCOAPZr60adb1FXjvd4rIJhF5P8b48HTkzrnvASxNKa0aHBz8vFkiyDn3BYDbieiVEMLWGQTUXoMGawihoafmIkoFDANYCGAdM783HYk2JiLS7OgQkUdjjO/OxeDUMypA8oc9zHxsJlLn3JMAdiuGiG4LIXx5riJUwCkA84no3hDCJ0WEzrmjAG5UHDPP2M6LuGoXcc5pa+0WkY0xxr6iQ1mWLTDG/DYJdzUzV4rOTfe7puHH1RS7pypmovkUkWVZttwY810ddy4xoQJ2ENHmqluPMXNPkfH6711dXW1jY2MfAViex8SR8fHx3WVStNpblqrHjTGntQ7cKiKHlMQYc0mlUvmzrIju7u7zR0ZGdhFR7yRv/AXgaDVIf9bCpR8iuiClNK9a8OYBUG8vVryI/FrvBSc1vQBsYOY3ywqo47z316SUeo0xd4hIW4nzmsKPpJTW1QVo79dJZ4iIukMI/5QgaQjJsuw6IlpmjFmQUro4v/WIiPwuIifUM0S0X0QujDFeURPgvb9KRHTm01U6GOci0lr7IRHpwLs5xrhr8kBS98L/JmLSbHlKRBbHGP8+o5A45w4AWJ3frLAyzsYDzrm1AHTq0iq6JoQwUNtPJXHOnQZwWf68KROQ914H2j258fUhhLfrdhuWUmvtcSK6Pk+VfcaYfSGEE7O5sWI7OjpaW1tbtxDRy7nxZ0IIOybzTFvLnXOPA5gozdX0UiGHR0dHvxoaGvp3JjGLFi1a2NLSsoaI7q8OuVfmxp8PIdSElBKgIGttT7WIvAbg2inntGsOikisNrHBlFK7MaadiNpERF/fCgDn5Wf6jTF9lUrleCPRpbpZHkA6LZUu1QAOiMjeGOO3M3mrlIA6gfd+VUrphrx9z8//uOq3VtLhanSfTCmdNMYMhxAOl4mZ/wA1oMF+HdM3kAAAAABJRU5ErkJggg==",ds="/assets/avter-DUp3luTf.png",ct="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1735280866862'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='17804'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='32'%20height='32'%3e%3cpath%20d='M474%20152m8%200l60%200q8%200%208%208l0%20704q0%208-8%208l-60%200q-8%200-8-8l0-704q0-8%208-8Z'%20fill='%2381bdfe'%20p-id='17805'%3e%3c/path%3e%3cpath%20d='M168%20474m8%200l672%200q8%200%208%208l0%2060q0%208-8%208l-672%200q-8%200-8-8l0-60q0-8%208-8Z'%20fill='%2381bdfe'%20p-id='17806'%3e%3c/path%3e%3c/svg%3e",vs="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1735280492544'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='4326'%20width='32'%20height='32'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M442.514286%2073.142857c82.529524%2064.24381%20140.239238%20126.610286%20173.129143%20187.099429%2031.158857%2057.295238%2043.666286%20115.907048%2037.546666%20175.835428l-1.219047%209.996191%206.095238-4.973715a174.055619%20174.055619%200%200%200%2049.249524-69.607619l2.681904-7.411809%207.704381-23.04c82.285714%2055.734857%20123.440762%20150.064762%20123.440762%20283.062857C841.142857%20823.515429%20665.795048%20950.857143%20521.654857%20950.857143c-144.11581%200-308.224-85.333333-334.750476-263.875048-26.550857-178.541714%2083.480381-261.90019%20158.427429-378.197333C395.288381%20231.253333%20427.690667%20152.697905%20442.514286%2073.142857z%20m33.718857%20154.575238c-17.554286%2041.447619-39.424%2082.407619-65.536%20122.904381l-8.313905%2012.653714c-8.411429%2012.507429-17.310476%2024.941714-28.818286%2040.374858l-40.96%2054.467047c-63.634286%2086.869333-80.944762%20136.021333-68.851809%20217.526857%2017.92%20120.441905%20128.341333%20197.778286%20257.901714%20197.778286%20120.905143%200%20241.785905-110.933333%20241.785905-249.344%200-61.976381-9.825524-111.323429-29.110857-149.699048-8.240762%209.411048-17.237333%2018.285714-26.965334%2026.59962l-159.085714%20130.023619%2026.697143-195.364572c6.41219-46.811429-2.462476-92.208762-27.648-138.483809-13.214476-24.30781-31.98781-49.737143-56.368762-76.166096l-8.338286-8.850285-6.387809%2015.579428z'%20p-id='4327'%20fill='%23ff4d4f'%3e%3c/path%3e%3c/svg%3e",ps="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1735287774232'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1465'%20width='16'%20height='16'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M563.8%20512l262.5-312.9c4.4-5.2%200.7-13.1-6.1-13.1h-79.8c-4.7%200-9.2%202.1-12.3%205.7L511.6%20449.8%20295.1%20191.7c-3-3.6-7.5-5.7-12.3-5.7H203c-6.8%200-10.5%207.9-6.1%2013.1L459.4%20512%20196.9%20824.9c-4.4%205.2-0.7%2013.1%206.1%2013.1h79.8c4.7%200%209.2-2.1%2012.3-5.7l216.5-258.1%20216.5%20258.1c3%203.6%207.5%205.7%2012.3%205.7h79.8c6.8%200%2010.5-7.9%206.1-13.1L563.8%20512z'%20p-id='1466'%3e%3c/path%3e%3c/svg%3e",gs="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1735280690063'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='8850'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='32'%20height='32'%3e%3cpath%20d='M1022.955204%20556.24776c0%20100.19191-81.516572%20181.698249-181.718715%20181.698249l-185.637977%200c-11.2973%200-20.466124-9.168824-20.466124-20.466124%200-11.307533%209.168824-20.466124%2020.466124-20.466124l185.637977%200c77.628008%200%20140.786467-63.148226%20140.786467-140.766001%200-77.423347-62.841234-140.448776-140.203182-140.766001-0.419556%200.030699-0.828878%200.051165-1.248434%200.061398-5.935176%200.153496-11.665691-2.302439-15.666818-6.702656-4.001127-4.41045-5.884011-10.345626-5.157463-16.250102%201.330298-10.806113%201.944282-19.760043%201.944282-28.192086%200-60.763922-23.658839-117.874641-66.617234-160.833035-42.968627-42.958394-100.089579-66.617234-160.843268-66.617234-47.368844%200-92.742241%2014.449084-131.208321%2041.781592-37.616736%2026.738991-65.952084%2063.700811-81.925894%20106.884332-2.425236%206.54916-8.012488%2011.399631-14.827707%2012.893658-6.815219%201.483794-13.927197-0.603751-18.859533-5.536087-19.289322-19.340487-44.943608-29.982872-72.245418-29.982872-56.322773%200-102.146425%2045.813419-102.146425%20102.125959%200%200.317225%200.040932%200.982374%200.092098%201.627057%200.061398%200.920976%200.122797%201.831718%200.153496%202.762927%200.337691%209.465582-5.863545%2017.928325-15.001669%2020.455891-32.356942%208.943696-61.541635%2028.550243-82.181721%2055.217602-21.305235%2027.516704-32.571836%2060.508096-32.571836%2095.41307%200%2086.244246%2070.188572%20156.422585%20156.443052%20156.422585l169.981393%200c11.2973%200%2020.466124%209.15859%2020.466124%2020.466124%200%2011.2973-9.168824%2020.466124-20.466124%2020.466124l-169.981393%200c-108.828614%200-197.3753-88.536452-197.3753-197.354833%200-44.053332%2014.223956-85.712127%2041.126676-120.473839%2022.809495-29.450752%2053.897537-52.086285%2088.710414-64.816215%205.065366-74.322729%2067.149353-133.2447%20142.751215-133.2447%2028.386514%200%2055.504128%208.217149%2078.651314%2023.52581%2019.657712-39.868009%2048.842405-74.169233%2085.497233-100.212376%2045.434795-32.295544%2099.004875-49.354058%20154.918325-49.354058%2071.692832%200%20139.087778%2027.915793%20189.782368%2078.600149%2050.694589%2050.694589%2078.610382%20118.089535%2078.610382%20189.782368%200%203.704368-0.102331%207.470135-0.296759%2011.368932C952.633602%20386.245901%201022.955204%20463.188294%201022.955204%20556.24776z'%20p-id='8851'%3e%3c/path%3e%3cpath%20d='M629.258611%20589.106122c-3.990894%203.990894-9.230222%205.996574-14.46955%205.996574s-10.478655-2.00568-14.46955-5.996574l-67.087954-67.077721%200%20358.689289c0%2011.307533-9.15859%2020.466124-20.466124%2020.466124-11.307533%200-20.466124-9.15859-20.466124-20.466124l0-358.689289-67.087954%2067.077721c-7.992021%207.992021-20.947078%207.992021-28.939099%200s-7.992021-20.957311%200-28.949332l102.023628-102.013395c7.992021-7.992021%2020.947078-7.992021%2028.939099%200l102.023628%20102.013395C637.250632%20568.148811%20637.250632%20581.114101%20629.258611%20589.106122z'%20p-id='8852'%3e%3c/path%3e%3c/svg%3e",hs="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1735280632344'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='7700'%20width='32'%20height='32'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M924.672%20126.976q36.864%2036.864%2054.784%2082.432t17.92%2093.696-17.92%2093.696-54.784%2082.432l-392.192%20389.12q-36.864%2036.864-90.624%2061.44t-113.664%2028.672-122.368-16.384-115.712-73.728q-52.224-52.224-72.704-113.152t-16.384-121.344%2028.16-113.664%2060.928-90.112l348.16-345.088q9.216-9.216%2027.136-4.608t27.136%2013.824q8.192%209.216%2013.312%2027.136t-4.096%2027.136l-347.136%20344.064q-27.648%2027.648-46.08%2064.512t-21.504%2078.848%2012.288%2084.992%2055.296%2082.944q35.84%2035.84%2079.36%2050.688t86.528%2012.288%2081.92-18.944%2066.56-44.032l391.168-388.096q27.648-27.648%2039.424-57.344t11.264-58.88-13.824-56.832-36.864-51.2q-44.032-43.008-98.816-40.448t-110.08%2057.856l-353.28%20351.232q-23.552%2023.552-23.04%2052.224t18.944%2047.104q22.528%2022.528%2051.712%2018.432t47.616-22.528l320.512-318.464q9.216-9.216%2027.136-4.608t27.136%2013.824%2014.336%2027.136-4.096%2027.136l-321.536%20318.464q-36.864%2036.864-70.656%2051.2t-63.488%2012.8-55.296-15.872-47.104-34.816q-17.408-16.384-31.232-41.984t-15.872-56.32%2010.752-65.536%2049.664-70.656q18.432-18.432%2032.768-33.792%2012.288-13.312%2023.04-23.552t11.776-11.264l285.696-284.672q36.864-36.864%2080.384-57.856t88.576-24.064%2088.576%2012.288%2080.384%2052.224z'%20p-id='7701'%20fill='%231e1e1e'%3e%3c/path%3e%3c/svg%3e",ms="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1735280808939'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='15804'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='32'%20height='32'%3e%3cpath%20d='M873.8816%20150.1184C973.9264%20250.2656%201024%20370.8928%201024%20512c0%20141.2096-50.0736%20261.8368-150.1184%20361.8816C773.7344%20973.9264%20653.1072%201024%20512%201024c-141.1072%200-261.7344-50.0736-361.8816-150.1184C50.0736%20773.8368%200%20653.2096%200%20512c0-141.1072%2050.0736-261.7344%20150.1184-361.8816C250.2656%2050.0736%20370.8928%200%20512%200%20653.1072%200%20773.7344%2050.0736%20873.8816%20150.1184zM819.712%20526.7456%20507.0848%20211.6608%20192%20526.7456l56.6272%2054.1696%20219.0336-219.0336%200%20477.4912%2078.7456%200L546.4064%20361.8816l219.0336%20219.0336L819.712%20526.7456z'%20p-id='15805'%20fill='%234096ff'%3e%3c/path%3e%3c/svg%3e",fs="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1735295375625'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='3239'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='16'%20height='16'%3e%3cpath%20d='M659.748571%20245.272381l-51.687619-51.687619-318.439619%20318.585905%20318.415238%20318.268952%2051.712-51.736381-266.703238-266.556952z'%20p-id='3240'%3e%3c/path%3e%3c/svg%3e",ws="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1735295357873'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='2254'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='16'%20height='16'%3e%3cpath%20d='M605.086476%20512.146286L338.358857%20245.272381l51.760762-51.687619%20318.415238%20318.585905L390.095238%20830.415238l-51.687619-51.736381z'%20p-id='2255'%3e%3c/path%3e%3c/svg%3e",ys="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1735287324782'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='1522'%20width='32'%20height='32'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3cpath%20d='M616.746667%2085.333333L896%20347.904V853.333333a85.333333%2085.333333%200%200%201-85.333333%2085.333334H213.333333a85.333333%2085.333333%200%200%201-85.333333-85.333334V170.666667a85.333333%2085.333333%200%200%201%2085.333333-85.333334h403.413334z%20m244.352%20295.381334L581.802667%20118.186667v177.237333a85.333333%2085.333333%200%200%200%2085.333333%2085.333333h193.962667z%20m-107.264%2076.373333h-49.152l-79.488%20227.157333-109.354667-227.114666h-13.226667l-110.506666%20226.688-77.824-226.688H265.130667l113.749333%20328.192h13.226667l117.12-239.36%20114.858666%20239.36h13.781334l115.968-328.192z'%20fill='%235197e8'%20p-id='1523'%3e%3c/path%3e%3c/svg%3e",_s="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1735378230313'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='3218'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='16'%20height='16'%3e%3cpath%20d='M784%20371.2c-16-25.6-35.2-44.8-44.8-54.4-9.6-9.6-28.8-9.6-38.4%203.2-9.6%209.6-9.6%2028.8%203.2%2038.4%203.2%203.2%206.4%206.4%209.6%209.6%209.6%209.6%2019.2%2022.4%2025.6%2035.2%2057.6%2086.4%2057.6%20179.2-38.4%20278.4-9.6%209.6-9.6%2028.8%200%2038.4%209.6%209.6%2028.8%209.6%2038.4%200C851.2%20598.4%20851.2%20476.8%20784%20371.2z'%20p-id='3219'%3e%3c/path%3e%3cpath%20d='M896%20246.4c-16-25.6-35.2-48-54.4-70.4-9.6-12.8-19.2-19.2-25.6-25.6-9.6-9.6-28.8-9.6-38.4%203.2-9.6%209.6-9.6%2028.8%203.2%2038.4%203.2%203.2%2012.8%209.6%2022.4%2022.4%2016%2019.2%2032%2038.4%2048%2064%20105.6%20160%20105.6%20336-70.4%20518.4-9.6%209.6-9.6%2028.8%200%2038.4%209.6%209.6%2028.8%209.6%2038.4%200C1014.4%20630.4%201014.4%20425.6%20896%20246.4z'%20p-id='3220'%3e%3c/path%3e%3cpath%20d='M483.2%2086.4l-217.6%20185.6-108.8%200c-57.6%200-108.8%2048-108.8%20108.8l0%20272c0%2060.8%2048%20108.8%20108.8%20108.8l96%200%20230.4%20182.4c54.4%2041.6%20105.6%2016%20105.6-51.2l0-755.2C588.8%2067.2%20534.4%2041.6%20483.2%2086.4zM534.4%20889.6c0%2022.4-3.2%2022.4-19.2%209.6l-236.8-185.6c-3.2-3.2-9.6-6.4-16-6.4l-105.6%200c-28.8%200-54.4-25.6-54.4-54.4l0-272c0-28.8%2025.6-54.4%2054.4-54.4l118.4%200c6.4%200%2012.8-3.2%2016-6.4l224-192c16-12.8%2016-12.8%2016%206.4L531.2%20889.6z'%20p-id='3221'%3e%3c/path%3e%3c/svg%3e",ks="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAUVJREFUOE+l0z8snlEUBvCfxSZhwSpYxGCUGJAYLaSxaDcWg4EYJBKaSAxNDR0sLFIWEV2MTTA0MRrEUq0VSyUWMbknuW/y+vJ9n+JON+fPc57znHMa1H6dmMvudfypFtpQB+AALdn/D+MvAaxgGo+4Qx+Gc9IRztCMRmwme8QrMzjHPm7Rij1cZICe9J8o+T6k2N5KgCt8SckbJapN+X9fss1gAR21GAS1IYxUiPgz2Y8z9WcMQu2oPIZuXGILYd/NlSfzFKbQhd/4EUxCg6g4mPT4nCuE8teI0S1mgLXMph0xkVHMJ5FPygBfcYjo+wazmUlgROVvaEuJoUe0uFwAVGthFQM4zQz68QtL1VooBC7GWIj4MfX9KTu/p8SdWiIWADHG7WJBsrG8iUVc3THG4vzFw1sW6d2rXHkrrz6mSoD/Oucnp3ZSV0/fYroAAAAASUVORK5CYII=",Re="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1736386332100'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='3350'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='16'%20height='16'%3e%3cpath%20d='M923.04%20689.226667L515.786667%20281.973333a5.333333%205.333333%200%200%200-7.573334%200l-407.253333%20407.253334a5.333333%205.333333%200%200%200%200%207.573333l45.226667%2045.226667a5.333333%205.333333%200%200%200%207.573333%200l354.453333-354.453334a5.333333%205.333333%200%200%201%207.573334%200l354.453333%20354.453334a5.333333%205.333333%200%200%200%207.573333%200l45.226667-45.226667a5.333333%205.333333%200%200%200%200-7.573333z'%20p-id='3351'%3e%3c/path%3e%3c/svg%3e",qe="data:image/svg+xml,%3c?xml%20version='1.0'%20standalone='no'?%3e%3c!DOCTYPE%20svg%20PUBLIC%20'-//W3C//DTD%20SVG%201.1//EN'%20'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'%3e%3csvg%20t='1736386047967'%20class='icon'%20viewBox='0%200%201024%201024'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20p-id='2366'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20width='16'%20height='16'%3e%3cpath%20d='M545.322667%20615.808L248.021333%20329.258667a33.706667%2033.706667%200%200%200-46.421333%200c-12.8%2012.373333-12.8%2032.384%200%2044.714666L544%20704l342.4-330.026667c12.8-12.373333%2012.8-32.341333%200-44.714666a33.706667%2033.706667%200%200%200-46.421333%200l-294.656%20286.549333z'%20fill='%23000000'%20p-id='2367'%3e%3c/path%3e%3c/svg%3e",As={class:"model-config"},bs=["src"],Cs={class:"config-panel"},Ss={class:"model-list"},xs={class:"model-header"},Ds={class:"model-title"},Is={class:"model-form"},Ms={class:"form-item"},Ts={class:"form-item"},Es={key:0,class:"form-item"},$s={class:"form-item"},Us={class:"form-item"},zs={class:"action-buttons"},Ps={__name:"index",setup(m){const d=[{label:"主流模型",options:[{label:"ChatGPT",value:"chatgpt",endpoint:"https://api.openai.com/v1"},{label:"Claude",value:"claude",endpoint:"https://api.anthropic.com"},{label:"GPT-4",value:"gpt4",endpoint:"https://api.openai.com/v1"}]},{label:"开源模型",options:[{label:"DeepSeek",value:"deepseek",endpoint:"https://api.deepseek.com/v1"},{label:"Ollama",value:"ollama",endpoint:"http://localhost:11434"},{label:"ChatGLM",value:"chatglm",endpoint:"https://api.zhipuai.cn/v1"}]},{label:"国内模型",options:[{label:"阿里通义千问",value:"qianwen",endpoint:"https://dashscope.aliyuncs.com/api/v1"},{label:"百度文心一言",value:"wenxin",endpoint:"https://aip.baidubce.com/rpc/2.0/ai_custom/v1"},{label:"讯飞星火",value:"spark",endpoint:"https://spark-api.xf-yun.com/v1"}]},{label:"其他",options:[{label:"自定义模型",value:"custom",endpoint:""}]}],g=r(!1),k=r(!1),p=r(!1),y=r([{type:"",key:"",endpoint:"",name:""}]),o=r([]),f=async()=>{p.value=!0;try{const u=(await U.get("https://aiapi.raycos.com.cn/api/models")).data;if(console.log(u),u.code===2e3){const _=u.data.models.map(x=>({label:x.name,value:x.type,description:x.description||""}));o.value=[{label:"API模型",options:_},...d]}}catch(c){console.error("获取模型列表失败:",c),B.error("获取模型列表失败")}finally{p.value=!1}},F=c=>({chatgpt:"请输入 OpenAI API Key",gpt4:"请输入 OpenAI API Key",claude:"请输入 Anthropic API Key",deepseek:"请输入 DeepSeek API Key",qianwen:"请输入阿里云 API Key",wenxin:"请输入百度 API Key",spark:"请输入讯飞 API Key",chatglm:"请输入智谱 API Key",ollama:"可选:请输入访问密钥",custom:"请输入 API Key"})[c]||"请输入 API Key",J=(c,u)=>{const _=y.value[u],x=o.value.flatMap(N=>N.options).find(N=>N.value===c);x&&(_.endpoint=x.endpoint,_.name=x.label)},I=()=>{g.value=!g.value},C=()=>{y.value.push({type:"",key:"",endpoint:"",name:""})},w=c=>{if(y.value.length===1){B.warning("至少保留一个模型配置");return}y.value.splice(c,1)},z=c=>!(!c.type||!c.key||c.type==="ollama"&&!c.endpoint||c.type==="custom"&&(!c.name||!c.endpoint)),T=async()=>{if(y.value.some(u=>!z(u))){B.error("请填写完整的模型信息");return}k.value=!0;try{localStorage.setItem("modelConfig",JSON.stringify(y.value)),B.success("配置保存成功")}catch{B.error("配置保存失败")}finally{k.value=!1}},h=()=>{const c=localStorage.getItem("modelConfig");c&&(y.value=JSON.parse(c))};return we(async()=>{h(),await f()}),(c,u)=>{const _=ee("a-button"),x=ee("a-select-option"),N=ee("a-select-opt-group"),oe=ee("a-select"),De=ee("a-input-password"),ve=ee("a-input");return l(),n("div",As,[e("div",{class:"config-header",onClick:I},[u[0]||(u[0]=e("img",{src:ks,alt:"setting",class:"config-icon"},null,-1)),u[1]||(u[1]=e("span",null,"模型配置",-1)),e("img",{src:g.value?W(Re):W(qe),alt:"toggle",class:"toggle-icon"},null,8,bs)]),R(e("div",Cs,[e("div",Ss,[(l(!0),n(L,null,q(y.value,(P,Q)=>(l(),n("div",{key:Q,class:"model-item"},[e("div",xs,[e("span",Ds,"模型 "+b(Q+1),1),S(_,{type:"link",danger:"",size:"small",onClick:D=>w(Q)},{default:Z(()=>u[2]||(u[2]=[te("删除")])),_:2},1032,["onClick"])]),e("div",Is,[e("div",Ms,[u[3]||(u[3]=e("label",null,"选择模型",-1)),S(oe,{style:{width:"200px"},value:P.type,"onUpdate:value":D=>P.type=D,placeholder:"请选择模型",onChange:D=>J(D,Q)},{default:Z(()=>[(l(!0),n(L,null,q(o.value,D=>(l(),nt(N,{key:D.label,label:D.label},{default:Z(()=>[(l(!0),n(L,null,q(D.options,le=>(l(),nt(x,{key:le.value,value:le.value},{default:Z(()=>[te(b(le.label),1)]),_:2},1032,["value"]))),128))]),_:2},1032,["label"]))),128))]),_:2},1032,["value","onUpdate:value","onChange"])]),P.type?(l(),n(L,{key:0},[e("div",Ts,[u[4]||(u[4]=e("label",null,"API Key",-1)),S(De,{value:P.key,"onUpdate:value":D=>P.key=D,placeholder:F(P.type)},null,8,["value","onUpdate:value","placeholder"])]),P.type==="ollama"?(l(),n("div",Es,[u[5]||(u[5]=e("label",null,"服务器地址",-1)),S(ve,{value:P.endpoint,"onUpdate:value":D=>P.endpoint=D,placeholder:"例如: http://localhost:11434"},null,8,["value","onUpdate:value"])])):$("",!0),P.type==="custom"?(l(),n(L,{key:1},[e("div",$s,[u[6]||(u[6]=e("label",null,"模型名称",-1)),S(ve,{value:P.name,"onUpdate:value":D=>P.name=D,placeholder:"请输入自定义模型名称"},null,8,["value","onUpdate:value"])]),e("div",Us,[u[7]||(u[7]=e("label",null,"服务器地址",-1)),S(ve,{value:P.endpoint,"onUpdate:value":D=>P.endpoint=D,placeholder:"请输入API地址"},null,8,["value","onUpdate:value"])])],64)):$("",!0)],64)):$("",!0)])]))),128))]),S(_,{type:"dashed",block:"",class:"add-model-btn",onClick:C},{default:Z(()=>[S(W(Yt)),u[8]||(u[8]=te(" 添加模型 "))]),_:1}),e("div",zs,[S(_,{type:"primary",loading:k.value,onClick:T},{default:Z(()=>u[9]||(u[9]=[te(" 保存配置 ")])),_:1},8,["loading"])])],512),[[ce,g.value]])])}}},Ls=de(Ps,[["__scopeId","data-v-e8e9ff38"]]),Gs=ut({name:"SearchResults",components:{FileSearchOutlined:Ht},props:{searchResults:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},total:{type:Number,default:0},message:{type:String,default:""},enableWebSearch:{type:Boolean,default:!0}},emits:["update:total","update:enableWebSearch"],setup(m,{emit:d}){const g=r([]),k=r(!1),p=r(""),y=r(!1),o=r(m.total),f=r(m.enableWebSearch);ue(()=>m.total,w=>{o.value=w}),ue(()=>m.searchResults,w=>{g.value=w,k.value=g.value.length<m.total},{immediate:!0}),ue(()=>m.message,w=>{w&&m.enableWebSearch&&(p.value=w)}),ue(()=>m.enableWebSearch,w=>{f.value=w,w||I()});const F=w=>dt(w).format("YYYY-MM-DD"),J=async()=>{if(!(!p.value.trim()||y.value||!m.enableWebSearch)){y.value=!0;try{const w=await U.post("https://aiapi.raycos.com.cn/api/web-search-results/",{query:p.value,num_results:20,page:1,page_size:20,engine:"bing"});console.log("API Response:",w.data),w.data&&w.data.code===200&&(g.value=w.data.data.result||[],console.log("Total Results:",w.data.data.total),o.value=w.data.data.total||0,d("update:total",w.data.data.total||0))}catch(w){console.error("Web search failed:",w),g.value=[],o.value=0,d("update:total",0)}finally{y.value=!1}}},I=()=>{p.value="",g.value=[],o.value=0,d("update:total",0)},C=()=>{f.value=!f.value,d("update:enableWebSearch",f.value)};return{displayResults:g,loading:m.loading,total:o,hasMore:k,formatDate:F,searchQuery:p,isSearching:y,handleSearch:J,clearSearch:I,isSearchEnabled:f,toggleSearch:C}}}),Vs={class:"search-results"},Ws={key:0,class:"results-list"},Bs={class:"result-title"},Os=["href"],Rs={class:"result-url"},qs={class:"result-snippet"},Js={class:"result-meta"},Ns={class:"result-date"},Ks={class:"result-source"},Fs={key:0,class:"loading-more",ref:"loadingTrigger"},Ys={key:0,class:"loading-spinner"},Hs={key:1},Qs={key:1,class:"no-results"};function js(m,d,g,k,p,y){return l(),n("div",Vs,[e("div",{class:"results-container",ref:"resultsContainer",onScroll:d[0]||(d[0]=(...o)=>m.handleScroll&&m.handleScroll(...o))},[m.displayResults.length>0?(l(),n("div",Ws,[(l(!0),n(L,null,q(m.displayResults,(o,f)=>(l(),n("div",{key:f,class:"result-item"},[e("h3",Bs,[e("a",{href:o.link,target:"_blank",rel:"noopener noreferrer"},b(o.title),9,Os)]),e("p",Rs,b(o.link),1),e("p",qs,b(o.snippet),1),e("div",Js,[e("span",Ns,b(m.formatDate(o.date)),1),e("span",Ks,b(o.source),1)])]))),128)),m.hasMore?(l(),n("div",Fs,[m.loading?(l(),n("div",Ys)):(l(),n("span",Hs,"Loading more results..."))],512)):$("",!0)])):(l(),n("div",Qs))],544)])}const Zs=de(Gs,[["render",js],["__scopeId","data-v-23d582dd"]]),Xs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAVZJREFUOE+l079Ll1EUBvDP/b73G9HeIISDUxiOtQTiEGFOCipE0BiELQ0KgoOgk/Rjk5zdGnL2L2hyMRIHocEpaGgsvfrq1feFF339Wni3e885z3mec58T3PCEXvWRJSwkrsy7MhB5h6cYqgEiH/EnMV83bgUoWA086vDymO9NBpEVPEsMZZBLAJHPGEhMYD9SZoBb3D9gNxdFFjGXuBMKpgJTjVnk4if4XSWfART8CNxO9FXv2yUrIXcoma4BjviCo/peM6iKPmTWibeRkVMyy2cAvaZ8IX4vsl/l343s/C9A1l837I9stUnYOP371Cahy0zJTGKw4EXgdejyqjwfWn0G07m+X80hVnlrGE1sFnzqsHvpGwvWAo8Lxv+yV1Puso6vh6x2eYPZQx72MtJwh+kWI2UPTHZ4fsC366w8igcNK2dp7xNj+NnqxOZy3WiZ/nXLTwAE1GVpm7M6FwAAAABJRU5ErkJggg==",ea={class:"voice-config"},ta=["src"],sa={class:"config-panel"},aa={class:"config-item"},oa={class:"voice-select-container"},la=["value"],na={class:"config-item"},ia={class:"slider-container"},ra={class:"slider-value"},ca={class:"config-item",style:{display:"flex","justify-content":"space-around"}},ua=["disabled"],da=["disabled"],va={__name:"index",setup(m){const d=vt(),g=r(!1),k=r([]),p=Oe({role:"",speed:1,language:"zh"}),y=r(!1),o=r(!1),f=r(null),F=async()=>{try{const c=(await U.get("https://aiapi.raycos.com.cn/chatbot/current_voice_config")).data.data;if(console.log("Current config:",c),c&&c.voice_name&&k.value.length>0){const u=k.value.find(_=>_.name===c.voice_name);console.log("Matched voice:",u),u&&(p.role=u.id,p.speed=c.speed||1,p.language=u.language,w())}}catch(h){console.error("获取当前语音配置失败:",h)}},J=async()=>{try{const c=(await U.get("https://aiapi.raycos.com.cn/chatbot/list_voices")).data.data.voices;k.value=Object.values(c).flat(),console.log("Voice list:",k.value),await F()}catch(h){console.error("获取语音列表失败:",h)}},I=h=>({"zh-cn":"中文","en-us":"英文","ja-jp":"日语","ko-kr":"韩语"})[h]||h;we(()=>{J()});const C=()=>{g.value=!g.value},w=()=>{d.commit("updateVoiceConfig",{...p})},z=async()=>{if(p.role){y.value=!0;try{const h=new FormData;h.append("voice_id",p.role),await U.post("https://aiapi.raycos.com.cn/switch_voice_config",h,{headers:{"Content-Type":"multipart/form-data"}})}catch(h){console.error("切换语音失败:",h),alert("语音切换失败")}finally{y.value=!1}}},T=async()=>{if(!(!p.role||o.value))try{o.value=!0;const c=(await U.get(`https://aiapi.raycos.com.cn/get_voice_preview?voice_id=${p.role}`)).data;if(c.code!==200)throw new Error(c.msg||"获取音频失败");f.value&&(f.value.pause(),f.value=null);let u;if(c.audio&&c.audio.startsWith("data:audio"))u=new Audio(c.audio);else if(c.audio_url){const x=c.audio_url.startsWith("http")?c.audio_url:`https://aiapi.raycos.com.cn${c.audio_url}`;u=new Audio(x)}else throw new Error("无效的音频数据");f.value=u,u.onended=()=>{o.value=!1,f.value=null},u.onerror=_=>{console.error("音频播放失败:",_),o.value=!1,f.value=null,alert("试听失败")},u.oncanplaythrough=async()=>{try{await u.play()}catch(_){console.error("播放音频失败:",_),o.value=!1,f.value=null,alert("播放失败")}}}catch(h){console.error("试听失败:",h),o.value=!1,alert(h.message||"试听失败")}};return Se(()=>{f.value&&(f.value.pause(),f.value=null)}),(h,c)=>(l(),n("div",ea,[e("div",{class:"config-header",onClick:C},[c[2]||(c[2]=e("img",{src:Xs,alt:"voice",class:"config-icon"},null,-1)),c[3]||(c[3]=e("span",null,"语音配置",-1)),e("img",{src:g.value?W(Re):W(qe),alt:"toggle",class:"toggle-icon"},null,8,ta)]),R(e("div",sa,[e("div",aa,[c[4]||(c[4]=e("label",null,"语音角色",-1)),e("div",oa,[R(e("select",{"onUpdate:modelValue":c[0]||(c[0]=u=>p.role=u),onChange:w},[(l(!0),n(L,null,q(k.value,u=>(l(),n("option",{key:u.id,value:u.id},b(u.name+"_"+u.gender)+" ("+b(I(u.language))+") ",9,la))),128))],544),[[Qt,p.role]])])]),e("div",na,[c[5]||(c[5]=e("label",null,"语速",-1)),e("div",ia,[R(e("input",{type:"range","onUpdate:modelValue":c[1]||(c[1]=u=>p.speed=u),min:"0.5",max:"2",step:"0.1",onChange:w},null,544),[[xe,p.speed]]),e("span",ra,b(p.speed)+"x",1)])]),e("div",ca,[e("button",{class:"preview-button",onClick:T,disabled:o.value},b(o.value?"播放中...":"试听"),9,ua),e("button",{class:"switch-button",onClick:z,disabled:y.value},b(y.value?"切换中...":"切换语音"),9,da)])],512),[[ce,g.value]])]))}},pa=de(va,[["__scopeId","data-v-8bc2e758"]]),ga="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='64%2064%20896%20896'%20width='16'%20height='16'%20fill='currentColor'%3e%3cpath%20d='M832%2064H192c-17.7%200-32%2014.3-32%2032v832c0%2017.7%2014.3%2032%2032%2032h640c17.7%200%2032-14.3%2032-32V96c0-17.7-14.3-32-32-32zm-260%2072h96v209.9L621.5%20312%20572%20347.4V136zm220%20752H232V136h280v296.9c0%203.3%201%206.6%203%209.3a15.9%2015.9%200%200%200%2022.3%203.7l83.8-59.9%2081.4%2059.4c2.7%202%206%203.1%209.3%203.1%208.8%200%2016-7.2%2016-16V136h64v752z'/%3e%3c/svg%3e",ha={class:"knowledge-config"},ma=["src"],fa={class:"config-panel"},wa={class:"knowledge-list"},ya={class:"group-header"},_a={class:"checkbox-list"},ka={class:"item-desc"},Aa={class:"action-buttons"},ba={__name:"index",setup(m){const d=r([]),g=r(!1),k=r(!1),p=Oe({product:[],tech:[],industry:[]}),y=()=>{g.value=!g.value},o=async()=>{k.value=!0;try{localStorage.setItem("knowledgeConfig",JSON.stringify(p)),B.success("知识库配置保存成功")}catch{B.error("知识库配置保存失败")}finally{k.value=!1}},f=()=>{const I=localStorage.getItem("knowledgeConfig");if(I){const C=JSON.parse(I);Object.keys(C).forEach(w=>{p[w]=C[w]})}},F=async I=>{try{const C=new URLSearchParams;return C.append("page",1),C.append("kb_id",I),C.append("pageSize",9999),(await U.post("https://aiapi.raycos.com.cn/docType/selectTypeList",C,{headers:{"Content-Type":"application/x-www-form-urlencoded",Authorization:`JWT ${localStorage.getItem("token")}`}})).data.data||[]}catch(C){return console.error("获取知识库子项失败:",C),[]}},J=async()=>{try{const C=await U.post("https://aiapi.raycos.com.cn/kbm/selectBucketInfo",{user_id:2},{headers:{Authorization:`JWT ${localStorage.getItem("token")}`}}),w=await Promise.all(C.data.data.map(async z=>{const T=await F(z.id);return console.log(T),{label:z.name,key:z.id,items:T.map(h=>({label:h.name,value:h.id}))}}));d.value=w,d.value.forEach(z=>{p[z.key]||(p[z.key]=[])})}catch(I){B.error("获取知识库信息失败"),console.error("获取知识库信息失败:",I)}};return we(async()=>{await J(),f()}),(I,C)=>{const w=ee("a-checkbox"),z=ee("a-checkbox-group"),T=ee("a-button");return l(),n("div",ha,[e("div",{class:"config-header",onClick:y},[C[0]||(C[0]=e("img",{src:ga,alt:"knowledge",class:"config-icon"},null,-1)),C[1]||(C[1]=e("span",null,"知识库配置",-1)),e("img",{src:g.value?W(Re):W(qe),alt:"toggle",class:"toggle-icon"},null,8,ma)]),R(e("div",fa,[e("div",wa,[(l(!0),n(L,null,q(d.value,h=>(l(),n("div",{class:"knowledge-group",key:h.label},[e("div",ya,b(h.label),1),e("div",_a,[S(z,{value:p[h.key],"onUpdate:value":c=>p[h.key]=c},{default:Z(()=>[(l(!0),n(L,null,q(h.items,c=>(l(),n("div",{key:c.value,class:"checkbox-item"},[S(w,{value:c.value},{default:Z(()=>[te(b(c.label)+" ",1),e("span",ka,b(c.description),1)]),_:2},1032,["value"])]))),128))]),_:2},1032,["value","onUpdate:value"])])]))),128))]),e("div",Aa,[S(T,{type:"primary",loading:k.value,onClick:o},{default:Z(()=>C[2]||(C[2]=[te(" 保存配置 ")])),_:1},8,["loading"])])],512),[[ce,g.value]])])}}},Ca=de(ba,[["__scopeId","data-v-6b9363c0"]]),Sa=ut({name:"KnowledgeResults",props:{searchResults:{type:Array,default:()=>[]},loading:{type:Boolean,default:!1},total:{type:Number,default:0},message:{type:String,default:""},searchType:{type:String,default:"remote",validator:m=>["remote","local"].includes(m)},showTranslation:{type:Boolean,default:!0}},emits:["update:enableSearch","search","translate"],setup(m,{emit:d}){const g=r(""),k=r(!1),p=r(!1),y=r([]),o=r(1),f=r(20),F=Be(()=>m.searchType==="local"?"搜索本地知识库...":"搜索远程知识库...");ue(()=>m.searchResults,h=>{console.log("New search results:",h),y.value=h.map(c=>({...c,translation:c.translation||""}))}),ue(()=>m.message,h=>{h&&(g.value=h,J())});const J=async()=>{if(!(!g.value.trim()||k.value)){k.value=!0,o.value=1;try{d("search",{query:g.value,page:o.value,pageSize:f.value,type:m.searchType,needTranslation:m.showTranslation})}finally{k.value=!1}}},I=async()=>{if(!(k.value||!p.value)){k.value=!0,o.value+=1;try{d("search",{query:g.value,page:o.value,pageSize:f.value,type:m.searchType})}finally{k.value=!1}}};return{searchQuery:g,isSearching:k,displayResults:y,hasMore:p,handleSearch:J,clearSearch:()=>{g.value="",y.value=[],o.value=1,d("update:enableSearch",!1)},formatDate:h=>dt(h).format("YYYY-MM-DD HH:mm"),handleScroll:h=>{const{scrollTop:c,scrollHeight:u,clientHeight:_}=h.target;u-c-_<50&&!k.value&&p.value&&I()},placeholder:F,formatContent:h=>{if(!h)return"";const c=g.value.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return h.replace(new RegExp(c,"gi"),u=>`<span class="highlight">${u}</span>`)}}}}),xa={class:"knowledge-results"},Da={class:"result-title"},Ia=["href"],Ma=["innerHTML"],Ta={key:0,class:"result-translation"},Ea={class:"translation-content"},$a={class:"result-meta"},Ua={class:"result-source"},za={class:"result-date"},Pa={key:0,class:"load-more"},La={key:1,class:"loading-state"},Ga={key:2,class:"empty-state"};function Va(m,d,g,k,p,y){return l(),n("div",xa,[d[4]||(d[4]=e("div",{class:"search-box"},null,-1)),!m.loading&&m.searchResults.length>0?(l(),n("div",{key:0,class:"results-container",ref:"resultsContainer",onScroll:d[0]||(d[0]=(...o)=>m.handleScroll&&m.handleScroll(...o))},[(l(!0),n(L,null,q(m.displayResults,o=>(l(),n("div",{key:o.id,class:"result-item"},[e("h3",Da,[e("a",{href:o.link,target:"_blank",rel:"noopener noreferrer"},b(o.title),9,Ia)]),e("div",{class:"result-content",innerHTML:m.formatContent(o.content)},null,8,Ma),o.translation?(l(),n("div",Ta,[d[1]||(d[1]=e("span",{class:"translation-label"},"中文释义:",-1)),e("span",Ea,b(o.translation),1)])):$("",!0),e("div",$a,[e("span",Ua,"来源: "+b(o.source||"知识库"),1),e("span",za,b(m.formatDate(o.date)),1)])]))),128)),m.hasMore?(l(),n("div",Pa,d[2]||(d[2]=[e("div",{class:"loading-spinner"},null,-1),e("span",null,"加载更多...",-1)]))):$("",!0)],544)):m.loading?(l(),n("div",La,d[3]||(d[3]=[e("div",{class:"loading-spinner"},null,-1),e("p",null,"正在搜索...",-1)]))):(l(),n("div",Ga))])}const Wa=de(Sa,[["render",Va],["__scopeId","data-v-c3cce166"]]),Ba={name:"ChangePasswordDialog",props:{visible:{type:Boolean,default:!1}},data(){return{formData:{old_password:"",new_password:"",confirm_password:""}}},methods:{closeDialog(){this.$emit("update:visible",!1),this.resetForm()},resetForm(){this.formData={old_password:"",new_password:"",confirm_password:""}},async handleSubmit(){var m,d;if(!this.formData.old_password){this.$message.error("请输入原密码");return}if(!this.formData.new_password){this.$message.error("请输入新密码");return}if(!this.formData.confirm_password){this.$message.error("请确认新密码");return}if(this.formData.new_password!==this.formData.confirm_password){this.$message.error("两次输入的新密码不一致");return}try{const g=await U.post("https://aiapi.raycos.com.cn/user/change_password",{old_password:this.formData.old_password,new_password:this.formData.new_password,confirm_password:this.formData.confirm_password},{headers:{Authorization:`JWT ${localStorage.getItem("token")}`}});if(g.data.code===200){this.$message.success("密码修改成功"),this.closeDialog();try{await U.post("https://aiapi.raycos.com.cn/user/logout",{},{headers:{Authorization:`JWT ${localStorage.getItem("token")}`}}),localStorage.removeItem("token"),this.$router.push("/login")}catch(k){console.error("退出登录失败:",k),localStorage.removeItem("token"),this.$router.push("/login")}}else this.$message.error(g.data.message||"密码修改失败")}catch(g){this.$message.error("密码修改失败:"+(((d=(m=g.response)==null?void 0:m.data)==null?void 0:d.message)||g.message))}}}},Oa={class:"dialog-content"},Ra={class:"dialog-header"},qa={class:"dialog-body"},Ja={class:"form-group"},Na={class:"form-group"},Ka={class:"form-group"},Fa={class:"dialog-footer"};function Ya(m,d,g,k,p,y){return g.visible?(l(),n("div",{key:0,class:"dialog-overlay",onClick:d[6]||(d[6]=fe((...o)=>y.closeDialog&&y.closeDialog(...o),["self"]))},[e("div",Oa,[e("div",Ra,[d[7]||(d[7]=e("h3",null,"修改密码",-1)),e("button",{class:"close-button",onClick:d[0]||(d[0]=(...o)=>y.closeDialog&&y.closeDialog(...o))},"×")]),e("div",qa,[e("div",Ja,[d[8]||(d[8]=e("label",null,"原密码:",-1)),R(e("input",{type:"password","onUpdate:modelValue":d[1]||(d[1]=o=>p.formData.old_password=o),placeholder:"请输入原密码"},null,512),[[xe,p.formData.old_password]])]),e("div",Na,[d[9]||(d[9]=e("label",null,"新密码:",-1)),R(e("input",{type:"password","onUpdate:modelValue":d[2]||(d[2]=o=>p.formData.new_password=o),placeholder:"请输入新密码"},null,512),[[xe,p.formData.new_password]])]),e("div",Ka,[d[10]||(d[10]=e("label",null,"确认密码:",-1)),R(e("input",{type:"password","onUpdate:modelValue":d[3]||(d[3]=o=>p.formData.confirm_password=o),placeholder:"请确认新密码"},null,512),[[xe,p.formData.confirm_password]])])]),e("div",Fa,[e("button",{class:"cancel-button",onClick:d[4]||(d[4]=(...o)=>y.closeDialog&&y.closeDialog(...o))},"取消"),e("button",{class:"confirm-button",onClick:d[5]||(d[5]=(...o)=>y.handleSubmit&&y.handleSubmit(...o))},"确认")])])])):$("",!0)}const Ha=de(Ba,[["render",Ya],["__scopeId","data-v-b963ecb7"]]),Qa={class:"header"},ja={class:"user-profile-bar"},Za={class:"user-info-bar"},Xa=["title"],eo={key:1,class:"theme-icon",src:us,alt:"切换到深色模式"},to={class:"user-name"},so={class:"user-name"},ao={class:"dropdown-menu"},oo=["src"],lo={class:"conversation-list"},no=["onClick"],io={class:"config-container"},ro={class:"chat"},co={key:0,class:"welcome-section"},uo={class:"suggestion-section"},vo={class:"cards-container"},po={class:"suggestion-card"},go={class:"suggestion-items"},ho=["onClick"],mo={class:"message-bubble"},fo={class:"message-content"},wo={key:0,class:"image-preview"},yo=["src"],_o={key:1,class:"video-preview"},ko=["src"],Ao={key:2,class:"file-info-display"},bo=["src"],Co={class:"file-details"},So=["title"],xo={class:"file-size"},Do=["innerHTML"],Io={key:2},Mo={key:3,class:"audio-controls"},To=["onClick"],Eo={key:0,class:"wave-animation"},$o=["src"],Uo={class:"input-container"},zo={class:"search-toggle-item"},Po={class:"toggle-content"},Lo={class:"toggle-switch"},Go=["disabled"],Vo={class:"search-toggle-item"},Wo={class:"toggle-content"},Bo={class:"toggle-switch"},Oo={class:"search-toggle-item"},Ro={class:"toggle-content"},qo=["value","disabled"],Jo={key:0,value:""},No={key:1,value:""},Ko=["value"],Fo={key:0,class:"attachments-panel"},Yo={class:"panel-content"},Ho={key:0,style:{display:"flex","justify-content":"center"}},Qo={key:0,class:"upload-loading"},jo={key:1},Zo={class:"file-list"},Xo={key:0,class:"file-loading"},el=["src"],tl=["src"],sl=["src"],al=["onClick"],ol={key:0,class:"file-info"},ll={class:"file-name"},nl={class:"file-size"},il={class:"input-wrapper"},rl={key:0,class:"loading-btn"},cl={key:1,src:ms,alt:"send"},ul={class:"right-menu-content"},dl={class:"panel-container"},vl={class:"panel-container"},pl={class:"document-preview"},gl={class:"preview-container"},hl={key:0,class:"direct-preview"},ml={class:"preview-header"},fl={class:"preview-body"},wl=["src"],yl=["src"],_l={key:2},kl={key:3},Al=["src"],bl={key:5,class:"file-preview"},Cl={class:"panel-container"},Sl=0,xl=800,Dl={__name:"report",setup(m){const d=new jt({html:!0,linkify:!0,typographer:!0});r(!1);const g=r(""),k=r(!1),p=r(!1),y=r(null),o=r([]),f=r([]);r(!1);const F=r(1),J=r(1),I=r(null),C=vt(),w=ts(),z=r([{id:1,title:"当前会话",messages:[]}]),T=r(!1),h=r(null),c=r(null),u=r(!1),_=r(null),x=r(null),N=r(!1),oe=r(null),De=r(!1),ve=r([]),P=r([]);let Q=null;const D=r([]),le=r(!1),Te=r(0),G=r(!1),j=r(!1),ye=r(!1),_e=r(!1),Ee=r([]),$e=r(0),Ue=r(!1),pe=()=>{ye.value=window.innerWidth<=768,ye.value?(p.value=!0,j.value=!0):(p.value=!1,j.value=!1)};we(()=>{pe(),window.addEventListener("resize",pe)});const ne=r(!1),Je=()=>{console.log(ne.value),ne.value=!ne.value},pt=()=>{j.value=!j.value,ye.value&&(document.body.style.overflow=j.value?"auto":"hidden",j.value||(p.value=!0)),document.querySelector(".chat")&&(document.querySelector(".chat").style.left=j.value?"0":"260px")},gt=()=>{p.value=!1,document.querySelector(".chat")&&(document.querySelector(".chat").style.right=`${E.value}px`)},ht=async()=>{De.value=!0;try{const s=await U.get("https://aiapi.raycos.com.cn/api/document/summary",{headers:{Authorization:`JWT ${localStorage.getItem("token")}`}});console.log("API Response:",s.data),s.data.code===200&&(oe.value=s.data.data.items,console.log("Document Summary:",oe.value),mt())}catch(s){console.error("获取文档摘要失败:",s)}finally{De.value=!1}},mt=()=>{Q&&clearInterval(Q);const s=()=>{var t;if(!((t=oe.value)!=null&&t.length)){console.log("No document summary data available");return}try{const i=oe.value[0];if(i!=null&&i.questions){const A=[...i.questions.map(M=>({question:M}))].sort(()=>.5-Math.random());ve.value=A.slice(0,3)}}catch(i){console.error("解析 Hot Topics 失败:",i)}try{const i=oe.value[1];if(i!=null&&i.questions){const A=[...i.questions.map(M=>({question:M}))].sort(()=>.5-Math.random());P.value=A.slice(0,3)}}catch(i){console.error("解析 Design Guide 失败:",i)}};s(),Q=setInterval(s,5e3)},ft=s=>{console.log("QA clicked:",s),s!=null&&s.question&&(g.value=s.question,ze())};Se(()=>{Q&&clearInterval(Q)});const Ne=()=>{k.value=!k.value},wt=s=>{o.value=o.value.filter(t=>t!==s),o.value.length===0?(E.value=0,document.querySelector(".chat")&&(document.querySelector(".chat").style.right="0px")):(E.value=450,document.querySelector(".chat")&&(document.querySelector(".chat").style.right=`${E.value}px`)),console.log(o.value.length)},Ke=()=>{var s;N.value||(s=y.value)==null||s.click()},Fe=async s=>{try{const t=new FormData;t.append("file",s);const i=await U.post("https://aiapi.raycos.com.cn/upload/file",t,{headers:{"Content-Type":"multipart/form-data"}});if(i.data.status===2e3)return i.data.data.fileUrl;throw new Error(i.data.message||"文件上传失败")}catch(t){throw console.error("文件上传失败:",t),t}},Ye=async s=>{const t=Array.from(s.target.files);if(t.length===0)return;const i=10*1024*1024;if(t.filter(v=>!!(ge(v)&&v.size>i)).length>0){alert("Video files must not exceed 10MB"),s.target.value="";return}N.value=!0,E.value=450;try{for(const v of t){const A={name:v.name,size:v.size,sizeFormatted:He(v.size),type:v.type,isUploading:!0};o.value.push(A);try{const M=await Fe(v),K=o.value.findIndex(re=>re.name===v.name);K!==-1&&o.value.splice(K,1,{...A,url:M,isUploading:!1})}catch(M){o.value=o.value.filter(K=>K.name!==v.name),console.error("单个文件上传失败:",M)}}}catch(v){console.error("文件上传失败:",v)}finally{N.value=!1,s.target.value="",o.value.length>0&&(ae.value="preview",p.value=!1,document.querySelector(".chat")&&(document.querySelector(".chat").style.right=`${E.value}px`))}t.length>0&&G.value&&(G.value=!1)},He=s=>{if(!s||isNaN(s))return"0 B";const t=1024,i=["B","KB","MB","GB"],a=Math.floor(Math.log(s)/Math.log(t));return parseFloat((s/Math.pow(t,a)).toFixed(2))+" "+i[a]},Qe=s=>s.url&&se(s)?s.url:ys,se=s=>{var a,v,A;const t=["jpg","jpeg","png","gif","webp"],i=((A=(v=(a=s.name)==null?void 0:a.split("."))==null?void 0:v.pop())==null?void 0:A.toLowerCase())||"";return t.includes(i)},ge=s=>{var a,v,A;const t=["mp4","webm","ogg"],i=((A=(v=(a=s.name)==null?void 0:a.split("."))==null?void 0:v.pop())==null?void 0:A.toLowerCase())||"";return t.includes(i)},yt=s=>{const t=s.name.split(".").pop().toLowerCase(),i=["jpg","jpeg","png","gif","webp"],a=["mp4","webm","ogg"];return i.includes(t)?"image":a.includes(t)?"video":"document"},Ie=r(""),he=r(null),ze=async()=>{var re,ot;if(!localStorage.getItem("token")){w.push("/login");return}if(T.value){T.value=!1,he.value&&(he.value.abort(),he.value=null),h.value&&(clearTimeout(h.value),h.value=null);return}if(!g.value.trim()&&o.value.length===0||T.value)return;T.value=!0;const t=g.value.trim();g.value="",G.value?(Ae.value=t,_t(t).catch(V=>{console.error("Web search failed:",V)})):_e.value&&(Ae.value=t,et({query:t,page:1,pageSize:20}));let i=t;const a=[],v=[],A=[];o.value.forEach(V=>{const X=yt(V);X==="image"?a.push(V.url):X==="video"?v.push(V.url):A.push(V.url)});const M={id:Date.now(),role:"user",content:i,displayContent:i,files:o.value.map(V=>({name:V.name,size:V.sizeFormatted,type:V.type,url:V.url}))};f.value.push(M);const K={id:Date.now()+1,role:"assistant",content:"Thinking...",displayContent:"Thinking...",isLoading:!0};f.value.push(K);try{he.value=new AbortController;const V=G.value?"https://aiapi.raycos.com.cn/api/chat/web-search-llm/":"https://aiapi.raycos.com.cn/api/chat/online/multimodal",X=await U.post(V,{message:t,chat_config_id:"2",user_id:"13365429324",session_id:Ie.value,source:"pc",image_urls:a,video_urls:v,documents:A,merchant_id:JSON.parse(localStorage.getItem("userInfo")).merchant.merchant_id,model_type:tt.value.type,model_name:tt.value.name},{headers:{Authorization:`JWT ${localStorage.getItem("token")}`},signal:he.value.signal});f.value=f.value.filter(Ft=>Ft.id!==K.id);const me=G.value?X.data.data:X.data,Nt=G.value?me.answer:me.choices[0].message.content,Kt=G.value?(re=me.audio_info)==null?void 0:re.audio:(ot=me.audio_info)==null?void 0:ot.audio,lt=(G.value,me.session_id);lt&&(Ie.value=lt);const Ce=Oe({id:Date.now()+2,role:"assistant",content:Nt,displayContent:"",audioData:Kt||null});f.value.push(Ce),Ce.audioData&&!u.value&&await st(Ce.audioData,Ce.id),await kt(Ce)}catch(V){V.name==="CanceledError"?(console.log("请求已被取消"),f.value=f.value.filter(X=>X.id!==K.id),f.value.push({id:Date.now()+2,role:"assistant",content:"生成已取消",displayContent:"生成已取消"})):(console.error("发送消息失败:",V),f.value=f.value.filter(X=>X.id!==K.id),f.value.push({id:Date.now()+2,role:"assistant",content:"Sorry, there was an error processing your request.",displayContent:"Sorry, there was an error processing your request."}))}finally{T.value=!1,he.value=null,await rt()}},_t=async s=>{le.value=!0;try{const t=await U.post("https://aiapi.raycos.com.cn/api/web-search-results/",{query:s,num_results:20,page:1,page_size:20,engine:"tavily"});console.log(t),t.data&&t.data.code===200&&(D.value=t.data.data.result||[],console.log(D.value),Te.value=t.data.data.total||0)}catch(t){console.error("Web search failed:",t),D.value=[],Te.value=0}finally{le.value=!1}},kt=async s=>{if(!s||!s.content){console.error("Invalid message or content is missing");return}return new Promise(t=>{let a=0;s.displayContent="";const v=()=>{a<s.content.length&&T.value?(s.displayContent=s.content.substring(0,a+1),a++,h.value=setTimeout(v,30)):(T.value||(s.displayContent=s.content),t())};v()})},At=()=>{J.value++;const s={id:Date.now(),title:`New Conversation ${J.value}`,messages:[]};z.value.push(s),Ie.value="",je(s.id)},je=s=>{F.value=s;const t=z.value.find(i=>i.id===s);f.value=t?t.messages:[],Ie.value=""},bt=async s=>{if(N.value)return;const t=Array.from(s.dataTransfer.files);if(t.length===0)return;const i=10*1024*1024;t.filter(a=>!!(ge(a)&&a.size>i)),N.value=!0;try{for(const a of t){const v={name:a.name,size:a.size,sizeFormatted:He(a.size),type:a.type,isUploading:!0};o.value.push(v);try{const A=await Fe(a),M=o.value.findIndex(K=>K.name===a.name);M!==-1&&o.value.splice(M,1,{...v,url:A,isUploading:!1})}catch(A){o.value=o.value.filter(M=>M.name!==a.name),console.error("单个文件上传失败:",A)}}}catch(a){console.error("文件上传失败:",a)}finally{N.value=!1,o.value.length>0&&(ae.value="preview",p.value=!1,document.querySelector(".chat")&&(document.querySelector(".chat").style.right=`${E.value}px`))}t.length>0&&G.value&&(G.value=!1)},Ct=s=>{s.audioData?_.value===s.id?ke():st(s.audioData,s.id):_.value===s.id?ke():St(s.content,s.id)},St=async(s,t)=>{try{if(_.value&&_.value!==t&&ke(),_.value===t)return;const i=await U.post("https://aiapi.raycos.com.cn/api/voices/play_text",{text:s},{headers:{Authorization:`JWT ${localStorage.getItem("token")}`}});if(i.data.code===200){const a=new Audio(`https://aiapi.raycos.com.cn${i.data.audio_url}`);x.value=a,_.value=t,u.value=!0,a.onended=()=>{_.value=null,x.value=null,u.value=!1},a.onerror=v=>{console.error("播放文本失败:",v),B.error("播放失败,请稍后重试"),_.value=null,x.value=null,u.value=!1},await a.play()}}catch(i){console.error("播放文本失败:",i),B.error("播放失败,请稍后重试"),_.value=null,x.value=null,u.value=!1}},ke=()=>{c.value&&(c.value.pause(),c.value.currentTime=0,c.value=null),x.value&&(x.value.pause(),x.value.currentTime=0,x.value=null),u.value=!1,_.value=null};Se(()=>{ke()});const xt=s=>s?d.render(s):"",E=r(0),Ze=s=>{s.preventDefault();const t=s.type==="mousedown"?s.clientX:s.touches[0].clientX,i=E.value,a=A=>{if(p.value)return;const M=A.type==="mousemove"?A.clientX:A.touches[0].clientX,K=t-M;let re=Math.min(Math.max(i+K,Sl),xl);E.value=re,document.querySelector(".chat")&&(document.querySelector(".chat").style.right=`${re}px`)},v=()=>{document.removeEventListener("mousemove",a),document.removeEventListener("mouseup",v),document.removeEventListener("touchmove",a),document.removeEventListener("touchend",v)};document.addEventListener("mousemove",a),document.addEventListener("mouseup",v),document.addEventListener("touchmove",a),document.addEventListener("touchend",v)};r(!0);const Ae=r(""),Dt=s=>{console.log(G),G.value=s,s&&(gt(),ae.value="search")},ae=r("search"),It=r(!1),Pe=()=>{It.value=window.innerWidth<=480};Se(()=>{window.removeEventListener("resize",Pe)});const Xe=r(!1),Le=()=>{Xe.value=window.innerWidth<=768};Se(()=>{window.removeEventListener("resize",Le)});const Mt=Be(()=>(pe(),!p.value)),Tt=s=>{s.target.checked?(E.value=450,document.querySelector(".chat")&&(document.querySelector(".chat").style.right=`${E.value}px`),G.value=!1,ae.value="knowledge",g.value.trim()&&et({query:g.value,page:1,pageSize:20})):(E.value=0,document.querySelector(".chat")&&(document.querySelector(".chat").style.right=`${E.value}px`))},et=async s=>{if(!(!s.query.trim()||!_e.value)){Ue.value=!0;try{const t=await U.post("https://aiapi.raycos.com.cn/chataids/mysql_fuzzy_search/",{keywords:s.query,documents:[],document_ids:[],limit:5},{headers:{Authorization:`JWT ${localStorage.getItem("token")}`}});console.log(t),t.data&&t.data.status===200&&(Ee.value=t.data.data.data||[],$e.value=t.data.data.data.total||0)}catch(t){console.error("Knowledge search failed:",t),Ee.value=[],$e.value=0}finally{Ue.value=!1}}},Et=s=>{s.target.checked?(E.value=450,document.querySelector(".chat")&&(document.querySelector(".chat").style.right=`${E.value}px`),_e.value=!1,ae.value="search",g.value.trim()&&(Ae.value=g.value)):(E.value=0,document.querySelector(".chat")&&(document.querySelector(".chat").style.right=`${E.value}px`))},$t="https://aiapi.raycos.com.cn",ie=r([]),be=r(null),Me=r(!1),tt=Be(()=>{if(!be.value||!ie.value.length)return{type:"",name:""};const s=ie.value.find(t=>t.id===be.value);return{type:(s==null?void 0:s.type)||"",name:(s==null?void 0:s.name)||""}}),Ut=async()=>{Me.value=!0;try{const t=await(await fetch(`${$t}/api/models`)).json();console.log(t),t.code===2e3&&(ie.value=(t.data.models||[]).map(i=>({id:i.id,name:i.name,type:i.type||i.model_type||"default"})),ie.value.length>0&&(be.value=ie.value[0].id))}catch(s){console.error("Failed to fetch models:",s)}finally{Me.value=!1}},zt=s=>{be.value=s},Ge=r({name:"",role:""});we(()=>{Le(),window.addEventListener("resize",Le),Pe(),window.addEventListener("resize",Pe),pe(),window.addEventListener("resize",pe),Ut(),ht();const s=localStorage.getItem("userInfo");if(s)try{Ge.value=JSON.parse(s)}catch(t){console.error("解析用户信息失败:",t)}});const Ve=r(!1),Pt=()=>{Ve.value=!0,ne.value=!1},Lt=async()=>{try{await U.post("https://aiapi.raycos.com.cn/user/logout",{},{headers:{Authorization:`JWT ${localStorage.getItem("token")}`}}),localStorage.removeItem("token"),localStorage.removeItem("userInfo"),localStorage.removeItem("permissions"),localStorage.removeItem("username"),localStorage.removeItem("mobile"),C.commit("app/setUser",{user:{},permission:[],auth:{}}),ne.value=!1,w.push("/login")}catch(s){console.error("退出登录失败:",s),localStorage.clear(),w.push("/login")}},Gt=async()=>{var s,t;try{const i=await U.post("https://aiapi.raycos.com.cn/user/create_invitation",{},{headers:{Authorization:`JWT ${localStorage.getItem("token")}`}});if(console.log(i),i.data.code===200){B.success("创建邀请成功");const a=`${window.location.protocol}//${window.location.host}`;window.location.href=`${a}${i.data.data.invitation_link}`}else B.error(i.data.message||"创建邀请失败")}catch(i){console.error("创建邀请失败:",i),B.error(((t=(s=i.response)==null?void 0:s.data)==null?void 0:t.message)||"创建邀请失败,请稍后重试")}ne.value=!1},st=async(s,t)=>{try{if(_.value&&_.value!==t&&ke(),_.value===t)return;const i=new Audio(s);x.value=i,_.value=t,u.value=!0,i.onended=()=>{_.value=null,x.value=null,u.value=!1},i.onerror=a=>{console.error("播放音频失败:",a),B.error("播放失败,请稍后重试"),_.value=null,x.value=null,u.value=!1},await i.play()}catch(i){console.error("播放音频失败:",i),B.error("播放失败,请稍后重试"),_.value=null,x.value=null,u.value=!1}},Y=r(!1),We=s=>{document.documentElement.classList.toggle("dark-theme",s)},Vt=()=>{Y.value=!Y.value,localStorage.setItem("theme",Y.value?"dark":"light"),We(Y.value)};we(()=>{document.querySelector(".chat")&&(document.querySelector(".chat").style.right="0px"),pe();const s=localStorage.getItem("theme");s?Y.value=s==="dark":Y.value=window.matchMedia("(prefers-color-scheme: dark)").matches,We(Y.value),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",i=>{localStorage.getItem("theme")||(Y.value=i.matches,We(i.matches))})});const Wt=r({xls:!1,minColLength:15,minRowLength:50,widthOffset:50,heightOffset:30,forceRender:!0,maxSheetLength:10,showGridLines:!0,defaultFontSize:12,defaultRowHeight:24,autoFitColumn:!0,overflowColumns:!0,showToolbar:!0}),at=()=>{console.log("Excel文件渲染完成"),rt(()=>{window.dispatchEvent(new Event("resize"))})},Bt=s=>{console.error("Excel文件渲染失败:",s),B.error("Excel预览失败:"+(s.message||"请尝试下载后查看"))},Ot=s=>{var v,A,M;if(!s)return!1;const t=["doc","docx"],i=((M=(A=(v=s.name)==null?void 0:v.split("."))==null?void 0:A.pop())==null?void 0:M.toLowerCase())||"",a=t.includes(i);return a&&s.type?s.type==="application/msword"||s.type==="application/vnd.openxmlformats-officedocument.wordprocessingml.document":a},Rt=s=>{var a,v,A;if(!s)return!1;const t=["xls","xlsx"],i=((A=(v=(a=s.name)==null?void 0:a.split("."))==null?void 0:v.pop())==null?void 0:A.toLowerCase())||"";return t.includes(i)},qt=s=>{var t,i;return s&&((i=(t=s.name)==null?void 0:t.toLowerCase())==null?void 0:i.endsWith(".pdf"))||!1},O=r(null);ue(()=>o.value,s=>{s&&s.length>0?O.value=s[s.length-1]:O.value=null},{immediate:!0,deep:!0});const Jt=()=>{O.value=null};return(s,t)=>{var i;return l(),n("div",{class:H(["layout",{"dark-theme":Y.value}])},[S(Ha,{visible:Ve.value,"onUpdate:visible":t[0]||(t[0]=a=>Ve.value=a)},null,8,["visible"]),e("div",Qa,[e("div",ja,[t[11]||(t[11]=e("div",{class:"logo"},[e("img",{src:rs,alt:"logo",class:"logo-img"})],-1)),e("div",Za,[e("div",{class:"theme-switch",onClick:Vt,title:Y.value?"切换到浅色模式":"切换到深色模式"},[S(Zt,{name:"theme-icon",mode:"out-in"},{default:Z(()=>[Y.value?(l(),n("img",{key:Y.value,src:cs,alt:"切换到浅色模式",class:"theme-icon"})):(l(),n("img",eo))]),_:1})],8,Xa),ye.value?$("",!0):(l(),n("div",{key:0,class:"user-info",onClick:Je},[e("div",to,"商户名称:"+b(((i=Ge.value.merchant)==null?void 0:i.merchant_name)||"未登录用户"),1),e("div",so,"当前用户:"+b(Ge.value.username||"未登录用户"),1)])),e("div",{class:"avatar",onClick:Je},t[7]||(t[7]=[e("img",{src:ds,alt:"用户头像"},null,-1)]))]),R(e("div",ao,[e("div",{class:"dropdown-item",onClick:Pt},t[8]||(t[8]=[e("i",{class:"fas fa-key"},null,-1),te(" 修改密码 ")])),e("div",{class:"dropdown-item",onClick:Gt},t[9]||(t[9]=[e("i",{class:"fas fa-user-plus"},null,-1),te(" 创建邀请 ")])),e("div",{class:"dropdown-item",onClick:Lt},t[10]||(t[10]=[e("i",{class:"fas fa-sign-out-alt"},null,-1),te(" 退出登录 ")]))],512),[[ce,ne.value]])])]),e("div",{class:H(["collapse-left-button",{"menu-collapsed":j.value}]),onClick:pt},[e("img",{src:j.value?W(ws):W(fs),alt:"toggle",class:"collapse-icon"},null,8,oo)],2),e("div",{class:H(["menu",{collapsed:j.value}])},[e("button",{class:"new-conversation-btn",onClick:At},t[12]||(t[12]=[e("img",{class:"tab-icon",src:ct,alt:""},null,-1),e("span",null,"New Conversation",-1)])),e("div",lo,[(l(!0),n(L,null,q(z.value,a=>(l(),n("div",{key:a.id,class:H(["conversation-item",{active:F.value===a.id}]),onClick:v=>je(a.id)},b(a.title),11,no))),128))]),e("div",io,[S(Ca),S(Ls),S(pa)])],2),e("div",ro,[f.value.length===0?(l(),n("div",co,[e("div",uo,[t[15]||(t[15]=e("h3",null,"嗨,我是你的智能助手",-1)),e("div",vo,[e("div",po,[t[13]||(t[13]=e("div",{class:"card-header"},[e("img",{src:vs,alt:"hot topics",class:"tab-icon"}),e("h4",null,"推荐问题")],-1)),t[14]||(t[14]=e("p",{class:"card-subtitle"},"为您精选的热门问题",-1)),e("div",go,[(l(!0),n(L,null,q([...ve.value,...P.value],(a,v)=>(l(),n("div",{key:v,class:"suggestion-item",onClick:A=>ft(a)},b(a.question),9,ho))),128))])])])])])):(l(),n("div",{key:1,class:"message-list",ref_key:"messageList",ref:I},[(l(!0),n(L,null,q(f.value,a=>(l(),n("div",{key:a.id,class:H(["message-item",a.role==="user"?"user":"assistant"])},[e("div",mo,[e("div",fo,[a.role==="user"&&a.files?(l(!0),n(L,{key:0},q(a.files,v=>(l(),n("div",{key:v.name,class:"file-message"},[se(v)?(l(),n("div",wo,[e("img",{src:v.url,class:"preview-image"},null,8,yo)])):ge(v)?(l(),n("div",_o,[e("video",{controls:"",class:"preview-video",src:v.url,preload:"metadata"}," Your browser does not support the video tag. ",8,ko)])):(l(),n("div",Ao,[e("img",{src:Qe(v),class:"file-type-icon"},null,8,bo),e("div",Co,[e("span",{class:"file-name",title:v.name},b(v.name),9,So),e("span",xo,b(v.size),1)])]))]))),128)):$("",!0),a.role==="assistant"?(l(),n("div",{key:1,class:"message-text",innerHTML:xt(a.displayContent)},null,8,Do)):(l(),n("div",Io,b(a.content),1)),a.role==="assistant"?(l(),n("div",Mo,[e("button",{class:"audio-btn",onClick:v=>Ct(a)},[_.value===a.id?(l(),n("div",Eo,t[16]||(t[16]=[e("span",{class:"wave-bar"},null,-1),e("span",{class:"wave-bar"},null,-1),e("span",{class:"wave-bar"},null,-1),e("span",{class:"wave-bar"},null,-1)]))):(l(),n("img",{key:1,src:W(_s),alt:"播放",class:"audio-icon"},null,8,$o))],8,To)])):$("",!0)])])],2))),128))],512)),e("div",Uo,[e("div",{class:H(["search-toggles",{compact:Xe.value}])},[e("div",zo,[e("div",Po,[S(W(ss)),t[18]||(t[18]=e("span",{class:"toggle-text"},"互联网",-1)),e("div",Lo,[R(e("input",{type:"checkbox",id:"webSearchToggle","onUpdate:modelValue":t[1]||(t[1]=a=>G.value=a),onChange:Et,disabled:o.value.length>0,class:"toggle-input"},null,40,Go),[[it,G.value]]),e("label",{for:"webSearchToggle",class:H(["toggle-label",{disabled:o.value.length>0}])},t[17]||(t[17]=[e("span",{class:"toggle-slider"},null,-1)]),2)])])]),e("div",Vo,[e("div",Wo,[S(W(as)),t[20]||(t[20]=e("span",{class:"toggle-text"},"知识库",-1)),e("div",Bo,[R(e("input",{type:"checkbox",id:"knowledgeSearchToggle","onUpdate:modelValue":t[2]||(t[2]=a=>_e.value=a),onChange:Tt,class:"toggle-input"},null,544),[[it,_e.value]]),t[19]||(t[19]=e("label",{for:"knowledgeSearchToggle",class:"toggle-label"},[e("span",{class:"toggle-slider"})],-1))])])]),e("div",Oo,[e("div",Ro,[e("select",{class:"model-select",value:be.value,onChange:t[3]||(t[3]=a=>zt(a.target.value)),disabled:Me.value},[Me.value?(l(),n("option",Jo,"加载中...")):ie.value.length===0?(l(),n("option",No,"无可用模型")):$("",!0),(l(!0),n(L,null,q(ie.value,a=>(l(),n("option",{key:a.id,value:a.id},b(a.name),9,Ko))),128))],40,qo)])])],2),k.value?(l(),n("div",Fo,[e("div",Yo,[e("div",{class:"attachments-header"},[t[22]||(t[22]=e("span",null,"Attachments",-1)),e("button",{class:"close-btn",onClick:Ne},t[21]||(t[21]=[e("img",{src:ps,alt:""},null,-1)]))]),o.value.length===0?(l(),n("div",Ho,[e("div",{class:H(["upload-area",{"has-files":o.value.length>0}]),onClick:Ke,onDrop:fe(bt,["prevent"]),onDragover:t[4]||(t[4]=fe(()=>{},["prevent"])),onDragenter:t[5]||(t[5]=fe(()=>{},["prevent"]))},[N.value?(l(),n("div",Qo,t[23]||(t[23]=[e("div",{class:"loading-spinner"},null,-1),e("div",{class:"upload-text"},"Uploading...",-1)]))):(l(),n(L,{key:1},[t[24]||(t[24]=e("img",{src:gs,alt:"upload",class:"upload-icon"},null,-1)),t[25]||(t[25]=e("div",{class:"upload-text"},"Upload files",-1)),t[26]||(t[26]=e("div",{class:"upload-hint"}," Click or drag files to this area to upload ",-1))],64)),e("input",{type:"file",ref_key:"fileInput",ref:y,style:{display:"none"},onChange:Ye,multiple:""},null,544)],34)])):$("",!0),o.value.length!==0?(l(),n("div",jo,[e("div",Zo,[(l(!0),n(L,null,q(o.value,a=>(l(),n("div",{key:a.name,class:H(["file-item",{"is-image":se(a)}])},[e("div",{class:H(se(a)?"file-wrapper":"")},[a.isUploading?(l(),n("div",Xo,t[27]||(t[27]=[e("div",{class:"loading-spinner"},null,-1)]))):se(a)?(l(),n("img",{key:1,src:a.url,alt:"file",class:"file-icon"},null,8,el)):ge(a)?(l(),n("video",{key:2,src:a.url,class:"file-icon",preload:"metadata"}," Your browser does not support the video tag. ",8,tl)):(l(),n("img",{key:3,src:Qe(a),alt:"file",class:H(se(a)||ge(a)?"file-icon":"")},null,10,sl)),a.isUploading?$("",!0):(l(),n("button",{key:4,class:"remove-btn",onClick:fe(v=>wt(a),["stop"])}," × ",8,al))],2),se(a)?$("",!0):(l(),n("div",ol,[e("span",ll,b(a.name),1),e("span",nl,b(a.sizeFormatted),1)]))],2))),128)),e("button",{class:"add-more-btn",onClick:fe(Ke,["stop"])},t[28]||(t[28]=[e("img",{src:ct,alt:"add"},null,-1)]))]),e("input",{type:"file",ref_key:"fileInput",ref:y,style:{display:"none"},onChange:Ye,multiple:""},null,544)])):$("",!0)])])):$("",!0),e("div",il,[e("button",{class:"attachment-btn",onClick:Ne},t[29]||(t[29]=[e("img",{src:hs,alt:"attachment",class:"tab-icon"},null,-1)])),R(e("input",{type:"text",class:"message-input","onUpdate:modelValue":t[6]||(t[6]=a=>g.value=a),onKeyup:Xt(ze,["enter"]),placeholder:"Type a message..."},null,544),[[xe,g.value]]),e("button",{class:"send-btn",onClick:ze},[T.value?(l(),n("span",rl,t[30]||(t[30]=[e("span",{class:"loading-square"},null,-1)]))):(l(),n("img",cl))])])])]),ye.value?$("",!0):(l(),n("div",{key:0,class:H(["right_menu",{collapsed:!Mt.value}]),style:es({width:E.value+"px"})},[e("div",{class:"resize-handle",onMousedown:Ze,onTouchstart:Ze},null,32),e("div",ul,[R(e("div",dl,[S(Zs,{searchResults:D.value,loading:le.value,total:Te.value,enableWebSearch:G.value,message:Ae.value,"onUpdate:enableWebSearch":Dt},null,8,["searchResults","loading","total","enableWebSearch","message"])],512),[[ce,ae.value==="search"]]),R(e("div",vl,[t[32]||(t[32]=e("div",{class:"preview-header"},[e("span",null,"文档预览")],-1)),e("div",pl,[e("div",gl,[O.value?(l(),n("div",hl,[e("div",ml,[e("span",null,b(O.value.name),1),e("button",{class:"close-btn",onClick:Jt},[S(W(os))])]),e("div",fl,[se(O.value)?(l(),n("img",{key:0,src:O.value.url,class:"preview-image",alt:"preview"},null,8,wl)):ge(O.value)?(l(),n("video",{key:1,src:O.value.url,controls:"",class:"preview-video"},null,8,yl)):Ot(O.value)?(l(),n("div",_l,[S(W(ls),{src:O.value.url,class:"doc-preview",onRendered:at,onError:s.handleError},null,8,["src","onError"])])):Rt(O.value)?(l(),n("div",kl,[S(W(ns),{options:Wt.value,onRendered:at,onError:Bt,src:O.value.url,class:"doc-preview"},null,8,["options","src"])])):qt(O.value)?(l(),n("iframe",{key:4,src:O.value.url,style:{width:"100%",height:"100%"},frameborder:"0"},null,8,Al)):(l(),n("div",bl,[S(W(is),{class:"large-icon"}),t[31]||(t[31]=e("p",null,"该文件类型暂不支持预览",-1))]))])])):$("",!0)])])],512),[[ce,ae.value==="preview"]]),R(e("div",Cl,[S(Wa,{searchResults:Ee.value,loading:Ue.value,total:$e.value,message:Ae.value},null,8,["searchResults","loading","total","message"])],512),[[ce,ae.value==="knowledge"]])])],6))],2)}}},Tl=de(Dl,[["__scopeId","data-v-b004f9e0"]]);export{Tl as default};