1 |
- import{J as d,r as O,o,K as i,a as e,N as B,O as U,Q as X,V as L,W,X as C,b as $,w as H,Y as ne,c as we,Z as V,$ as fs,v as ee,d as xe,a0 as Qe,a1 as oe,a2 as ye,a3 as Ie,H as He,a4 as N,a5 as je,a6 as Te,a7 as ie,a8 as ae,a9 as ws,aa as Xe,ab as ys,ac as _s,ad as ks,ae as le,af as Je,ag as bs,ah as F,ai as Ae,aj as Cs,ak as Me,al as Ss,am as Ke}from"./vendor-DxWLqeX3.js";import{_ as se}from"./index-B5bpwC9e.js";const Ye="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",$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='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",Ds="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",As="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",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='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",xs="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",Is="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",Ts="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",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='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",Es="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",zs="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAUVJREFUOE+l0z8snlEUBvCfxSZhwSpYxGCUGJAYLaSxaDcWg4EYJBKaSAxNDR0sLFIWEV2MTTA0MRrEUq0VSyUWMbknuW/y+vJ9n+JON+fPc57znHMa1H6dmMvudfypFtpQB+AALdn/D+MvAaxgGo+4Qx+Gc9IRztCMRmwme8QrMzjHPm7Rij1cZICe9J8o+T6k2N5KgCt8SckbJapN+X9fss1gAR21GAS1IYxUiPgz2Y8z9WcMQu2oPIZuXGILYd/NlSfzFKbQhd/4EUxCg6g4mPT4nCuE8teI0S1mgLXMph0xkVHMJ5FPygBfcYjo+wazmUlgROVvaEuJoUe0uFwAVGthFQM4zQz68QtL1VooBC7GWIj4MfX9KTu/p8SdWiIWADHG7WJBsrG8iUVc3THG4vzFw1sW6d2rXHkrrz6mSoD/Oucnp3ZSV0/fYroAAAAASUVORK5CYII=",Pe="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",Ee="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",Vs={class:"model-config"},Ls=["src"],Gs={class:"config-panel"},Us={class:"model-list"},Bs={class:"model-header"},Fs={class:"model-title"},Os={class:"model-form"},Ws={class:"form-item"},Rs={class:"form-item"},qs={key:0,class:"form-item"},Ns={class:"form-item"},Ks={class:"form-item"},Ys={class:"action-buttons"},Qs={__name:"index",setup(l){const c=[{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:""}]}],h=d(!1),y=d(!1),m=d([{type:"",key:"",endpoint:"",name:""}]),D=d(c),r=w=>({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"})[w]||"请输入 API Key",g=(w,n)=>{const v=m.value[n],_=c.flatMap(R=>R.options).find(R=>R.value===w);_&&(v.endpoint=_.endpoint,v.name=_.label)},E=()=>{h.value=!h.value},z=()=>{m.value.push({type:"",key:"",endpoint:"",name:""})},S=w=>{if(m.value.length===1){ee.warning("至少保留一个模型配置");return}m.value.splice(w,1)},b=w=>!(!w.type||!w.key||w.type==="ollama"&&!w.endpoint||w.type==="custom"&&(!w.name||!w.endpoint)),u=async()=>{if(m.value.some(n=>!b(n))){ee.error("请填写完整的模型信息");return}y.value=!0;try{localStorage.setItem("modelConfig",JSON.stringify(m.value)),ee.success("配置保存成功")}catch{ee.error("配置保存失败")}finally{y.value=!1}};return(()=>{const w=localStorage.getItem("modelConfig");w&&(m.value=JSON.parse(w))})(),(w,n)=>{const v=O("a-button"),_=O("a-select-option"),R=O("a-select-opt-group"),ce=O("a-select"),de=O("a-input-password"),K=O("a-input");return o(),i("div",Vs,[e("div",{class:"config-header",onClick:E},[n[0]||(n[0]=e("img",{src:zs,alt:"setting",class:"config-icon"},null,-1)),n[1]||(n[1]=e("span",null,"模型配置",-1)),e("img",{src:h.value?B(Pe):B(Ee),alt:"toggle",class:"toggle-icon"},null,8,Ls)]),U(e("div",Gs,[e("div",Us,[(o(!0),i(L,null,W(m.value,(T,j)=>(o(),i("div",{key:j,class:"model-item"},[e("div",Bs,[e("span",Fs,"模型 "+C(j+1),1),$(v,{type:"link",danger:"",size:"small",onClick:M=>S(j)},{default:H(()=>n[2]||(n[2]=[ne("删除")])),_:2},1032,["onClick"])]),e("div",Os,[e("div",Ws,[n[3]||(n[3]=e("label",null,"选择模型",-1)),$(ce,{value:T.type,"onUpdate:value":M=>T.type=M,placeholder:"请选择模型",onChange:M=>g(M,j)},{default:H(()=>[(o(!0),i(L,null,W(D.value,M=>(o(),we(R,{key:M.label,label:M.label},{default:H(()=>[(o(!0),i(L,null,W(M.options,x=>(o(),we(_,{key:x.value,value:x.value},{default:H(()=>[ne(C(x.label),1)]),_:2},1032,["value"]))),128))]),_:2},1032,["label"]))),128))]),_:2},1032,["value","onUpdate:value","onChange"])]),T.type?(o(),i(L,{key:0},[e("div",Rs,[n[4]||(n[4]=e("label",null,"API Key",-1)),$(de,{value:T.key,"onUpdate:value":M=>T.key=M,placeholder:r(T.type)},null,8,["value","onUpdate:value","placeholder"])]),T.type==="ollama"?(o(),i("div",qs,[n[5]||(n[5]=e("label",null,"服务器地址",-1)),$(K,{value:T.endpoint,"onUpdate:value":M=>T.endpoint=M,placeholder:"例如: http://localhost:11434"},null,8,["value","onUpdate:value"])])):V("",!0),T.type==="custom"?(o(),i(L,{key:1},[e("div",Ns,[n[6]||(n[6]=e("label",null,"模型名称",-1)),$(K,{value:T.name,"onUpdate:value":M=>T.name=M,placeholder:"请输入自定义模型名称"},null,8,["value","onUpdate:value"])]),e("div",Ks,[n[7]||(n[7]=e("label",null,"服务器地址",-1)),$(K,{value:T.endpoint,"onUpdate:value":M=>T.endpoint=M,placeholder:"请输入API地址"},null,8,["value","onUpdate:value"])])],64)):V("",!0)],64)):V("",!0)])]))),128))]),$(v,{type:"dashed",block:"",class:"add-model-btn",onClick:z},{default:H(()=>[$(B(fs)),n[8]||(n[8]=ne(" 添加模型 "))]),_:1}),e("div",Ys,[$(v,{type:"primary",loading:y.value,onClick:u},{default:H(()=>n[9]||(n[9]=[ne(" 保存配置 ")])),_:1},8,["loading"])])],512),[[X,h.value]])])}}},Hs=se(Qs,[["__scopeId","data-v-458dfcda"]]),js=xe({name:"SearchResults",components:{FileSearchOutlined:Qe},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(l,{emit:c}){const h=d([]),y=d(!1),m=d(""),D=d(!1),r=d(l.total),g=d(l.enableWebSearch);oe(()=>l.total,u=>{r.value=u}),oe(()=>l.searchResults,u=>{h.value=u,y.value=h.value.length<l.total},{immediate:!0}),oe(()=>l.message,u=>{u&&l.enableWebSearch&&(m.value=u,z())}),oe(()=>l.enableWebSearch,u=>{g.value=u,u||S()});const E=u=>He(u).format("YYYY-MM-DD"),z=async()=>{if(!(!m.value.trim()||D.value||!l.enableWebSearch)){D.value=!0;try{const u=await N.post("https://ylaiapi.raycos.com.cn/api/web-search-results/",{query:m.value,num_results:20,page:1,page_size:20,engine:"bing"});console.log("API Response:",u.data),u.data&&u.data.code===200&&(h.value=u.data.data.results||[],console.log("Total Results:",u.data.data.total_results),r.value=u.data.data.total_results||0,c("update:total",u.data.data.total_results||0))}catch(u){console.error("Web search failed:",u),h.value=[],r.value=0,c("update:total",0)}finally{D.value=!1}}},S=()=>{m.value="",h.value=[],r.value=0,c("update:total",0)},b=()=>{g.value=!g.value,c("update:enableWebSearch",g.value)};return{displayResults:h,loading:l.loading,total:r,hasMore:y,formatDate:E,searchQuery:m,isSearching:D,handleSearch:z,clearSearch:S,isSearchEnabled:g,toggleSearch:b}}}),Xs={class:"search-results"},Js={class:"search-box"},Zs={class:"input-wrapper"},et=["disabled"],st={class:"results-header"},tt={class:"result-stats"},at={key:0,class:"results-list"},lt={class:"result-title"},nt=["href"],ot={class:"result-url"},it={class:"result-snippet"},rt={class:"result-meta"},ct={class:"result-date"},dt={class:"result-source"},ut={key:0,class:"loading-more",ref:"loadingTrigger"},vt={key:0,class:"loading-spinner"},pt={key:1},gt={key:1,class:"no-results"};function ht(l,c,h,y,m,D){const r=O("FileSearchOutlined");return o(),i("div",Xs,[e("div",Js,[e("div",Zs,[U(e("input",{"onUpdate:modelValue":c[0]||(c[0]=g=>l.searchQuery=g),type:"text",placeholder:"Enter your search query",onKeyup:c[1]||(c[1]=Ie((...g)=>l.handleSearch&&l.handleSearch(...g),["enter"]))},null,544),[[ye,l.searchQuery]]),l.searchQuery?(o(),i("span",{key:0,class:"clear-icon",onClick:c[2]||(c[2]=(...g)=>l.clearSearch&&l.clearSearch(...g))},"×")):V("",!0)]),e("button",{onClick:c[3]||(c[3]=(...g)=>l.handleSearch&&l.handleSearch(...g)),disabled:l.isSearching}," 搜索一下 ",8,et)]),e("div",st,[c[5]||(c[5]=e("h2",null,"Related Search Results",-1)),e("div",tt," Found "+C(l.total)+" results ",1)]),e("div",{class:"results-container",ref:"resultsContainer",onScroll:c[4]||(c[4]=(...g)=>l.handleScroll&&l.handleScroll(...g))},[l.displayResults.length>0?(o(),i("div",at,[(o(!0),i(L,null,W(l.displayResults,(g,E)=>(o(),i("div",{key:E,class:"result-item"},[e("h3",lt,[e("a",{href:g.link,target:"_blank",rel:"noopener noreferrer"},C(g.title),9,nt)]),e("p",ot,C(g.link),1),e("p",it,C(g.snippet),1),e("div",rt,[e("span",ct,C(l.formatDate(g.date)),1),e("span",dt,C(g.source),1)])]))),128)),l.hasMore?(o(),i("div",ut,[l.loading?(o(),i("div",vt)):(o(),i("span",pt,"Loading more results..."))],512)):V("",!0)])):(o(),i("div",gt,[$(r,{class:"no-results-icon"}),c[6]||(c[6]=e("p",null,"No related results found",-1))]))],544)])}const mt=se(js,[["render",ht],["__scopeId","data-v-0f6c539c"]]),ft="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAAVZJREFUOE+l079Ll1EUBvDP/b73G9HeIISDUxiOtQTiEGFOCipE0BiELQ0KgoOgk/Rjk5zdGnL2L2hyMRIHocEpaGgsvfrq1feFF339Wni3e885z3mec58T3PCEXvWRJSwkrsy7MhB5h6cYqgEiH/EnMV83bgUoWA086vDymO9NBpEVPEsMZZBLAJHPGEhMYD9SZoBb3D9gNxdFFjGXuBMKpgJTjVnk4if4XSWfART8CNxO9FXv2yUrIXcoma4BjviCo/peM6iKPmTWibeRkVMyy2cAvaZ8IX4vsl/l343s/C9A1l837I9stUnYOP371Cahy0zJTGKw4EXgdejyqjwfWn0G07m+X80hVnlrGE1sFnzqsHvpGwvWAo8Lxv+yV1Puso6vh6x2eYPZQx72MtJwh+kWI2UPTHZ4fsC366w8igcNK2dp7xNj+NnqxOZy3WiZ/nXLTwAE1GVpm7M6FwAAAABJRU5ErkJggg==",wt={class:"voice-config"},yt=["src"],_t={class:"config-panel"},kt={class:"config-item"},bt={class:"voice-select-container"},Ct=["value"],St={class:"config-item"},$t={class:"slider-container"},Dt={class:"slider-value"},At={class:"config-item",style:{display:"flex","justify-content":"space-around"}},Mt=["disabled"],xt=["disabled"],It={__name:"index",setup(l){const c=je(),h=d(!1),y=d([]),m=Te({role:"",speed:1,language:"zh"}),D=d(!1),r=d(!1),g=d(null),E=async()=>{try{const v=(await N.get("https://ylaiapi.raycos.com.cn/chatbot/current_voice_config")).data.data;if(console.log("Current config:",v),v&&v.voice_name&&y.value.length>0){const _=y.value.find(R=>R.name===v.voice_name);console.log("Matched voice:",_),_&&(m.role=_.id,m.speed=v.speed||1,m.language=_.language,u())}}catch(n){console.error("获取当前语音配置失败:",n)}},z=async()=>{try{const v=(await N.get("https://ylaiapi.raycos.com.cn/chatbot/list_voices")).data.data.voices;y.value=Object.values(v).flat(),console.log("Voice list:",y.value),await E()}catch(n){console.error("获取语音列表失败:",n)}},S=n=>({"zh-cn":"中文","en-us":"英文","ja-jp":"日语","ko-kr":"韩语"})[n]||n;ie(()=>{z()});const b=()=>{h.value=!h.value},u=()=>{c.commit("updateVoiceConfig",{...m})},f=async()=>{if(m.role){D.value=!0;try{const n=new FormData;n.append("voice_id",m.role),await N.post("https://ylaiapi.raycos.com.cn/switch_voice_config",n,{headers:{"Content-Type":"multipart/form-data"}})}catch(n){console.error("切换语音失败:",n),alert("语音切换失败")}finally{D.value=!1}}},w=async()=>{if(!(!m.role||r.value))try{r.value=!0;const n=`https://ylaiapi.raycos.com.cn/get_voice_preview?voice_id=${m.role}&text=你好&style=chat`;g.value&&(g.value.pause(),g.value=null);const v=new Audio(n);g.value=v,v.onended=()=>{r.value=!1,g.value=null},v.onerror=()=>{console.error("音频播放失败"),r.value=!1,g.value=null,alert("试听失败")},await v.play()}catch(n){console.error("试听失败:",n),r.value=!1,alert("试听失败")}};return ae(()=>{g.value&&(g.value.pause(),g.value=null)}),(n,v)=>(o(),i("div",wt,[e("div",{class:"config-header",onClick:b},[v[2]||(v[2]=e("img",{src:ft,alt:"voice",class:"config-icon"},null,-1)),v[3]||(v[3]=e("span",null,"语音配置",-1)),e("img",{src:h.value?B(Pe):B(Ee),alt:"toggle",class:"toggle-icon"},null,8,yt)]),U(e("div",_t,[e("div",kt,[v[4]||(v[4]=e("label",null,"语音角色",-1)),e("div",bt,[U(e("select",{"onUpdate:modelValue":v[0]||(v[0]=_=>m.role=_),onChange:u},[(o(!0),i(L,null,W(y.value,_=>(o(),i("option",{key:_.id,value:_.id},C(_.name+"_"+_.gender)+" ("+C(S(_.language))+") ",9,Ct))),128))],544),[[ws,m.role]])])]),e("div",St,[v[5]||(v[5]=e("label",null,"语速",-1)),e("div",$t,[U(e("input",{type:"range","onUpdate:modelValue":v[1]||(v[1]=_=>m.speed=_),min:"0.5",max:"2",step:"0.1",onChange:u},null,544),[[ye,m.speed]]),e("span",Dt,C(m.speed)+"x",1)])]),e("div",At,[e("button",{class:"preview-button",onClick:w,disabled:r.value},C(r.value?"播放中...":"试听"),9,Mt),e("button",{class:"switch-button",onClick:f,disabled:D.value},C(D.value?"切换中...":"切换语音"),9,xt)])],512),[[X,h.value]])]))}},Tt=se(It,[["__scopeId","data-v-d3a778eb"]]),Pt="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",Et={class:"knowledge-config"},zt=["src"],Vt={class:"config-panel"},Lt={class:"knowledge-list"},Gt={class:"group-header"},Ut={class:"checkbox-list"},Bt={class:"item-desc"},Ft={class:"action-buttons"},Ot={__name:"index",setup(l){const c=d([]),h=d(!1),y=d(!1),m=Te({product:[],tech:[],industry:[]}),D=()=>{h.value=!h.value},r=async()=>{y.value=!0;try{localStorage.setItem("knowledgeConfig",JSON.stringify(m)),ee.success("知识库配置保存成功")}catch{ee.error("知识库配置保存失败")}finally{y.value=!1}},g=()=>{const S=localStorage.getItem("knowledgeConfig");if(S){const b=JSON.parse(S);Object.keys(b).forEach(u=>{m[u]=b[u]})}},E=async S=>{try{const b=new URLSearchParams;return b.append("page",1),b.append("kb_id",S),b.append("pageSize",9999),(await N.post("http://58.246.234.210:8084/docType/selectTypeList",b,{headers:{"Content-Type":"application/x-www-form-urlencoded"}})).data.data.dataList||[]}catch(b){return console.error("获取知识库子项失败:",b),[]}},z=async()=>{try{const b=await N.post("http://58.246.234.210:8084/kbm/selectBucketInfo",{user_id:2}),u=await Promise.all(b.data.data.map(async f=>{const w=await E(f.id);return console.log(w),{label:f.name,key:f.id,items:w.map(n=>({label:n.name,value:n.id}))}}));c.value=u,c.value.forEach(f=>{m[f.key]||(m[f.key]=[])})}catch(S){ee.error("获取知识库信息失败"),console.error("获取知识库信息失败:",S)}};return ie(async()=>{await z(),g()}),(S,b)=>{const u=O("a-checkbox"),f=O("a-checkbox-group"),w=O("a-button");return o(),i("div",Et,[e("div",{class:"config-header",onClick:D},[b[0]||(b[0]=e("img",{src:Pt,alt:"knowledge",class:"config-icon"},null,-1)),b[1]||(b[1]=e("span",null,"知识库配置",-1)),e("img",{src:h.value?B(Pe):B(Ee),alt:"toggle",class:"toggle-icon"},null,8,zt)]),U(e("div",Vt,[e("div",Lt,[(o(!0),i(L,null,W(c.value,n=>(o(),i("div",{class:"knowledge-group",key:n.label},[e("div",Gt,C(n.label),1),e("div",Ut,[$(f,{value:m[n.key],"onUpdate:value":v=>m[n.key]=v},{default:H(()=>[(o(!0),i(L,null,W(n.items,v=>(o(),i("div",{key:v.value,class:"checkbox-item"},[$(u,{value:v.value},{default:H(()=>[ne(C(v.label)+" ",1),e("span",Bt,C(v.description),1)]),_:2},1032,["value"])]))),128))]),_:2},1032,["value","onUpdate:value"])])]))),128))]),e("div",Ft,[$(w,{type:"primary",loading:y.value,onClick:r},{default:H(()=>b[2]||(b[2]=[ne(" 保存配置 ")])),_:1},8,["loading"])])],512),[[X,h.value]])])}}},Wt=se(Ot,[["__scopeId","data-v-97e545f3"]]),Rt=xe({name:"DocumentPreview",components:{FileOutlined:Xe,EyeOutlined:ys,DownloadOutlined:_s,CloseOutlined:ks},props:{documents:{type:Array,default:()=>[]}},emits:["select"],setup(l,{emit:c}){const h=d(!1),y=d(null);return{previewVisible:h,currentDoc:y,isImageFile:u=>{var n,v,_;if(!u)return!1;const f=["jpg","jpeg","png","gif","webp"],w=((_=(v=(n=u.name)==null?void 0:n.split("."))==null?void 0:v.pop())==null?void 0:_.toLowerCase())||"";return f.includes(w)},isVideoFile:u=>{var n,v,_;if(!u)return!1;const f=["mp4","webm","ogg"],w=((_=(v=(n=u.name)==null?void 0:n.split("."))==null?void 0:v.pop())==null?void 0:_.toLowerCase())||"";return f.includes(w)},getFileIcon:u=>"/src/assets/svg/word.svg",formatFileSize:u=>{if(!u||isNaN(u))return"0 B";const f=1024,w=["B","KB","MB","GB"],n=Math.floor(Math.log(u)/Math.log(f));return parseFloat((u/Math.pow(f,n)).toFixed(2))+" "+w[n]},handleSelect:u=>{c("select",u)},handlePreview:u=>{y.value=u,h.value=!0},handleDownload:u=>{if(u.url){const f=document.createElement("a");f.href=u.url,f.download=u.name,document.body.appendChild(f),f.click(),document.body.removeChild(f)}},closePreview:()=>{h.value=!1,y.value=null}}}}),qt={class:"document-preview"},Nt={class:"document-list"},Kt={key:0,class:"empty-state"},Yt=["onClick"],Qt={class:"doc-icon"},Ht=["src"],jt=["src"],Xt=["src"],Jt={class:"info"},Zt=["title"],ea={class:"size"},sa={class:"actions"},ta=["onClick"],aa=["onClick"],la={class:"preview-header"},na={class:"preview-body"},oa=["src"],ia=["src"],ra={key:2,class:"file-preview"};function ca(l,c,h,y,m,D){var S,b,u;const r=O("FileOutlined"),g=O("EyeOutlined"),E=O("DownloadOutlined"),z=O("CloseOutlined");return o(),i("div",qt,[e("div",Nt,[l.documents.length===0?(o(),i("div",Kt,[$(r,{class:"empty-icon"}),c[3]||(c[3]=e("p",null,"暂无文档",-1))])):(o(!0),i(L,{key:1},W(l.documents,f=>(o(),i("div",{key:f.name,class:"document-item"},[e("div",{class:"document-info",onClick:w=>l.handleSelect(f)},[e("div",Qt,[l.isImageFile(f)?(o(),i("img",{key:0,src:f.url,class:"preview-thumbnail",alt:"preview"},null,8,Ht)):l.isVideoFile(f)?(o(),i("video",{key:1,src:f.url,class:"preview-thumbnail",preload:"metadata"},null,8,jt)):(o(),i("img",{key:2,src:l.getFileIcon(f),alt:"file",class:"file-icon"},null,8,Xt))]),e("div",Jt,[e("div",{class:"name",title:f.name},C(f.name),9,Zt),e("div",ea,C(f.sizeFormatted||l.formatFileSize(f.size)),1)])],8,Yt),e("div",sa,[e("button",{class:"action-btn",onClick:w=>l.handlePreview(f),title:"预览"},[$(g)],8,ta),e("button",{class:"action-btn",onClick:w=>l.handleDownload(f),title:"下载"},[$(E)],8,aa)])]))),128))]),l.previewVisible?(o(),i("div",{key:0,class:"preview-modal",onClick:c[2]||(c[2]=(...f)=>l.closePreview&&l.closePreview(...f))},[e("div",{class:"preview-content",onClick:c[1]||(c[1]=le(()=>{},["stop"]))},[e("div",la,[e("span",null,C((S=l.currentDoc)==null?void 0:S.name),1),e("button",{class:"close-btn",onClick:c[0]||(c[0]=(...f)=>l.closePreview&&l.closePreview(...f))},[$(z)])]),e("div",na,[l.isImageFile(l.currentDoc)?(o(),i("img",{key:0,src:(b=l.currentDoc)==null?void 0:b.url,class:"preview-image",alt:"preview"},null,8,oa)):l.isVideoFile(l.currentDoc)?(o(),i("video",{key:1,src:(u=l.currentDoc)==null?void 0:u.url,controls:"",class:"preview-video"},null,8,ia)):(o(),i("div",ra,[$(r,{class:"large-icon"}),c[4]||(c[4]=e("p",null,"该文件类型暂不支持预览",-1))]))])])])):V("",!0)])}const da=se(Rt,[["render",ca],["__scopeId","data-v-e0b66e4b"]]),ua=xe({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:l=>["remote","local"].includes(l)}},emits:["update:enableSearch","search"],setup(l,{emit:c}){const h=d(""),y=d(!1),m=d(!1),D=d([]),r=d(1),g=d(20),E=Je(()=>l.searchType==="local"?"搜索本地知识库...":"搜索远程知识库...");oe(()=>l.searchResults,n=>{D.value=n}),oe(()=>l.message,n=>{n&&(h.value=n,z())});const z=async()=>{if(!(!h.value.trim()||y.value)){y.value=!0,r.value=1;try{c("search",{query:h.value,page:r.value,pageSize:g.value,type:l.searchType})}finally{y.value=!1}}},S=async()=>{if(!(y.value||!m.value)){y.value=!0,r.value+=1;try{c("search",{query:h.value,page:r.value,pageSize:g.value,type:l.searchType})}finally{y.value=!1}}};return{searchQuery:h,isSearching:y,displayResults:D,hasMore:m,handleSearch:z,clearSearch:()=>{h.value="",D.value=[],r.value=1,c("update:enableSearch",!1)},formatDate:n=>He(n).format("YYYY-MM-DD HH:mm"),handleScroll:n=>{const{scrollTop:v,scrollHeight:_,clientHeight:R}=n.target;_-v-R<50&&!y.value&&m.value&&S()},placeholder:E,formatContent:n=>n?n.replace(new RegExp(h.value,"gi"),v=>`<span style="color: #1677ff; font-weight: 500;">${v}</span>`):""}}}),va={class:"knowledge-results"},pa={class:"search-box"},ga={class:"input-wrapper"},ha=["placeholder"],ma=["disabled"],fa={class:"result-title"},wa=["innerHTML"],ya={class:"result-meta"},_a={class:"result-source"},ka={class:"result-date"},ba={key:0,class:"load-more"},Ca={key:1,class:"loading-state"},Sa={key:2,class:"empty-state"};function $a(l,c,h,y,m,D){return o(),i("div",va,[e("div",pa,[e("div",ga,[U(e("input",{"onUpdate:modelValue":c[0]||(c[0]=r=>l.searchQuery=r),type:"text",placeholder:l.placeholder,onKeyup:c[1]||(c[1]=Ie((...r)=>l.handleSearch&&l.handleSearch(...r),["enter"])),class:"search-input"},null,40,ha),[[ye,l.searchQuery]]),l.searchQuery?(o(),i("span",{key:0,class:"clear-icon",onClick:c[2]||(c[2]=(...r)=>l.clearSearch&&l.clearSearch(...r))},"×")):V("",!0)]),e("button",{onClick:c[3]||(c[3]=(...r)=>l.handleSearch&&l.handleSearch(...r)),disabled:l.isSearching,class:"search-button"},C(l.isSearching?"搜索中...":"搜索"),9,ma)]),!l.loading&&l.searchResults.length>0?(o(),i("div",{key:0,class:"results-container",ref:"resultsContainer",onScroll:c[4]||(c[4]=(...r)=>l.handleScroll&&l.handleScroll(...r))},[(o(!0),i(L,null,W(l.displayResults,r=>(o(),i("div",{key:r.id,class:"result-item"},[e("div",fa,C(r.title),1),e("div",{class:"result-content",innerHTML:l.formatContent(r.content)},null,8,wa),e("div",ya,[e("span",_a,"来源: "+C(r.source||"知识库"),1),e("span",ka,C(l.formatDate(r.date)),1)])]))),128)),l.hasMore?(o(),i("div",ba,c[5]||(c[5]=[e("div",{class:"loading-spinner"},null,-1),e("span",null,"加载更多...",-1)]))):V("",!0)],544)):l.loading?(o(),i("div",Ca,c[6]||(c[6]=[e("div",{class:"loading-spinner"},null,-1),e("p",null,"正在搜索...",-1)]))):(o(),i("div",Sa,[c[7]||(c[7]=e("div",{class:"empty-icon"},"🔍",-1)),e("p",null,C(l.searchQuery?"未找到相关内容":"请输入关键词搜索"),1)]))])}const Da=se(ua,[["render",$a],["__scopeId","data-v-827e992f"]]),Aa={class:"layout"},Ma=["src"],xa={class:"conversation-list"},Ia=["onClick"],Ta={class:"config-container"},Pa={class:"chat"},Ea={key:0,class:"welcome-section"},za={class:"suggestion-section"},Va={class:"cards-container"},La={class:"suggestion-card"},Ga={class:"suggestion-items"},Ua=["onClick"],Ba={class:"message-bubble"},Fa={class:"message-content"},Oa={key:0,class:"image-preview"},Wa=["src"],Ra={key:1,class:"video-preview"},qa=["src"],Na={key:2,class:"file-info-display"},Ka=["src"],Ya={class:"file-details"},Qa=["title"],Ha={class:"file-size"},ja=["innerHTML"],Xa={key:2},Ja={key:3,class:"audio-controls"},Za=["onClick"],el={key:0,class:"wave-animation"},sl=["src"],tl={class:"input-container"},al={class:"search-toggle-item"},ll={class:"toggle-content"},nl={class:"toggle-text"},ol={class:"toggle-switch"},il=["disabled"],rl={class:"search-toggle-item"},cl={class:"toggle-content"},dl={class:"toggle-text"},ul={class:"toggle-switch"},vl={key:0,class:"attachments-panel"},pl={class:"panel-content"},gl={key:0,style:{display:"flex","justify-content":"center"}},hl={key:0,class:"upload-loading"},ml={key:1},fl={class:"file-list"},wl={key:0,class:"file-loading"},yl=["src"],_l=["src"],kl=["src"],bl=["onClick"],Cl={key:0,class:"file-info"},Sl={class:"file-name"},$l={class:"file-size"},Dl={class:"input-wrapper"},Al=["disabled"],Ml={class:"right-menu-content"},xl={class:"right-menu-tabs"},Il={class:"panel-container"},Tl={class:"search-header"},Pl={class:"web-search-toggle"},El={for:"searchToggle",class:"toggle-label"},zl={class:"panel-container"},Vl={class:"panel-container"},Ll=0,Gl=800,Ul={__name:"report",setup(l){const c=new bs({html:!0,linkify:!0,typographer:!0});d(!1);const h=d(""),y=d(!1),m=d(!1),D=d(null),r=d([]),g=d([]);d(!1);const E=d(1),z=d(1),S=d(null);je();const b=d([{id:1,title:"当前会话",messages:[]}]),u=d(!1),f=d(null),w=d(!1),n=d(null),v=d(!1),_=d(null),R=d(!1),ce=d([]),de=d([]);let K=null;const T=d([]),j=d(!1),M=d(0),x=d(!1),J=d(!1),ze=d(!1),Y=d(!1),_e=d([]),ke=d(0),be=d(!1),Ce=()=>{ze.value=window.innerWidth<=768};ie(()=>{Ce(),window.addEventListener("resize",Ce)}),ae(()=>{window.removeEventListener("resize",Ce)});const Ze=()=>{J.value=!J.value,ze.value&&(document.body.style.overflow=J.value?"auto":"hidden",J.value||(m.value=!0))},ue=()=>{m.value=!1,document.querySelector(".chat")&&(document.querySelector(".chat").style.right=`${ge.value}px`)},es=async()=>{R.value=!0;try{const a=await N.get("https://ylaiapi.raycos.com.cn/api/document/summary");console.log("API Response:",a.data),a.data.code===200&&(_.value=a.data.data.items,console.log("Document Summary:",_.value),ss())}catch(a){console.error("获取文档摘要失败:",a)}finally{R.value=!1}},ss=()=>{K&&clearInterval(K);const a=()=>{var s;if(!((s=_.value)!=null&&s.length)){console.log("No document summary data available");return}try{const t=_.value[0];if(t!=null&&t.questions){const A=[...t.questions.map(P=>({question:P}))].sort(()=>.5-Math.random());ce.value=A.slice(0,3)}}catch(t){console.error("解析 Hot Topics 失败:",t)}try{const t=_.value[1];if(t!=null&&t.questions){const A=[...t.questions.map(P=>({question:P}))].sort(()=>.5-Math.random());de.value=A.slice(0,3)}}catch(t){console.error("解析 Design Guide 失败:",t)}};a(),K=setInterval(a,5e3)},ts=a=>{console.log("QA clicked:",a),a!=null&&a.question&&(h.value=a.question,Se())};ae(()=>{K&&clearInterval(K)}),ie(()=>{es()});const Ve=()=>{y.value=!y.value},as=a=>{r.value=r.value.filter(s=>s!==a)},Le=()=>{var a;v.value||(a=D.value)==null||a.click()},Ge=async a=>{try{const s=new FormData;s.append("file",a);const t=await N.post("https://ylaiapi.raycos.com.cn/upload/file",s,{headers:{"Content-Type":"multipart/form-data"}});if(t.data.status===200)return t.data.data.fileUrl;throw new Error(t.data.message||"文件上传失败")}catch(s){throw console.error("文件上传失败:",s),s}},Ue=async a=>{const s=Array.from(a.target.files);if(s.length===0)return;const t=10*1024*1024;if(s.filter(k=>!!(re(k)&&k.size>t)).length>0){alert("Video files must not exceed 10MB"),a.target.value="";return}v.value=!0;try{for(const k of s){const A={name:k.name,size:k.size,sizeFormatted:Be(k.size),type:k.type,isUploading:!0};r.value.push(A);try{const P=await Ge(k),q=r.value.findIndex(I=>I.name===k.name);q!==-1&&r.value.splice(q,1,{...A,url:P,isUploading:!1})}catch(P){r.value=r.value.filter(q=>q.name!==k.name),console.error("单个文件上传失败:",P)}}}catch(k){console.error("文件上传失败:",k)}finally{v.value=!1,a.target.value="",r.value.length>0&&(ue(),G.value="preview")}s.length>0&&x.value&&(x.value=!1)},Be=a=>{if(!a||isNaN(a))return"0 B";const s=1024,t=["B","KB","MB","GB"],p=Math.floor(Math.log(a)/Math.log(s));return parseFloat((a/Math.pow(s,p)).toFixed(2))+" "+t[p]},Fe=a=>a.url&&Z(a)?a.url:Ps,Z=a=>{var p,k,A;const s=["jpg","jpeg","png","gif","webp"],t=((A=(k=(p=a.name)==null?void 0:p.split("."))==null?void 0:k.pop())==null?void 0:A.toLowerCase())||"";return s.includes(t)},re=a=>{var p,k,A;const s=["mp4","webm","ogg"],t=((A=(k=(p=a.name)==null?void 0:p.split("."))==null?void 0:k.pop())==null?void 0:A.toLowerCase())||"";return s.includes(t)},ls=a=>{const s=a.name.split(".").pop().toLowerCase(),t=["jpg","jpeg","png","gif","webp"],p=["mp4","webm","ogg"];return t.includes(s)?"image":p.includes(s)?"video":"document"},ve=()=>{S.value&&Me(()=>{S.value.scrollTop=S.value.scrollHeight})},pe=d(""),Se=async()=>{var q;if(!h.value.trim()&&r.value.length===0||u.value)return;x.value&&(he.value=h.value);let a=h.value.trim();const s=[],t=[],p=[];r.value.forEach(I=>{const Q=ls(I);Q==="image"?s.push(I.url):Q==="video"?t.push(I.url):p.push(I.url)});const k={id:Date.now(),role:"user",content:a,displayContent:a,files:r.value.map(I=>({name:I.name,size:I.sizeFormatted,type:I.type,url:I.url}))};g.value.push(k),ve(),ns(a).catch(I=>{console.error("Web search failed:",I)});const A=h.value;y.value=!1,h.value="",[...r.value],r.value=[];const P={id:Date.now()+1,role:"assistant",content:"Thinking...",displayContent:"Thinking...",isLoading:!0};g.value.push(P),ve();try{const I=x.value?"https://ylaiapi.raycos.com.cn/api/chat/web-search-llm/":"https://ylaiapi.raycos.com.cn/api/chat/online/multimodal",Q=await N.post(I,{message:A,chat_config_id:"2",user_id:"13365429324",session_id:pe.value,source:"pc",image_urls:s,video_urls:t,documents:p});Q.data.data.session_id&&(pe.value=Q.data.data.session_id),g.value=g.value.filter(ms=>ms.id!==P.id);const fe=Te({id:Date.now()+2,role:"assistant",content:Q.data.data.answer,displayContent:"",audioData:((q=Q.data.data.audio_info)==null?void 0:q.audio)||null});g.value.push(fe),fe.audioData&&We(fe.audioData),await os(fe)}catch(I){console.error("发送消息失败:",I),g.value=g.value.filter(Q=>Q.id!==P.id),g.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{u.value=!1,await Me(),ve()}},ns=async a=>{j.value=!0;try{const s=await N.post("https://ylaiapi.raycos.com.cn/api/web-search-results/",{query:a,num_results:20,page:1,page_size:20,engine:"bing"});s.data&&s.data.code===200&&(T.value=s.data.data.results||[],M.value=s.data.data.total_results||0)}catch(s){console.error("Web search failed:",s),T.value=[],M.value=0}finally{j.value=!1}},os=async a=>{if(!a||!a.content){console.error("Invalid message or content is missing");return}return new Promise(s=>{let p=0;a.displayContent="";const k=()=>{p<a.content.length?(a.displayContent=a.content.substring(0,p+1),p++,Me(()=>{ve(),setTimeout(k,30)})):s()};k()})},is=()=>{z.value++;const a={id:Date.now(),title:`New Conversation ${z.value}`,messages:[]};b.value.push(a),pe.value="",Oe(a.id)},Oe=a=>{E.value=a;const s=b.value.find(t=>t.id===a);g.value=s?s.messages:[],pe.value=""},rs=async a=>{if(v.value)return;const s=Array.from(a.dataTransfer.files);if(s.length===0)return;const t=10*1024*1024;s.filter(p=>!!(re(p)&&p.size>t)),v.value=!0;try{for(const p of s){const k={name:p.name,size:p.size,sizeFormatted:Be(p.size),type:p.type,isUploading:!0};r.value.push(k);try{const A=await Ge(p),P=r.value.findIndex(q=>q.name===p.name);P!==-1&&r.value.splice(P,1,{...k,url:A,isUploading:!1})}catch(A){r.value=r.value.filter(P=>P.name!==p.name),console.error("单个文件上传失败:",A)}}}catch(p){console.error("文件上传失败:",p)}finally{v.value=!1,r.value.length>0&&(ue(),G.value="preview")}s.length>0&&x.value&&(x.value=!1)},cs=a=>{n.value===a.id?te():We(a.audioData,a.id)},We=async(a,s)=>{try{te();const t=new Audio(a);f.value=t,n.value=s,t.addEventListener("ended",()=>{te()}),t.addEventListener("error",p=>{console.error("音频播放错误:",p),te()}),await t.play(),w.value=!0}catch(t){console.error("音频播放失败:",t),te()}},te=()=>{f.value&&(f.value.pause(),f.value=null),w.value=!1,n.value=null};ae(()=>{te()});const ds=a=>a?c.render(a):"",ge=d(600),Re=a=>{a.preventDefault();const s=a.type==="mousedown"?a.clientX:a.touches[0].clientX,t=ge.value,p=A=>{if(m.value)return;const P=A.type==="mousemove"?A.clientX:A.touches[0].clientX,q=s-P;let I=Math.min(Math.max(t+q,Ll),Gl);ge.value=I,document.querySelector(".chat")&&(document.querySelector(".chat").style.right=`${I}px`)},k=()=>{document.removeEventListener("mousemove",p),document.removeEventListener("mouseup",k),document.removeEventListener("touchmove",p),document.removeEventListener("touchend",k)};document.addEventListener("mousemove",p),document.addEventListener("mouseup",k),document.addEventListener("touchmove",p),document.addEventListener("touchend",k)};d(!0);const he=d(""),us=()=>{(x.value||Y.value)&&h.value.trim()&&(he.value=h.value,Y.value&&Ne({query:h.value,page:1,pageSize:20}))},qe=a=>{x.value=a,a&&(ue(),G.value="search")},G=d("search"),vs=a=>{console.log("Selected document:",a)},ps=d(!1),$e=()=>{ps.value=window.innerWidth<=480};ie(()=>{$e(),window.addEventListener("resize",$e)}),ae(()=>{window.removeEventListener("resize",$e)});const me=d(!1),De=()=>{me.value=window.innerWidth<=768};ie(()=>{De(),window.addEventListener("resize",De)}),ae(()=>{window.removeEventListener("resize",De)});const gs=Je(()=>!m.value&&(x.value&&G.value==="search"||Y.value&&G.value==="knowledge"||G.value==="preview"&&r.value.length>0)),hs=a=>{Y.value=a,a&&(ue(),G.value="knowledge",h.value.trim()&&Ne({query:h.value,page:1,pageSize:20}))},Ne=async a=>{if(!(!a.query.trim()||!Y.value)){be.value=!0;try{const s=await N.post("https://ylaiapi.raycos.com.cn/api/knowledge-search/",{query:a.query,page:a.page,page_size:a.pageSize});s.data&&s.data.code===200&&(_e.value=s.data.data.results||[],ke.value=s.data.data.total||0)}catch(s){console.error("Knowledge search failed:",s),_e.value=[],ke.value=0}finally{be.value=!1}}};return(a,s)=>(o(),i("div",Aa,[e("div",{class:F(["menu",{collapsed:J.value}])},[e("div",{class:F(["collapse-left-button",{"menu-collapsed":J.value}]),onClick:Ze},[e("img",{src:J.value?B(Ts):B(Is),alt:"toggle",class:"collapse-icon"},null,8,Ma)],2),s[11]||(s[11]=e("div",{class:"logo"},[e("img",{src:"https://ecsaas.raycos.com.cn/web/uploads/20230713/3690c0badc2c7be4552a253f72d6d701.png",draggable:!1,alt:"logo",class:"logo-img"}),e("span",null,"Raycos Tech")],-1)),e("button",{class:"new-conversation-btn",onClick:is},s[10]||(s[10]=[e("img",{class:"tab-icon",src:Ye,alt:""},null,-1),e("span",null,"New Conversation",-1)])),e("div",xa,[(o(!0),i(L,null,W(b.value,t=>(o(),i("div",{key:t.id,class:F(["conversation-item",{active:E.value===t.id}]),onClick:p=>Oe(t.id)},C(t.title),11,Ia))),128))]),e("div",Ta,[$(Wt),$(Hs),$(Tt)])],2),e("div",Pa,[g.value.length===0?(o(),i("div",Ea,[e("div",za,[s[14]||(s[14]=e("h3",null,"嗨,我是你的智能助手",-1)),e("div",Va,[e("div",La,[s[12]||(s[12]=e("div",{class:"card-header"},[e("img",{src:$s,alt:"hot topics",class:"tab-icon"}),e("h4",null,"推荐问题")],-1)),s[13]||(s[13]=e("p",{class:"card-subtitle"},"为您精选的热门问题",-1)),e("div",Ga,[(o(!0),i(L,null,W([...ce.value,...de.value],(t,p)=>(o(),i("div",{key:p,class:"suggestion-item",onClick:k=>ts(t)},C(t.question),9,Ua))),128))])])])])])):(o(),i("div",{key:1,class:"message-list",ref_key:"messageList",ref:S},[(o(!0),i(L,null,W(g.value,t=>(o(),i("div",{key:t.id,class:F(["message-item",t.role==="user"?"user":"assistant"])},[e("div",Ba,[e("div",Fa,[t.role==="user"&&t.files?(o(!0),i(L,{key:0},W(t.files,p=>(o(),i("div",{key:p.name,class:"file-message"},[Z(p)?(o(),i("div",Oa,[e("img",{src:p.url,class:"preview-image"},null,8,Wa)])):re(p)?(o(),i("div",Ra,[e("video",{controls:"",class:"preview-video",src:p.url,preload:"metadata"}," Your browser does not support the video tag. ",8,qa)])):(o(),i("div",Na,[e("img",{src:Fe(p),class:"file-type-icon"},null,8,Ka),e("div",Ya,[e("span",{class:"file-name",title:p.name},C(p.name),9,Qa),e("span",Ha,C(p.size),1)])]))]))),128)):V("",!0),t.role==="assistant"?(o(),i("div",{key:1,class:"message-text",innerHTML:ds(t.displayContent)},null,8,ja)):(o(),i("div",Xa,C(t.content),1)),t.role==="assistant"&&t.audioData?(o(),i("div",Ja,[e("button",{class:"audio-btn",onClick:p=>cs(t)},[n.value===t.id?(o(),i("div",el,s[15]||(s[15]=[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)]))):(o(),i("img",{key:1,src:B(Es),alt:"播放",class:"audio-icon"},null,8,sl))],8,Za)])):V("",!0)])])],2))),128))],512)),e("div",tl,[e("div",{class:F(["search-toggles",{compact:me.value}])},[e("div",al,[e("div",ll,[$(B(Ss)),U(e("span",nl,"互联网",512),[[X,!me.value]]),e("div",ol,[U(e("input",{type:"checkbox",id:"webSearchToggle","onUpdate:modelValue":s[0]||(s[0]=t=>x.value=t),disabled:r.value.length>0,class:"toggle-input"},null,8,il),[[Ae,x.value]]),e("label",{for:"webSearchToggle",class:F(["toggle-label",{disabled:r.value.length>0}])},s[16]||(s[16]=[e("span",{class:"toggle-slider"},null,-1)]),2)])])]),e("div",rl,[e("div",cl,[$(B(Ke)),U(e("span",dl,"知识库",512),[[X,!me.value]]),e("div",ul,[U(e("input",{type:"checkbox",id:"knowledgeSearchToggle","onUpdate:modelValue":s[1]||(s[1]=t=>Y.value=t),onChange:s[2]||(s[2]=t=>hs(Y.value)),class:"toggle-input"},null,544),[[Ae,Y.value]]),s[17]||(s[17]=e("label",{for:"knowledgeSearchToggle",class:"toggle-label"},[e("span",{class:"toggle-slider"})],-1))])])])],2),y.value?(o(),i("div",vl,[e("div",pl,[e("div",{class:"attachments-header"},[s[19]||(s[19]=e("span",null,"Attachments",-1)),e("button",{class:"close-btn",onClick:Ve},s[18]||(s[18]=[e("img",{src:Ds,alt:""},null,-1)]))]),r.value.length===0?(o(),i("div",gl,[e("div",{class:F(["upload-area",{"has-files":r.value.length>0}]),onClick:Le,onDrop:le(rs,["prevent"]),onDragover:s[3]||(s[3]=le(()=>{},["prevent"])),onDragenter:s[4]||(s[4]=le(()=>{},["prevent"]))},[v.value?(o(),i("div",hl,s[20]||(s[20]=[e("div",{class:"loading-spinner"},null,-1),e("div",{class:"upload-text"},"Uploading...",-1)]))):(o(),i(L,{key:1},[s[21]||(s[21]=e("img",{src:As,alt:"upload",class:"upload-icon"},null,-1)),s[22]||(s[22]=e("div",{class:"upload-text"},"Upload files",-1)),s[23]||(s[23]=e("div",{class:"upload-hint"}," Click or drag files to this area to upload ",-1))],64)),e("input",{type:"file",ref_key:"fileInput",ref:D,style:{display:"none"},onChange:Ue,multiple:""},null,544)],34)])):V("",!0),r.value.length!==0?(o(),i("div",ml,[e("div",fl,[(o(!0),i(L,null,W(r.value,t=>(o(),i("div",{key:t.name,class:F(["file-item",{"is-image":Z(t)}])},[e("div",{class:F(Z(t)?"file-wrapper":"")},[t.isUploading?(o(),i("div",wl,s[24]||(s[24]=[e("div",{class:"loading-spinner"},null,-1)]))):Z(t)?(o(),i("img",{key:1,src:t.url,alt:"file",class:"file-icon"},null,8,yl)):re(t)?(o(),i("video",{key:2,src:t.url,class:"file-icon",preload:"metadata"}," Your browser does not support the video tag. ",8,_l)):(o(),i("img",{key:3,src:Fe(t),alt:"file",class:F(Z(t)||re(t)?"file-icon":"")},null,10,kl)),t.isUploading?V("",!0):(o(),i("button",{key:4,class:"remove-btn",onClick:le(p=>as(t),["stop"])}," × ",8,bl))],2),Z(t)?V("",!0):(o(),i("div",Cl,[e("span",Sl,C(t.name),1),e("span",$l,C(t.sizeFormatted),1)]))],2))),128)),e("button",{class:"add-more-btn",onClick:le(Le,["stop"])},s[25]||(s[25]=[e("img",{src:Ye,alt:"add"},null,-1)]))]),e("input",{type:"file",ref_key:"fileInput",ref:D,style:{display:"none"},onChange:Ue,multiple:""},null,544)])):V("",!0)])])):V("",!0),e("div",Dl,[e("button",{class:"attachment-btn",onClick:Ve},s[26]||(s[26]=[e("img",{src:Ms,alt:"attachment",class:"tab-icon"},null,-1)])),U(e("input",{type:"text",class:"message-input","onUpdate:modelValue":s[5]||(s[5]=t=>h.value=t),onKeyup:Ie(Se,["enter"]),onInput:us,placeholder:"Type a message..."},null,544),[[ye,h.value]]),e("button",{class:"send-btn",onClick:Se,disabled:!h.value&&r.value.length===0},s[27]||(s[27]=[e("img",{src:xs,alt:"send"},null,-1)]),8,Al)])])]),e("div",{class:F(["right_menu",{collapsed:!gs.value}]),style:Cs({width:ge.value+"px"})},[e("div",{class:"resize-handle",onMousedown:Re,onTouchstart:Re},null,32),e("div",Ml,[e("div",xl,[e("div",{class:F(["tab-item",{active:G.value==="search"}]),onClick:s[6]||(s[6]=t=>G.value="search")},[$(B(Qe)),s[28]||(s[28]=e("span",null,"搜索",-1))],2),e("div",{class:F(["tab-item",{active:G.value==="knowledge"}]),onClick:s[7]||(s[7]=t=>G.value="knowledge")},[$(B(Ke)),s[29]||(s[29]=e("span",null,"知识库",-1))],2),e("div",{class:F(["tab-item",{active:G.value==="preview"}]),onClick:s[8]||(s[8]=t=>G.value="preview")},[$(B(Xe)),s[30]||(s[30]=e("span",null,"文档预览",-1))],2)]),U(e("div",Il,[e("div",Tl,[s[31]||(s[31]=e("span",null,"搜索结果",-1)),e("div",Pl,[U(e("input",{type:"checkbox",id:"searchToggle","onUpdate:modelValue":s[9]||(s[9]=t=>x.value=t),class:"toggle-input",onChange:qe},null,544),[[Ae,x.value]]),e("label",El,C(x.value?"搜索已开启":"搜索已关闭"),1)])]),x.value?(o(),we(mt,{key:0,searchResults:T.value,loading:j.value,total:M.value,enableWebSearch:x.value,message:he.value,"onUpdate:enableWebSearch":qe},null,8,["searchResults","loading","total","enableWebSearch","message"])):V("",!0)],512),[[X,G.value==="search"]]),U(e("div",zl,[s[32]||(s[32]=e("div",{class:"preview-header"},[e("span",null,"文档预览")],-1)),$(da,{documents:r.value,onSelect:vs},null,8,["documents"])],512),[[X,G.value==="preview"]]),U(e("div",Vl,[s[33]||(s[33]=e("div",{class:"search-header"},[e("span",null,"知识库搜索结果")],-1)),Y.value?(o(),we(Da,{key:0,searchResults:_e.value,loading:be.value,total:ke.value,message:he.value},null,8,["searchResults","loading","total","message"])):V("",!0)],512),[[X,G.value==="knowledge"]])])],6)]))}},Ol=se(Ul,[["__scopeId","data-v-9d7cd494"]]);export{Ol as default};
|