@questdb/web-console 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/THIRD_PARTY_LICENSES.txt +9192 -0
- package/dist/assets/index-Cg4NZQY-.js +7079 -0
- package/dist/assets/index-DH6Mra5W.js +1055 -0
- package/dist/assets/{index-Blrq3gwz.css → index-DhT2UWZo.css} +2 -2
- package/dist/index.html +2 -2
- package/package.json +8 -5
- package/dist/assets/index-DU6JLCfQ.js +0 -6600
- package/dist/assets/index-ZyLe708n.js +0 -1046
- package/dist/fonts/PPFormula-SemiExtendedBold.otf +0 -0
- package/dist/fonts/PPFormula-SemiExtendedBold.ttf +0 -0
- package/dist/fonts/PPFormula-SemiExtendedBold.woff +0 -0
- package/dist/fonts/PPFormula-SemiExtendedBold.woff2 +0 -0
|
@@ -0,0 +1,1055 @@
|
|
|
1
|
+
import{p as G,Q as yt,s as se,u as Ne,a as it,j as r,A as st,K as Dt,c as f,B as ue,b as ot,t as fe,C as xe,e as ke,d as qt,f as F,g as ca,h as bt,i as Rt,k as da,l as ua,m as ha,n as Ct,o as Tt,q as Ae,r as ma,T as ga,v as zt,w as Bt,x as Ot,y as wt,z as ze,D as X,E as Le,F as kt,G as pa,H as Be,I as fa,J as ye,L as At,M as xa,N as $t,O as Oe,P as Se,R as ya,S as ba,U as Ca,V as wa,W as ka,X as $e,Y as Wt,Z as We,_ as Fe,$ as vt,a0 as Aa,a1 as va,a2 as Pt,a3 as Ma,a4 as Mt,a5 as jt,a6 as be,a7 as ja,a8 as Ut,a9 as Ha,aa as Ea,ab as _a,ac as Ia,ad as Za,ae as Va,af as Na,ag as La,ah as Sa,ai as Fa,aj as Da,ak as qa,al as oe,am as Ra,an as Ta,ao as za,ap as Qt,aq as De,ar as Ba,as as Oa,at as $a,au as Wa,av as Pa,aw as Ua,ax as lt,ay as Kt,az as Gt,aA as Qa,aB as Ka,aC as Xt,aD as Ga,aE as Xa,aF as Ya}from"./index-Cg4NZQY-.js";import{b as n,E as le,H as p,Z as Yt,R as Jt,C as Y,D as en,U as tn}from"./vendor-DsPrTxrp.js";const Ja=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),n.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]),er=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208.49,120.49a12,12,0,0,1-17,0L140,69V216a12,12,0,0,1-24,0V69L64.49,120.49a12,12,0,0,1-17-17l72-72a12,12,0,0,1,17,0l72,72A12,12,0,0,1,208.49,120.49Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),n.createElement("path",{d:"M205.66,106.34l-72-72a8,8,0,0,0-11.32,0l-72,72A8,8,0,0,0,56,120h64v96a8,8,0,0,0,16,0V120h64a8,8,0,0,0,5.66-13.66ZM75.31,104,128,51.31,180.69,104Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M207.39,115.06A8,8,0,0,1,200,120H136v96a8,8,0,0,1-16,0V120H56a8,8,0,0,1-5.66-13.66l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,207.39,115.06Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M204.24,116.24a6,6,0,0,1-8.48,0L134,54.49V216a6,6,0,0,1-12,0V54.49L60.24,116.24a6,6,0,0,1-8.48-8.48l72-72a6,6,0,0,1,8.48,0l72,72A6,6,0,0,1,204.24,116.24Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M205.66,117.66a8,8,0,0,1-11.32,0L136,59.31V216a8,8,0,0,1-16,0V59.31L61.66,117.66a8,8,0,0,1-11.32-11.32l72-72a8,8,0,0,1,11.32,0l72,72A8,8,0,0,1,205.66,117.66Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M202.83,114.83a4,4,0,0,1-5.66,0L132,49.66V216a4,4,0,0,1-8,0V49.66L58.83,114.83a4,4,0,0,1-5.66-5.66l72-72a4,4,0,0,1,5.66,0l72,72A4,4,0,0,1,202.83,114.83Z"}))]]),tr=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M88,128a16,16,0,1,1,16,16A16,16,0,0,1,88,128Zm64,16a16,16,0,1,0-16-16A16,16,0,0,0,152,144Zm84-80V192a20,20,0,0,1-20,20H84.47L53,239.17l-.12.11A19.91,19.91,0,0,1,40.05,244a20.14,20.14,0,0,1-8.49-1.9A19.82,19.82,0,0,1,20,224V64A20,20,0,0,1,40,44H216A20,20,0,0,1,236,64Zm-24,4H44V215.23l28.16-24.32A11.93,11.93,0,0,1,80,188H212Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,64V192a8,8,0,0,1-8,8H80L45.15,230.11A8,8,0,0,1,32,224V64a8,8,0,0,1,8-8H216A8,8,0,0,1,224,64Z",opacity:"0.2"}),n.createElement("path",{d:"M116,128a12,12,0,1,1,12,12A12,12,0,0,1,116,128ZM84,140a12,12,0,1,0-12-12A12,12,0,0,0,84,140Zm88,0a12,12,0,1,0-12-12A12,12,0,0,0,172,140Zm60-76V192a16,16,0,0,1-16,16H83l-32.6,28.16-.09.07A15.89,15.89,0,0,1,40,240a16.13,16.13,0,0,1-6.8-1.52A15.85,15.85,0,0,1,24,224V64A16,16,0,0,1,40,48H216A16,16,0,0,1,232,64ZM40,224h0ZM216,64H40V224l34.77-30A8,8,0,0,1,80,192H216Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.84,15.84,0,0,0,9.25,14.5A16.05,16.05,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM84,140a12,12,0,1,1,12-12A12,12,0,0,1,84,140Zm44,0a12,12,0,1,1,12-12A12,12,0,0,1,128,140Zm44,0a12,12,0,1,1,12-12A12,12,0,0,1,172,140Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M138,128a10,10,0,1,1-10-10A10,10,0,0,1,138,128ZM84,118a10,10,0,1,0,10,10A10,10,0,0,0,84,118Zm88,0a10,10,0,1,0,10,10A10,10,0,0,0,172,118Zm58-54V192a14,14,0,0,1-14,14H82.23L49.07,234.64l-.06.05A13.87,13.87,0,0,1,40,238a14.11,14.11,0,0,1-5.95-1.33A13.88,13.88,0,0,1,26,224V64A14,14,0,0,1,40,50H216A14,14,0,0,1,230,64Zm-12,0a2,2,0,0,0-2-2H40a2,2,0,0,0-2,2V224a2,2,0,0,0,3.26,1.55l34.82-30.08A6,6,0,0,1,80,194H216a2,2,0,0,0,2-2Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M116,128a12,12,0,1,1,12,12A12,12,0,0,1,116,128ZM84,140a12,12,0,1,0-12-12A12,12,0,0,0,84,140Zm88,0a12,12,0,1,0-12-12A12,12,0,0,0,172,140Zm60-76V192a16,16,0,0,1-16,16H83l-32.6,28.16-.09.07A15.89,15.89,0,0,1,40,240a16.13,16.13,0,0,1-6.8-1.52A15.85,15.85,0,0,1,24,224V64A16,16,0,0,1,40,48H216A16,16,0,0,1,232,64ZM40,224h0ZM216,64H40V224l34.77-30A8,8,0,0,1,80,192H216Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M136,128a8,8,0,1,1-8-8A8,8,0,0,1,136,128Zm-52-8a8,8,0,1,0,8,8A8,8,0,0,0,84,120Zm88,0a8,8,0,1,0,8,8A8,8,0,0,0,172,120Zm56-56V192a12,12,0,0,1-12,12H81.49L47.76,233.13l0,0A11.89,11.89,0,0,1,40,236a12.17,12.17,0,0,1-5.1-1.14A11.89,11.89,0,0,1,28,224V64A12,12,0,0,1,40,52H216A12,12,0,0,1,228,64Zm-8,0a4,4,0,0,0-4-4H40a4,4,0,0,0-4,4V224a4,4,0,0,0,6.56,3.08L77.38,197A4,4,0,0,1,80,196H216a4,4,0,0,0,4-4Z"}))]]),nr=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,44H40A20,20,0,0,0,20,64V224A19.82,19.82,0,0,0,31.56,242.1a20.14,20.14,0,0,0,8.49,1.9,19.91,19.91,0,0,0,12.82-4.72l.12-.11L84.47,212H216a20,20,0,0,0,20-20V64A20,20,0,0,0,216,44Zm-4,144H80a11.93,11.93,0,0,0-7.84,2.92L44,215.23V68H212ZM84,108A12,12,0,0,1,96,96h64a12,12,0,1,1,0,24H96A12,12,0,0,1,84,108Zm0,40a12,12,0,0,1,12-12h64a12,12,0,0,1,0,24H96A12,12,0,0,1,84,148Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,64V192a8,8,0,0,1-8,8H80L45.15,230.11A8,8,0,0,1,32,224V64a8,8,0,0,1,8-8H216A8,8,0,0,1,224,64Z",opacity:"0.2"}),n.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.84,15.84,0,0,0,9.25,14.5A16.05,16.05,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM160,152H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Zm0-32H96a8,8,0,0,1,0-16h64a8,8,0,0,1,0,16Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,50H40A14,14,0,0,0,26,64V224a13.88,13.88,0,0,0,8.09,12.69A14.11,14.11,0,0,0,40,238a13.87,13.87,0,0,0,9-3.31l.06-.05L82.23,206H216a14,14,0,0,0,14-14V64A14,14,0,0,0,216,50Zm2,142a2,2,0,0,1-2,2H80a6,6,0,0,0-3.92,1.46L41.26,225.53A2,2,0,0,1,38,224V64a2,2,0,0,1,2-2H216a2,2,0,0,1,2,2Zm-52-80a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,112Zm0,32a6,6,0,0,1-6,6H96a6,6,0,0,1,0-12h64A6,6,0,0,1,166,144Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,48H40A16,16,0,0,0,24,64V224a15.85,15.85,0,0,0,9.24,14.5A16.13,16.13,0,0,0,40,240a15.89,15.89,0,0,0,10.25-3.78l.09-.07L83,208H216a16,16,0,0,0,16-16V64A16,16,0,0,0,216,48ZM40,224h0ZM216,192H80a8,8,0,0,0-5.23,1.95L40,224V64H216ZM88,112a8,8,0,0,1,8-8h64a8,8,0,0,1,0,16H96A8,8,0,0,1,88,112Zm0,32a8,8,0,0,1,8-8h64a8,8,0,1,1,0,16H96A8,8,0,0,1,88,144Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,52H40A12,12,0,0,0,28,64V224a11.89,11.89,0,0,0,6.93,10.88A12.17,12.17,0,0,0,40,236a11.89,11.89,0,0,0,7.69-2.83l0,0L81.49,204H216a12,12,0,0,0,12-12V64A12,12,0,0,0,216,52Zm4,140a4,4,0,0,1-4,4H80a4,4,0,0,0-2.62,1L42.56,227.06A4,4,0,0,1,36,224V64a4,4,0,0,1,4-4H216a4,4,0,0,1,4,4Zm-56-80a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,112Zm0,32a4,4,0,0,1-4,4H96a4,4,0,0,1,0-8h64A4,4,0,0,1,164,144Z"}))]]),ar=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),n.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),rr=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M236,137A108.13,108.13,0,1,1,119,20,12,12,0,0,1,121,44,84.12,84.12,0,1,0,212,135,12,12,0,1,1,236,137ZM116,76v52a12,12,0,0,0,12,12h52a12,12,0,0,0,0-24H140V76a12,12,0,0,0-24,0Zm92,20a16,16,0,1,0-16-16A16,16,0,0,0,208,96ZM176,64a16,16,0,1,0-16-16A16,16,0,0,0,176,64Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),n.createElement("path",{d:"M232,136.66A104.12,104.12,0,1,1,119.34,24,8,8,0,0,1,120.66,40,88.12,88.12,0,1,0,216,135.34,8,8,0,0,1,232,136.66ZM120,72v56a8,8,0,0,0,8,8h56a8,8,0,0,0,0-16H136V72a8,8,0,0,0-16,0Zm40-24a12,12,0,1,0-12-12A12,12,0,0,0,160,48Zm36,24a12,12,0,1,0-12-12A12,12,0,0,0,196,72Zm24,36a12,12,0,1,0-12-12A12,12,0,0,0,220,108Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M208,96a12,12,0,1,1,12,12A12,12,0,0,1,208,96ZM196,72a12,12,0,1,0-12-12A12,12,0,0,0,196,72Zm28.66,56a8,8,0,0,0-8.63,7.31A88.12,88.12,0,1,1,120.66,40,8,8,0,0,0,119.34,24,104.12,104.12,0,1,0,232,136.66,8,8,0,0,0,224.66,128ZM128,56a72,72,0,1,1-72,72A72.08,72.08,0,0,1,128,56Zm-8,72a8,8,0,0,0,8,8h48a8,8,0,0,0,0-16H136V80a8,8,0,0,0-16,0Zm40-80a12,12,0,1,0-12-12A12,12,0,0,0,160,48Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M230,136.49A102.12,102.12,0,1,1,119.51,26a6,6,0,0,1,1,12A90.13,90.13,0,1,0,218,135.51a6,6,0,1,1,12,1ZM122,72v56a6,6,0,0,0,6,6h56a6,6,0,0,0,0-12H134V72a6,6,0,0,0-12,0Zm38-26a10,10,0,1,0-10-10A10,10,0,0,0,160,46Zm36,24a10,10,0,1,0-10-10A10,10,0,0,0,196,70Zm24,36a10,10,0,1,0-10-10A10,10,0,0,0,220,106Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M232,136.66A104.12,104.12,0,1,1,119.34,24,8,8,0,0,1,120.66,40,88.12,88.12,0,1,0,216,135.34,8,8,0,0,1,232,136.66ZM120,72v56a8,8,0,0,0,8,8h56a8,8,0,0,0,0-16H136V72a8,8,0,0,0-16,0Zm40-24a12,12,0,1,0-12-12A12,12,0,0,0,160,48Zm36,24a12,12,0,1,0-12-12A12,12,0,0,0,196,72Zm24,36a12,12,0,1,0-12-12A12,12,0,0,0,220,108Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M228,136.33A100.13,100.13,0,1,1,119.67,28a4,4,0,1,1,.66,8A92.13,92.13,0,1,0,220,135.67a4,4,0,1,1,8,.66ZM128,132h56a4,4,0,0,0,0-8H132V72a4,4,0,0,0-8,0v56A4,4,0,0,0,128,132Zm32-88a8,8,0,1,0-8-8A8,8,0,0,0,160,44Zm36,24a8,8,0,1,0-8-8A8,8,0,0,0,196,68Zm24,36a8,8,0,1,0-8-8A8,8,0,0,0,220,104Z"}))]]),ir=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M140,80v41.21l34.17,20.5a12,12,0,1,1-12.34,20.58l-40-24A12,12,0,0,1,116,128V80a12,12,0,0,1,24,0ZM128,28A99.38,99.38,0,0,0,57.24,57.34c-4.69,4.74-9,9.37-13.24,14V64a12,12,0,0,0-24,0v40a12,12,0,0,0,12,12H72a12,12,0,0,0,0-24H57.77C63,86,68.37,80.22,74.26,74.26a76,76,0,1,1,1.58,109,12,12,0,0,0-16.48,17.46A100,100,0,1,0,128,28Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),n.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,128A96,96,0,0,1,62.11,197.82a8,8,0,1,1,11-11.64A80,80,0,1,0,71.43,71.43C67.9,75,64.58,78.51,61.35,82L77.66,98.34A8,8,0,0,1,72,112H32a8,8,0,0,1-8-8V64a8,8,0,0,1,13.66-5.66L50,70.7c3.22-3.49,6.54-7,10.06-10.55A96,96,0,0,1,224,128ZM128,72a8,8,0,0,0-8,8v48a8,8,0,0,0,3.88,6.86l40,24a8,8,0,1,0,8.24-13.72L136,123.47V80A8,8,0,0,0,128,72Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M134,80v44.6l37.09,22.25a6,6,0,0,1-6.18,10.3l-40-24A6,6,0,0,1,122,128V80a6,6,0,0,1,12,0Zm-6-46A93.4,93.4,0,0,0,61.51,61.56c-8.58,8.68-16,17-23.51,25.8V64a6,6,0,0,0-12,0v40a6,6,0,0,0,6,6H72a6,6,0,0,0,0-12H44.73C52.86,88.29,60.79,79.35,70,70a82,82,0,1,1,1.7,117.62,6,6,0,1,0-8.24,8.72A94,94,0,1,0,128,34Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M136,80v43.47l36.12,21.67a8,8,0,0,1-8.24,13.72l-40-24A8,8,0,0,1,120,128V80a8,8,0,0,1,16,0Zm-8-48A95.44,95.44,0,0,0,60.08,60.15C52.81,67.51,46.35,74.59,40,82V64a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H72a8,8,0,0,0,0-16H49c7.15-8.42,14.27-16.35,22.39-24.57a80,80,0,1,1,1.66,114.75,8,8,0,1,0-11,11.64A96,96,0,1,0,128,32Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M132,80v45.74l38.06,22.83a4,4,0,0,1-4.12,6.86l-40-24A4,4,0,0,1,124,128V80a4,4,0,0,1,8,0Zm-4-44A91.42,91.42,0,0,0,62.93,63C53.05,73,44.66,82.47,36,92.86V64a4,4,0,0,0-8,0v40a4,4,0,0,0,4,4H72a4,4,0,0,0,0-8H40.47C49.61,89,58.3,79,68.6,68.6a84,84,0,1,1,1.75,120.49,4,4,0,1,0-5.5,5.82A92,92,0,1,0,128,36Z"}))]]),sr=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M51.51,104.49l-32-32a12,12,0,0,1,0-17l32-32a12,12,0,1,1,17,17L45,64,68.49,87.51a12,12,0,0,1-17,17Zm48,0a12,12,0,0,0,17,0l32-32a12,12,0,0,0,0-17l-32-32a12,12,0,1,0-17,17L123,64,99.51,87.51A12,12,0,0,0,99.51,104.49ZM200,36H180a12,12,0,0,0,0,24h16V196H60V140a12,12,0,0,0-24,0v60a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M152,32V96a16,16,0,0,1-16,16H32A16,16,0,0,1,16,96V32A16,16,0,0,1,32,16H136A16,16,0,0,1,152,32Z",opacity:"0.2"}),n.createElement("path",{d:"M58.34,101.66l-32-32a8,8,0,0,1,0-11.32l32-32A8,8,0,0,1,69.66,37.66L43.31,64,69.66,90.34a8,8,0,0,1-11.32,11.32Zm40,0a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0,0-11.32l-32-32A8,8,0,0,0,98.34,37.66L124.69,64,98.34,90.34A8,8,0,0,0,98.34,101.66ZM200,40H176a8,8,0,0,0,0,16h24V200H56V136a8,8,0,0,0-16,0v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M200,40H168a16,16,0,0,0-16-16H32A16,16,0,0,0,16,40v80a16,16,0,0,0,16,16h8v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40ZM106.34,61.66a8,8,0,0,1,11.32-11.32l24,24a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32-11.32L124.69,80Zm-64,24a8,8,0,0,1,0-11.32l24-24A8,8,0,0,1,77.66,61.66L59.31,80,77.66,98.34a8,8,0,0,1-11.32,11.32ZM200,200H56V136h96a16,16,0,0,0,16-16V56h32Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M59.76,100.24l-32-32a6,6,0,0,1,0-8.48l32-32a6,6,0,1,1,8.48,8.48L40.49,64,68.24,91.76a6,6,0,1,1-8.48,8.48Zm40,0a6,6,0,0,0,8.48,0l32-32a6,6,0,0,0,0-8.48l-32-32a6,6,0,1,0-8.48,8.48L127.51,64,99.76,91.76A6,6,0,0,0,99.76,100.24ZM200,42H176a6,6,0,0,0,0,12h24a2,2,0,0,1,2,2V200a2,2,0,0,1-2,2H56a2,2,0,0,1-2-2V136a6,6,0,0,0-12,0v64a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M58.34,101.66l-32-32a8,8,0,0,1,0-11.32l32-32A8,8,0,0,1,69.66,37.66L43.31,64,69.66,90.34a8,8,0,0,1-11.32,11.32Zm40,0a8,8,0,0,0,11.32,0l32-32a8,8,0,0,0,0-11.32l-32-32A8,8,0,0,0,98.34,37.66L124.69,64,98.34,90.34A8,8,0,0,0,98.34,101.66ZM200,40H176a8,8,0,0,0,0,16h24V200H56V136a8,8,0,0,0-16,0v64a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M61.17,98.83l-32-32a4,4,0,0,1,0-5.66l32-32a4,4,0,0,1,5.66,5.66L37.66,64,66.83,93.17a4,4,0,0,1-5.66,5.66Zm40,0a4,4,0,0,0,5.66,0l32-32a4,4,0,0,0,0-5.66l-32-32a4,4,0,0,0-5.66,5.66L130.34,64,101.17,93.17A4,4,0,0,0,101.17,98.83ZM200,44H176a4,4,0,0,0,0,8h24a4,4,0,0,1,4,4V200a4,4,0,0,1-4,4H56a4,4,0,0,1-4-4V136a4,4,0,0,0-8,0v64a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44Z"}))]]),or=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M209.88,69.83A115.19,115.19,0,0,0,128,36h-.41C63.85,36.22,12,88.76,12,153.13V176a20,20,0,0,0,20,20H224a20,20,0,0,0,20-20V152A115.25,115.25,0,0,0,209.88,69.83ZM220,172H127.32l46.44-65A12,12,0,1,0,154.24,93L97.82,172H36V153.13c0-1.72,0-3.43.14-5.13H56a12,12,0,0,0,0-24H40.62c10.91-33.39,40-58.52,75.38-63.21V80a12,12,0,0,0,24,0V60.8A92,92,0,0,1,215.66,124H200a12,12,0,0,0,0,24h19.9c.06,1.33.1,2.66.1,4Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M232,152v24a8,8,0,0,1-8,8H32a8,8,0,0,1-8-8V153.13C24,95.65,70.15,48.2,127.63,48A104,104,0,0,1,232,152Z",opacity:"0.2"}),n.createElement("path",{d:"M207.06,72.67A111.24,111.24,0,0,0,128,40h-.4C66.07,40.21,16,91,16,153.13V176a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V152A111.25,111.25,0,0,0,207.06,72.67ZM224,176H119.71l54.76-75.3a8,8,0,0,0-12.94-9.42L99.92,176H32V153.13c0-3.08.15-6.12.43-9.13H56a8,8,0,0,0,0-16H35.27c10.32-38.86,44-68.24,84.73-71.66V80a8,8,0,0,0,16,0V56.33A96.14,96.14,0,0,1,221,128H200a8,8,0,0,0,0,16h23.67c.21,2.65.33,5.31.33,8Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M240,152v24a16,16,0,0,1-16,16H115.93a4,4,0,0,1-3.24-6.35L174.27,101a8.21,8.21,0,0,0-1.37-11.3,8,8,0,0,0-11.37,1.61l-72,99.06A4,4,0,0,1,86.25,192H32a16,16,0,0,1-16-16V153.13c0-1.79,0-3.57.13-5.33a4,4,0,0,1,4-3.8H48a8,8,0,0,0,8-8.53A8.17,8.17,0,0,0,47.73,128H23.92a4,4,0,0,1-3.87-5c12-43.84,49.66-77.13,95.52-82.28a4,4,0,0,1,4.43,4V72a8,8,0,0,0,8.53,8A8.17,8.17,0,0,0,136,71.73V44.67a4,4,0,0,1,4.43-4A112.18,112.18,0,0,1,236.23,123a4,4,0,0,1-3.88,5H208.27a8.17,8.17,0,0,0-8.25,7.47,8,8,0,0,0,8,8.53h27.92a4,4,0,0,1,4,3.86C240,149.23,240,150.61,240,152Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M205.65,74.08A109.26,109.26,0,0,0,128,42h-.39C67.17,42.21,18,92.06,18,153.13V176a14,14,0,0,0,14,14H224a14,14,0,0,0,14-14V152A109.3,109.3,0,0,0,205.65,74.08ZM226,176a2,2,0,0,1-2,2H115.78l57.07-78.47a6,6,0,0,0-9.7-7.06L100.94,178H32a2,2,0,0,1-2-2V153.13A102.36,102.36,0,0,1,30.62,142H56a6,6,0,0,0,0-12H32.71C42.6,88.4,78.53,56.86,122,54.19V80a6,6,0,0,0,12,0V54.19A98.05,98.05,0,0,1,223.53,130H200a6,6,0,0,0,0,12h25.5c.33,3.3.5,6.64.5,10Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M207.06,72.67A111.24,111.24,0,0,0,128,40h-.4C66.07,40.21,16,91,16,153.13V176a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V152A111.25,111.25,0,0,0,207.06,72.67ZM224,176H119.71l54.76-75.3a8,8,0,0,0-12.94-9.42L99.92,176H32V153.13c0-3.08.15-6.12.43-9.13H56a8,8,0,0,0,0-16H35.27c10.32-38.86,44-68.24,84.73-71.66V80a8,8,0,0,0,16,0V56.33A96.14,96.14,0,0,1,221,128H200a8,8,0,0,0,0,16h23.67c.21,2.65.33,5.31.33,8Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M204.23,75.5A107.37,107.37,0,0,0,127.62,44C68.28,44.21,20,93.16,20,153.13V176a12,12,0,0,0,12,12H224a12,12,0,0,0,12-12V152A107.25,107.25,0,0,0,204.23,75.5ZM228,176a4,4,0,0,1-4,4H111.85l59.38-81.65a4,4,0,1,0-6.46-4.7L102,180H32a4,4,0,0,1-4-4V153.13A103.42,103.42,0,0,1,28.84,140H56a4,4,0,0,0,0-8H30.21C39.59,87.66,77.84,53.93,124,52.09V80a4,4,0,0,0,8,0V52.08A100.08,100.08,0,0,1,226,132H200a4,4,0,0,0,0,8h27.29a101.6,101.6,0,0,1,.71,12Z"}))]]),lr=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M71.51,144.49a12,12,0,0,1,0-17l24-24a12,12,0,0,1,17,17L109,124h55V104a12,12,0,0,1,24,0v32a12,12,0,0,1-12,12H109l3.52,3.51a12,12,0,0,1-17,17ZM236,56V200a20,20,0,0,1-20,20H40a20,20,0,0,1-20-20V56A20,20,0,0,1,40,36H216A20,20,0,0,1,236,56Zm-24,4H44V196H212Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,56V200a8,8,0,0,1-8,8H40a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H216A8,8,0,0,1,224,56Z",opacity:"0.2"}),n.createElement("path",{d:"M184,104v32a8,8,0,0,1-8,8H99.31l10.35,10.34a8,8,0,0,1-11.32,11.32l-24-24a8,8,0,0,1,0-11.32l24-24a8,8,0,0,1,11.32,11.32L99.31,128H168V104a8,8,0,0,1,16,0Zm48-48V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,40H40A16,16,0,0,0,24,56V200a16,16,0,0,0,16,16H216a16,16,0,0,0,16-16V56A16,16,0,0,0,216,40Zm-32,96a8,8,0,0,1-8,8H99.31l10.35,10.34a8,8,0,0,1-11.32,11.32l-24-24a8,8,0,0,1,0-11.32l24-24a8,8,0,0,1,11.32,11.32L99.31,128H168V104a8,8,0,0,1,16,0Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M182,104v32a6,6,0,0,1-6,6H94.48l13.76,13.76a6,6,0,1,1-8.48,8.48l-24-24a6,6,0,0,1,0-8.48l24-24a6,6,0,0,1,8.48,8.48L94.48,130H170V104a6,6,0,0,1,12,0Zm48-48V200a14,14,0,0,1-14,14H40a14,14,0,0,1-14-14V56A14,14,0,0,1,40,42H216A14,14,0,0,1,230,56Zm-12,0a2,2,0,0,0-2-2H40a2,2,0,0,0-2,2V200a2,2,0,0,0,2,2H216a2,2,0,0,0,2-2Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M184,104v32a8,8,0,0,1-8,8H99.31l10.35,10.34a8,8,0,0,1-11.32,11.32l-24-24a8,8,0,0,1,0-11.32l24-24a8,8,0,0,1,11.32,11.32L99.31,128H168V104a8,8,0,0,1,16,0Zm48-48V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56ZM216,200V56H40V200H216Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M180,104v32a4,4,0,0,1-4,4H89.66l17.17,17.17a4,4,0,0,1-5.66,5.66l-24-24a4,4,0,0,1,0-5.66l24-24a4,4,0,0,1,5.66,5.66L89.66,132H172V104a4,4,0,0,1,8,0Zm48-48V200a12,12,0,0,1-12,12H40a12,12,0,0,1-12-12V56A12,12,0,0,1,40,44H216A12,12,0,0,1,228,56Zm-8,0a4,4,0,0,0-4-4H40a4,4,0,0,0-4,4V200a4,4,0,0,0,4,4H216a4,4,0,0,0,4-4Z"}))]]),cr=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),n.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),dr=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M230.15,70.54,185.46,25.86a20,20,0,0,0-28.28,0L33.86,149.17A19.86,19.86,0,0,0,28,163.31V208a20,20,0,0,0,20,20H216a12,12,0,0,0,0-24H125L230.15,98.83A20,20,0,0,0,230.15,70.54ZM91,204H52V165l84-84,39,39ZM192,103,153,64l18.34-18.34,39,39Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M221.66,90.34,192,120,136,64l29.66-29.66a8,8,0,0,1,11.31,0L221.66,79A8,8,0,0,1,221.66,90.34Z",opacity:"0.2"}),n.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM48,163.31l88-88L180.69,120l-88,88H48Zm144-54.62L147.32,64l24-24L216,84.69Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM192,108.69,147.32,64l24-24L216,84.69Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M225.91,74.79,181.22,30.1a14,14,0,0,0-19.8,0L38.1,153.41a13.94,13.94,0,0,0-4.1,9.9V208a14,14,0,0,0,14,14H216a6,6,0,0,0,0-12H110.49L225.91,94.59A14,14,0,0,0,225.91,74.79ZM93.52,210H48a2,2,0,0,1-2-2V163.31a2,2,0,0,1,.59-1.41L136,72.49,183.52,120ZM217.42,86.1,192,111.52,144.49,64,169.9,38.59a2,2,0,0,1,2.83,0l44.69,44.68A2,2,0,0,1,217.42,86.1Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M227.32,73.37,182.63,28.69a16,16,0,0,0-22.63,0L36.69,152A15.86,15.86,0,0,0,32,163.31V208a16,16,0,0,0,16,16H216a8,8,0,0,0,0-16H115.32l112-112A16,16,0,0,0,227.32,73.37ZM92.69,208H48V163.31l88-88L180.69,120ZM192,108.69,147.32,64l24-24L216,84.69Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224.49,76.2,179.8,31.51a12,12,0,0,0-17,0L39.51,154.83A12,12,0,0,0,36,163.31V208a12,12,0,0,0,12,12H216a4,4,0,0,0,0-8H105.66L224.49,93.17A12,12,0,0,0,224.49,76.2ZM94.34,212H48a4,4,0,0,1-4-4V163.31a4,4,0,0,1,1.17-2.82L136,69.66,186.35,120ZM218.83,87.51,192,114.34,141.66,64l26.83-26.83a4,4,0,0,1,5.66,0l44.68,44.69A4,4,0,0,1,218.83,87.51Z"}))]]),ur=new Map([["bold",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,48H40a12,12,0,0,0,0,24h4V208a20,20,0,0,0,20,20H192a20,20,0,0,0,20-20V72h4a12,12,0,0,0,0-24ZM188,204H68V72H188ZM76,20A12,12,0,0,1,88,8h80a12,12,0,0,1,0,24H88A12,12,0,0,1,76,20Z"}))],["duotone",n.createElement(n.Fragment,null,n.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),n.createElement("path",{d:"M216,48H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM192,208H64V64H192ZM80,24a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H88A8,8,0,0,1,80,24Z"}))],["fill",n.createElement(n.Fragment,null,n.createElement("path",{d:"M224,56a8,8,0,0,1-8,8h-8V208a16,16,0,0,1-16,16H64a16,16,0,0,1-16-16V64H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,56ZM88,32h80a8,8,0,0,0,0-16H88a8,8,0,0,0,0,16Z"}))],["light",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,50H40a6,6,0,0,0,0,12H50V208a14,14,0,0,0,14,14H192a14,14,0,0,0,14-14V62h10a6,6,0,0,0,0-12ZM194,208a2,2,0,0,1-2,2H64a2,2,0,0,1-2-2V62H194ZM82,24a6,6,0,0,1,6-6h80a6,6,0,0,1,0,12H88A6,6,0,0,1,82,24Z"}))],["regular",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,48H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM192,208H64V64H192ZM80,24a8,8,0,0,1,8-8h80a8,8,0,0,1,0,16H88A8,8,0,0,1,80,24Z"}))],["thin",n.createElement(n.Fragment,null,n.createElement("path",{d:"M216,52H40a4,4,0,0,0,0,8H52V208a12,12,0,0,0,12,12H192a12,12,0,0,0,12-12V60h12a4,4,0,0,0,0-8ZM196,208a4,4,0,0,1-4,4H64a4,4,0,0,1-4-4V60H196ZM84,24a4,4,0,0,1,4-4h80a4,4,0,0,1,0,8H88A4,4,0,0,1,84,24Z"}))]]),nn=n.forwardRef((e,t)=>n.createElement(G,{ref:t,...e,weights:Ja}));nn.displayName="ArrowCounterClockwiseIcon";const an=n.forwardRef((e,t)=>n.createElement(G,{ref:t,...e,weights:er}));an.displayName="ArrowUpIcon";const rn=n.forwardRef((e,t)=>n.createElement(G,{ref:t,...e,weights:tr}));rn.displayName="ChatDotsIcon";const sn=n.forwardRef((e,t)=>n.createElement(G,{ref:t,...e,weights:nr}));sn.displayName="ChatTextIcon";const on=n.forwardRef((e,t)=>n.createElement(G,{ref:t,...e,weights:ar}));on.displayName="CheckIcon";const ln=n.forwardRef((e,t)=>n.createElement(G,{ref:t,...e,weights:rr}));ln.displayName="ClockCountdownIcon";const cn=n.forwardRef((e,t)=>n.createElement(G,{ref:t,...e,weights:ir}));cn.displayName="ClockCounterClockwiseIcon";const dn=n.forwardRef((e,t)=>n.createElement(G,{ref:t,...e,weights:sr}));dn.displayName="CodeBlockIcon";const un=n.forwardRef((e,t)=>n.createElement(G,{ref:t,...e,weights:or}));un.displayName="GaugeIcon";const hn=n.forwardRef((e,t)=>n.createElement(G,{ref:t,...e,weights:lr}));hn.displayName="KeyReturnIcon";const mn=n.forwardRef((e,t)=>n.createElement(G,{ref:t,...e,weights:cr}));mn.displayName="MagnifyingGlassIcon";const gn=n.forwardRef((e,t)=>n.createElement(G,{ref:t,...e,weights:dr}));gn.displayName="PencilSimpleLineIcon";const pn=n.forwardRef((e,t)=>n.createElement(G,{ref:t,...e,weights:ur}));pn.displayName="TrashSimpleIcon";const hr=p(F).attrs({alignItems:"center",gap:"0"}).withConfig({displayName:"ExplainQueryButton__KeyBinding"})([`
|
|
2
|
+
color: `,`;
|
|
3
|
+
`],({theme:e})=>e.color.pinkPrimary),mr=ot.isMacintosh||ot.isIOS?"\u2318":"Ctrl",gr=ot.isMacintosh||ot.isIOS?"Cmd+E":"Ctrl+E",pr=p(ue).withConfig({displayName:"ExplainQueryButton__ExplainButton"})([`
|
|
4
|
+
gap: 1rem;
|
|
5
|
+
`]),fr=({conversationId:e,queryText:t})=>{const{quest:a}=n.useContext(yt),i=le(se.query.getTables),{setStatus:l,abortController:o,hasSchemaAccess:s,currentModel:d,apiKey:h,aiAssistantSettings:x}=Ne(),{addMessage:g,updateMessage:c,updateConversationName:w,persistMessages:b,setIsStreaming:y}=it(),A=()=>{fe(xe.AI_EXPLAIN_QUERY),ke(qt({conversationId:e,queryText:t,settings:{model:d,apiKey:h},aiAssistantSettings:x,questClient:a,tables:i,hasSchemaAccess:s,abortSignal:o==null?void 0:o.signal}),{addMessage:g,updateMessage:c,setStatus:l,setIsStreaming:y,persistMessages:b,updateConversationName:w})};return r.jsxs(pr,{skin:"gradient",gradientWeight:"thin",onClick:A,title:`Explain query with AI Assistant (${gr})`,"data-hook":"button-explain-query",children:[r.jsx(st,{size:12,variant:"hollow"}),"Explain query",r.jsxs(hr,{children:[r.jsx(Dt,{keyString:mr,color:f("pinkPrimary"),hoverColor:f("pinkPrimary")}),r.jsx(Dt,{keyString:"E",color:f("pinkPrimary"),hoverColor:f("pinkPrimary")})]})]})},fn=(e,t,a,i)=>{if(!(a!=null&&a.current)||!i.current)return null;const l=i.current.getModel();if(!l)return null;const o=a.current[t.toString()];if(!o)return null;const s=o[e];if(!s||!s.error)return null;const d=s.selection?s.selection.startOffset:s.startOffset,h=s.selection?s.selection.endOffset:s.endOffset,x=l.getPositionAt(d),g=l.getPositionAt(d+s.error.position),c=l.getWordAtPosition(g),w=l.getPositionAt(h),b=s.selection?l.getValueInRange({startLineNumber:x.lineNumber,startColumn:x.column,endLineNumber:w.lineNumber,endColumn:w.column}):ca(e).queryText;return{errorMessage:s.error.error||"Query execution failed",word:c?c.word:null,fixStart:d,fixEnd:h,queryText:b}},xr=p(ue).withConfig({displayName:"FixQueryButton__FixButton"})([`
|
|
6
|
+
gap: 1rem;
|
|
7
|
+
`]),yr=()=>{const{quest:e}=n.useContext(yt),{editorRef:t,executionRefs:a}=bt(),i=le(se.query.getTables),{setStatus:l,abortController:o,hasSchemaAccess:s,currentModel:d,apiKey:h,aiAssistantSettings:x}=Ne(),{chatWindowState:g,getConversationMeta:c,addMessage:w,updateMessage:b,updateConversationName:y,persistMessages:A,setIsStreaming:v}=it(),M=()=>{fe(xe.AI_FIX_QUERY);const C=g.activeConversationId,k=c(C),_=fn(k.queryKey,k.bufferId,a,t),{errorMessage:H,queryText:L,word:Z}=_;ke(Rt({conversationId:C,queryText:L,errorMessage:H,errorWord:Z??void 0,settings:{model:d,apiKey:h},aiAssistantSettings:x,questClient:e,tables:i,hasSchemaAccess:s,abortSignal:o==null?void 0:o.signal}),{addMessage:w,updateMessage:b,setStatus:l,setIsStreaming:v,persistMessages:A,updateConversationName:y})};return r.jsxs(xr,{skin:"gradient",gradientWeight:"thin",onClick:M,title:"Fix query with AI Assistant","data-hook":"button-fix-query",children:[r.jsx(st,{size:12,variant:"hollow"}),"Fix query"]})},xn=p.div.withConfig({displayName:"AssistantModesCompact__Container"})([`
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-direction: column;
|
|
10
|
+
gap: 0.4rem;
|
|
11
|
+
align-items: flex-start;
|
|
12
|
+
width: 100%;
|
|
13
|
+
overflow-y: auto;
|
|
14
|
+
overflow-x: hidden;
|
|
15
|
+
min-height: 0;
|
|
16
|
+
`]),yn=p.div.withConfig({displayName:"AssistantModesCompact__ModeHeader"})([`
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-shrink: 0;
|
|
19
|
+
width: 100%;
|
|
20
|
+
|
|
21
|
+
`,`
|
|
22
|
+
`,`
|
|
23
|
+
gap: 0.8rem;
|
|
24
|
+
`],({$expanded:e})=>e?Y([`
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
align-items: flex-start;
|
|
27
|
+
`]):Y([`
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: space-between;
|
|
30
|
+
padding: 0.4rem;
|
|
31
|
+
`]),({$abort:e})=>e&&Y([`
|
|
32
|
+
opacity: 0.7;
|
|
33
|
+
`])),Ht=p.div.withConfig({displayName:"AssistantModesCompact__ModeChevron"})([`
|
|
34
|
+
width: 1.4rem;
|
|
35
|
+
height: 1.4rem;
|
|
36
|
+
flex-shrink: 0;
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
justify-content: center;
|
|
40
|
+
color: `,`;
|
|
41
|
+
cursor: pointer;
|
|
42
|
+
transition:
|
|
43
|
+
color 0.2s,
|
|
44
|
+
transform 0.2s;
|
|
45
|
+
transform: rotate(`,`);
|
|
46
|
+
`],f("gray2"),({$expanded:e})=>e?"90deg":"0deg"),Et=p.div.withConfig({displayName:"AssistantModesCompact__ModeTitle"})([`
|
|
47
|
+
font-weight: 500;
|
|
48
|
+
font-size: 1.4rem;
|
|
49
|
+
color: `,`;
|
|
50
|
+
text-align: center;
|
|
51
|
+
margin-right: auto;
|
|
52
|
+
transition: color 0.2s;
|
|
53
|
+
flex-shrink: 0;
|
|
54
|
+
|
|
55
|
+
`,`
|
|
56
|
+
`,`
|
|
57
|
+
`],f("gray2"),({$isActive:e})=>e&&Ot,({$isTopLevel:e})=>e&&Y([`
|
|
58
|
+
color: `,`;
|
|
59
|
+
`],f("foreground"))),bn=p.div.withConfig({displayName:"AssistantModesCompact__ModeHeaderTop"})([`
|
|
60
|
+
display: flex;
|
|
61
|
+
gap: 0.8rem;
|
|
62
|
+
align-items: center;
|
|
63
|
+
flex-shrink: 0;
|
|
64
|
+
`,`
|
|
65
|
+
`,`
|
|
66
|
+
`,`
|
|
67
|
+
`],({$expanded:e})=>e&&Y([`
|
|
68
|
+
padding: 0.4rem;
|
|
69
|
+
`]),({$expanded:e})=>!e&&Y([`
|
|
70
|
+
min-height: 0;
|
|
71
|
+
min-width: 0;
|
|
72
|
+
`]),({$isExpandable:e})=>e&&Y([`
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
user-select: none;
|
|
75
|
+
&:hover `,", &:hover ",` {
|
|
76
|
+
color: `,`;
|
|
77
|
+
}
|
|
78
|
+
`],Et,Ht,f("foreground"))),Cn=p.div.withConfig({displayName:"AssistantModesCompact__ExpandableWrapper"})([`
|
|
79
|
+
display: grid;
|
|
80
|
+
grid-template-rows: `,`;
|
|
81
|
+
transition:
|
|
82
|
+
grid-template-rows 0.1s ease-out,
|
|
83
|
+
opacity 0.3s ease-out;
|
|
84
|
+
width: 100%;
|
|
85
|
+
|
|
86
|
+
`,`
|
|
87
|
+
`],({$expanded:e})=>e?"1fr":"0fr",({$expanded:e})=>!e&&Y([`
|
|
88
|
+
height: 0;
|
|
89
|
+
opacity: 0;
|
|
90
|
+
`])),wn=p.div.withConfig({displayName:"AssistantModesCompact__ExpandableContent"})([`
|
|
91
|
+
min-height: 0;
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
`]),br=p.div.withConfig({displayName:"AssistantModesCompact__ReasoningThread"})([`
|
|
94
|
+
display: flex;
|
|
95
|
+
flex-direction: column;
|
|
96
|
+
gap: 0.8rem;
|
|
97
|
+
align-items: flex-start;
|
|
98
|
+
padding: 0 2.8rem;
|
|
99
|
+
`]),ct=p.div.withConfig({displayName:"AssistantModesCompact__ReasoningItem"})([`
|
|
100
|
+
display: flex;
|
|
101
|
+
gap: 0.5rem;
|
|
102
|
+
align-items: center;
|
|
103
|
+
padding: 0.4rem;
|
|
104
|
+
padding-left: 0;
|
|
105
|
+
`]),Pe=p.div.withConfig({displayName:"AssistantModesCompact__ReasoningIcon"})([`
|
|
106
|
+
width: 1.4rem;
|
|
107
|
+
height: 1.4rem;
|
|
108
|
+
flex-shrink: 0;
|
|
109
|
+
display: flex;
|
|
110
|
+
align-items: center;
|
|
111
|
+
justify-content: center;
|
|
112
|
+
color: `,`;
|
|
113
|
+
`],f("foreground")),dt=p.div.withConfig({displayName:"AssistantModesCompact__ReasoningText"})([`
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-wrap: wrap;
|
|
116
|
+
gap: 0.4rem;
|
|
117
|
+
align-items: center;
|
|
118
|
+
min-height: 0;
|
|
119
|
+
min-width: 0;
|
|
120
|
+
`]),ee=p.span.withConfig({displayName:"AssistantModesCompact__ReasoningTextPart"})([`
|
|
121
|
+
font-weight: 400;
|
|
122
|
+
font-size: 1.4rem;
|
|
123
|
+
color: `,`;
|
|
124
|
+
`],f("gray2")),ve=p.div.withConfig({displayName:"AssistantModesCompact__CodeBadge"})([`
|
|
125
|
+
background: `,`;
|
|
126
|
+
border: 1px solid `,`;
|
|
127
|
+
border-radius: 0.4rem;
|
|
128
|
+
padding: 0 0.4rem;
|
|
129
|
+
display: flex;
|
|
130
|
+
align-items: center;
|
|
131
|
+
justify-content: center;
|
|
132
|
+
transform: translateY(1px);
|
|
133
|
+
`],f("background"),f("selection")),Me=p.span.withConfig({displayName:"AssistantModesCompact__CodeBadgeText"})([`
|
|
134
|
+
font-family: `,`;
|
|
135
|
+
font-size: 1.2rem;
|
|
136
|
+
color: `,`;
|
|
137
|
+
`],({theme:e})=>e.fontMonospace,f("purple")),Cr=p(on).withConfig({displayName:"AssistantModesCompact__CheckIcon"})([`
|
|
138
|
+
width: 1.6rem;
|
|
139
|
+
height: 1.6rem;
|
|
140
|
+
color: `,`;
|
|
141
|
+
flex-shrink: 0;
|
|
142
|
+
`],f("pink")),wr=p(Bt).withConfig({displayName:"AssistantModesCompact__CloseCircleIcon"})([`
|
|
143
|
+
color: `,`;
|
|
144
|
+
flex-shrink: 0;
|
|
145
|
+
`],f("red")),kr=({size:e=20})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 256 256",style:{flexShrink:0},children:[r.jsx("defs",{children:r.jsxs("linearGradient",{id:"checkCircleGradient",x1:"128",x2:"128",y1:"24",y2:"232",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#d14671"}),r.jsx("stop",{offset:"1",stopColor:"#892c6c"})]})}),r.jsx("path",{fill:"url(#checkCircleGradient)",d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"})]}),Ar=p.div.withConfig({displayName:"AssistantModesCompact__CollapsedSectionsWrapper"})([`
|
|
146
|
+
display: flex;
|
|
147
|
+
flex-direction: column;
|
|
148
|
+
gap: 0.8rem;
|
|
149
|
+
padding-left: 2.8rem;
|
|
150
|
+
`]),vr=p.span.withConfig({displayName:"AssistantModesCompact__DurationText"})([`
|
|
151
|
+
font-size: 1.2rem;
|
|
152
|
+
color: `,`;
|
|
153
|
+
font-family: `,`;
|
|
154
|
+
font-weight: 400;
|
|
155
|
+
flex-shrink: 0;
|
|
156
|
+
transform: translateY(1px);
|
|
157
|
+
`],f("graphLegend"),({theme:e})=>e.fontMonospace),Mr=(e,t)=>{if(e===Ae.Processing&&t&&"type"in t)switch(t.type){case"fix":return"Processing fix request";case"explain":return"Processing explain request";default:return e}return e},kn=e=>[Ae.InvestigatingTable,Ae.InvestigatingDocs].includes(e.type),jr=({operationHistory:e,status:t,isLive:a=!1,onScrollNeeded:i,collapsed:l=!1,responseStart:o})=>{const s=Yt(),[d,h]=n.useState({}),[x,g]=n.useState(!1),c=n.useRef(0),w=n.useRef(null),b=n.useMemo(()=>da(e,t,a),[e,t,a]),y=n.useRef(a);n.useEffect(()=>{if(y.current&&!a){const C={};b.forEach(k=>{C[k.id]=!0}),h(C)}else if(a&&b.length>c.current){const C={};b.forEach((k,_)=>{_<b.length-1&&(C[k.id]=!0)}),h(C),i==null||i()}c.current=b.length,y.current=a},[b,a,i]);const A=C=>{h(k=>{const _=b.find(T=>T.id===C),H=_?kn(_):!1,L=b.findIndex(T=>T.id===C)===b.length-1,Z=l?!1:a?L:!0;return k[C]===void 0?{...k,[C]:Z&&H}:{...k,[C]:!k[C]}})},v=n.useMemo(()=>{var k;if(e.length===0)return null;const C=(k=e[0])==null?void 0:k.timestamp;return!C||!o?null:ua(o-C)},[e,o]);if(e.length===0)return null;const M=b.map((C,k)=>{const _=kn(C),H=k===b.length-1,L=l?!1:a?H:!0,Z=d[C.id]===void 0?L&&_:!d[C.id]&&_,T=b[k+1],V=ha(C,T,o);return r.jsxs(yn,{$expanded:Z,$abort:C.abort,children:[r.jsxs(bn,{$expanded:Z,$isExpandable:_,"data-hook":`assistant-mode-${C.type.toLowerCase().replace(/\s+/g,"-")}`,role:"presentation",onClick:_?()=>A(C.id):void 0,children:[r.jsx(Pe,{children:C.active?r.jsx(Ct,{size:14}):C.abort?r.jsx(wr,{size:14}):r.jsx(Cr,{})}),r.jsxs(F,{gap:"0.3rem",children:[r.jsx(Et,{$isActive:C.active,children:C.type}),V&&r.jsxs(vr,{children:["(",V,")"]}),_&&r.jsx(Ht,{$expanded:Z,children:r.jsx(Tt,{size:14})})]})]}),_&&r.jsx(Cn,{$expanded:Z,children:r.jsx(wn,{children:r.jsx(br,{children:C.operations.map((m,I)=>{const N=`${C.id}-${I}-${JSON.stringify(m.args)}`;if(m.type===Ae.Processing){const S=Mr(m.type,m.args);return r.jsxs(ct,{children:[r.jsx(Pe,{children:r.jsx(ma,{style:{width:"14px",height:"14px"}})}),r.jsx(dt,{children:r.jsx(ee,{children:S})})]},N)}if(m.type===Ae.InvestigatingTable){const S=m.args&&"name"in m.args?m.args.name:"table",B=m.args&&"tableOpType"in m.args?m.args.tableOpType:"details";return r.jsxs(ct,{children:[r.jsx(Pe,{children:r.jsx(ga,{size:14,color:s.color.gray2})}),r.jsxs(dt,{children:[r.jsx(ee,{children:"Investigating"}),r.jsx(ve,{children:r.jsx(Me,{children:S})}),r.jsx(ee,{children:B})]})]},N)}if(m.type===Ae.InvestigatingDocs){const S=m.args&&"items"in m.args&&Array.isArray(m.args.items)?m.args.items:null;if(S&&S.length>0)return r.jsx(Jt.Fragment,{children:S.map((ae,Ce)=>{const He=`${N}-item-${Ce}`;return r.jsxs(ct,{children:[r.jsx(Pe,{children:r.jsx(zt,{size:14,color:s.color.gray2})}),r.jsx(dt,{children:ae.section?r.jsxs(r.Fragment,{children:[r.jsx(ee,{children:"Investigating"}),r.jsx(ve,{children:r.jsx(Me,{children:ae.section})}),r.jsx(ee,{children:"in"}),r.jsx(ve,{children:r.jsx(Me,{children:ae.name})})]}):r.jsxs(r.Fragment,{children:[r.jsx(ee,{children:"Investigating"}),r.jsx(ve,{children:r.jsx(Me,{children:ae.name})})]})})]},He)})},N);const B=m.args&&"name"in m.args?m.args.name:null,te=m.args&&"section"in m.args?m.args.section:null;return r.jsxs(ct,{children:[r.jsx(Pe,{children:r.jsx(zt,{size:14})}),r.jsx(dt,{children:B&&te?r.jsxs(r.Fragment,{children:[r.jsx(ee,{children:"Investigating"}),r.jsx(ve,{children:r.jsx(Me,{children:te})}),r.jsx(ee,{children:"in"}),r.jsx(ve,{children:r.jsx(Me,{children:B})}),r.jsx(ee,{children:"documentation"})]}):B?r.jsxs(r.Fragment,{children:[r.jsx(ee,{children:"Investigating"}),r.jsx(ve,{children:r.jsx(Me,{children:B})}),r.jsx(ee,{children:"documentation"})]}):r.jsx(ee,{children:"Investigating documentation"})})]},N)}return null})})})})]},C.id)});return l?r.jsx(xn,{ref:w,"data-hook":"assistant-modes-container",children:r.jsxs(yn,{$expanded:x,$abort:!1,children:[r.jsxs(bn,{$expanded:x,$isExpandable:!0,onClick:()=>g(C=>!C),"data-hook":"assistant-mode-processing-collapsed",role:"presentation",children:[r.jsx(kr,{size:20}),r.jsx(Et,{$isActive:!1,children:v?`Thought for ${v}`:"Thought"}),r.jsx(Ht,{$expanded:x,children:r.jsx(Tt,{size:14})})]}),r.jsx(Cn,{$expanded:x,children:r.jsx(wn,{children:r.jsx(Ar,{children:M})})})]})}):r.jsx(xn,{ref:w,"data-hook":"assistant-modes-container",children:M})},Hr={tokenize:Nr,partial:!0},An={tokenize:Lr,partial:!0},vn={tokenize:Sr,partial:!0},Mn={tokenize:Fr,partial:!0},Er={tokenize:Dr,partial:!0},jn={tokenize:Zr,previous:En},Hn={tokenize:Vr,previous:_n},he={tokenize:Ir,previous:In},ce={},_r={text:ce};let je=48;for(;je<123;)ce[je]=he,je++,je===58?je=65:je===91&&(je=97);ce[43]=he,ce[45]=he,ce[46]=he,ce[95]=he,ce[72]=[he,Hn],ce[104]=[he,Hn],ce[87]=[he,jn],ce[119]=[he,jn];function Ir(e,t,a){const i=this;let l,o;return s;function s(c){return!_t(c)||!In.call(i,i.previous)||It(i.events)?a(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(c))}function d(c){return _t(c)?(e.consume(c),d):c===64?(e.consume(c),h):a(c)}function h(c){return c===46?e.check(Er,g,x)(c):c===45||c===95||wt(c)?(o=!0,e.consume(c),h):g(c)}function x(c){return e.consume(c),l=!0,h}function g(c){return o&&l&&ze(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(c)):a(c)}}function Zr(e,t,a){const i=this;return l;function l(s){return s!==87&&s!==119||!En.call(i,i.previous)||It(i.events)?a(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Hr,e.attempt(An,e.attempt(vn,o),a),a)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(s)}}function Vr(e,t,a){const i=this;let l="",o=!1;return s;function s(c){return(c===72||c===104)&&_n.call(i,i.previous)&&!It(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(c),e.consume(c),d):a(c)}function d(c){if(ze(c)&&l.length<5)return l+=String.fromCodePoint(c),e.consume(c),d;if(c===58){const w=l.toLowerCase();if(w==="http"||w==="https")return e.consume(c),h}return a(c)}function h(c){return c===47?(e.consume(c),o?x:(o=!0,h)):a(c)}function x(c){return c===null||pa(c)||X(c)||Le(c)||kt(c)?a(c):e.attempt(An,e.attempt(vn,g),a)(c)}function g(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(c)}}function Nr(e,t,a){let i=0;return l;function l(s){return(s===87||s===119)&&i<3?(i++,e.consume(s),l):s===46&&i===3?(e.consume(s),o):a(s)}function o(s){return s===null?a(s):t(s)}}function Lr(e,t,a){let i,l,o;return s;function s(x){return x===46||x===95?e.check(Mn,h,d)(x):x===null||X(x)||Le(x)||x!==45&&kt(x)?h(x):(o=!0,e.consume(x),s)}function d(x){return x===95?i=!0:(l=i,i=void 0),e.consume(x),s}function h(x){return l||i||!o?a(x):t(x)}}function Sr(e,t){let a=0,i=0;return l;function l(s){return s===40?(a++,e.consume(s),l):s===41&&i<a?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(Mn,t,o)(s):s===null||X(s)||Le(s)?t(s):(e.consume(s),l)}function o(s){return s===41&&i++,e.consume(s),l}}function Fr(e,t,a){return i;function i(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),i):d===38?(e.consume(d),o):d===93?(e.consume(d),l):d===60||d===null||X(d)||Le(d)?t(d):a(d)}function l(d){return d===null||d===40||d===91||X(d)||Le(d)?t(d):i(d)}function o(d){return ze(d)?s(d):a(d)}function s(d){return d===59?(e.consume(d),i):ze(d)?(e.consume(d),s):a(d)}}function Dr(e,t,a){return i;function i(o){return e.consume(o),l}function l(o){return wt(o)?a(o):t(o)}}function En(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||X(e)}function _n(e){return!ze(e)}function In(e){return!(e===47||_t(e))}function _t(e){return e===43||e===45||e===46||e===95||wt(e)}function It(e){let t=e.length,a=!1;for(;t--;){const i=e[t][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){a=!0;break}if(i._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const qr={tokenize:Pr,partial:!0};function Rr(){return{document:{91:{tokenize:Or,continuation:{tokenize:$r},exit:Wr}},text:{91:{tokenize:Br},93:{add:"after",tokenize:Tr,resolveTo:zr}}}}function Tr(e,t,a){const i=this;let l=i.events.length;const o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s;for(;l--;){const h=i.events[l][1];if(h.type==="labelImage"){s=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return d;function d(h){if(!s||!s._balanced)return a(h);const x=Be(i.sliceSerialize({start:s.end,end:i.now()}));return x.codePointAt(0)!==94||!o.includes(x.slice(1))?a(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function zr(e,t){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const i={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},d=[e[a+1],e[a+2],["enter",i,t],e[a+3],e[a+4],["enter",l,t],["exit",l,t],["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",i,t]];return e.splice(a,e.length-a+1,...d),e}function Br(e,t,a){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o=0,s;return d;function d(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),h}function h(c){return c!==94?a(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",x)}function x(c){if(o>999||c===93&&!s||c===null||c===91||X(c))return a(c);if(c===93){e.exit("chunkString");const w=e.exit("gfmFootnoteCallString");return l.includes(Be(i.sliceSerialize(w)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):a(c)}return X(c)||(s=!0),o++,e.consume(c),c===92?g:x}function g(c){return c===91||c===92||c===93?(e.consume(c),o++,x):x(c)}}function Or(e,t,a){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o,s=0,d;return h;function h(y){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),x}function x(y){return y===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):a(y)}function g(y){if(s>999||y===93&&!d||y===null||y===91||X(y))return a(y);if(y===93){e.exit("chunkString");const A=e.exit("gfmFootnoteDefinitionLabelString");return o=Be(i.sliceSerialize(A)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(y),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),w}return X(y)||(d=!0),s++,e.consume(y),y===92?c:g}function c(y){return y===91||y===92||y===93?(e.consume(y),s++,g):g(y)}function w(y){return y===58?(e.enter("definitionMarker"),e.consume(y),e.exit("definitionMarker"),l.includes(o)||l.push(o),ye(e,b,"gfmFootnoteDefinitionWhitespace")):a(y)}function b(y){return t(y)}}function $r(e,t,a){return e.check(fa,t,e.attempt(qr,t,a))}function Wr(e){e.exit("gfmFootnoteDefinition")}function Pr(e,t,a){const i=this;return ye(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const s=i.events[i.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?t(o):a(o)}}function Ur(e){let t=(e||{}).singleTilde;const a={tokenize:l,resolveAll:i};return t==null&&(t=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function i(o,s){let d=-1;for(;++d<o.length;)if(o[d][0]==="enter"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._close){let h=d;for(;h--;)if(o[h][0]==="exit"&&o[h][1].type==="strikethroughSequenceTemporary"&&o[h][1]._open&&o[d][1].end.offset-o[d][1].start.offset===o[h][1].end.offset-o[h][1].start.offset){o[d][1].type="strikethroughSequence",o[h][1].type="strikethroughSequence";const x={type:"strikethrough",start:Object.assign({},o[h][1].start),end:Object.assign({},o[d][1].end)},g={type:"strikethroughText",start:Object.assign({},o[h][1].end),end:Object.assign({},o[d][1].start)},c=[["enter",x,s],["enter",o[h][1],s],["exit",o[h][1],s],["enter",g,s]],w=s.parser.constructs.insideSpan.null;w&&At(c,c.length,0,xa(w,o.slice(h+1,d),s)),At(c,c.length,0,[["exit",g,s],["enter",o[d][1],s],["exit",o[d][1],s],["exit",x,s]]),At(o,h-1,d-h+3,c),d=h+c.length-2;break}}for(d=-1;++d<o.length;)o[d][1].type==="strikethroughSequenceTemporary"&&(o[d][1].type="data");return o}function l(o,s,d){const h=this.previous,x=this.events;let g=0;return c;function c(b){return h===126&&x[x.length-1][1].type!=="characterEscape"?d(b):(o.enter("strikethroughSequenceTemporary"),w(b))}function w(b){const y=$t(h);if(b===126)return g>1?d(b):(o.consume(b),g++,w);if(g<2&&!t)return d(b);const A=o.exit("strikethroughSequenceTemporary"),v=$t(b);return A._open=!v||v===2&&!!y,A._close=!y||y===2&&!!v,s(b)}}}class Qr{constructor(){this.map=[]}add(t,a,i){Kr(this,t,a,i)}consume(t){if(this.map.sort((o,s)=>o[0]-s[0]),this.map.length===0)return;let a=this.map.length;const i=[];for(;a>0;)a-=1,i.push(t.slice(this.map[a][0]+this.map[a][1])),i.push(this.map[a][2]),t.length=this.map[a][0];i.push([...t]),t.length=0;let l=i.pop();for(;l;)t.push(...l),l=i.pop();this.map.length=0}}function Kr(e,t,a,i){let l=0;if(!(a===0&&i.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=a,e.map[l][2].push(...i);return}l+=1}e.map.push([t,a,i])}}function Gr(e,t){let a=!1;const i=[];for(;t<e.length;){const l=e[t];if(a){if(l[0]==="enter")l[1].type==="tableContent"&&i.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=i.length-1;i[o]=i[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(a=!0);t+=1}return i}const Xr={flow:{null:{tokenize:Yr,resolveAll:Jr}}};function Yr(e,t,a){const i=this;let l=0,o=0,s;return d;function d(m){let I=i.events.length-1;for(;I>-1;){const B=i.events[I][1].type;if(B==="lineEnding"||B==="linePrefix")I--;else break}const N=I>-1?i.events[I][1].type:null,S=N==="tableHead"||N==="tableRow"?L:h;return S===L&&i.parser.lazy[i.now().line]?a(m):S(m)}function h(m){return e.enter("tableHead"),e.enter("tableRow"),x(m)}function x(m){return m===124||(s=!0,o+=1),g(m)}function g(m){return m===null?a(m):Oe(m)?o>1?(o=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),b):a(m):Se(m)?ye(e,g,"whitespace")(m):(o+=1,s&&(s=!1,l+=1),m===124?(e.enter("tableCellDivider"),e.consume(m),e.exit("tableCellDivider"),s=!0,g):(e.enter("data"),c(m)))}function c(m){return m===null||m===124||X(m)?(e.exit("data"),g(m)):(e.consume(m),m===92?w:c)}function w(m){return m===92||m===124?(e.consume(m),c):c(m)}function b(m){return i.interrupt=!1,i.parser.lazy[i.now().line]?a(m):(e.enter("tableDelimiterRow"),s=!1,Se(m)?ye(e,y,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):y(m))}function y(m){return m===45||m===58?v(m):m===124?(s=!0,e.enter("tableCellDivider"),e.consume(m),e.exit("tableCellDivider"),A):H(m)}function A(m){return Se(m)?ye(e,v,"whitespace")(m):v(m)}function v(m){return m===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(m),e.exit("tableDelimiterMarker"),M):m===45?(o+=1,M(m)):m===null||Oe(m)?_(m):H(m)}function M(m){return m===45?(e.enter("tableDelimiterFiller"),C(m)):H(m)}function C(m){return m===45?(e.consume(m),C):m===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(m),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(m))}function k(m){return Se(m)?ye(e,_,"whitespace")(m):_(m)}function _(m){return m===124?y(m):m===null||Oe(m)?!s||l!==o?H(m):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(m)):H(m)}function H(m){return a(m)}function L(m){return e.enter("tableRow"),Z(m)}function Z(m){return m===124?(e.enter("tableCellDivider"),e.consume(m),e.exit("tableCellDivider"),Z):m===null||Oe(m)?(e.exit("tableRow"),t(m)):Se(m)?ye(e,Z,"whitespace")(m):(e.enter("data"),T(m))}function T(m){return m===null||m===124||X(m)?(e.exit("data"),Z(m)):(e.consume(m),m===92?V:T)}function V(m){return m===92||m===124?(e.consume(m),T):T(m)}}function Jr(e,t){let a=-1,i=!0,l=0,o=[0,0,0,0],s=[0,0,0,0],d=!1,h=0,x,g,c;const w=new Qr;for(;++a<e.length;){const b=e[a],y=b[1];b[0]==="enter"?y.type==="tableHead"?(d=!1,h!==0&&(Zn(w,t,h,x,g),g=void 0,h=0),x={type:"table",start:Object.assign({},y.start),end:Object.assign({},y.end)},w.add(a,0,[["enter",x,t]])):y.type==="tableRow"||y.type==="tableDelimiterRow"?(i=!0,c=void 0,o=[0,0,0,0],s=[0,a+1,0,0],d&&(d=!1,g={type:"tableBody",start:Object.assign({},y.start),end:Object.assign({},y.end)},w.add(a,0,[["enter",g,t]])),l=y.type==="tableDelimiterRow"?2:g?3:1):l&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")?(i=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=ut(w,t,o,l,void 0,c),o=[0,0,0,0]),s[2]=a)):y.type==="tableCellDivider"&&(i?i=!1:(o[1]!==0&&(s[0]=s[1],c=ut(w,t,o,l,void 0,c)),o=s,s=[o[1],a,0,0])):y.type==="tableHead"?(d=!0,h=a):y.type==="tableRow"||y.type==="tableDelimiterRow"?(h=a,o[1]!==0?(s[0]=s[1],c=ut(w,t,o,l,a,c)):s[1]!==0&&(c=ut(w,t,s,l,a,c)),l=0):l&&(y.type==="data"||y.type==="tableDelimiterMarker"||y.type==="tableDelimiterFiller")&&(s[3]=a)}for(h!==0&&Zn(w,t,h,x,g),w.consume(t.events),a=-1;++a<t.events.length;){const b=t.events[a];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=Gr(t.events,a))}return e}function ut(e,t,a,i,l,o){const s=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",d="tableContent";a[0]!==0&&(o.end=Object.assign({},qe(t.events,a[0])),e.add(a[0],0,[["exit",o,t]]));const h=qe(t.events,a[1]);if(o={type:s,start:Object.assign({},h),end:Object.assign({},h)},e.add(a[1],0,[["enter",o,t]]),a[2]!==0){const x=qe(t.events,a[2]),g=qe(t.events,a[3]),c={type:d,start:Object.assign({},x),end:Object.assign({},g)};if(e.add(a[2],0,[["enter",c,t]]),i!==2){const w=t.events[a[2]],b=t.events[a[3]];if(w[1].end=Object.assign({},b[1].end),w[1].type="chunkText",w[1].contentType="text",a[3]>a[2]+1){const y=a[2]+1,A=a[3]-a[2]-1;e.add(y,A,[])}}e.add(a[3]+1,0,[["exit",c,t]])}return l!==void 0&&(o.end=Object.assign({},qe(t.events,l)),e.add(l,0,[["exit",o,t]]),o=void 0),o}function Zn(e,t,a,i,l){const o=[],s=qe(t.events,a);l&&(l.end=Object.assign({},s),o.push(["exit",l,t])),i.end=Object.assign({},s),o.push(["exit",i,t]),e.add(a+1,0,o)}function qe(e,t){const a=e[t],i=a[0]==="enter"?"start":"end";return a[1][i]}const ei={tokenize:ni},ti={text:{91:ei}};function ni(e,t,a){const i=this;return l;function l(h){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?a(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),o)}function o(h){return X(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),s):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),s):a(h)}function s(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):a(h)}function d(h){return Oe(h)?t(h):Se(h)?e.check({tokenize:ai},t,a)(h):a(h)}}function ai(e,t,a){return ye(e,i,"whitespace");function i(l){return l===null?a(l):t(l)}}function ri(e){return ya([_r,Rr(),Ur(e),Xr,ti])}function Vn(e,t){const a=String(e);if(typeof t!="string")throw new TypeError("Expected character");let i=0,l=a.indexOf(t);for(;l!==-1;)i++,l=a.indexOf(t,l+t.length);return i}function ii(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const si={}.hasOwnProperty,oi=(function(e,t,a,i){let l,o;typeof t=="string"||t instanceof RegExp?(o=[[t,a]],l=i):(o=t,l=a),l||(l={});const s=ba(l.ignore||[]),d=li(o);let h=-1;for(;++h<d.length;)Ca(e,"text",x);return e;function x(c,w){let b=-1,y;for(;++b<w.length;){const A=w[b];if(s(A,y?y.children.indexOf(A):void 0,y))return;y=A}if(y)return g(c,w)}function g(c,w){const b=w[w.length-1],y=d[h][0],A=d[h][1];let v=0;const M=b.children.indexOf(c);let C=!1,k=[];y.lastIndex=0;let _=y.exec(c.value);for(;_;){const H=_.index,L={index:_.index,input:_.input,stack:[...w,c]};let Z=A(..._,L);if(typeof Z=="string"&&(Z=Z.length>0?{type:"text",value:Z}:void 0),Z!==!1&&(v!==H&&k.push({type:"text",value:c.value.slice(v,H)}),Array.isArray(Z)?k.push(...Z):Z&&k.push(Z),v=H+_[0].length,C=!0),!y.global)break;_=y.exec(c.value)}return C?(v<c.value.length&&k.push({type:"text",value:c.value.slice(v)}),b.children.splice(M,1,...k)):k=[c],M+k.length}});function li(e){const t=[];if(typeof e!="object")throw new TypeError("Expected array or object as schema");if(Array.isArray(e)){let a=-1;for(;++a<e.length;)t.push([Nn(e[a][0]),Ln(e[a][1])])}else{let a;for(a in e)si.call(e,a)&&t.push([Nn(a),Ln(e[a])])}return t}function Nn(e){return typeof e=="string"?new RegExp(ii(e),"g"):e}function Ln(e){return typeof e=="function"?e:()=>e}const Zt="phrasing",Vt=["autolink","link","image","label"],ci={transforms:[fi],enter:{literalAutolink:ui,literalAutolinkEmail:Nt,literalAutolinkHttp:Nt,literalAutolinkWww:Nt},exit:{literalAutolink:pi,literalAutolinkEmail:gi,literalAutolinkHttp:hi,literalAutolinkWww:mi}},di={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Zt,notInConstruct:Vt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Zt,notInConstruct:Vt},{character:":",before:"[ps]",after:"\\/",inConstruct:Zt,notInConstruct:Vt}]};function ui(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Nt(e){this.config.enter.autolinkProtocol.call(this,e)}function hi(e){this.config.exit.autolinkProtocol.call(this,e)}function mi(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.url="http://"+this.sliceSerialize(e)}function gi(e){this.config.exit.autolinkEmail.call(this,e)}function pi(e){this.exit(e)}function fi(e){oi(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,xi],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,yi]],{ignore:["link","linkReference"]})}function xi(e,t,a,i,l){let o="";if(!Sn(l)||(/^w/i.test(t)&&(a=t+a,t="",o="http://"),!bi(a)))return!1;const s=Ci(a+i);if(!s[0])return!1;const d={type:"link",title:null,url:o+t+s[0],children:[{type:"text",value:t+s[0]}]};return s[1]?[d,{type:"text",value:s[1]}]:d}function yi(e,t,a,i){return!Sn(i,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+a,children:[{type:"text",value:t+"@"+a}]}}function bi(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function Ci(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let a=t[0],i=a.indexOf(")");const l=Vn(e,"(");let o=Vn(e,")");for(;i!==-1&&l>o;)e+=a.slice(0,i+1),a=a.slice(i+1),i=a.indexOf(")"),o++;return[e,a]}function Sn(e,t){const a=e.input.charCodeAt(e.index-1);return(e.index===0||Le(a)||kt(a))&&(!t||a!==47)}function Fn(e){return e.label||!e.identifier?e.label||"":wa(e.identifier)}function wi(e,t,a){const i=t.indexStack,l=e.children||[],o=t.createTracker(a),s=[];let d=-1;for(i.push(-1);++d<l.length;){const h=l[d];i[i.length-1]=d,s.push(o.move(t.handle(h,e,t,{before:`
|
|
158
|
+
`,after:`
|
|
159
|
+
`,...o.current()}))),h.type!=="list"&&(t.bulletLastUsed=void 0),d<l.length-1&&s.push(o.move(ki(h,l[d+1],e,t)))}return i.pop(),s.join("")}function ki(e,t,a,i){let l=i.join.length;for(;l--;){const o=i.join[l](e,t,a,i);if(o===!0||o===1)break;if(typeof o=="number")return`
|
|
160
|
+
`.repeat(1+o);if(o===!1)return`
|
|
161
|
+
|
|
162
|
+
<!---->
|
|
163
|
+
|
|
164
|
+
`}return`
|
|
165
|
+
|
|
166
|
+
`}const Ai=/\r?\n|\r/g;function vi(e,t){const a=[];let i=0,l=0,o;for(;o=Ai.exec(e);)s(e.slice(i,o.index)),a.push(o[0]),i=o.index+o[0].length,l++;return s(e.slice(i)),a.join("");function s(d){a.push(t(d,l,!d))}}function Dn(e){if(!e._compiled){const t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function Mi(e,t){return qn(e,t.inConstruct,!0)&&!qn(e,t.notInConstruct,!1)}function qn(e,t,a){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return a;let i=-1;for(;++i<t.length;)if(e.includes(t[i]))return!0;return!1}function Rn(e,t,a){const i=(a.before||"")+(t||"")+(a.after||""),l=[],o=[],s={};let d=-1;for(;++d<e.unsafe.length;){const g=e.unsafe[d];if(!Mi(e.stack,g))continue;const c=Dn(g);let w;for(;w=c.exec(i);){const b="before"in g||!!g.atBreak,y="after"in g,A=w.index+(b?w[1].length:0);l.includes(A)?(s[A].before&&!b&&(s[A].before=!1),s[A].after&&!y&&(s[A].after=!1)):(l.push(A),s[A]={before:b,after:y})}}l.sort(ji);let h=a.before?a.before.length:0;const x=i.length-(a.after?a.after.length:0);for(d=-1;++d<l.length;){const g=l[d];g<h||g>=x||g+1<x&&l[d+1]===g+1&&s[g].after&&!s[g+1].before&&!s[g+1].after||l[d-1]===g-1&&s[g].before&&!s[g-1].before&&!s[g-1].after||(h!==g&&o.push(Tn(i.slice(h,g),"\\")),h=g,/[!-/:-@[-`{-~]/.test(i.charAt(g))&&(!a.encode||!a.encode.includes(i.charAt(g)))?o.push("\\"):(o.push("&#x"+i.charCodeAt(g).toString(16).toUpperCase()+";"),h++))}return o.push(Tn(i.slice(h,x),a.after)),o.join("")}function ji(e,t){return e-t}function Tn(e,t){const a=/\\(?=[!-/:-@[-`{-~])/g,i=[],l=[],o=e+t;let s=-1,d=0,h;for(;h=a.exec(o);)i.push(h.index);for(;++s<i.length;)d!==i[s]&&l.push(e.slice(d,i[s])),l.push("\\"),d=i[s];return l.push(e.slice(d)),l.join("")}function ht(e){const t=e||{},a=t.now||{};let i=t.lineShift||0,l=a.line||1,o=a.column||1;return{move:h,current:s,shift:d};function s(){return{now:{line:l,column:o},lineShift:i}}function d(x){i+=x}function h(x){const g=x||"",c=g.split(/\r?\n|\r/g),w=c[c.length-1];return l+=c.length-1,o=c.length===1?o+w.length:1+w.length+i,g}}zn.peek=Di;function Hi(){return{enter:{gfmFootnoteDefinition:_i,gfmFootnoteDefinitionLabelString:Ii,gfmFootnoteCall:Ni,gfmFootnoteCallString:Li},exit:{gfmFootnoteDefinition:Vi,gfmFootnoteDefinitionLabelString:Zi,gfmFootnoteCall:Fi,gfmFootnoteCallString:Si}}}function Ei(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:qi,footnoteReference:zn}}}function _i(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function Ii(){this.buffer()}function Zi(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.label=t,a.identifier=Be(this.sliceSerialize(e)).toLowerCase()}function Vi(e){this.exit(e)}function Ni(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Li(){this.buffer()}function Si(e){const t=this.resume(),a=this.stack[this.stack.length-1];a.label=t,a.identifier=Be(this.sliceSerialize(e)).toLowerCase()}function Fi(e){this.exit(e)}function zn(e,t,a,i){const l=ht(i);let o=l.move("[^");const s=a.enter("footnoteReference"),d=a.enter("reference");return o+=l.move(Rn(a,Fn(e),{...l.current(),before:o,after:"]"})),d(),s(),o+=l.move("]"),o}function Di(){return"["}function qi(e,t,a,i){const l=ht(i);let o=l.move("[^");const s=a.enter("footnoteDefinition"),d=a.enter("label");return o+=l.move(Rn(a,Fn(e),{...l.current(),before:o,after:"]"})),d(),o+=l.move("]:"+(e.children&&e.children.length>0?" ":"")),l.shift(4),o+=l.move(vi(wi(e,a,l.current()),Ri)),s(),o}function Ri(e,t,a){return t===0?e:(a?"":" ")+e}function Bn(e,t,a){const i=t.indexStack,l=e.children||[],o=[];let s=-1,d=a.before;i.push(-1);let h=t.createTracker(a);for(;++s<l.length;){const x=l[s];let g;if(i[i.length-1]=s,s+1<l.length){let c=t.handle.handlers[l[s+1].type];c&&c.peek&&(c=c.peek),g=c?c(l[s+1],e,t,{before:"",after:"",...h.current()}).charAt(0):""}else g=a.after;o.length>0&&(d==="\r"||d===`
|
|
167
|
+
`)&&x.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),d=" ",h=t.createTracker(a),h.move(o.join(""))),o.push(h.move(t.handle(x,e,t,{...h.current(),before:d,after:g}))),d=o[o.length-1].slice(-1)}return i.pop(),o.join("")}const Ti=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];On.peek=Wi;const zi={canContainEols:["delete"],enter:{strikethrough:Oi},exit:{strikethrough:$i}},Bi={unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:Ti}],handlers:{delete:On}};function Oi(e){this.enter({type:"delete",children:[]},e)}function $i(e){this.exit(e)}function On(e,t,a,i){const l=ht(i),o=a.enter("strikethrough");let s=l.move("~~");return s+=Bn(e,a,{...l.current(),before:s,after:"~"}),s+=l.move("~~"),o(),s}function Wi(){return"~"}$n.peek=Pi;function $n(e,t,a){let i=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(i);)l+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++o<a.unsafe.length;){const s=a.unsafe[o],d=Dn(s);let h;if(s.atBreak)for(;h=d.exec(i);){let x=h.index;i.charCodeAt(x)===10&&i.charCodeAt(x-1)===13&&x--,i=i.slice(0,x)+" "+i.slice(h.index+1)}}return l+i+l}function Pi(){return"`"}function Ui(e){return e.length}function Qi(e,t){const a=t||{},i=(a.align||[]).concat(),l=a.stringLength||Ui,o=[],s=[],d=[],h=[];let x=0,g=-1;for(;++g<e.length;){const A=[],v=[];let M=-1;for(e[g].length>x&&(x=e[g].length);++M<e[g].length;){const C=Ki(e[g][M]);if(a.alignDelimiters!==!1){const k=l(C);v[M]=k,(h[M]===void 0||k>h[M])&&(h[M]=k)}A.push(C)}s[g]=A,d[g]=v}let c=-1;if(typeof i=="object"&&"length"in i)for(;++c<x;)o[c]=Wn(i[c]);else{const A=Wn(i);for(;++c<x;)o[c]=A}c=-1;const w=[],b=[];for(;++c<x;){const A=o[c];let v="",M="";A===99?(v=":",M=":"):A===108?v=":":A===114&&(M=":");let C=a.alignDelimiters===!1?1:Math.max(1,h[c]-v.length-M.length);const k=v+"-".repeat(C)+M;a.alignDelimiters!==!1&&(C=v.length+C+M.length,C>h[c]&&(h[c]=C),b[c]=C),w[c]=k}s.splice(1,0,w),d.splice(1,0,b),g=-1;const y=[];for(;++g<s.length;){const A=s[g],v=d[g];c=-1;const M=[];for(;++c<x;){const C=A[c]||"";let k="",_="";if(a.alignDelimiters!==!1){const H=h[c]-(v[c]||0),L=o[c];L===114?k=" ".repeat(H):L===99?H%2?(k=" ".repeat(H/2+.5),_=" ".repeat(H/2-.5)):(k=" ".repeat(H/2),_=k):_=" ".repeat(H)}a.delimiterStart!==!1&&!c&&M.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&C==="")&&(a.delimiterStart!==!1||c)&&M.push(" "),a.alignDelimiters!==!1&&M.push(k),M.push(C),a.alignDelimiters!==!1&&M.push(_),a.padding!==!1&&M.push(" "),(a.delimiterEnd!==!1||c!==x-1)&&M.push("|")}y.push(a.delimiterEnd===!1?M.join("").replace(/ +$/,""):M.join(""))}return y.join(`
|
|
168
|
+
`)}function Ki(e){return e==null?"":String(e)}function Wn(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}const Gi={enter:{table:Xi,tableData:Pn,tableHeader:Pn,tableRow:Ji},exit:{codeText:e0,table:Yi,tableData:Lt,tableHeader:Lt,tableRow:Lt}};function Xi(e){const t=e._align;this.enter({type:"table",align:t.map(a=>a==="none"?null:a),children:[]},e),this.setData("inTable",!0)}function Yi(e){this.exit(e),this.setData("inTable")}function Ji(e){this.enter({type:"tableRow",children:[]},e)}function Lt(e){this.exit(e)}function Pn(e){this.enter({type:"tableCell",children:[]},e)}function e0(e){let t=this.resume();this.getData("inTable")&&(t=t.replace(/\\([\\|])/g,t0));const a=this.stack[this.stack.length-1];a.value=t,this.exit(e)}function t0(e,t){return t==="|"?t:e}function n0(e){const t=e||{},a=t.tableCellPadding,i=t.tablePipeAlign,l=t.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
169
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:s,tableRow:d,tableCell:h,inlineCode:w}};function s(b,y,A,v){return x(g(b,A,v),b.align)}function d(b,y,A,v){const M=c(b,A,v),C=x([M]);return C.slice(0,C.indexOf(`
|
|
170
|
+
`))}function h(b,y,A,v){const M=A.enter("tableCell"),C=A.enter("phrasing"),k=Bn(b,A,{...v,before:o,after:o});return C(),M(),k}function x(b,y){return Qi(b,{align:y,alignDelimiters:i,padding:a,stringLength:l})}function g(b,y,A){const v=b.children;let M=-1;const C=[],k=y.enter("table");for(;++M<v.length;)C[M]=c(v[M],y,A);return k(),C}function c(b,y,A){const v=b.children;let M=-1;const C=[],k=y.enter("tableRow");for(;++M<v.length;)C[M]=h(v[M],b,y,A);return k(),C}function w(b,y,A){let v=$n(b,y,A);return A.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function a0(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function r0(e){const t=e.options.listItemIndent||"tab";if(t===1||t==="1")return"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function i0(e,t,a,i){const l=r0(a);let o=a.bulletCurrent||a0(a);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(a.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let s=o.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(s=Math.ceil(s/4)*4);const d=a.createTracker(i);d.move(o+" ".repeat(s-o.length)),d.shift(s);const h=a.enter("listItem"),x=a.indentLines(a.containerFlow(e,d.current()),g);return h(),x;function g(c,w,b){return w?(b?"":" ".repeat(s))+c:(b?o:o+" ".repeat(s-o.length))+c}}const s0={exit:{taskListCheckValueChecked:Un,taskListCheckValueUnchecked:Un,paragraph:l0}},o0={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:c0}};function Un(e){const t=this.stack[this.stack.length-2];t.checked=e.type==="taskListCheckValueChecked"}function l0(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const a=this.stack[this.stack.length-1],i=a.children[0];if(i&&i.type==="text"){const l=t.children;let o=-1,s;for(;++o<l.length;){const d=l[o];if(d.type==="paragraph"){s=d;break}}s===a&&(i.value=i.value.slice(1),i.value.length===0?a.children.shift():a.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,a.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function c0(e,t,a,i){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",d=ht(i);o&&d.move(s);let h=i0(e,t,a,{...i,...d.current()});return o&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,x)),h;function x(g){return g+s}}function d0(){return[ci,Hi(),zi,Gi,s0]}function u0(e){return{extensions:[di,Ei(),Bi,n0(e),o0]}}function h0(e={}){const t=this.data();a("micromarkExtensions",ri(e)),a("fromMarkdownExtensions",d0()),a("toMarkdownExtensions",u0(e));function a(i,l){(t[i]?t[i]:t[i]=[]).push(l)}}const m0=p.div.withConfig({displayName:"AssistantMarkdown__CodeBlockWrapper"})([`
|
|
171
|
+
margin: 1rem 0;
|
|
172
|
+
width: 100%;
|
|
173
|
+
`]),g0=p.div.withConfig({displayName:"AssistantMarkdown__MarkdownContent"})([`
|
|
174
|
+
margin: 0;
|
|
175
|
+
width: 100%;
|
|
176
|
+
font-family: `,`;
|
|
177
|
+
font-size: 1.4rem;
|
|
178
|
+
line-height: 2.1rem;
|
|
179
|
+
color: `,`;
|
|
180
|
+
word-break: break-word;
|
|
181
|
+
|
|
182
|
+
p {
|
|
183
|
+
margin: 0 0 1rem 0;
|
|
184
|
+
&:last-child {
|
|
185
|
+
margin-bottom: 0;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
code {
|
|
190
|
+
background: `,`;
|
|
191
|
+
border: 1px solid `,`;
|
|
192
|
+
border-radius: 0.4rem;
|
|
193
|
+
padding: 0.1rem 0.4rem;
|
|
194
|
+
font-family: `,`;
|
|
195
|
+
font-size: 1.3rem;
|
|
196
|
+
color: `,`;
|
|
197
|
+
white-space: pre-wrap;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
strong {
|
|
201
|
+
font-weight: 600;
|
|
202
|
+
color: `,`;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
em {
|
|
206
|
+
font-style: italic;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
ul,
|
|
210
|
+
ol {
|
|
211
|
+
margin: 0.5rem 0;
|
|
212
|
+
padding-left: 2rem;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
li {
|
|
216
|
+
margin-bottom: 0.3rem;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
a {
|
|
220
|
+
color: `,`;
|
|
221
|
+
text-decoration: none;
|
|
222
|
+
&:hover {
|
|
223
|
+
text-decoration: underline;
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
h1,
|
|
228
|
+
h2,
|
|
229
|
+
h3,
|
|
230
|
+
h4 {
|
|
231
|
+
margin: 1rem 0 0.5rem 0;
|
|
232
|
+
font-weight: 600;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
h1 {
|
|
236
|
+
font-size: 1.8rem;
|
|
237
|
+
}
|
|
238
|
+
h2 {
|
|
239
|
+
font-size: 1.6rem;
|
|
240
|
+
}
|
|
241
|
+
h3 {
|
|
242
|
+
font-size: 1.5rem;
|
|
243
|
+
}
|
|
244
|
+
h4 {
|
|
245
|
+
font-size: 1.4rem;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
blockquote {
|
|
249
|
+
border-left: 3px solid `,`;
|
|
250
|
+
margin: 1rem 0;
|
|
251
|
+
padding-left: 1rem;
|
|
252
|
+
color: `,`;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.table-wrapper {
|
|
256
|
+
overflow-x: auto;
|
|
257
|
+
margin: 1rem 0;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
table {
|
|
261
|
+
border-collapse: collapse;
|
|
262
|
+
min-width: max-content;
|
|
263
|
+
border-radius: 0.8rem;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
th,
|
|
267
|
+
td {
|
|
268
|
+
padding: 0.6rem 0.8rem;
|
|
269
|
+
border: 1px solid `,`;
|
|
270
|
+
text-align: left;
|
|
271
|
+
white-space: nowrap;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
th {
|
|
275
|
+
background: `,`;
|
|
276
|
+
font-weight: 600;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
td:last-child {
|
|
280
|
+
white-space: normal;
|
|
281
|
+
min-width: 200px;
|
|
282
|
+
}
|
|
283
|
+
`],({theme:e})=>e.font,f("foreground"),f("background"),f("selection"),({theme:e})=>e.fontMonospace,f("purple"),f("foreground"),({theme:e})=>e.color.cyan,f("selection"),f("gray2"),f("selection"),f("backgroundDarker")),p0=e=>({a:({children:t,href:a,...i})=>r.jsx("a",{...typeof a=="string"&&a.startsWith("http")?{target:"_blank",rel:"noopener noreferrer"}:{},href:a,...i,children:t}),table:({children:t,...a})=>r.jsx("div",{className:"table-wrapper",children:r.jsx("table",{...a,children:t})}),pre:({children:t})=>r.jsx(r.Fragment,{children:t}),code:n.memo(({children:t,className:a})=>{if(typeof a=="string"&&a.includes("language-")){const i=(Array.isArray(t)?t.join(""):typeof t=="string"?t:"").replace(/\n$/,"");return r.jsx(m0,{"data-hook":"chat-message-code-block",children:r.jsx($e,{value:i,maxHeight:216,onOpenInEditor:()=>{var l;(l=e.current)==null||l.call(e,{type:"code",value:i})}})},i)}return r.jsx("code",{children:t})},(t,a)=>t.children===a.children&&t.className===a.className)}),f0=({content:e,messageId:t,onOpenInEditor:a})=>{const i=n.useRef(a);n.useEffect(()=>{i.current=a},[a]);const l=n.useMemo(()=>p0(i),[]);return r.jsx(g0,{children:r.jsx(ka,{remarkPlugins:[h0],components:l,children:e})},t)},x0=tn([`
|
|
284
|
+
from {
|
|
285
|
+
transform: rotate(0deg);
|
|
286
|
+
}
|
|
287
|
+
to {
|
|
288
|
+
transform: rotate(360deg);
|
|
289
|
+
}
|
|
290
|
+
`]),y0=p.span.withConfig({displayName:"ChatMessages__LoadingIconWrapper"})([`
|
|
291
|
+
display: flex;
|
|
292
|
+
align-items: center;
|
|
293
|
+
justify-content: center;
|
|
294
|
+
animation: `,` 3s linear infinite;
|
|
295
|
+
`],x0),b0=()=>r.jsx(y0,{children:r.jsx(Fa,{})}),C0=p(F).withConfig({displayName:"ChatMessages__MessagesContainer"})([`
|
|
296
|
+
display: flex;
|
|
297
|
+
flex-direction: column;
|
|
298
|
+
gap: 1.5rem;
|
|
299
|
+
padding: 2rem 1rem;
|
|
300
|
+
overflow-y: auto;
|
|
301
|
+
flex: 1 1 auto;
|
|
302
|
+
min-height: 0;
|
|
303
|
+
width: 100%;
|
|
304
|
+
`,`
|
|
305
|
+
`],({$scrolled:e})=>!e&&Y([`
|
|
306
|
+
opacity: 0;
|
|
307
|
+
`])),w0=p(F).attrs({align:"flex-start"}).withConfig({displayName:"ChatMessages__MessageBubble"})([`
|
|
308
|
+
display: flex;
|
|
309
|
+
flex-direction: column;
|
|
310
|
+
gap: 0.5rem;
|
|
311
|
+
padding: 0.8rem;
|
|
312
|
+
border-radius: 0.8rem;
|
|
313
|
+
width: 100%;
|
|
314
|
+
align-self: flex-end;
|
|
315
|
+
background: `,`;
|
|
316
|
+
border: 1px solid rgba(25, 26, 33, 0.32);
|
|
317
|
+
flex-shrink: 0;
|
|
318
|
+
`],f("loginBackground")),Qn=p(F).withConfig({displayName:"ChatMessages__UserRequestBox"})([`
|
|
319
|
+
display: flex;
|
|
320
|
+
flex-direction: column;
|
|
321
|
+
gap: 0.5rem;
|
|
322
|
+
padding: 0.8rem;
|
|
323
|
+
width: 100%;
|
|
324
|
+
align-self: flex-end;
|
|
325
|
+
background: `,`;
|
|
326
|
+
border: 1px solid rgba(25, 26, 33, 0.32);
|
|
327
|
+
border-radius: 0.6rem;
|
|
328
|
+
flex-shrink: 0;
|
|
329
|
+
`],f("loginBackground")),k0=p(F).attrs({alignItems:"center",gap:"0.8rem"}).withConfig({displayName:"ChatMessages__UserRequestHeader"})([`
|
|
330
|
+
width: 100%;
|
|
331
|
+
padding: 0.4rem;
|
|
332
|
+
flex: 1 0 auto;
|
|
333
|
+
`]),mt=p(F).withConfig({displayName:"ChatMessages__UserRequestContent"})([`
|
|
334
|
+
display: flex;
|
|
335
|
+
flex-direction: column;
|
|
336
|
+
border-radius: 0.6rem;
|
|
337
|
+
overflow: hidden;
|
|
338
|
+
flex-shrink: 0;
|
|
339
|
+
width: 100%;
|
|
340
|
+
align-items: flex-start;
|
|
341
|
+
`]),Kn=p.div.withConfig({displayName:"ChatMessages__InlineSQLEditor"})([`
|
|
342
|
+
width: 100%;
|
|
343
|
+
`]),A0=p(F).attrs({gap:"1rem",alignItems:"center"}).withConfig({displayName:"ChatMessages__OperationBadge"})([`
|
|
344
|
+
width: 100%;
|
|
345
|
+
padding: 0 0.4rem;
|
|
346
|
+
`]),v0=p(F).attrs({align:"center",justifyContent:"center"}).withConfig({displayName:"ChatMessages__BadgeIconContainer"})([`
|
|
347
|
+
background: #290a13;
|
|
348
|
+
border: 1px solid rgba(122, 31, 58, 0.64);
|
|
349
|
+
border-radius: 0.4rem;
|
|
350
|
+
padding: 0.8rem;
|
|
351
|
+
width: 4.8rem;
|
|
352
|
+
height: 4rem;
|
|
353
|
+
flex-shrink: 0;
|
|
354
|
+
`]),M0=p.div.withConfig({displayName:"ChatMessages__BadgeIconWrapper"})([`
|
|
355
|
+
width: 2.4rem;
|
|
356
|
+
height: 2.4rem;
|
|
357
|
+
display: flex;
|
|
358
|
+
align-items: center;
|
|
359
|
+
justify-content: center;
|
|
360
|
+
color: `,`;
|
|
361
|
+
|
|
362
|
+
svg {
|
|
363
|
+
width: 100%;
|
|
364
|
+
height: 100%;
|
|
365
|
+
}
|
|
366
|
+
`],({theme:e})=>e.color.pink),j0=p(be).withConfig({displayName:"ChatMessages__BadgeTitle"})([`
|
|
367
|
+
font-weight: 500;
|
|
368
|
+
font-size: 1.6rem;
|
|
369
|
+
line-height: 1.6rem;
|
|
370
|
+
color: `,`;
|
|
371
|
+
`],f("foreground")),H0=p(F).withConfig({displayName:"ChatMessages__BadgeDescriptionContainer"})([`
|
|
372
|
+
align-items: flex-start;
|
|
373
|
+
flex-direction: column;
|
|
374
|
+
padding: 0.8rem;
|
|
375
|
+
width: 100%;
|
|
376
|
+
`]),E0=p(be).withConfig({displayName:"ChatMessages__BadgeDescriptionText"})([`
|
|
377
|
+
font-size: 1.4rem;
|
|
378
|
+
line-height: 2.1rem;
|
|
379
|
+
color: `,`;
|
|
380
|
+
`],f("foreground")),_0=p(be).withConfig({displayName:"ChatMessages__BadgeDescriptionIssueText"})([`
|
|
381
|
+
font-size: 1.4rem;
|
|
382
|
+
line-height: 2.1rem;
|
|
383
|
+
font-weight: 600;
|
|
384
|
+
`]),I0=p(F).withConfig({displayName:"ChatMessages__IssueMessageRow"})([`
|
|
385
|
+
display: flex;
|
|
386
|
+
align-items: center;
|
|
387
|
+
gap: 0.5rem;
|
|
388
|
+
`]),Gn=p(ue).withConfig({displayName:"ChatMessages__SchemaNameDisplay"})([`
|
|
389
|
+
margin-left: 0.4rem;
|
|
390
|
+
padding: 0.5rem 1rem;
|
|
391
|
+
align-items: center;
|
|
392
|
+
gap: 1rem;
|
|
393
|
+
border-radius: 0.6rem;
|
|
394
|
+
border: 1px solid `,`;
|
|
395
|
+
background: `,`;
|
|
396
|
+
|
|
397
|
+
&:hover,
|
|
398
|
+
&:active {
|
|
399
|
+
background: `,` !important;
|
|
400
|
+
border-color: `,` !important;
|
|
401
|
+
}
|
|
402
|
+
`],f("selection"),f("backgroundDarker"),f("backgroundLighter"),f("cyan")),Xn=p(be).withConfig({displayName:"ChatMessages__SchemaName"})([`
|
|
403
|
+
font-size: 1.4rem;
|
|
404
|
+
color: `,`;
|
|
405
|
+
`],f("foreground")),Yn=p(be).withConfig({displayName:"ChatMessages__MessageContent"})([`
|
|
406
|
+
font-size: 1.4rem;
|
|
407
|
+
line-height: 1.8rem;
|
|
408
|
+
color: `,`;
|
|
409
|
+
white-space: pre-wrap;
|
|
410
|
+
word-wrap: break-word;
|
|
411
|
+
`],f("foreground")),Z0=p(F).withConfig({displayName:"ChatMessages__ExplanationBox"})([`
|
|
412
|
+
display: flex;
|
|
413
|
+
flex-direction: column;
|
|
414
|
+
gap: 0.5rem;
|
|
415
|
+
width: 100%;
|
|
416
|
+
align-self: flex-start;
|
|
417
|
+
text-align: left;
|
|
418
|
+
background: transparent;
|
|
419
|
+
padding: 0.4rem;
|
|
420
|
+
border-radius: 0.6rem;
|
|
421
|
+
flex-shrink: 0;
|
|
422
|
+
|
|
423
|
+
`,`
|
|
424
|
+
|
|
425
|
+
.assistant-label,
|
|
426
|
+
.token-display {
|
|
427
|
+
transition: opacity 0.2s;
|
|
428
|
+
opacity: 0;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
&:hover {
|
|
432
|
+
.assistant-label,
|
|
433
|
+
.token-display {
|
|
434
|
+
opacity: 1;
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
`],({$hasOperationHistory:e})=>e&&Y([`
|
|
438
|
+
padding-top: 0;
|
|
439
|
+
`])),V0=p(F).attrs({alignItems:"center",gap:"1rem"}).withConfig({displayName:"ChatMessages__AssistantHeader"})([`
|
|
440
|
+
width: 100%;
|
|
441
|
+
padding: 0.4rem;
|
|
442
|
+
flex: 1 0 auto;
|
|
443
|
+
`]),N0=p(be).attrs({className:"assistant-label"}).withConfig({displayName:"ChatMessages__AssistantLabel"})([`
|
|
444
|
+
font-size: 1.4rem;
|
|
445
|
+
color: `,`;
|
|
446
|
+
`],f("foreground")),L0=p(F).attrs({className:"token-display"}).withConfig({displayName:"ChatMessages__TokenDisplay"})([`
|
|
447
|
+
align-items: center;
|
|
448
|
+
gap: 0.9rem;
|
|
449
|
+
margin: 0 0 0 auto;
|
|
450
|
+
`]),S0=p(F).withConfig({displayName:"ChatMessages__ExplanationContent"})([`
|
|
451
|
+
display: flex;
|
|
452
|
+
flex-direction: column;
|
|
453
|
+
border-radius: 0.6rem;
|
|
454
|
+
padding: 0.8rem;
|
|
455
|
+
flex-shrink: 0;
|
|
456
|
+
width: 100%;
|
|
457
|
+
`]),F0=p.div.withConfig({displayName:"ChatMessages__Divider"})([`
|
|
458
|
+
width: 100%;
|
|
459
|
+
height: 1px;
|
|
460
|
+
background: linear-gradient(90deg, #9c274b 0%, rgba(54, 14, 26, 0) 100%);
|
|
461
|
+
margin-bottom: 1rem;
|
|
462
|
+
`]),D0=p.div.withConfig({displayName:"ChatMessages__OperationHistoryContainer"})([`
|
|
463
|
+
margin-bottom: 0.6rem;
|
|
464
|
+
width: 100%;
|
|
465
|
+
`,`
|
|
466
|
+
`],({$trimBottom:e})=>e&&Y([`
|
|
467
|
+
margin-bottom: 0;
|
|
468
|
+
padding-bottom: 0.3rem;
|
|
469
|
+
`])),q0=p.div.withConfig({displayName:"ChatMessages__ErrorContainer"})([`
|
|
470
|
+
display: flex;
|
|
471
|
+
align-items: center;
|
|
472
|
+
flex-shrink: 0;
|
|
473
|
+
gap: 0.5rem;
|
|
474
|
+
padding: 0.4rem 0.4rem 0.4rem 0.8rem;
|
|
475
|
+
border: 1px solid `,`;
|
|
476
|
+
border-radius: 0.6rem;
|
|
477
|
+
color: `,`;
|
|
478
|
+
font-size: 1.4rem;
|
|
479
|
+
line-height: 2rem;
|
|
480
|
+
width: 100%;
|
|
481
|
+
`],f("red"),f("foreground")),R0=p(ue).withConfig({displayName:"ChatMessages__RetryButton"})([`
|
|
482
|
+
margin-left: auto;
|
|
483
|
+
flex-shrink: 0;
|
|
484
|
+
padding: 0.5rem 0.8rem;
|
|
485
|
+
height: auto;
|
|
486
|
+
`]),T0=tn([`
|
|
487
|
+
0%, 50% { opacity: 1; }
|
|
488
|
+
51%, 100% { opacity: 0; }
|
|
489
|
+
`]),z0=p.span.withConfig({displayName:"ChatMessages__StreamingCursor"})([`
|
|
490
|
+
display: inline-block;
|
|
491
|
+
width: 2px;
|
|
492
|
+
height: 1.4em;
|
|
493
|
+
background: `,`;
|
|
494
|
+
margin-left: 2px;
|
|
495
|
+
margin-right: auto;
|
|
496
|
+
vertical-align: text-bottom;
|
|
497
|
+
animation: `,` 1s infinite;
|
|
498
|
+
`],f("foreground"),T0),B0=p.div.withConfig({displayName:"ChatMessages__MessagesEnd"})([`
|
|
499
|
+
min-height: 1px;
|
|
500
|
+
width: 100%;
|
|
501
|
+
background: transparent;
|
|
502
|
+
`]),O0=p(F).withConfig({displayName:"ChatMessages__DiffContainer"})([`
|
|
503
|
+
display: flex;
|
|
504
|
+
flex-direction: column;
|
|
505
|
+
gap: 10px;
|
|
506
|
+
margin-top: 1rem;
|
|
507
|
+
padding: 8px 12px;
|
|
508
|
+
border: 1px solid `,`;
|
|
509
|
+
border-radius: 8px;
|
|
510
|
+
background: `,`;
|
|
511
|
+
width: 100%;
|
|
512
|
+
`],f("selection"),f("backgroundDarker")),$0=p(F).withConfig({displayName:"ChatMessages__DiffHeader"})([`
|
|
513
|
+
display: flex;
|
|
514
|
+
align-items: center;
|
|
515
|
+
justify-content: space-between;
|
|
516
|
+
padding-bottom: 8px;
|
|
517
|
+
border-bottom: 1px solid `,`;
|
|
518
|
+
width: 100%;
|
|
519
|
+
`,`
|
|
520
|
+
`],f("selectionDarker"),({$isExpanded:e})=>!e&&Y([`
|
|
521
|
+
border-bottom: 0;
|
|
522
|
+
padding-bottom: 0;
|
|
523
|
+
`])),W0=p(F).withConfig({displayName:"ChatMessages__DiffHeaderLeft"})([`
|
|
524
|
+
display: flex;
|
|
525
|
+
align-items: center;
|
|
526
|
+
gap: 1rem;
|
|
527
|
+
padding: 4px 0;
|
|
528
|
+
`]),P0=p.span.withConfig({displayName:"ChatMessages__DiffHeaderLabel"})([`
|
|
529
|
+
font-size: 1.4rem;
|
|
530
|
+
color: `,`;
|
|
531
|
+
`],f("offWhite")),U0=p(F).withConfig({displayName:"ChatMessages__DiffHeaderRight"})([`
|
|
532
|
+
display: flex;
|
|
533
|
+
align-items: center;
|
|
534
|
+
gap: 1.8rem;
|
|
535
|
+
margin-left: auto;
|
|
536
|
+
`]),Jn=p(F).withConfig({displayName:"ChatMessages__DiffHeaderStatus"})([`
|
|
537
|
+
display: flex;
|
|
538
|
+
align-items: center;
|
|
539
|
+
gap: 0.8rem;
|
|
540
|
+
color: `,`;
|
|
541
|
+
font-size: 1.3rem;
|
|
542
|
+
`],({$isAccepted:e,$isRejected:t,$isRejectedWithFollowUp:a})=>t?f("red"):a?f("cyan"):e?f("greenDarker"):f("gray2")),ea=p.span.withConfig({displayName:"ChatMessages__StatusIcon"})([`
|
|
543
|
+
display: flex;
|
|
544
|
+
align-items: center;
|
|
545
|
+
color: `,`;
|
|
546
|
+
`],({$isAccepted:e,$isRejected:t,$isRejectedWithFollowUp:a})=>t?f("red"):a?f("cyan"):e?f("greenDarker"):f("gray2")),St=p.button.withConfig({displayName:"ChatMessages__IconButton"})([`
|
|
547
|
+
display: flex;
|
|
548
|
+
align-items: center;
|
|
549
|
+
justify-content: center;
|
|
550
|
+
padding: 0;
|
|
551
|
+
background: transparent;
|
|
552
|
+
border: none;
|
|
553
|
+
cursor: pointer;
|
|
554
|
+
height: 22px;
|
|
555
|
+
width: 22px;
|
|
556
|
+
color: `,`;
|
|
557
|
+
|
|
558
|
+
&:hover {
|
|
559
|
+
svg {
|
|
560
|
+
filter: brightness(1.3);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
`],f("gray2")),Q0=p(St).withConfig({displayName:"ChatMessages__ExpandButton"})([`
|
|
564
|
+
width: 16px;
|
|
565
|
+
height: 16px;
|
|
566
|
+
`]),K0=p.div.withConfig({displayName:"ChatMessages__DiffEditorWrapper"})([`
|
|
567
|
+
position: relative;
|
|
568
|
+
width: 100%;
|
|
569
|
+
`]),G0=p(F).withConfig({displayName:"ChatMessages__ButtonBar"})([`
|
|
570
|
+
padding: 0.5rem;
|
|
571
|
+
gap: 1rem;
|
|
572
|
+
justify-content: center;
|
|
573
|
+
flex-shrink: 0;
|
|
574
|
+
width: fit-content;
|
|
575
|
+
margin: 0 auto;
|
|
576
|
+
background: `,`;
|
|
577
|
+
border: 1px solid `,`;
|
|
578
|
+
border-radius: 0.4rem;
|
|
579
|
+
`],f("backgroundDarker"),f("selection")),X0=p(ue).withConfig({displayName:"ChatMessages__AcceptButton"})([`
|
|
580
|
+
background: `,`;
|
|
581
|
+
color: `,`;
|
|
582
|
+
border: 0.1rem solid `,`;
|
|
583
|
+
width: 10rem;
|
|
584
|
+
|
|
585
|
+
&:hover:not(:disabled) {
|
|
586
|
+
background: `,`;
|
|
587
|
+
border-color: `,`;
|
|
588
|
+
filter: brightness(1.2);
|
|
589
|
+
}
|
|
590
|
+
`],({theme:e})=>e.color.pinkDarker,f("foreground"),({theme:e})=>e.color.pinkDarker,({theme:e})=>e.color.pinkDarker,({theme:e})=>e.color.pinkDarker),Y0=p(ue).withConfig({displayName:"ChatMessages__RejectButton"})([`
|
|
591
|
+
background: `,`;
|
|
592
|
+
color: `,`;
|
|
593
|
+
border: 1px solid transparent;
|
|
594
|
+
width: 10rem;
|
|
595
|
+
|
|
596
|
+
&:hover:not(:disabled) {
|
|
597
|
+
background: `,`;
|
|
598
|
+
border-color: transparent;
|
|
599
|
+
}
|
|
600
|
+
`],f("background"),f("foreground"),f("selection")),J0=e=>{switch(e){case"fix_request":return{icon:r.jsx(Va,{size:24}),title:"Fix Query",description:"Help me debug and fix the error with the attached SQL query"};case"explain_request":return{icon:r.jsx(Za,{size:24}),title:"Explain Query",description:"Explain this query in detail"};case"schema_explain_request":return{icon:r.jsx(Ia,{size:24}),title:"Explain Schema",description:"Provide an overview, detailed column descriptions and storage details."};case"health_issue_request":return{icon:r.jsx(_a,{size:24}),title:"Health Issue Analysis",description:"Analyze table health issue and provide steps for resolution:"};default:return null}},es=e=>{switch(e){case"loading":return r.jsx(b0,{});case"success":return r.jsx(Sa,{});case"error":return r.jsx(La,{});default:return r.jsx(Na,{})}},ts=({messages:e,onAcceptChange:t,onRejectChange:a,onRunQuery:i,onOpenInEditor:l,onApplyToEditor:o,onRetry:s,running:d,aiSuggestionRequest:h,queryNotifications:x,queryStartOffset:g=0,isOperationInProgress:c,editorSQL:w,isStreaming:b,isLoadingMessages:y,scrollToMessageId:A,onScrollToMessageComplete:v})=>{const M=Yt(),C=en(),k=le(se.query.getTables),_=n.useRef(null),H=n.useRef(null),L=n.useRef(new Map),{status:Z}=Ne(),[T,V]=n.useState(!1),m=n.useRef(!1),I=n.useCallback(()=>{if(T&&m.current||A)return;const u=T?"smooth":"instant";setTimeout(()=>{var E;(E=_.current)==null||E.scrollIntoView({behavior:u}),V(!0)})},[T,A]),N=n.useCallback(u=>{const E=k.find(J=>J.table_name===u.tableName&&Wt(J)===u.kind);E&&C(We.console.pushSidebarHistory({type:"tableDetails",payload:{tableName:E.table_name,isMatView:E.table_type==="M",isView:E.table_type==="V"}}))},[k]);n.useEffect(()=>{const u=H.current;if(!u)return;const E=()=>{m.current=!0};return u.addEventListener("wheel",E),()=>u.removeEventListener("wheel",E)},[]),n.useEffect(()=>{m.current=!1},[e.length]);const S=n.useMemo(()=>{for(let u=e.length-1;u>=0;u--){const E=e[u];if(E.role==="assistant"&&E.sql)return u}return-1},[e]),B=n.useRef(S>=0?S:-1),[te,ae]=n.useState(S>=0?new Set([S]):new Set);n.useEffect(()=>{S>=0&&S!==B.current&&(ae(u=>new Set([...u,S])),B.current=S)},[S]);const Ce=u=>u>=1e3?`${(u/1e3).toFixed(1)}K`:u.toString(),He=n.useMemo(()=>e.reduce((u,E)=>{var J;return u+(E.hideFromUI?0:(((J=E.operationHistory)==null?void 0:J.length)??0)+(E.error||E.content?1:0))},0),[e]),Ue=n.useMemo(()=>{var u,E;return b?((E=(u=e[e.length-1])==null?void 0:u.content)==null?void 0:E.length)??0:0},[e,b]);n.useEffect(()=>{I()},[He,Ue]),n.useLayoutEffect(()=>{if(!A||y)return;const u=L.current.get(A);if(u){const E=setTimeout(()=>{u.scrollIntoView({behavior:"smooth",block:"start"}),V(!0),v()},100);return()=>clearTimeout(E)}},[A,y,v]),n.useEffect(()=>()=>{v()},[]);const re=[];e.forEach((u,E)=>{u.hideFromUI||re.push({message:u,originalIndex:E})});const gt=re.length>0?re[re.length-1].originalIndex:-1,pt=n.useMemo(()=>{for(let u=e.length-1;u>=0;u--)if(e[u].role==="assistant"&&!e[u].hideFromUI)return u;return-1},[e]),Re=u=>{for(let E=u+1;E<e.length;E++)if(e[E].role==="user"&&!e[E].hideFromUI)return!0;return!1};return r.jsxs(C0,{ref:H,$scrolled:T,"data-hook":"chat-messages-container",children:[re.map(({message:u,originalIndex:E})=>{var me,K,Qe,Ke;const J=`${u.id}`,Ee=Fe(u.sql||"")===Fe(w||""),W=(me=u.displayHealthIssueData)==null?void 0:me.severity;if(u.role==="user"){const O=u.displayType,U=u.sql;if(O&&O!=="ask_request"){const q=J0(O);let R=null;if(O==="schema_explain_request"&&u.displaySchemaData){const $=u.displaySchemaData;R=r.jsx(mt,{children:r.jsxs(Gn,{onClick:()=>N($),children:[r.jsx(vt,{kind:$.kind,partitionBy:$.partitionBy,walEnabled:$.walEnabled,designatedTimestamp:$.designatedTimestamp}),r.jsx(Xn,{children:$.tableName})]})})}else if(O==="health_issue_request"&&u.displayHealthIssueData){const $=u.displayHealthIssueData;R=r.jsx(mt,{children:r.jsxs(Gn,{children:[r.jsx(vt,{kind:"table"}),r.jsx(Xn,{children:$.tableName})]})})}else U&&(R=r.jsx(mt,{children:r.jsx(Kn,{"data-hook":"user-request-sql-editor",children:r.jsx($e,{value:U,maxHeight:216,onOpenInEditor:()=>l({type:"code",value:U},Ee)})})}));return r.jsxs(Qn,{"data-hook":"chat-message-user",ref:$=>{$&&L.current.set(u.id,$)},children:[r.jsxs(A0,{children:[r.jsx(v0,{children:r.jsx(M0,{children:q==null?void 0:q.icon})}),r.jsx(j0,{children:q==null?void 0:q.title})]}),(q==null?void 0:q.description)&&r.jsxs(H0,{children:[r.jsx(E0,{children:q.description}),O==="health_issue_request"&&((K=u.displayHealthIssueData)==null?void 0:K.issueMessage)&&r.jsxs(I0,{children:[W==="critical"?r.jsx(Aa,{size:14,weight:"fill",color:M.color.red}):r.jsx(va,{size:14,weight:"fill",color:M.color.orange}),r.jsx(_0,{color:W==="critical"?"red":"orange",children:u.displayHealthIssueData.issueMessage})]})]}),R]},J)}if(O==="ask_request"&&U){const q=u.displayUserMessage||u.content;return r.jsxs(Qn,{"data-hook":"chat-message-user",ref:R=>{R&&L.current.set(u.id,R)},children:[r.jsx(k0,{children:r.jsx(Yn,{children:q})}),r.jsx(mt,{children:r.jsx(Kn,{"data-hook":"user-request-sql-editor",children:r.jsx($e,{value:U,maxHeight:216,onOpenInEditor:()=>l({type:"code",value:U},Ee)})})})]},J)}return r.jsx(w0,{"data-hook":"chat-message-user",ref:q=>{q&&L.current.set(u.id,q)},children:r.jsx(Yn,{children:u.content})},J)}else{const O=u.explanation||u.content,U=u.tokenUsage;let q=null;U&&typeof U.inputTokens=="number"&&typeof U.outputTokens=="number"&&(q=r.jsxs(r.Fragment,{children:[r.jsx("span",{style:{fontWeight:600},children:Ce(U.inputTokens)})," ","input /"," ",r.jsx("span",{style:{fontWeight:600},children:Ce(U.outputTokens)})," ","output tokens"]}));const R=!!u.sql,$=R&&u.previousSQL!==void 0&&Fe(u.sql||"")===Fe(u.previousSQL||""),Ge=te.has(E),ge=u.isAccepted===!0,ie=u.isRejected===!0,de=R&&!ge&&!ie&&Re(E),Te=E===gt,Xe=b&&Te,Ye=R&&!$&&!ge&&!ie&&!de&&Te;let _e="neutral";if(u.sql){const z=Fe(u.sql);if(d===Pt.AI_SUGGESTION&&h&&Fe(h.query)===z)_e="loading";else if(x){const j=Ma(z,g),D=(Qe=x[j])==null?void 0:Qe.latest;D&&(D.type===Mt.ERROR?_e="error":(D.type===Mt.SUCCESS||D.type===Mt.INFO)&&(_e="success"))}}const Ie=jt(u.previousSQL),Je=jt(u.sql),Ze=(Ke=u.operationHistory)==null?void 0:Ke.filter(z=>z.type!==Ae.Aborted),et=!!u.error,ft=et&&!b&&!c&&Te,tt=E===pt&&c===!0,we=!!Ze&&Ze.length>0;return r.jsxs(Z0,{$hasOperationHistory:we,"data-hook":"chat-message-assistant",ref:z=>{z&&L.current.set(u.id,z)},children:[we&&r.jsxs(r.Fragment,{children:[r.jsx(F0,{}),r.jsx(D0,{$trimBottom:!u.content,children:r.jsx(jr,{operationHistory:Ze,status:Z,isLive:tt,onScrollNeeded:I,collapsed:!!u.content||!!u.error,responseStart:u.responseStart})})]}),u.content&&r.jsxs(r.Fragment,{children:[r.jsxs(V0,{"data-hook":"assistant-header",children:[r.jsx(st,{size:20,variant:"filled"}),r.jsx(N0,{children:u.model||"Assistant"}),q&&r.jsxs(L0,{className:"token-display",children:[r.jsx(un,{size:"16px",color:M.color.gray2}),r.jsx(be,{size:"sm",color:"gray2",children:q})]})]}),r.jsxs(S0,{children:[r.jsx(f0,{content:O,messageId:u.id,onOpenInEditor:l}),Xe&&r.jsx(z0,{"data-hook":"streaming-cursor"}),R&&!Xe&&r.jsxs(O0,{"data-hook":"inline-diff-container",children:[r.jsxs($0,{$isExpanded:Ge,children:[r.jsxs(W0,{children:[r.jsx(ja,{size:22,color:"#BDBDBD"}),r.jsx(P0,{children:"Suggested change"})]}),$&&r.jsxs(Jn,{"data-hook":"diff-status-unchanged",children:[r.jsx(ea,{children:r.jsx(Ut,{size:"14px"})}),"Already accepted"]}),!$&&(ge||ie||de)&&r.jsxs(Jn,{$isAccepted:ge,$isRejected:ie,$isRejectedWithFollowUp:de,"data-hook":ie?"diff-status-rejected":de?"diff-status-followed-up":"diff-status-accepted",children:[r.jsx(ea,{$isAccepted:ge,$isRejected:ie,$isRejectedWithFollowUp:de,children:ie?r.jsx(Ha,{size:"14px"}):de?r.jsx(rn,{size:"14px"}):r.jsx(Ut,{size:"14px"})}),ie?"Rejected":de?"Followed up":"Accepted"]}),r.jsxs(U0,{children:[r.jsx(St,{onClick:z=>{z.stopPropagation(),u.sql&&i&&i(u.sql)},title:"Run this query","data-hook":"message-action-run-sql",children:es(_e)}),!Ye&&o&&!(E===S&&ge)&&!Ee&&r.jsx(St,{onClick:z=>{z.stopPropagation(),u.id&&u.sql&&!c&&(fe(xe.AI_EDITOR_SUGGESTION_APPLY),o(u.id,u.sql))},title:"Apply to editor",disabled:c,style:{opacity:c?.5:1,cursor:c?"not-allowed":"pointer"},"data-hook":"message-action-apply",children:r.jsx(hn,{size:22,color:"#BDBDBD"})}),r.jsx(Q0,{title:"Expand diff view","data-hook":"diff-expand-button",onClick:()=>{ae(z=>{const j=new Set(z);return j.has(E)?j.delete(E):j.add(E),j})},children:r.jsx(Ea,{})})]})]}),Ge&&r.jsxs(r.Fragment,{children:[r.jsx(K0,{children:r.jsx($e,{diffEditor:!0,original:Ie,modified:Je,maxHeight:300,onOpenInEditor:()=>l({type:"diff",original:Ie??"",modified:Je??""}),handleScrollNeeded:I})}),Ye&&r.jsxs(G0,{align:"center",justifyContent:"center",children:[a&&u.id&&r.jsx(Y0,{onClick:()=>a(u.id),"data-hook":"message-action-reject",children:"Reject"}),t&&u.id&&r.jsx(X0,{onClick:()=>t(u.id),"data-hook":"message-action-accept",children:"Accept"})]})]})]})]})]}),et&&r.jsxs(q0,{"data-hook":"chat-message-error",children:[r.jsx(Bt,{size:16,color:M.color.red,style:{flexShrink:0}}),u.error,ft&&s&&r.jsx(R0,{size:"sm",skin:"secondary",prefixIcon:r.jsx(nn,{size:12}),onClick:()=>{const z=e.slice(0,E).findLastIndex(j=>j.role==="user");z>=0&&s(e[z].id,u.id)},"data-hook":"retry-button",children:"Retry"})]})]},J)}}),r.jsx(B0,{ref:_,"data-hook":"messages-end"})]})},ns=p(F).withConfig({displayName:"ChatInput__InputContainer"})([`
|
|
601
|
+
display: flex;
|
|
602
|
+
flex-direction: column;
|
|
603
|
+
align-items: stretch;
|
|
604
|
+
gap: 0.8rem;
|
|
605
|
+
padding: 1rem 1.2rem;
|
|
606
|
+
flex-shrink: 0;
|
|
607
|
+
width: 100%;
|
|
608
|
+
margin-top: auto;
|
|
609
|
+
border-top: 1px solid `,`;
|
|
610
|
+
`],f("selection")),as=p(F).withConfig({displayName:"ChatInput__InputWrapper"})([`
|
|
611
|
+
display: flex;
|
|
612
|
+
position: relative;
|
|
613
|
+
width: 100%;
|
|
614
|
+
overflow: hidden;
|
|
615
|
+
`]),rs=p.textarea.withConfig({displayName:"ChatInput__StyledTextArea"})([`
|
|
616
|
+
flex: 1;
|
|
617
|
+
min-height: 8rem;
|
|
618
|
+
max-height: 30rem;
|
|
619
|
+
line-height: 1.3;
|
|
620
|
+
padding: `,`;
|
|
621
|
+
background: `,`;
|
|
622
|
+
border: 1px solid `,`;
|
|
623
|
+
border-radius: 0.6rem;
|
|
624
|
+
color: `,`;
|
|
625
|
+
font-size: 1.4rem;
|
|
626
|
+
font-family: `,`;
|
|
627
|
+
resize: none;
|
|
628
|
+
outline: none;
|
|
629
|
+
|
|
630
|
+
&:focus {
|
|
631
|
+
border-color: `,`;
|
|
632
|
+
}
|
|
633
|
+
|
|
634
|
+
&::placeholder {
|
|
635
|
+
color: `,`;
|
|
636
|
+
}
|
|
637
|
+
|
|
638
|
+
&:disabled {
|
|
639
|
+
opacity: 0.5;
|
|
640
|
+
}
|
|
641
|
+
`],({$hasContext:e})=>e?"4.4rem 4.5rem 1.2rem 1.2rem":"1.2rem 4.5rem 1.2rem 1.2rem",f("backgroundDarker"),f("selection"),f("foreground"),({theme:e})=>e.font,f("pinkDarker"),f("gray2")),is=p.button.withConfig({displayName:"ChatInput__ActionButton"})([`
|
|
642
|
+
position: absolute;
|
|
643
|
+
right: 0.8rem;
|
|
644
|
+
bottom: 0.8rem;
|
|
645
|
+
padding: 0.6rem;
|
|
646
|
+
border: none;
|
|
647
|
+
display: flex;
|
|
648
|
+
align-items: center;
|
|
649
|
+
justify-content: center;
|
|
650
|
+
border-radius: 0.4rem;
|
|
651
|
+
cursor: pointer;
|
|
652
|
+
`]),ss=p.div.withConfig({displayName:"ChatInput__ContextBadgeContainer"})([`
|
|
653
|
+
position: absolute;
|
|
654
|
+
padding: 0.8rem;
|
|
655
|
+
top: 2px;
|
|
656
|
+
border-radius: 0.6rem;
|
|
657
|
+
left: 1px;
|
|
658
|
+
width: calc(100% - 0.2rem);
|
|
659
|
+
display: inline-flex;
|
|
660
|
+
background: `,`;
|
|
661
|
+
`],f("backgroundDarker")),os=p.div.withConfig({displayName:"ChatInput__ContextBadge"})([`
|
|
662
|
+
display: flex;
|
|
663
|
+
padding: 0.3rem 0.6rem;
|
|
664
|
+
align-items: center;
|
|
665
|
+
gap: 0.4rem;
|
|
666
|
+
line-height: 1.4;
|
|
667
|
+
border-radius: 0.6rem;
|
|
668
|
+
border: 1px solid `,`;
|
|
669
|
+
background: `,`;
|
|
670
|
+
color: `,`;
|
|
671
|
+
font-size: 1.3rem;
|
|
672
|
+
user-select: none;
|
|
673
|
+
cursor: pointer;
|
|
674
|
+
|
|
675
|
+
&:hover {
|
|
676
|
+
border: 1px solid `,`;
|
|
677
|
+
color: `,`;
|
|
678
|
+
}
|
|
679
|
+
`],f("selection"),f("chatBackground"),f("gray2"),f("offWhite"),f("offWhite")),ls=p.div.withConfig({displayName:"ChatInput__ContextBadgeIcon"})([`
|
|
680
|
+
display: flex;
|
|
681
|
+
align-items: center;
|
|
682
|
+
color: `,`;
|
|
683
|
+
flex-shrink: 0;
|
|
684
|
+
|
|
685
|
+
svg {
|
|
686
|
+
color: `,`;
|
|
687
|
+
}
|
|
688
|
+
`],f("gray2"),f("gray2")),cs=p(is).withConfig({displayName:"ChatInput__SendButton"})([`
|
|
689
|
+
background: `,`;
|
|
690
|
+
color: `,`;
|
|
691
|
+
|
|
692
|
+
&:hover:not(:disabled) {
|
|
693
|
+
background: `,`;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
&:disabled {
|
|
697
|
+
opacity: 0.5;
|
|
698
|
+
cursor: not-allowed;
|
|
699
|
+
}
|
|
700
|
+
`],f("pinkDarker"),f("foreground"),f("pink")),ds=p.div.withConfig({displayName:"ChatInput__ThoughtStream"})([`
|
|
701
|
+
display: flex;
|
|
702
|
+
position: relative;
|
|
703
|
+
width: 100%;
|
|
704
|
+
background: `,`;
|
|
705
|
+
border: 1px solid transparent;
|
|
706
|
+
background:
|
|
707
|
+
linear-gradient(`,", ",`)
|
|
708
|
+
padding-box,
|
|
709
|
+
`,` border-box;
|
|
710
|
+
border-radius: 0.6rem;
|
|
711
|
+
height: 4rem;
|
|
712
|
+
`],f("backgroundDarker"),f("backgroundDarker"),f("backgroundDarker"),qa),us=p.div.withConfig({displayName:"ChatInput__ThoughtStreamContent"})([`
|
|
713
|
+
display: flex;
|
|
714
|
+
align-items: center;
|
|
715
|
+
background: `,`;
|
|
716
|
+
gap: 0.8rem;
|
|
717
|
+
width: 100%;
|
|
718
|
+
height: 100%;
|
|
719
|
+
border-radius: 0.6rem;
|
|
720
|
+
padding: 0 1.2rem;
|
|
721
|
+
padding-right: 4.5rem;
|
|
722
|
+
`],f("backgroundDarker")),hs=p.div.withConfig({displayName:"ChatInput__ThoughtText"})([`
|
|
723
|
+
font-weight: 500;
|
|
724
|
+
font-size: 1.4rem;
|
|
725
|
+
color: `,`;
|
|
726
|
+
`,`
|
|
727
|
+
`],f("gray2"),Ot),ms=p.button.withConfig({displayName:"ChatInput__StopButton"})([`
|
|
728
|
+
position: absolute;
|
|
729
|
+
right: 0.8rem;
|
|
730
|
+
top: 50%;
|
|
731
|
+
transform: translateY(-50%);
|
|
732
|
+
width: 2.6rem;
|
|
733
|
+
height: 2.6rem;
|
|
734
|
+
border-radius: 50%;
|
|
735
|
+
border: none;
|
|
736
|
+
display: flex;
|
|
737
|
+
align-items: center;
|
|
738
|
+
justify-content: center;
|
|
739
|
+
cursor: pointer;
|
|
740
|
+
transition: all 0.15s ease;
|
|
741
|
+
background: #da152832;
|
|
742
|
+
color: #da1e28;
|
|
743
|
+
|
|
744
|
+
&:hover {
|
|
745
|
+
background: `,`;
|
|
746
|
+
color: `,`;
|
|
747
|
+
}
|
|
748
|
+
`],f("red"),f("foreground")),ta=(e,t=30)=>{if(!e)return"";const a=e.trim().replace(/\s+/g," ");return a.length<=t?a:a.slice(0,t)+"..."},gs=n.forwardRef(({onSend:e,disabled:t=!1,placeholder:a="Ask a question or request a refinement...",contextSQL:i,contextTableId:l,onContextClick:o},s)=>{const[d,h]=n.useState(""),x=n.useRef(null),g=le(se.query.getTables),c=n.useMemo(()=>l==null?null:g.find(H=>H.id===l)??null,[l,g]),w=c!=null&&c.table_name?ta(c.table_name):i?ta(i):null,b=!!w;n.useImperativeHandle(s,()=>({focus:()=>{var H;(H=x.current)==null||H.focus()}}));const{status:y,abortOperation:A}=Ne(),v=oe(y);n.useEffect(()=>{x.current&&(x.current.style.height="auto",x.current.style.height=`${x.current.scrollHeight}px`)},[d]);const M=()=>{const H=d.trim();H&&!t&&!v&&(e(H),h(""),x.current&&(x.current.style.height="auto"))},C=H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),M())},k=()=>{A()},_=v;return r.jsxs(ns,{children:[_?r.jsxs(ds,{"data-hook":"chat-assistant-modes",children:[r.jsxs(us,{children:[r.jsx(Ct,{size:20}),r.jsx(hs,{children:y})]}),r.jsx(ms,{onClick:k,title:"Stop generation","data-hook":"chat-stop-button",children:r.jsx(Da,{size:"14px"})})]}):r.jsxs(as,{children:[b&&r.jsx(ss,{children:r.jsxs(os,{role:"presentation",onClick:o,"data-hook":"chat-context-badge",children:[r.jsx(ls,{children:c?r.jsx(vt,{kind:Wt(c),partitionBy:c.partitionBy,walEnabled:c.walEnabled,designatedTimestamp:c.designatedTimestamp}):r.jsx(dn,{size:14,weight:"regular"})}),w]})}),r.jsx(rs,{ref:x,value:d,onChange:H=>h(H.target.value),onKeyDown:C,placeholder:a,disabled:t,rows:1,$hasContext:b,"data-hook":"chat-input-textarea"}),r.jsx(cs,{onClick:M,disabled:!d.trim()||t,title:"Send (Enter) \u2022 New line (Shift+Enter)","data-hook":"chat-send-button",children:r.jsx(an,{size:20,weight:"bold"})})]}),r.jsx(be,{color:"gray2",size:"sm",align:"center",children:"Chats are connected to a single query to improve responses."})]})}),na=p.button.withConfig({displayName:"ChatHistoryItem__Container"})([`
|
|
749
|
+
display: flex;
|
|
750
|
+
align-items: center;
|
|
751
|
+
gap: 0.6rem;
|
|
752
|
+
padding: 0.4rem 0.8rem;
|
|
753
|
+
border-radius: 4px;
|
|
754
|
+
cursor: `,`;
|
|
755
|
+
background: `,`;
|
|
756
|
+
opacity: `,`;
|
|
757
|
+
border: 0;
|
|
758
|
+
width: 100%;
|
|
759
|
+
text-align: left;
|
|
760
|
+
|
|
761
|
+
&:hover {
|
|
762
|
+
background: `,`;
|
|
763
|
+
|
|
764
|
+
.chat-title {
|
|
765
|
+
color: `,`;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
`],({disabled:e})=>e?"not-allowed":"pointer",f("transparent"),({disabled:e})=>e?.5:1,({disabled:e})=>e?"transparent":f("selection"),({disabled:e})=>e?f("offWhite"):f("foreground")),ps=p.div.withConfig({displayName:"ChatHistoryItem__IconWrapper"})([`
|
|
769
|
+
display: flex;
|
|
770
|
+
align-items: center;
|
|
771
|
+
justify-content: center;
|
|
772
|
+
flex-shrink: 0;
|
|
773
|
+
color: `,`;
|
|
774
|
+
`],f("gray2")),fs=p.div.withConfig({displayName:"ChatHistoryItem__Content"})([`
|
|
775
|
+
display: flex;
|
|
776
|
+
flex-direction: column;
|
|
777
|
+
flex: 1;
|
|
778
|
+
min-width: 0;
|
|
779
|
+
padding-left: 0.4rem;
|
|
780
|
+
`]),xs=p.div.attrs({className:"chat-title"}).withConfig({displayName:"ChatHistoryItem__Title"})([`
|
|
781
|
+
padding: 0.2rem 0.4rem;
|
|
782
|
+
border: 1px solid transparent;
|
|
783
|
+
color: `,`;
|
|
784
|
+
white-space: nowrap;
|
|
785
|
+
overflow: hidden;
|
|
786
|
+
text-overflow: ellipsis;
|
|
787
|
+
transform: translateX(-0.4rem);
|
|
788
|
+
`],f("offWhite")),ys=p.input.withConfig({displayName:"ChatHistoryItem__TitleInput"})([`
|
|
789
|
+
color: `,`;
|
|
790
|
+
background: transparent;
|
|
791
|
+
border: 1px solid `,`;
|
|
792
|
+
border-radius: 6px;
|
|
793
|
+
outline: none;
|
|
794
|
+
padding: 0.2rem 0.4rem;
|
|
795
|
+
font-family: inherit;
|
|
796
|
+
transform: translateX(-0.4rem);
|
|
797
|
+
|
|
798
|
+
&:focus {
|
|
799
|
+
outline: none;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
&::selection {
|
|
803
|
+
background: `,`;
|
|
804
|
+
}
|
|
805
|
+
&::-moz-selection {
|
|
806
|
+
background: `,`;
|
|
807
|
+
}
|
|
808
|
+
&::-webkit-selection {
|
|
809
|
+
background: `,`;
|
|
810
|
+
}
|
|
811
|
+
`],f("foreground"),f("pinkDarker"),f("pinkPrimary"),f("pinkPrimary"),f("pinkPrimary")),bs=p.div.withConfig({displayName:"ChatHistoryItem__Subtitle"})([`
|
|
812
|
+
font-size: 1.2rem;
|
|
813
|
+
line-height: 1.5;
|
|
814
|
+
color: `,`;
|
|
815
|
+
white-space: nowrap;
|
|
816
|
+
overflow: hidden;
|
|
817
|
+
text-overflow: ellipsis;
|
|
818
|
+
`],f("gray2")),Cs=p.div.withConfig({displayName:"ChatHistoryItem__ActionsContainer"})([`
|
|
819
|
+
display: flex;
|
|
820
|
+
align-items: center;
|
|
821
|
+
gap: 0.4rem;
|
|
822
|
+
flex-shrink: 0;
|
|
823
|
+
`]),aa=p.button.withConfig({displayName:"ChatHistoryItem__ActionButton"})([`
|
|
824
|
+
display: flex;
|
|
825
|
+
align-items: center;
|
|
826
|
+
justify-content: center;
|
|
827
|
+
padding: 0.4rem;
|
|
828
|
+
background: transparent;
|
|
829
|
+
border: none;
|
|
830
|
+
border-radius: 4px;
|
|
831
|
+
cursor: pointer;
|
|
832
|
+
color: `,`;
|
|
833
|
+
opacity: 0;
|
|
834
|
+
|
|
835
|
+
`,`:hover & {
|
|
836
|
+
opacity: 1;
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
&:hover {
|
|
840
|
+
background: `,`;
|
|
841
|
+
}
|
|
842
|
+
`],f("foreground"),na,f("backgroundDarker")),ws=p.span.withConfig({displayName:"ChatHistoryItem__CurrentIndicator"})([`
|
|
843
|
+
font-size: 1.2rem;
|
|
844
|
+
line-height: 1.5rem;
|
|
845
|
+
color: #9ca3af;
|
|
846
|
+
white-space: nowrap;
|
|
847
|
+
`]),ks=({conversation:e,subtitle:t,isCurrent:a,hasOngoingProcess:i,disabled:l,onSelect:o,onRename:s,onDelete:d})=>{const[h,x]=n.useState(!1),[g,c]=n.useState(e.conversationName),w=n.useRef(null);n.useEffect(()=>{h&&w.current&&(w.current.focus(),w.current.select())},[h]);const b=k=>{k.stopPropagation(),c(e.conversationName),x(!0)},y=k=>{k.stopPropagation(),d(e.id)},A=async()=>{const k=g.trim();k&&k!==e.conversationName&&(fe(xe.AI_CHAT_RENAME),await s(e.id,k)),x(!1)},v=async k=>{k.key==="Enter"?await A():k.key==="Escape"&&(c(e.conversationName),x(!1))},M=async()=>{await A()},C=async()=>{!h&&!l&&await o(e.id)};return r.jsxs(na,{onClick:C,disabled:l,"data-hook":"chat-history-item",children:[r.jsx(ps,{children:r.jsx(sn,{size:18})}),r.jsxs(fs,{children:[h?r.jsx(ys,{ref:w,value:g,onChange:k=>c(k.target.value),onKeyDown:v,onBlur:M,onClick:k=>k.stopPropagation(),"data-hook":"chat-history-rename"}):r.jsx(xs,{"data-hook":"chat-history-title",children:e.conversationName}),t&&r.jsx(bs,{children:t})]}),r.jsxs(Cs,{children:[!h&&r.jsxs(r.Fragment,{children:[r.jsx(aa,{onClick:b,title:"Edit title","data-hook":"chat-history-edit",children:r.jsx(gn,{size:18})}),!i&&r.jsx(aa,{onClick:y,title:"Delete","data-hook":"chat-history-delete",children:r.jsx(pn,{size:18})})]}),a&&r.jsx(ws,{children:"Current"})]})]})},As=p.div.withConfig({displayName:"DateSeparator__Container"})([`
|
|
848
|
+
display: flex;
|
|
849
|
+
align-items: center;
|
|
850
|
+
gap: 1rem;
|
|
851
|
+
padding: 0.4rem 0;
|
|
852
|
+
width: 100%;
|
|
853
|
+
`]),ra=p.div.withConfig({displayName:"DateSeparator__Line"})([`
|
|
854
|
+
flex: 1;
|
|
855
|
+
height: 1px;
|
|
856
|
+
background: `,`;
|
|
857
|
+
`],f("selection")),vs=p.div.withConfig({displayName:"DateSeparator__LabelContainer"})([`
|
|
858
|
+
display: flex;
|
|
859
|
+
align-items: center;
|
|
860
|
+
gap: 0.8rem;
|
|
861
|
+
color: `,`;
|
|
862
|
+
`],f("gray2")),Ms=p.span.withConfig({displayName:"DateSeparator__Label"})([`
|
|
863
|
+
font-size: 1.3rem;
|
|
864
|
+
letter-spacing: 0.016rem;
|
|
865
|
+
white-space: nowrap;
|
|
866
|
+
`]),js=({label:e})=>r.jsxs(As,{children:[r.jsx(ra,{}),r.jsxs(vs,{children:[r.jsx(ln,{size:16}),r.jsx(Ms,{children:e})]}),r.jsx(ra,{})]}),Hs=6e4;function ia(e){const t=Ra(),a=za(t);return Ta(e,new Date().getTime(),{locale:a})+" ago"}function Es(e){const t=[...e].sort((o,s)=>s.updatedAt-o.updatedAt),a=new Map;for(const o of t){const s=ia(o.updatedAt),d=a.get(s)||[];a.set(s,[...d,o])}const i=[],l=new Set;for(const o of t){const s=ia(o.updatedAt);l.has(s)||(l.add(s),i.push({label:s,conversations:a.get(s)||[]}))}return i}function _s(e){const[t,a]=n.useState(0);return n.useEffect(()=>{const i=setInterval(()=>{a(l=>l+1)},Hs);return()=>clearInterval(i)},[]),n.useMemo(()=>Es(e),[e,t])}function Is(e,t){if(!t.trim())return e;const a=t.toLowerCase().trim();return e.filter(i=>i.conversationName.toLowerCase().includes(a))}const sa=p.div.withConfig({displayName:"ChatHistoryView__Container"})([`
|
|
867
|
+
display: flex;
|
|
868
|
+
flex-direction: column;
|
|
869
|
+
height: 100%;
|
|
870
|
+
width: 100%;
|
|
871
|
+
padding: 2rem 1rem 4rem 1rem;
|
|
872
|
+
background: `,`;
|
|
873
|
+
overflow: hidden;
|
|
874
|
+
`],f("chatBackground")),Zs=p.div.withConfig({displayName:"ChatHistoryView__SearchContainer"})([`
|
|
875
|
+
position: relative;
|
|
876
|
+
display: flex;
|
|
877
|
+
align-items: center;
|
|
878
|
+
flex-shrink: 0;
|
|
879
|
+
`]),Vs=p.div.withConfig({displayName:"ChatHistoryView__SearchIcon"})([`
|
|
880
|
+
position: absolute;
|
|
881
|
+
left: 1.2rem;
|
|
882
|
+
display: flex;
|
|
883
|
+
align-items: center;
|
|
884
|
+
color: `,`;
|
|
885
|
+
pointer-events: none;
|
|
886
|
+
z-index: 1;
|
|
887
|
+
`],f("gray2")),Ns=p.button.withConfig({displayName:"ChatHistoryView__ClearButton"})([`
|
|
888
|
+
position: absolute;
|
|
889
|
+
right: 0.8rem;
|
|
890
|
+
display: flex;
|
|
891
|
+
align-items: center;
|
|
892
|
+
justify-content: center;
|
|
893
|
+
padding: 0.2rem;
|
|
894
|
+
background: transparent;
|
|
895
|
+
border: none;
|
|
896
|
+
border-radius: 4px;
|
|
897
|
+
cursor: pointer;
|
|
898
|
+
color: `,`;
|
|
899
|
+
|
|
900
|
+
&:hover {
|
|
901
|
+
color: `,`;
|
|
902
|
+
}
|
|
903
|
+
`],f("gray2"),f("foreground")),Ls=p($a).withConfig({displayName:"ChatHistoryView__SearchInput"})([`
|
|
904
|
+
width: 100%;
|
|
905
|
+
background: transparent;
|
|
906
|
+
color: `,`;
|
|
907
|
+
padding: 0.8rem 3.6rem 0.8rem 3.6rem;
|
|
908
|
+
border: 1px solid `,`4d;
|
|
909
|
+
height: 3rem;
|
|
910
|
+
border-radius: 0.6rem;
|
|
911
|
+
|
|
912
|
+
&:focus {
|
|
913
|
+
background: transparent;
|
|
914
|
+
border-color: `,`;
|
|
915
|
+
}
|
|
916
|
+
`],f("foreground"),f("gray2"),f("pinkDarker")),Ss=p.div.withConfig({displayName:"ChatHistoryView__ListContainer"})([`
|
|
917
|
+
display: flex;
|
|
918
|
+
flex-direction: column;
|
|
919
|
+
gap: 0.6rem;
|
|
920
|
+
padding: 2rem 0.4rem;
|
|
921
|
+
overflow-y: auto;
|
|
922
|
+
flex: 1;
|
|
923
|
+
min-height: 0;
|
|
924
|
+
`]),oa=p.div.withConfig({displayName:"ChatHistoryView__EmptyState"})([`
|
|
925
|
+
display: flex;
|
|
926
|
+
flex-direction: column;
|
|
927
|
+
align-items: center;
|
|
928
|
+
justify-content: center;
|
|
929
|
+
flex: 1;
|
|
930
|
+
color: `,`;
|
|
931
|
+
font-size: 1.3rem;
|
|
932
|
+
text-align: center;
|
|
933
|
+
padding: 2rem;
|
|
934
|
+
`],f("gray2")),Fs=p(De.Content).withConfig({displayName:"ChatHistoryView__AlertDialogContent"})([`
|
|
935
|
+
background: `,`;
|
|
936
|
+
`],f("chatBackground")),Ds=p.div.withConfig({displayName:"ChatHistoryView__DialogHeader"})([`
|
|
937
|
+
display: flex;
|
|
938
|
+
align-items: center;
|
|
939
|
+
justify-content: space-between;
|
|
940
|
+
padding: 1.5rem 2rem;
|
|
941
|
+
border-bottom: 1px solid `,`;
|
|
942
|
+
`],f("selection")),qs=p.h3.withConfig({displayName:"ChatHistoryView__DialogTitle"})([`
|
|
943
|
+
margin: 0;
|
|
944
|
+
font-weight: 500;
|
|
945
|
+
color: `,`;
|
|
946
|
+
`],f("foreground")),Rs=p.p.withConfig({displayName:"ChatHistoryView__DialogDescription"})([`
|
|
947
|
+
margin: 2rem;
|
|
948
|
+
font-size: 1.4rem;
|
|
949
|
+
line-height: 1.5;
|
|
950
|
+
`]),Ts=p.div.withConfig({displayName:"ChatHistoryView__DialogButtons"})([`
|
|
951
|
+
display: flex;
|
|
952
|
+
justify-content: flex-end;
|
|
953
|
+
gap: 1rem;
|
|
954
|
+
padding: 0 2rem 0 2rem;
|
|
955
|
+
`]),zs=p(ue).attrs({skin:"secondary"}).withConfig({displayName:"ChatHistoryView__CancelButton"})([""]),Bs=p(ue).withConfig({displayName:"ChatHistoryView__DeleteButton"})([`
|
|
956
|
+
background: `,`;
|
|
957
|
+
border-color: `,`;
|
|
958
|
+
|
|
959
|
+
&:hover:not(:disabled) {
|
|
960
|
+
background: `,`;
|
|
961
|
+
filter: brightness(1.1);
|
|
962
|
+
}
|
|
963
|
+
`],f("red"),f("red"),f("red")),Os=({currentConversationId:e})=>{const[t,a]=n.useState(""),[i,l]=n.useState(!1),[o,s]=n.useState(null),d=n.useRef(null),{conversationMetas:h,chatWindowState:x,openChatWindow:g,updateConversationName:c,deleteConversation:w}=it(),{status:b}=Ne(),{buffers:y}=bt(),A=le(se.query.getTables),v=n.useMemo(()=>Array.from(h.values()),[h]),M=n.useMemo(()=>Is(v,t),[v,t]),C=_s(M),k=(V,m)=>{if(V){if(m==="buffer"){const I=y.find(N=>N.id===V);if(I)return I.label}else if(m==="table"){const I=A.find(N=>N.id===V);if(I)return I.table_name}}},_=async V=>{await g(V)},H=async(V,m)=>{await c(V,m)},L=V=>{s(V),l(!0)},Z=async()=>{o&&await w(o),l(!1),s(null)},T=()=>{l(!1),s(null)};return n.useEffect(()=>{d.current&&d.current.scrollIntoView({block:"center"})},[]),v.length===0?r.jsx(sa,{children:r.jsx(oa,{"data-hook":"chat-history-empty",children:"No conversations yet"})}):r.jsxs(sa,{children:[r.jsxs(Zs,{children:[r.jsx(Vs,{children:r.jsx(mn,{size:18})}),r.jsx(Ls,{type:"text",placeholder:"Search chats",value:t,onChange:V=>a(V.target.value),"data-hook":"chat-history-search"}),t&&r.jsx(Ns,{onClick:()=>a(""),title:"Clear search","data-hook":"chat-history-search-clear",children:r.jsx(Qt,{size:16})})]}),r.jsxs(Ss,{"data-hook":"chat-history-list",children:[C.map((V,m)=>r.jsxs(Jt.Fragment,{children:[m>0&&r.jsx(js,{label:V.label}),V.conversations.map(I=>{const N=I.id===e;return r.jsx("div",{ref:N?d:void 0,children:r.jsx(ks,{conversation:I,subtitle:I.bufferId??I.tableId?k(I.bufferId??I.tableId,I.bufferId?"buffer":"table"):void 0,isCurrent:N,hasOngoingProcess:I.id===x.activeConversationId&&oe(b),disabled:oe(b)&&I.id!==x.activeConversationId,onSelect:_,onRename:H,onDelete:L})},I.id)})]},V.label)),M.length===0&&t&&r.jsx(oa,{children:"No chats match your search"})]}),r.jsx(De.Root,{open:i,onOpenChange:l,children:r.jsxs(De.Portal,{children:[r.jsx(Ba,{children:r.jsx(Oa,{primitive:De.Overlay})}),r.jsxs(Fs,{maxwidth:"40rem",children:[r.jsx(Ds,{children:r.jsx(qs,{children:"Delete conversation"})}),r.jsx(Rs,{children:"Are you sure you want to delete this conversation? This action cannot be undone."}),r.jsxs(Ts,{children:[r.jsx(De.Cancel,{asChild:!0,children:r.jsx(zs,{onClick:T,children:"Cancel"})}),r.jsx(De.Action,{asChild:!0,children:r.jsx(Bs,{onClick:Z,children:"Delete"})})]})]})]})})]})},$s=p.div.withConfig({displayName:"AIChatWindow__HeaderLeft"})([`
|
|
964
|
+
display: flex;
|
|
965
|
+
align-items: center;
|
|
966
|
+
gap: 1rem;
|
|
967
|
+
flex: 1;
|
|
968
|
+
min-width: 0;
|
|
969
|
+
overflow: hidden;
|
|
970
|
+
`]),Ws=p.span.withConfig({displayName:"AIChatWindow__HeaderTitle"})([`
|
|
971
|
+
white-space: nowrap;
|
|
972
|
+
overflow: hidden;
|
|
973
|
+
text-overflow: ellipsis;
|
|
974
|
+
font-size: 1.6rem;
|
|
975
|
+
`]),Ft=p(ue).attrs(({$active:e})=>({skin:"transparent",$active:e})).withConfig({displayName:"AIChatWindow__HeaderButton"})([`
|
|
976
|
+
color: `,`;
|
|
977
|
+
padding: 0.6rem;
|
|
978
|
+
|
|
979
|
+
`,`
|
|
980
|
+
`],f("foreground"),({$active:e})=>e&&Y([`
|
|
981
|
+
background: `,`;
|
|
982
|
+
`],f("selection"))),Ps=p.div.withConfig({displayName:"AIChatWindow__HeaderRight"})([`
|
|
983
|
+
display: flex;
|
|
984
|
+
align-items: center;
|
|
985
|
+
gap: 0.5rem;
|
|
986
|
+
flex-shrink: 0;
|
|
987
|
+
`]),Us=p.div.withConfig({displayName:"AIChatWindow__ChatWindowContent"})([`
|
|
988
|
+
display: flex;
|
|
989
|
+
height: 100%;
|
|
990
|
+
width: 100%;
|
|
991
|
+
overflow: hidden;
|
|
992
|
+
`]),Qs=p.div.withConfig({displayName:"AIChatWindow__InitialQueryContainer"})([`
|
|
993
|
+
display: flex;
|
|
994
|
+
flex-direction: column;
|
|
995
|
+
gap: 1rem;
|
|
996
|
+
padding: 1.5rem;
|
|
997
|
+
overflow-y: auto;
|
|
998
|
+
flex: 1 1 auto;
|
|
999
|
+
min-height: 0;
|
|
1000
|
+
width: 100%;
|
|
1001
|
+
`]),Ks=p.div.withConfig({displayName:"AIChatWindow__InitialQueryBox"})([`
|
|
1002
|
+
display: flex;
|
|
1003
|
+
flex-direction: column;
|
|
1004
|
+
align-self: flex-end;
|
|
1005
|
+
flex-shrink: 0;
|
|
1006
|
+
overflow: hidden;
|
|
1007
|
+
width: 100%;
|
|
1008
|
+
`]),Gs=p.div.withConfig({displayName:"AIChatWindow__InitialQueryEditor"})([`
|
|
1009
|
+
width: 100%;
|
|
1010
|
+
overflow: hidden;
|
|
1011
|
+
`]),Xs=p.div.withConfig({displayName:"AIChatWindow__ButtonContainer"})([`
|
|
1012
|
+
display: flex;
|
|
1013
|
+
justify-content: flex-start;
|
|
1014
|
+
align-items: center;
|
|
1015
|
+
gap: 1rem;
|
|
1016
|
+
width: 100%;
|
|
1017
|
+
margin-top: 0.5rem;
|
|
1018
|
+
`]),Ys=p.div.withConfig({displayName:"AIChatWindow__BlankChatContainer"})([`
|
|
1019
|
+
display: flex;
|
|
1020
|
+
flex-direction: column;
|
|
1021
|
+
align-items: flex-start;
|
|
1022
|
+
justify-content: center;
|
|
1023
|
+
gap: 1.2rem;
|
|
1024
|
+
padding: 1.8rem;
|
|
1025
|
+
flex: 1 1 auto;
|
|
1026
|
+
min-height: 0;
|
|
1027
|
+
max-width: 40rem;
|
|
1028
|
+
text-align: center;
|
|
1029
|
+
margin: 0 auto;
|
|
1030
|
+
`]),Js=p.h2.withConfig({displayName:"AIChatWindow__BlankChatHeading"})([`
|
|
1031
|
+
font-size: 2rem;
|
|
1032
|
+
font-weight: 600;
|
|
1033
|
+
text-align: left;
|
|
1034
|
+
color: `,`;
|
|
1035
|
+
margin: 0;
|
|
1036
|
+
`],f("foreground")),e1=p.p.withConfig({displayName:"AIChatWindow__BlankChatSubheading"})([`
|
|
1037
|
+
font-size: 1.4rem;
|
|
1038
|
+
font-weight: 400;
|
|
1039
|
+
color: `,`;
|
|
1040
|
+
text-align: left;
|
|
1041
|
+
margin: 0;
|
|
1042
|
+
line-height: 1.5;
|
|
1043
|
+
`],f("gray2")),la=p(F).withConfig({displayName:"AIChatWindow__ChatPanel"})([`
|
|
1044
|
+
display: flex;
|
|
1045
|
+
flex-direction: column;
|
|
1046
|
+
align-items: stretch;
|
|
1047
|
+
height: 100%;
|
|
1048
|
+
width: 100%;
|
|
1049
|
+
gap: 0;
|
|
1050
|
+
`]),t1=()=>{const e=en(),t=le(se.console.getActiveSidebar),{quest:a}=n.useContext(yt),{editorRef:i,showPreviewBuffer:l,closePreviewBuffer:o,executionRefs:s,highlightQuery:d}=bt(),{conversationMetas:h,activeConversationMessages:x,chatWindowState:g,isLoadingMessages:c,isStreaming:w,setIsStreaming:b,scrollToMessageId:y,setScrollToMessageId:A,closeChatWindow:v,openBlankChatWindow:M,openHistoryView:C,closeHistoryView:k,getConversationMeta:_,addMessage:H,updateMessage:L,replaceConversationMessages:Z,updateConversationName:T,acceptSuggestion:V,rejectSuggestion:m,persistMessages:I}=it(),{status:N,setStatus:S,abortController:B,canUse:te,hasSchemaAccess:ae,currentModel:Ce,apiKey:He,aiAssistantSettings:Ue}=Ne(),re=le(se.query.getTables),gt=le(se.query.getRunning),pt=le(se.query.getAISuggestionRequest),Re=g.activeConversationId?_(g.activeConversationId):null,u=n.useMemo(()=>Re?{...Re,messages:x}:null,[Re,x]),E=u==null?void 0:u.bufferId,J=le(se.query.getQueryNotificationsForBuffer(E??-1)),Ee=n.useRef(null),W=n.useMemo(()=>jt(u==null?void 0:u.currentSQL),[u]),me=n.useMemo(()=>Wa(u==null?void 0:u.queryKey),[u==null?void 0:u.queryKey]),K=x,Qe=n.useMemo(()=>Pa(K),[K]),Ke=n.useMemo(()=>K.length>0&&!c,[K,c]),O=n.useMemo(()=>K.length===0&&W&&W.trim()!==`
|
|
1051
|
+
`&&te&&!oe(N),[K.length,W,te,N]),U=n.useMemo(()=>!O||!u||!u.queryKey||!u.bufferId||!i.current?!1:fn(u.queryKey,u.bufferId,s,i)!==null,[O,u,i,s]),q=O&&U&&te&&!oe(N),R=g.isHistoryOpen??!1,$=h.size>0,Ge=n.useMemo(()=>oe(N)?!0:u?u.messages.length===0&&!u.queryKey&&!u.tableId:!1,[u,N]),ge=n.useMemo(()=>{if(R)return"Chat history";if(!u)return"";if(u.conversationName)return u.conversationName;const j=u.messages[0];if(j!=null&&j.displayType)switch(j.displayType){case"fix_request":return"Fix query";case"explain_request":return"Explain query";case"ask_request":return"Ask AI";case"health_issue_request":return"Health issue analysis";default:return"AI Assistant"}return"AI Assistant"},[u,R]),ie=n.useCallback(()=>{R?k():C()},[R,k,C]),de=()=>K.length>0?"Ask a follow up question or request refinement...":(u==null?void 0:u.tableId)!=null||W!=null&&W.trim()?"Ask a question or request an edit...":"Ask AI about your tables, or generate a query...",Te=(j,D=!1)=>{if(!te||!g.activeConversationId||!u)return;fe(xe.AI_CHAT_SEND);const pe=g.activeConversationId;D&&o();const P=u.messages.some(Ve=>Ve.role==="assistant");ke(Xt({conversationId:pe,userMessage:j,currentSQL:W,conversationHistory:u.messages,isFirstMessage:!P,settings:{model:Ce,apiKey:He},aiAssistantSettings:Ue,questClient:a,tables:re,hasSchemaAccess:ae,abortSignal:B==null?void 0:B.signal}),{addMessage:H,updateMessage:L,setStatus:S,setIsStreaming:b,persistMessages:I,updateConversationName:T,replaceConversationMessages:Z})},Xe=n.useCallback(async j=>{g.activeConversationId&&(fe(xe.AI_CHAT_ACCEPT),await V({conversationId:g.activeConversationId,messageId:j}),e(We.query.setAISuggestionRequest(null)))},[g.activeConversationId,V]),Ye=n.useCallback(async j=>{g.activeConversationId&&(fe(xe.AI_CHAT_REJECT),await m(g.activeConversationId,j),setTimeout(()=>{var D;(D=Ee.current)==null||D.focus()},100))},[g.activeConversationId,m]),_e=n.useCallback(j=>{const D=j.trim().endsWith(";")?j.trim().slice(0,-1):j.trim();e(We.query.setAISuggestionRequest({query:D,startOffset:me.startOffset})),e(We.query.toggleRunning(Pt.AI_SUGGESTION))},[me.startOffset]),Ie=n.useCallback(async()=>{if(fe(xe.AI_CONTEXT_BADGE_CLICK,{type:u!=null&&u.tableId?"table":"query"}),(u==null?void 0:u.queryKey)&&(u==null?void 0:u.bufferId))return await d(u.queryKey,u.bufferId);if(u!=null&&u.tableId){const j=re.find(D=>D.id===u.tableId);if(j)return e(We.console.pushSidebarHistory({type:"tableDetails",payload:{tableName:j.table_name,isMatView:j.table_type==="M",isView:j.table_type==="V"}})),!0}return!1},[u==null?void 0:u.queryKey,u==null?void 0:u.bufferId,u==null?void 0:u.tableId,d,re]),Je=n.useCallback(()=>{A(null)},[A]),Ze=n.useCallback(async(j,D=!1)=>{if(!(D&&await Ie()))if(j.type==="diff"){if(!g.activeConversationId)return;l({type:"diff",original:j.original,modified:j.modified,conversationId:g.activeConversationId})}else l({type:"code",value:j.value})},[l,g.activeConversationId,Ie]),et=n.useCallback(async(j,D)=>{if(!g.activeConversationId)return;const pe=Ua(D,!1);try{await V({conversationId:g.activeConversationId,messageId:j,skipDefaultMessage:!0}),H({role:"user",content:`User replaced query with one of your previous suggestions. Now the query is:
|
|
1052
|
+
|
|
1053
|
+
\`\`\`sql
|
|
1054
|
+
${pe.replaceAll(/\s+/g," ").trim()}
|
|
1055
|
+
\`\`\``,timestamp:Date.now(),hideFromUI:!0}),await I(g.activeConversationId)}catch(P){console.error("Error applying SQL to editor:",P),lt.error("Failed to apply changes to editor")}},[g.activeConversationId,V,H,I]),ft=async(j,D)=>{if(!g.activeConversationId||!te||oe(N))return;const pe=g.activeConversationId,P=K.find(Q=>Q.id===j);if(!P)return;const Ve={settings:{model:Ce,apiKey:He},aiAssistantSettings:Ue,questClient:a,tables:re,hasSchemaAccess:ae,abortSignal:B==null?void 0:B.signal};let xt=!1;const nt={addMessage:Q=>{H(Q,xt?[]:[j,D]),xt||(xt=!0)},updateMessage:L,setStatus:S,setIsStreaming:b,persistMessages:I,updateConversationName:T,replaceConversationMessages:Z};switch(P.displayType){case"explain_request":{if(!P.sql)return;ke(qt({conversationId:pe,queryText:P.sql,...Ve}),nt);break}case"fix_request":{if(!P.sql)return;ke(Rt({conversationId:pe,queryText:P.sql,...Ve}),nt);break}case"schema_explain_request":{if(!P.displaySchemaData)return;const Q=P.displaySchemaData;try{const ne=Q.kind==="matview"?await a.showMatViewDDL(Q.tableName):Q.kind==="view"?await a.showViewDDL(Q.tableName):await a.showTableDDL(Q.tableName);if((ne==null?void 0:ne.type)!==Ga.DQL||!ne.data||ne.data.length===0){lt.error("Failed to fetch table schema for retry");return}const at=ne.data[0];if(!at.ddl){lt.error("Failed to fetch table schema for retry");return}ke(Xa({conversationId:pe,tableName:Q.tableName,schema:at.ddl,kindLabel:Ya(Q.kind),schemaDisplayData:Q,...Ve}),nt)}catch(ne){console.error("Error fetching DDL for retry:",ne),lt.error("Failed to fetch table schema for retry")}break}case"ask_request":default:{const Q=P.displayUserMessage||P.content,ne=K.filter(rt=>rt.id!==j&&rt.id!==D),at=ne.some(rt=>rt.role==="assistant");ke(Xt({conversationId:pe,userMessage:Q,currentSQL:P.sql||W,conversationHistory:ne,isFirstMessage:!at,...Ve}),nt);break}}},tt=n.useRef(null),we=n.useCallback(()=>{var j,D;(D=(j=tt.current)==null?void 0:j.querySelector('button[data-hook="button-explain-query"]'))==null||D.click()},[]),z=n.useCallback(j=>{O&&(j.metaKey||j.ctrlKey)&&(j.key==="e"||j.key==="E")&&(j.preventDefault(),we())},[O]);return n.useEffect(()=>{if(O)return Kt.subscribe(Gt.EXPLAIN_QUERY_EXEC,we),document.addEventListener("keydown",z),()=>{document.removeEventListener("keydown",z),Kt.unsubscribe(Gt.EXPLAIN_QUERY_EXEC,we)}},[O,z,we]),(t==null?void 0:t.type)!=="aiChat"||!u&&!R?null:r.jsx(Qa,{mode:"side","data-hook":"ai-chat-window",open:(t==null?void 0:t.type)==="aiChat",onOpenChange:j=>{j||v()},onDismiss:v,trigger:r.jsx("span",{}),title:r.jsxs($s,{children:[r.jsx(st,{size:20,variant:"filled"}),r.jsx(Ws,{"data-hook":"chat-window-title",children:ge})]}),afterTitle:r.jsxs(Ps,{children:[r.jsx(Ft,{onClick:M,title:"New chat",disabled:Ge,"data-hook":"chat-window-new",children:r.jsx(Ka,{size:16,weight:"bold"})}),r.jsx(Ft,{$active:R,onClick:ie,title:R?"Back to chat":"Chat history",disabled:!$||oe(N),"data-hook":"chat-window-history",children:r.jsx(cn,{size:16,weight:"bold"})}),r.jsx(Ft,{onClick:v,title:"Close","data-hook":"chat-window-close",children:r.jsx(Qt,{size:16,weight:"bold"})})]}),children:r.jsx(Us,{children:c?r.jsx(la,{children:r.jsx(Ct,{size:20,style:{margin:"auto"}})}):R?r.jsx(Os,{currentConversationId:g.previousConversationId??null}):r.jsxs(la,{children:[Ke?r.jsx(ts,{messages:K,onAcceptChange:Xe,onRejectChange:Ye,onRunQuery:_e,onOpenInEditor:Ze,onApplyToEditor:et,onRetry:ft,running:gt,aiSuggestionRequest:pt,queryNotifications:J,queryStartOffset:me.startOffset,isOperationInProgress:oe(N),editorSQL:me.queryText,isStreaming:w,isLoadingMessages:c,scrollToMessageId:y,onScrollToMessageComplete:Je}):W&&W.trim()?r.jsxs(Qs,{children:[r.jsx(Ks,{"data-hook":"chat-initial-query-box",children:r.jsx(Gs,{"data-hook":"chat-lite-editor",children:r.jsx($e,{value:W.trim(),maxHeight:216,onOpenInEditor:()=>Ze({type:"code",value:W.trim()},!0)})})}),(O||q)&&r.jsxs(Xs,{ref:tt,children:[O&&r.jsx(fr,{conversationId:u.id,queryText:W.trim()}),q&&r.jsx(yr,{})]})]}):r.jsxs(Ys,{"data-hook":"chat-blank-state",children:[r.jsx(Js,{children:"Leverage AI directly in your database"}),r.jsx(e1,{children:"Our AI Assistant is a specialized programming and support agent that makes you more effective and helps you solve problems as you interface with your QuestDB database. Start a conversation."})]}),r.jsx(gs,{ref:Ee,onSend:j=>Te(j,Qe),disabled:!te||oe(N),placeholder:de(),contextSQL:me.queryText,contextTableId:u==null?void 0:u.tableId,onContextClick:Ie})]})})})};export{t1 as default};
|