@questdb/web-console 1.1.7 → 1.1.10

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.
@@ -0,0 +1,1013 @@
1
+ import{p as Q,Q as Ge,s as le,u as ye,a as Fe,j as s,A as De,K as vt,c as g,B as se,b as Se,e as He,E as Me,d as Ye,M as Xe,g as Je,f as et,i as tt,h as T,k as nt,l as Un,m as at,F as At,w as Pn,n as Qn,o as Kn,q as Gn,C as Yn,r as rt,t as Ee,v as G,x as be,y as it,z as Xn,D as _e,G as Jn,H as he,I as ot,J as ea,L as Ht,N as je,O as ke,P as ta,R as na,S as aa,T as ra,U as Mt,V as qe,W as Et,X as ia,Y as lt,Z as st,_ as oa,$ as _t,a0 as pe,a1 as la,a2 as sa,a3 as ca,a4 as da,a5 as ua,a6 as ha,a7 as ma,a8 as pa,a9 as fa,aa as jt,ab as ga,ac as xa,ad as ya,ae as ce,af as ba,ag as ka,ah as wa,ai as Zt,aj as we,ak as Ca,al as va,am as Aa,an as Ha,ao as Ma,ap as ct,aq as Ea,ar as _a}from"./index-CH73wMnb.js";import{b as t,E as de,H as x,R as Vt,Z as It,C as fe,U as ja,D as Za}from"./vendor-DsPrTxrp.js";const Va=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.createElement("path",{d:"M200,112H56l72-72Z",opacity:"0.2"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Ia=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),La=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Na=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Fa=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,128a88,88,0,1,1-88-88A88,88,0,0,1,216,128Z",opacity:"0.2"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Da=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Sa=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M71.68,97.22,34.74,128l36.94,30.78a12,12,0,1,1-15.36,18.44l-48-40a12,12,0,0,1,0-18.44l48-40A12,12,0,0,1,71.68,97.22Zm176,21.56-48-40a12,12,0,1,0-15.36,18.44L221.26,128l-36.94,30.78a12,12,0,1,0,15.36,18.44l48-40a12,12,0,0,0,0-18.44ZM164.1,28.72a12,12,0,0,0-15.38,7.18l-64,176a12,12,0,0,0,7.18,15.37A11.79,11.79,0,0,0,96,228a12,12,0,0,0,11.28-7.9l64-176A12,12,0,0,0,164.1,28.72Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M240,128l-48,40H64L16,128,64,88H192Z",opacity:"0.2"}),t.createElement("path",{d:"M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z"}))],["fill",t.createElement(t.Fragment,null,t.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,40ZM92.8,145.6a8,8,0,1,1-9.6,12.8l-32-24a8,8,0,0,1,0-12.8l32-24a8,8,0,0,1,9.6,12.8L69.33,128Zm58.89-71.4-32,112a8,8,0,1,1-15.38-4.4l32-112a8,8,0,0,1,15.38,4.4Zm53.11,60.2-32,24a8,8,0,0,1-9.6-12.8L186.67,128,163.2,110.4a8,8,0,1,1,9.6-12.8l32,24a8,8,0,0,1,0,12.8Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M67.84,92.61,25.37,128l42.47,35.39a6,6,0,1,1-7.68,9.22l-48-40a6,6,0,0,1,0-9.22l48-40a6,6,0,0,1,7.68,9.22Zm176,30.78-48-40a6,6,0,1,0-7.68,9.22L230.63,128l-42.47,35.39a6,6,0,1,0,7.68,9.22l48-40a6,6,0,0,0,0-9.22Zm-81.79-89A6,6,0,0,0,154.36,38l-64,176A6,6,0,0,0,94,221.64a6.15,6.15,0,0,0,2,.36,6,6,0,0,0,5.64-3.95l64-176A6,6,0,0,0,162.05,34.36Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M69.12,94.15,28.5,128l40.62,33.85a8,8,0,1,1-10.24,12.29l-48-40a8,8,0,0,1,0-12.29l48-40a8,8,0,0,1,10.24,12.3Zm176,27.7-48-40a8,8,0,1,0-10.24,12.3L227.5,128l-40.62,33.85a8,8,0,1,0,10.24,12.29l48-40a8,8,0,0,0,0-12.29ZM162.73,32.48a8,8,0,0,0-10.25,4.79l-64,176a8,8,0,0,0,4.79,10.26A8.14,8.14,0,0,0,96,224a8,8,0,0,0,7.52-5.27l64-176A8,8,0,0,0,162.73,32.48Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M66.56,91.07,22.25,128l44.31,36.93A4,4,0,0,1,64,172a3.94,3.94,0,0,1-2.56-.93l-48-40a4,4,0,0,1,0-6.14l48-40a4,4,0,0,1,5.12,6.14Zm176,33.86-48-40a4,4,0,1,0-5.12,6.14L233.75,128l-44.31,36.93a4,4,0,1,0,5.12,6.14l48-40a4,4,0,0,0,0-6.14ZM161.37,36.24a4,4,0,0,0-5.13,2.39l-64,176a4,4,0,0,0,2.39,5.13A4.12,4.12,0,0,0,96,220a4,4,0,0,0,3.76-2.63l64-176A4,4,0,0,0,161.37,36.24Z"}))]]),qa=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Ra=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),za=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Ta=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Ba=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),t.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]),Oa=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M200,36H56A20,20,0,0,0,36,56V200a20,20,0,0,0,20,20H200a20,20,0,0,0,20-20V56A20,20,0,0,0,200,36ZM60,60h56V196H60ZM196,196H140V60h56Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M208,56V200a8,8,0,0,1-8,8H56a8,8,0,0,1-8-8V56a8,8,0,0,1,8-8H200A8,8,0,0,1,208,56Z",opacity:"0.2"}),t.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40ZM56,56h64V200H56ZM200,200H136V56h64V200Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M120,44V212a4,4,0,0,1-4,4H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40h60A4,4,0,0,1,120,44Zm80-4H140a4,4,0,0,0-4,4V212a4,4,0,0,0,4,4h60a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M200,42H56A14,14,0,0,0,42,56V200a14,14,0,0,0,14,14H200a14,14,0,0,0,14-14V56A14,14,0,0,0,200,42ZM54,200V56a2,2,0,0,1,2-2h66V202H56A2,2,0,0,1,54,200Zm148,0a2,2,0,0,1-2,2H134V54h66a2,2,0,0,1,2,2Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M200,40H56A16,16,0,0,0,40,56V200a16,16,0,0,0,16,16H200a16,16,0,0,0,16-16V56A16,16,0,0,0,200,40ZM56,56h64V200H56ZM200,200H136V56h64V200Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M200,44H56A12,12,0,0,0,44,56V200a12,12,0,0,0,12,12H200a12,12,0,0,0,12-12V56A12,12,0,0,0,200,44ZM52,200V56a4,4,0,0,1,4-4h68V204H56A4,4,0,0,1,52,200Zm152,0a4,4,0,0,1-4,4H132V52h68a4,4,0,0,1,4,4Z"}))]]),$a=new Map([["bold",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.createElement("path",{d:"M200,56V208a8,8,0,0,1-8,8H64a8,8,0,0,1-8-8V56Z",opacity:"0.2"}),t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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",t.createElement(t.Fragment,null,t.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"}))]]),Lt=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Va}));Lt.displayName="ArrowUpIcon";const Nt=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Ia}));Nt.displayName="ChatDotsIcon";const Ft=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:La}));Ft.displayName="ChatTextIcon";const Dt=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Na}));Dt.displayName="ClockCountdownIcon";const St=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Fa}));St.displayName="ClockCounterClockwiseIcon";const qt=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Da}));qt.displayName="CodeBlockIcon";const Rt=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Sa}));Rt.displayName="CodeIcon";const zt=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:qa}));zt.displayName="GaugeIcon";const Tt=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Ra}));Tt.displayName="KeyReturnIcon";const Bt=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:za}));Bt.displayName="MagnifyingGlassIcon";const Ot=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Ta}));Ot.displayName="PencilSimpleLineIcon";const $t=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Ba}));$t.displayName="PlusIcon";const Wt=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:Oa}));Wt.displayName="SquareSplitHorizontalIcon";const Ut=t.forwardRef((e,n)=>t.createElement(Q,{ref:n,...e,weights:$a}));Ut.displayName="TrashSimpleIcon";const Wa=x(T).attrs({alignItems:"center",gap:"0"}).withConfig({displayName:"ExplainQueryButton__KeyBinding"})([`
2
+ color: `,`;
3
+ `],({theme:e})=>e.color.pinkPrimary),Ua=Se.isMacintosh||Se.isIOS?"\u2318":"Ctrl",Pa=Se.isMacintosh||Se.isIOS?"Cmd+E":"Ctrl+E",Qa=x(se).withConfig({displayName:"ExplainQueryButton__ExplainButton"})([`
4
+ gap: 1rem;
5
+ `]),Ka=({conversationId:e,queryText:n})=>{const{quest:a}=t.useContext(Ge),r=de(le.query.getTables),{setStatus:l,abortController:o,hasSchemaAccess:i,currentModel:d,apiKey:u}=ye(),{addMessage:f,updateMessage:m,updateConversationName:c,persistMessages:y}=Fe(),b=()=>{const p=d,C=u;(async()=>{const v=`Explain this SQL query with 2-4 sentences:
6
+
7
+ \`\`\`sql
8
+ ${n}
9
+ \`\`\``;f({role:"user",content:v,timestamp:Date.now(),displayType:"explain_request",sql:n});const k=crypto.randomUUID();f({id:k,role:"assistant",content:"",timestamp:Date.now(),operationHistory:[]}),He.publish(Me.AI_QUERY_HIGHLIGHT,e);const E=Ye(p),A={model:p,provider:E,apiKey:C},Z=Xe.find(I=>I.isTestModel&&I.provider===E);Z&&Je({firstUserMessage:v,settings:{model:Z.value,provider:E,apiKey:C}}).then(I=>{I&&c(e,I)});const V=I=>{m(e,k,{operationHistory:[...I]})},R=await et({userMessage:v,conversationHistory:[],currentSQL:n,settings:A,modelToolsClient:nt(a,i?r:void 0),setStatus:(I,L)=>l(I,{...L??{},conversationId:e},V),abortSignal:o==null?void 0:o.signal,operation:"explain"});if(tt(R)){const I=R;m(e,k,{error:I.type!=="aborted"?I.message:"Operation has been cancelled"}),await y(e);return}const M=R;if(!M.explanation){m(e,k,{error:"No explanation received from AI Assistant"}),await y(e);return}m(e,k,{content:M.explanation,explanation:M.explanation,tokenUsage:M.tokenUsage}),await y(e)})()};return s.jsxs(Qa,{skin:"gradient",gradientWeight:"thin",onClick:b,title:`Explain query with AI Assistant (${Pa})`,"data-hook":"button-explain-query",children:[s.jsx(De,{size:12,variant:"hollow"}),"Explain query",s.jsxs(Wa,{children:[s.jsx(vt,{keyString:Ua,color:g("pinkPrimary"),hoverColor:g("pinkPrimary")}),s.jsx(vt,{keyString:"E",color:g("pinkPrimary"),hoverColor:g("pinkPrimary")})]})]})},Pt=(e,n,a,r)=>{if(!(a!=null&&a.current)||!r.current)return null;const l=r.current.getModel();if(!l)return null;const o=a.current[n.toString()];if(!o)return null;const i=o[e];if(!i||!i.error)return null;const d=i.selection?i.selection.startOffset:i.startOffset,u=i.selection?i.selection.endOffset:i.endOffset,f=l.getPositionAt(d),m=l.getPositionAt(d+i.error.position),c=l.getWordAtPosition(m),y=l.getPositionAt(u),b=i.selection?l.getValueInRange({startLineNumber:f.lineNumber,startColumn:f.column,endLineNumber:y.lineNumber,endColumn:y.column}):Un(e).queryText;return{errorMessage:i.error.error||"Query execution failed",word:c?c.word:null,fixStart:d,fixEnd:u,queryText:b}},Ga=x(se).withConfig({displayName:"FixQueryButton__FixButton"})([`
10
+ gap: 1rem;
11
+ `]),Ya=()=>{const{quest:e}=t.useContext(Ge),{editorRef:n,executionRefs:a}=at(),r=de(le.query.getTables),{setStatus:l,abortController:o,hasSchemaAccess:i,currentModel:d,apiKey:u}=ye(),{chatWindowState:f,getConversationMeta:m,addMessage:c,updateMessage:y,updateConversationName:b,persistMessages:p}=Fe(),C=async()=>{const v=f.activeConversationId,k=m(v),E=Pt(k.queryKey,k.bufferId,a,n),{errorMessage:A,queryText:Z,word:V}=E,R=`Fix this SQL query that has an error:
12
+
13
+ \`\`\`sql
14
+ ${Z}
15
+ \`\`\`
16
+
17
+ Error: ${A}${V?`
18
+
19
+ Error near: "${V}"`:""}`;c({role:"user",content:R,timestamp:Date.now(),displayType:"fix_request",sql:Z});const M=crypto.randomUUID();c({id:M,role:"assistant",content:"",timestamp:Date.now(),operationHistory:[]}),He.publish(Me.AI_QUERY_HIGHLIGHT,k.id);const I=Ye(d),L={model:d,provider:I,apiKey:u},h=Xe.find(_=>_.isTestModel&&_.provider===I);h&&Je({firstUserMessage:R,settings:{model:h.value,provider:I,apiKey:u}}).then(_=>{_&&b(k.id,_)});const F=_=>{y(k.id,M,{operationHistory:[..._]})},B=await et({userMessage:R,conversationHistory:[],currentSQL:Z,settings:L,modelToolsClient:nt(e,i?r:void 0),setStatus:(_,Y)=>l(_,{...Y??{},conversationId:k.id},F),abortSignal:o==null?void 0:o.signal,operation:"fix"});if(tt(B)){const _=B;y(k.id,M,{error:_.type!=="aborted"?_.message:"Operation has been cancelled"}),await p(k.id);return}const S=B;if(!S.sql&&S.explanation){y(k.id,M,{content:S.explanation,explanation:S.explanation,tokenUsage:S.tokenUsage}),await p(k.id);return}if(!S.sql){y(k.id,M,{error:"No fixed query or explanation received from AI Assistant"}),await p(k.id);return}const w=S.explanation?`SQL Query:
20
+ \`\`\`sql
21
+ ${S.sql}
22
+ \`\`\`
23
+
24
+ Explanation:
25
+ ${S.explanation}`:`SQL Query:
26
+ \`\`\`sql
27
+ ${S.sql}
28
+ \`\`\``;y(k.id,M,{content:w,sql:S.sql,explanation:S.explanation,tokenUsage:S.tokenUsage}),await p(k.id)};return s.jsxs(Ga,{skin:"gradient",gradientWeight:"thin",onClick:C,title:"Fix query with AI Assistant","data-hook":"button-fix-query",children:[s.jsx(De,{size:12,variant:"hollow"}),"Fix query"]})},Qt=x.div.withConfig({displayName:"LiteEditor__EditorWrapper"})([`
29
+ position: relative;
30
+ padding: `,`;
31
+ border-radius: 8px;
32
+ border: `,`;
33
+ background: `,`;
34
+
35
+ .monaco-editor-background {
36
+ background: `,`;
37
+ }
38
+
39
+ .monaco-editor {
40
+ background: `,`;
41
+ }
42
+
43
+ .editor.original {
44
+ display: none !important;
45
+ }
46
+
47
+ .editor-scrollable {
48
+ width: 100% !important;
49
+ }
50
+
51
+ .view-lines {
52
+ width: 100% !important;
53
+ pointer-events: none;
54
+ }
55
+
56
+ .current-line {
57
+ background: transparent !important;
58
+ border: 0 !important;
59
+ }
60
+
61
+ .margin {
62
+ display: none !important;
63
+ }
64
+
65
+ .monaco-scrollable-element {
66
+ left: 0 !important;
67
+ }
68
+
69
+ .scrollbar {
70
+ display: none !important;
71
+ }
72
+
73
+ .open-in-editor-btn {
74
+ opacity: 0;
75
+ transition: opacity 0.15s ease-in-out;
76
+ }
77
+
78
+ &:hover .open-in-editor-btn {
79
+ opacity: 1;
80
+ }
81
+ `],({$noBorder:e})=>e?0:"0 1.2rem",({$noBorder:e,theme:n})=>e?"none":`1px solid ${n.color.selection}`,({theme:e})=>e.color.backgroundDarker,({theme:e})=>e.color.backgroundDarker,({theme:e})=>e.color.backgroundDarker),Xa=x(se).attrs({skin:"transparent"}).withConfig({displayName:"LiteEditor__OpenInEditorButton"})([`
82
+ gap: 1rem;
83
+ font-size: 1.2rem;
84
+ background: `,`;
85
+ border: 0;
86
+ color: `,`;
87
+ `],({theme:e})=>e.color.backgroundDarker,({theme:e})=>e.color.offWhite),Kt=x(Yn).withConfig({displayName:"LiteEditor__SuccessIcon"})([`
88
+ position: absolute;
89
+ transform: translate(75%, -75%);
90
+ color: `,`;
91
+ `],({theme:e})=>e.color.green),Ja=x.div.withConfig({displayName:"LiteEditor__ButtonsContainer"})([`
92
+ position: absolute;
93
+ top: 0.8rem;
94
+ right: 1.2rem;
95
+ display: flex;
96
+ align-items: center;
97
+ justify-content: flex-end;
98
+ gap: 1.2rem;
99
+ z-index: 10;
100
+ `]),Gt=x(se).withConfig({displayName:"LiteEditor__CopyButtonBase"})([`
101
+ color: #e5e7eb;
102
+ padding: 0 0.6rem;
103
+ background: `,`;
104
+ `],({theme:e})=>e.color.backgroundDarker),er=x(Gt).withConfig({displayName:"LiteEditor__CopyButtonFloating"})([`
105
+ position: absolute;
106
+ top: 0.2rem;
107
+ right: 0.8rem;
108
+ z-index: 10;
109
+ `]),Ze=Vt.memo(({height:e="100%",language:n=Qn,theme:a="dracula",fontSize:r=12,padding:l={top:8,bottom:8},lineHeight:o=20,noBorder:i,...d})=>{const u=It(),f=t.useRef(!1),[m,c]=t.useState(!1),y=b=>{Gn(b),c(!0),setTimeout(()=>c(!1),2e3)};return d.diffEditor?s.jsxs(Qt,{$noBorder:i,style:{height:e,...i?void 0:{paddingTop:8,paddingBottom:8}},children:[s.jsxs(Ja,{children:[d.onExpandDiff&&s.jsxs(Xa,{className:"open-in-editor-btn",onClick:d.onExpandDiff,title:"Open in editor","data-hook":"diff-open-in-editor-button",children:["Open in editor",s.jsx(Wt,{size:"1.8rem",color:u.color.offWhite})]}),s.jsxs(Gt,{skin:"transparent",onClick:()=>y(d.modified),title:"Copy to clipboard",children:[m&&s.jsx(Kt,{size:"1rem"}),s.jsx(At,{size:"1.8rem"})]})]}),s.jsx(Pn,{height:e,language:n,original:d.original,modified:d.modified,theme:a,onMount:b=>{b.onDidUpdateDiff(()=>{var C;if(f.current)return;const p=(C=b.getLineChanges())==null?void 0:C[0];p&&(f.current=!0,b.getModifiedEditor().revealLineInCenter(p.modifiedStartLineNumber))})},options:{readOnly:!0,lineNumbers:"off",minimap:{enabled:!1},scrollBeyondLastLine:!1,scrollbar:{vertical:"hidden",horizontal:"hidden"},automaticLayout:!0,folding:!1,wordWrap:"on",glyphMargin:!1,renderSideBySide:!1,enableSplitViewResizing:!1,renderIndicators:!1,renderOverviewRuler:!1,hideCursorInOverviewRuler:!0,originalEditable:!1,overviewRulerBorder:!1,fontSize:r,lineHeight:o}})]}):s.jsxs(Qt,{$noBorder:i,style:{height:e},children:[s.jsxs(er,{skin:"transparent",onClick:()=>y(d.value??""),title:"Copy to clipboard",children:[m&&s.jsx(Kt,{size:"1rem"}),s.jsx(At,{size:"1.8rem"})]}),s.jsx(Kn,{height:e,language:n,value:d.value,theme:a,options:{readOnly:!0,lineNumbers:"off",minimap:{enabled:!1},scrollBeyondLastLine:!1,folding:!1,glyphMargin:!1,lineDecorationsWidth:0,lineNumbersMinChars:0,renderLineHighlight:"none",overviewRulerLanes:0,hideCursorInOverviewRuler:!0,overviewRulerBorder:!1,scrollbar:{vertical:"hidden",horizontal:"hidden"},fontSize:r,padding:l}})]})},(e,n)=>e.value===n.value&&e.diffEditor===n.diffEditor&&e.original===n.original&&e.modified===n.modified),tr={tokenize:lr,partial:!0},Yt={tokenize:sr,partial:!0},Xt={tokenize:cr,partial:!0},Jt={tokenize:dr,partial:!0},nr={tokenize:ur,partial:!0},en={tokenize:ir,previous:nn},tn={tokenize:or,previous:an},ue={tokenize:rr,previous:rn},ie={},ar={text:ie};let ge=48;for(;ge<123;)ie[ge]=ue,ge++,ge===58?ge=65:ge===91&&(ge=97);ie[43]=ue,ie[45]=ue,ie[46]=ue,ie[95]=ue,ie[72]=[ue,tn],ie[104]=[ue,tn],ie[87]=[ue,en],ie[119]=[ue,en];function rr(e,n,a){const r=this;let l,o;return i;function i(c){return!dt(c)||!rn.call(r,r.previous)||ut(r.events)?a(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(c))}function d(c){return dt(c)?(e.consume(c),d):c===64?(e.consume(c),u):a(c)}function u(c){return c===46?e.check(nr,m,f)(c):c===45||c===95||rt(c)?(o=!0,e.consume(c),u):m(c)}function f(c){return e.consume(c),l=!0,u}function m(c){return o&&l&&Ee(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):a(c)}}function ir(e,n,a){const r=this;return l;function l(i){return i!==87&&i!==119||!nn.call(r,r.previous)||ut(r.events)?a(i):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(tr,e.attempt(Yt,e.attempt(Xt,o),a),a)(i))}function o(i){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(i)}}function or(e,n,a){const r=this;let l="",o=!1;return i;function i(c){return(c===72||c===104)&&an.call(r,r.previous)&&!ut(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(c),e.consume(c),d):a(c)}function d(c){if(Ee(c)&&l.length<5)return l+=String.fromCodePoint(c),e.consume(c),d;if(c===58){const y=l.toLowerCase();if(y==="http"||y==="https")return e.consume(c),u}return a(c)}function u(c){return c===47?(e.consume(c),o?f:(o=!0,u)):a(c)}function f(c){return c===null||Xn(c)||G(c)||be(c)||it(c)?a(c):e.attempt(Yt,e.attempt(Xt,m),a)(c)}function m(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function lr(e,n,a){let r=0;return l;function l(i){return(i===87||i===119)&&r<3?(r++,e.consume(i),l):i===46&&r===3?(e.consume(i),o):a(i)}function o(i){return i===null?a(i):n(i)}}function sr(e,n,a){let r,l,o;return i;function i(f){return f===46||f===95?e.check(Jt,u,d)(f):f===null||G(f)||be(f)||f!==45&&it(f)?u(f):(o=!0,e.consume(f),i)}function d(f){return f===95?r=!0:(l=r,r=void 0),e.consume(f),i}function u(f){return l||r||!o?a(f):n(f)}}function cr(e,n){let a=0,r=0;return l;function l(i){return i===40?(a++,e.consume(i),l):i===41&&r<a?o(i):i===33||i===34||i===38||i===39||i===41||i===42||i===44||i===46||i===58||i===59||i===60||i===63||i===93||i===95||i===126?e.check(Jt,n,o)(i):i===null||G(i)||be(i)?n(i):(e.consume(i),l)}function o(i){return i===41&&r++,e.consume(i),l}}function dr(e,n,a){return r;function r(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),r):d===38?(e.consume(d),o):d===93?(e.consume(d),l):d===60||d===null||G(d)||be(d)?n(d):a(d)}function l(d){return d===null||d===40||d===91||G(d)||be(d)?n(d):r(d)}function o(d){return Ee(d)?i(d):a(d)}function i(d){return d===59?(e.consume(d),r):Ee(d)?(e.consume(d),i):a(d)}}function ur(e,n,a){return r;function r(o){return e.consume(o),l}function l(o){return rt(o)?a(o):n(o)}}function nn(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||G(e)}function an(e){return!Ee(e)}function rn(e){return!(e===47||dt(e))}function dt(e){return e===43||e===45||e===46||e===95||rt(e)}function ut(e){let n=e.length,a=!1;for(;n--;){const r=e[n][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const hr={tokenize:kr,partial:!0};function mr(){return{document:{91:{tokenize:xr,continuation:{tokenize:yr},exit:br}},text:{91:{tokenize:gr},93:{add:"after",tokenize:pr,resolveTo:fr}}}}function pr(e,n,a){const r=this;let l=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let i;for(;l--;){const u=r.events[l][1];if(u.type==="labelImage"){i=u;break}if(u.type==="gfmFootnoteCall"||u.type==="labelLink"||u.type==="label"||u.type==="image"||u.type==="link")break}return d;function d(u){if(!i||!i._balanced)return a(u);const f=_e(r.sliceSerialize({start:i.end,end:r.now()}));return f.codePointAt(0)!==94||!o.includes(f.slice(1))?a(u):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(u),e.exit("gfmFootnoteCallLabelMarker"),n(u))}}function fr(e,n){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 r={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)},i={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},d=[e[a+1],e[a+2],["enter",r,n],e[a+3],e[a+4],["enter",l,n],["exit",l,n],["enter",o,n],["enter",i,n],["exit",i,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(a,e.length-a+1,...d),e}function gr(e,n,a){const r=this,l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,i;return d;function d(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),u}function u(c){return c!==94?a(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(c){if(o>999||c===93&&!i||c===null||c===91||G(c))return a(c);if(c===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return l.includes(_e(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):a(c)}return G(c)||(i=!0),o++,e.consume(c),c===92?m:f}function m(c){return c===91||c===92||c===93?(e.consume(c),o++,f):f(c)}}function xr(e,n,a){const r=this,l=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,i=0,d;return u;function u(p){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(p){return p===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",m):a(p)}function m(p){if(i>999||p===93&&!d||p===null||p===91||G(p))return a(p);if(p===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return o=_e(r.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(p),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return G(p)||(d=!0),i++,e.consume(p),p===92?c:m}function c(p){return p===91||p===92||p===93?(e.consume(p),i++,m):m(p)}function y(p){return p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),l.includes(o)||l.push(o),he(e,b,"gfmFootnoteDefinitionWhitespace")):a(p)}function b(p){return n(p)}}function yr(e,n,a){return e.check(Jn,n,e.attempt(hr,n,a))}function br(e){e.exit("gfmFootnoteDefinition")}function kr(e,n,a){const r=this;return he(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const i=r.events[r.events.length-1];return i&&i[1].type==="gfmFootnoteDefinitionIndent"&&i[2].sliceSerialize(i[1],!0).length===4?n(o):a(o)}}function wr(e){let n=(e||{}).singleTilde;const a={tokenize:l,resolveAll:r};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function r(o,i){let d=-1;for(;++d<o.length;)if(o[d][0]==="enter"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._close){let u=d;for(;u--;)if(o[u][0]==="exit"&&o[u][1].type==="strikethroughSequenceTemporary"&&o[u][1]._open&&o[d][1].end.offset-o[d][1].start.offset===o[u][1].end.offset-o[u][1].start.offset){o[d][1].type="strikethroughSequence",o[u][1].type="strikethroughSequence";const f={type:"strikethrough",start:Object.assign({},o[u][1].start),end:Object.assign({},o[d][1].end)},m={type:"strikethroughText",start:Object.assign({},o[u][1].end),end:Object.assign({},o[d][1].start)},c=[["enter",f,i],["enter",o[u][1],i],["exit",o[u][1],i],["enter",m,i]],y=i.parser.constructs.insideSpan.null;y&&ot(c,c.length,0,ea(y,o.slice(u+1,d),i)),ot(c,c.length,0,[["exit",m,i],["enter",o[d][1],i],["exit",o[d][1],i],["exit",f,i]]),ot(o,u-1,d-u+3,c),d=u+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,i,d){const u=this.previous,f=this.events;let m=0;return c;function c(b){return u===126&&f[f.length-1][1].type!=="characterEscape"?d(b):(o.enter("strikethroughSequenceTemporary"),y(b))}function y(b){const p=Ht(u);if(b===126)return m>1?d(b):(o.consume(b),m++,y);if(m<2&&!n)return d(b);const C=o.exit("strikethroughSequenceTemporary"),v=Ht(b);return C._open=!v||v===2&&!!p,C._close=!p||p===2&&!!v,i(b)}}}class Cr{constructor(){this.map=[]}add(n,a,r){vr(this,n,a,r)}consume(n){if(this.map.sort((o,i)=>o[0]-i[0]),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(n.slice(this.map[a][0]+this.map[a][1])),r.push(this.map[a][2]),n.length=this.map[a][0];r.push([...n]),n.length=0;let l=r.pop();for(;l;)n.push(...l),l=r.pop();this.map.length=0}}function vr(e,n,a,r){let l=0;if(!(a===0&&r.length===0)){for(;l<e.map.length;){if(e.map[l][0]===n){e.map[l][1]+=a,e.map[l][2].push(...r);return}l+=1}e.map.push([n,a,r])}}function Ar(e,n){let a=!1;const r=[];for(;n<e.length;){const l=e[n];if(a){if(l[0]==="enter")l[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(a=!0);n+=1}return r}const Hr={flow:{null:{tokenize:Mr,resolveAll:Er}}};function Mr(e,n,a){const r=this;let l=0,o=0,i;return d;function d(h){let F=r.events.length-1;for(;F>-1;){const w=r.events[F][1].type;if(w==="lineEnding"||w==="linePrefix")F--;else break}const B=F>-1?r.events[F][1].type:null,S=B==="tableHead"||B==="tableRow"?R:u;return S===R&&r.parser.lazy[r.now().line]?a(h):S(h)}function u(h){return e.enter("tableHead"),e.enter("tableRow"),f(h)}function f(h){return h===124||(i=!0,o+=1),m(h)}function m(h){return h===null?a(h):je(h)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(h),e.exit("lineEnding"),b):a(h):ke(h)?he(e,m,"whitespace")(h):(o+=1,i&&(i=!1,l+=1),h===124?(e.enter("tableCellDivider"),e.consume(h),e.exit("tableCellDivider"),i=!0,m):(e.enter("data"),c(h)))}function c(h){return h===null||h===124||G(h)?(e.exit("data"),m(h)):(e.consume(h),h===92?y:c)}function y(h){return h===92||h===124?(e.consume(h),c):c(h)}function b(h){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(h):(e.enter("tableDelimiterRow"),i=!1,ke(h)?he(e,p,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(h):p(h))}function p(h){return h===45||h===58?v(h):h===124?(i=!0,e.enter("tableCellDivider"),e.consume(h),e.exit("tableCellDivider"),C):V(h)}function C(h){return ke(h)?he(e,v,"whitespace")(h):v(h)}function v(h){return h===58?(o+=1,i=!0,e.enter("tableDelimiterMarker"),e.consume(h),e.exit("tableDelimiterMarker"),k):h===45?(o+=1,k(h)):h===null||je(h)?Z(h):V(h)}function k(h){return h===45?(e.enter("tableDelimiterFiller"),E(h)):V(h)}function E(h){return h===45?(e.consume(h),E):h===58?(i=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(h),e.exit("tableDelimiterMarker"),A):(e.exit("tableDelimiterFiller"),A(h))}function A(h){return ke(h)?he(e,Z,"whitespace")(h):Z(h)}function Z(h){return h===124?p(h):h===null||je(h)?!i||l!==o?V(h):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(h)):V(h)}function V(h){return a(h)}function R(h){return e.enter("tableRow"),M(h)}function M(h){return h===124?(e.enter("tableCellDivider"),e.consume(h),e.exit("tableCellDivider"),M):h===null||je(h)?(e.exit("tableRow"),n(h)):ke(h)?he(e,M,"whitespace")(h):(e.enter("data"),I(h))}function I(h){return h===null||h===124||G(h)?(e.exit("data"),M(h)):(e.consume(h),h===92?L:I)}function L(h){return h===92||h===124?(e.consume(h),I):I(h)}}function Er(e,n){let a=-1,r=!0,l=0,o=[0,0,0,0],i=[0,0,0,0],d=!1,u=0,f,m,c;const y=new Cr;for(;++a<e.length;){const b=e[a],p=b[1];b[0]==="enter"?p.type==="tableHead"?(d=!1,u!==0&&(on(y,n,u,f,m),m=void 0,u=0),f={type:"table",start:Object.assign({},p.start),end:Object.assign({},p.end)},y.add(a,0,[["enter",f,n]])):p.type==="tableRow"||p.type==="tableDelimiterRow"?(r=!0,c=void 0,o=[0,0,0,0],i=[0,a+1,0,0],d&&(d=!1,m={type:"tableBody",start:Object.assign({},p.start),end:Object.assign({},p.end)},y.add(a,0,[["enter",m,n]])),l=p.type==="tableDelimiterRow"?2:m?3:1):l&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")?(r=!1,i[2]===0&&(o[1]!==0&&(i[0]=i[1],c=Re(y,n,o,l,void 0,c),o=[0,0,0,0]),i[2]=a)):p.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(i[0]=i[1],c=Re(y,n,o,l,void 0,c)),o=i,i=[o[1],a,0,0])):p.type==="tableHead"?(d=!0,u=a):p.type==="tableRow"||p.type==="tableDelimiterRow"?(u=a,o[1]!==0?(i[0]=i[1],c=Re(y,n,o,l,a,c)):i[1]!==0&&(c=Re(y,n,i,l,a,c)),l=0):l&&(p.type==="data"||p.type==="tableDelimiterMarker"||p.type==="tableDelimiterFiller")&&(i[3]=a)}for(u!==0&&on(y,n,u,f,m),y.consume(n.events),a=-1;++a<n.events.length;){const b=n.events[a];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=Ar(n.events,a))}return e}function Re(e,n,a,r,l,o){const i=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",d="tableContent";a[0]!==0&&(o.end=Object.assign({},Ce(n.events,a[0])),e.add(a[0],0,[["exit",o,n]]));const u=Ce(n.events,a[1]);if(o={type:i,start:Object.assign({},u),end:Object.assign({},u)},e.add(a[1],0,[["enter",o,n]]),a[2]!==0){const f=Ce(n.events,a[2]),m=Ce(n.events,a[3]),c={type:d,start:Object.assign({},f),end:Object.assign({},m)};if(e.add(a[2],0,[["enter",c,n]]),r!==2){const y=n.events[a[2]],b=n.events[a[3]];if(y[1].end=Object.assign({},b[1].end),y[1].type="chunkText",y[1].contentType="text",a[3]>a[2]+1){const p=a[2]+1,C=a[3]-a[2]-1;e.add(p,C,[])}}e.add(a[3]+1,0,[["exit",c,n]])}return l!==void 0&&(o.end=Object.assign({},Ce(n.events,l)),e.add(l,0,[["exit",o,n]]),o=void 0),o}function on(e,n,a,r,l){const o=[],i=Ce(n.events,a);l&&(l.end=Object.assign({},i),o.push(["exit",l,n])),r.end=Object.assign({},i),o.push(["exit",r,n]),e.add(a+1,0,o)}function Ce(e,n){const a=e[n],r=a[0]==="enter"?"start":"end";return a[1][r]}const _r={tokenize:Zr},jr={text:{91:_r}};function Zr(e,n,a){const r=this;return l;function l(u){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(u):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),o)}function o(u){return G(u)?(e.enter("taskListCheckValueUnchecked"),e.consume(u),e.exit("taskListCheckValueUnchecked"),i):u===88||u===120?(e.enter("taskListCheckValueChecked"),e.consume(u),e.exit("taskListCheckValueChecked"),i):a(u)}function i(u){return u===93?(e.enter("taskListCheckMarker"),e.consume(u),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):a(u)}function d(u){return je(u)?n(u):ke(u)?e.check({tokenize:Vr},n,a)(u):a(u)}}function Vr(e,n,a){return he(e,r,"whitespace");function r(l){return l===null?a(l):n(l)}}function Ir(e){return ta([ar,mr(),wr(e),Hr,jr])}function ln(e,n){const a=String(e);if(typeof n!="string")throw new TypeError("Expected character");let r=0,l=a.indexOf(n);for(;l!==-1;)r++,l=a.indexOf(n,l+n.length);return r}function Lr(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const Nr={}.hasOwnProperty,Fr=(function(e,n,a,r){let l,o;typeof n=="string"||n instanceof RegExp?(o=[[n,a]],l=r):(o=n,l=a),l||(l={});const i=na(l.ignore||[]),d=Dr(o);let u=-1;for(;++u<d.length;)aa(e,"text",f);return e;function f(c,y){let b=-1,p;for(;++b<y.length;){const C=y[b];if(i(C,p?p.children.indexOf(C):void 0,p))return;p=C}if(p)return m(c,y)}function m(c,y){const b=y[y.length-1],p=d[u][0],C=d[u][1];let v=0;const k=b.children.indexOf(c);let E=!1,A=[];p.lastIndex=0;let Z=p.exec(c.value);for(;Z;){const V=Z.index,R={index:Z.index,input:Z.input,stack:[...y,c]};let M=C(...Z,R);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M!==!1&&(v!==V&&A.push({type:"text",value:c.value.slice(v,V)}),Array.isArray(M)?A.push(...M):M&&A.push(M),v=V+Z[0].length,E=!0),!p.global)break;Z=p.exec(c.value)}return E?(v<c.value.length&&A.push({type:"text",value:c.value.slice(v)}),b.children.splice(k,1,...A)):A=[c],k+A.length}});function Dr(e){const n=[];if(typeof e!="object")throw new TypeError("Expected array or object as schema");if(Array.isArray(e)){let a=-1;for(;++a<e.length;)n.push([sn(e[a][0]),cn(e[a][1])])}else{let a;for(a in e)Nr.call(e,a)&&n.push([sn(a),cn(e[a])])}return n}function sn(e){return typeof e=="string"?new RegExp(Lr(e),"g"):e}function cn(e){return typeof e=="function"?e:()=>e}const ht="phrasing",mt=["autolink","link","image","label"],Sr={transforms:[$r],enter:{literalAutolink:Rr,literalAutolinkEmail:pt,literalAutolinkHttp:pt,literalAutolinkWww:pt},exit:{literalAutolink:Or,literalAutolinkEmail:Br,literalAutolinkHttp:zr,literalAutolinkWww:Tr}},qr={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ht,notInConstruct:mt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ht,notInConstruct:mt},{character:":",before:"[ps]",after:"\\/",inConstruct:ht,notInConstruct:mt}]};function Rr(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function pt(e){this.config.enter.autolinkProtocol.call(this,e)}function zr(e){this.config.exit.autolinkProtocol.call(this,e)}function Tr(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.url="http://"+this.sliceSerialize(e)}function Br(e){this.config.exit.autolinkEmail.call(this,e)}function Or(e){this.exit(e)}function $r(e){Fr(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,Wr],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,Ur]],{ignore:["link","linkReference"]})}function Wr(e,n,a,r,l){let o="";if(!dn(l)||(/^w/i.test(n)&&(a=n+a,n="",o="http://"),!Pr(a)))return!1;const i=Qr(a+r);if(!i[0])return!1;const d={type:"link",title:null,url:o+n+i[0],children:[{type:"text",value:n+i[0]}]};return i[1]?[d,{type:"text",value:i[1]}]:d}function Ur(e,n,a,r){return!dn(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+a,children:[{type:"text",value:n+"@"+a}]}}function Pr(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function Qr(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let a=n[0],r=a.indexOf(")");const l=ln(e,"(");let o=ln(e,")");for(;r!==-1&&l>o;)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),o++;return[e,a]}function dn(e,n){const a=e.input.charCodeAt(e.index-1);return(e.index===0||be(a)||it(a))&&(!n||a!==47)}function un(e){return e.label||!e.identifier?e.label||"":ra(e.identifier)}function Kr(e,n,a){const r=n.indexStack,l=e.children||[],o=n.createTracker(a),i=[];let d=-1;for(r.push(-1);++d<l.length;){const u=l[d];r[r.length-1]=d,i.push(o.move(n.handle(u,e,n,{before:`
110
+ `,after:`
111
+ `,...o.current()}))),u.type!=="list"&&(n.bulletLastUsed=void 0),d<l.length-1&&i.push(o.move(Gr(u,l[d+1],e,n)))}return r.pop(),i.join("")}function Gr(e,n,a,r){let l=r.join.length;for(;l--;){const o=r.join[l](e,n,a,r);if(o===!0||o===1)break;if(typeof o=="number")return`
112
+ `.repeat(1+o);if(o===!1)return`
113
+
114
+ <!---->
115
+
116
+ `}return`
117
+
118
+ `}const Yr=/\r?\n|\r/g;function Xr(e,n){const a=[];let r=0,l=0,o;for(;o=Yr.exec(e);)i(e.slice(r,o.index)),a.push(o[0]),r=o.index+o[0].length,l++;return i(e.slice(r)),a.join("");function i(d){a.push(n(d,l,!d))}}function hn(e){if(!e._compiled){const n=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((n?"("+n+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function Jr(e,n){return mn(e,n.inConstruct,!0)&&!mn(e,n.notInConstruct,!1)}function mn(e,n,a){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return a;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function pn(e,n,a){const r=(a.before||"")+(n||"")+(a.after||""),l=[],o=[],i={};let d=-1;for(;++d<e.unsafe.length;){const m=e.unsafe[d];if(!Jr(e.stack,m))continue;const c=hn(m);let y;for(;y=c.exec(r);){const b="before"in m||!!m.atBreak,p="after"in m,C=y.index+(b?y[1].length:0);l.includes(C)?(i[C].before&&!b&&(i[C].before=!1),i[C].after&&!p&&(i[C].after=!1)):(l.push(C),i[C]={before:b,after:p})}}l.sort(e0);let u=a.before?a.before.length:0;const f=r.length-(a.after?a.after.length:0);for(d=-1;++d<l.length;){const m=l[d];m<u||m>=f||m+1<f&&l[d+1]===m+1&&i[m].after&&!i[m+1].before&&!i[m+1].after||l[d-1]===m-1&&i[m].before&&!i[m-1].before&&!i[m-1].after||(u!==m&&o.push(fn(r.slice(u,m),"\\")),u=m,/[!-/:-@[-`{-~]/.test(r.charAt(m))&&(!a.encode||!a.encode.includes(r.charAt(m)))?o.push("\\"):(o.push("&#x"+r.charCodeAt(m).toString(16).toUpperCase()+";"),u++))}return o.push(fn(r.slice(u,f),a.after)),o.join("")}function e0(e,n){return e-n}function fn(e,n){const a=/\\(?=[!-/:-@[-`{-~])/g,r=[],l=[],o=e+n;let i=-1,d=0,u;for(;u=a.exec(o);)r.push(u.index);for(;++i<r.length;)d!==r[i]&&l.push(e.slice(d,r[i])),l.push("\\"),d=r[i];return l.push(e.slice(d)),l.join("")}function ze(e){const n=e||{},a=n.now||{};let r=n.lineShift||0,l=a.line||1,o=a.column||1;return{move:u,current:i,shift:d};function i(){return{now:{line:l,column:o},lineShift:r}}function d(f){r+=f}function u(f){const m=f||"",c=m.split(/\r?\n|\r/g),y=c[c.length-1];return l+=c.length-1,o=c.length===1?o+y.length:1+y.length+r,m}}gn.peek=u0;function t0(){return{enter:{gfmFootnoteDefinition:a0,gfmFootnoteDefinitionLabelString:r0,gfmFootnoteCall:l0,gfmFootnoteCallString:s0},exit:{gfmFootnoteDefinition:o0,gfmFootnoteDefinitionLabelString:i0,gfmFootnoteCall:d0,gfmFootnoteCallString:c0}}}function n0(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:h0,footnoteReference:gn}}}function a0(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function r0(){this.buffer()}function i0(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.label=n,a.identifier=_e(this.sliceSerialize(e)).toLowerCase()}function o0(e){this.exit(e)}function l0(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function s0(){this.buffer()}function c0(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.label=n,a.identifier=_e(this.sliceSerialize(e)).toLowerCase()}function d0(e){this.exit(e)}function gn(e,n,a,r){const l=ze(r);let o=l.move("[^");const i=a.enter("footnoteReference"),d=a.enter("reference");return o+=l.move(pn(a,un(e),{...l.current(),before:o,after:"]"})),d(),i(),o+=l.move("]"),o}function u0(){return"["}function h0(e,n,a,r){const l=ze(r);let o=l.move("[^");const i=a.enter("footnoteDefinition"),d=a.enter("label");return o+=l.move(pn(a,un(e),{...l.current(),before:o,after:"]"})),d(),o+=l.move("]:"+(e.children&&e.children.length>0?" ":"")),l.shift(4),o+=l.move(Xr(Kr(e,a,l.current()),m0)),i(),o}function m0(e,n,a){return n===0?e:(a?"":" ")+e}function xn(e,n,a){const r=n.indexStack,l=e.children||[],o=[];let i=-1,d=a.before;r.push(-1);let u=n.createTracker(a);for(;++i<l.length;){const f=l[i];let m;if(r[r.length-1]=i,i+1<l.length){let c=n.handle.handlers[l[i+1].type];c&&c.peek&&(c=c.peek),m=c?c(l[i+1],e,n,{before:"",after:"",...u.current()}).charAt(0):""}else m=a.after;o.length>0&&(d==="\r"||d===`
119
+ `)&&f.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),d=" ",u=n.createTracker(a),u.move(o.join(""))),o.push(u.move(n.handle(f,e,n,{...u.current(),before:d,after:m}))),d=o[o.length-1].slice(-1)}return r.pop(),o.join("")}const p0=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];yn.peek=b0;const f0={canContainEols:["delete"],enter:{strikethrough:x0},exit:{strikethrough:y0}},g0={unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:p0}],handlers:{delete:yn}};function x0(e){this.enter({type:"delete",children:[]},e)}function y0(e){this.exit(e)}function yn(e,n,a,r){const l=ze(r),o=a.enter("strikethrough");let i=l.move("~~");return i+=xn(e,a,{...l.current(),before:i,after:"~"}),i+=l.move("~~"),o(),i}function b0(){return"~"}bn.peek=k0;function bn(e,n,a){let r=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(r);)l+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<a.unsafe.length;){const i=a.unsafe[o],d=hn(i);let u;if(i.atBreak)for(;u=d.exec(r);){let f=u.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(u.index+1)}}return l+r+l}function k0(){return"`"}function w0(e){return e.length}function C0(e,n){const a=n||{},r=(a.align||[]).concat(),l=a.stringLength||w0,o=[],i=[],d=[],u=[];let f=0,m=-1;for(;++m<e.length;){const C=[],v=[];let k=-1;for(e[m].length>f&&(f=e[m].length);++k<e[m].length;){const E=v0(e[m][k]);if(a.alignDelimiters!==!1){const A=l(E);v[k]=A,(u[k]===void 0||A>u[k])&&(u[k]=A)}C.push(E)}i[m]=C,d[m]=v}let c=-1;if(typeof r=="object"&&"length"in r)for(;++c<f;)o[c]=kn(r[c]);else{const C=kn(r);for(;++c<f;)o[c]=C}c=-1;const y=[],b=[];for(;++c<f;){const C=o[c];let v="",k="";C===99?(v=":",k=":"):C===108?v=":":C===114&&(k=":");let E=a.alignDelimiters===!1?1:Math.max(1,u[c]-v.length-k.length);const A=v+"-".repeat(E)+k;a.alignDelimiters!==!1&&(E=v.length+E+k.length,E>u[c]&&(u[c]=E),b[c]=E),y[c]=A}i.splice(1,0,y),d.splice(1,0,b),m=-1;const p=[];for(;++m<i.length;){const C=i[m],v=d[m];c=-1;const k=[];for(;++c<f;){const E=C[c]||"";let A="",Z="";if(a.alignDelimiters!==!1){const V=u[c]-(v[c]||0),R=o[c];R===114?A=" ".repeat(V):R===99?V%2?(A=" ".repeat(V/2+.5),Z=" ".repeat(V/2-.5)):(A=" ".repeat(V/2),Z=A):Z=" ".repeat(V)}a.delimiterStart!==!1&&!c&&k.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&E==="")&&(a.delimiterStart!==!1||c)&&k.push(" "),a.alignDelimiters!==!1&&k.push(A),k.push(E),a.alignDelimiters!==!1&&k.push(Z),a.padding!==!1&&k.push(" "),(a.delimiterEnd!==!1||c!==f-1)&&k.push("|")}p.push(a.delimiterEnd===!1?k.join("").replace(/ +$/,""):k.join(""))}return p.join(`
120
+ `)}function v0(e){return e==null?"":String(e)}function kn(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}const A0={enter:{table:H0,tableData:wn,tableHeader:wn,tableRow:E0},exit:{codeText:_0,table:M0,tableData:ft,tableHeader:ft,tableRow:ft}};function H0(e){const n=e._align;this.enter({type:"table",align:n.map(a=>a==="none"?null:a),children:[]},e),this.setData("inTable",!0)}function M0(e){this.exit(e),this.setData("inTable")}function E0(e){this.enter({type:"tableRow",children:[]},e)}function ft(e){this.exit(e)}function wn(e){this.enter({type:"tableCell",children:[]},e)}function _0(e){let n=this.resume();this.getData("inTable")&&(n=n.replace(/\\([\\|])/g,j0));const a=this.stack[this.stack.length-1];a.value=n,this.exit(e)}function j0(e,n){return n==="|"?n:e}function Z0(e){const n=e||{},a=n.tableCellPadding,r=n.tablePipeAlign,l=n.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
121
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:i,tableRow:d,tableCell:u,inlineCode:y}};function i(b,p,C,v){return f(m(b,C,v),b.align)}function d(b,p,C,v){const k=c(b,C,v),E=f([k]);return E.slice(0,E.indexOf(`
122
+ `))}function u(b,p,C,v){const k=C.enter("tableCell"),E=C.enter("phrasing"),A=xn(b,C,{...v,before:o,after:o});return E(),k(),A}function f(b,p){return C0(b,{align:p,alignDelimiters:r,padding:a,stringLength:l})}function m(b,p,C){const v=b.children;let k=-1;const E=[],A=p.enter("table");for(;++k<v.length;)E[k]=c(v[k],p,C);return A(),E}function c(b,p,C){const v=b.children;let k=-1;const E=[],A=p.enter("tableRow");for(;++k<v.length;)E[k]=u(v[k],b,p,C);return A(),E}function y(b,p,C){let v=bn(b,p,C);return C.stack.includes("tableCell")&&(v=v.replace(/\|/g,"\\$&")),v}}function V0(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function I0(e){const n=e.options.listItemIndent||"tab";if(n===1||n==="1")return"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function L0(e,n,a,r){const l=I0(a);let o=a.bulletCurrent||V0(a);n&&n.type==="list"&&n.ordered&&(o=(typeof n.start=="number"&&n.start>-1?n.start:1)+(a.options.incrementListMarker===!1?0:n.children.indexOf(e))+o);let i=o.length+1;(l==="tab"||l==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(i=Math.ceil(i/4)*4);const d=a.createTracker(r);d.move(o+" ".repeat(i-o.length)),d.shift(i);const u=a.enter("listItem"),f=a.indentLines(a.containerFlow(e,d.current()),m);return u(),f;function m(c,y,b){return y?(b?"":" ".repeat(i))+c:(b?o:o+" ".repeat(i-o.length))+c}}const N0={exit:{taskListCheckValueChecked:Cn,taskListCheckValueUnchecked:Cn,paragraph:D0}},F0={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:S0}};function Cn(e){const n=this.stack[this.stack.length-2];n.checked=e.type==="taskListCheckValueChecked"}function D0(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const a=this.stack[this.stack.length-1],r=a.children[0];if(r&&r.type==="text"){const l=n.children;let o=-1,i;for(;++o<l.length;){const d=l[o];if(d.type==="paragraph"){i=d;break}}i===a&&(r.value=r.value.slice(1),r.value.length===0?a.children.shift():a.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,a.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function S0(e,n,a,r){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",i="["+(e.checked?"x":" ")+"] ",d=ze(r);o&&d.move(i);let u=L0(e,n,a,{...r,...d.current()});return o&&(u=u.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),u;function f(m){return m+i}}function q0(){return[Sr,t0(),f0,A0,N0]}function R0(e){return{extensions:[qr,n0(),g0,Z0(e),F0]}}function z0(e={}){const n=this.data();a("micromarkExtensions",Ir(e)),a("fromMarkdownExtensions",q0()),a("toMarkdownExtensions",R0(e));function a(r,l){(n[r]?n[r]:n[r]=[]).push(l)}}const T0=ja([`
123
+ from {
124
+ transform: rotate(0deg);
125
+ }
126
+ to {
127
+ transform: rotate(360deg);
128
+ }
129
+ `]),B0=x.span.withConfig({displayName:"ChatMessages__LoadingIconWrapper"})([`
130
+ display: flex;
131
+ align-items: center;
132
+ justify-content: center;
133
+ animation: `,` 3s linear infinite;
134
+ `],T0),O0=()=>s.jsx(B0,{children:s.jsx(pa,{})}),$0=x(T).withConfig({displayName:"ChatMessages__MessagesContainer"})([`
135
+ display: flex;
136
+ flex-direction: column;
137
+ gap: 2rem;
138
+ padding: 2rem 1rem;
139
+ overflow-y: auto;
140
+ flex: 1 1 auto;
141
+ min-height: 0;
142
+ width: 100%;
143
+ `,`
144
+ `],({$scrolled:e})=>!e&&fe([`
145
+ opacity: 0;
146
+ `])),W0=x(T).attrs({align:"flex-start"}).withConfig({displayName:"ChatMessages__MessageBubble"})([`
147
+ display: flex;
148
+ flex-direction: column;
149
+ gap: 0.5rem;
150
+ padding: 0.8rem;
151
+ border-radius: 0.8rem;
152
+ width: 100%;
153
+ align-self: flex-end;
154
+ background: `,`;
155
+ border: 1px solid rgba(25, 26, 33, 0.32);
156
+ flex-shrink: 0;
157
+ overflow: visible;
158
+ `],g("loginBackground")),vn=x(T).withConfig({displayName:"ChatMessages__UserRequestBox"})([`
159
+ display: flex;
160
+ flex-direction: column;
161
+ gap: 0.5rem;
162
+ padding: 0.8rem;
163
+ width: 100%;
164
+ align-self: flex-end;
165
+ background: `,`;
166
+ border: 1px solid rgba(25, 26, 33, 0.32);
167
+ border-radius: 0.6rem;
168
+ flex-shrink: 0;
169
+ overflow: visible;
170
+ `],g("loginBackground")),U0=x(T).attrs({alignItems:"center",gap:"0.8rem"}).withConfig({displayName:"ChatMessages__UserRequestHeader"})([`
171
+ width: 100%;
172
+ padding: 0.4rem;
173
+ flex: 1 0 auto;
174
+ `]),gt=x(T).withConfig({displayName:"ChatMessages__UserRequestContent"})([`
175
+ display: flex;
176
+ flex-direction: column;
177
+ border-radius: 0.6rem;
178
+ overflow: hidden;
179
+ flex-shrink: 0;
180
+ width: 100%;
181
+ align-items: flex-start;
182
+ `]),An=x.div.withConfig({displayName:"ChatMessages__InlineSQLEditor"})([`
183
+ width: 100%;
184
+ `]),P0=x(T).attrs({gap:"1rem",alignItems:"center"}).withConfig({displayName:"ChatMessages__OperationBadge"})([`
185
+ width: 100%;
186
+ padding: 0 0.4rem;
187
+ `]),Q0=x(T).attrs({align:"center",justifyContent:"center"}).withConfig({displayName:"ChatMessages__BadgeIconContainer"})([`
188
+ background: #290a13;
189
+ border: 1px solid rgba(122, 31, 58, 0.64);
190
+ border-radius: 0.4rem;
191
+ padding: 0.8rem;
192
+ width: 4.8rem;
193
+ height: 4rem;
194
+ flex-shrink: 0;
195
+ `]),K0=x.img.withConfig({displayName:"ChatMessages__BadgeIcon"})([`
196
+ width: 1.8rem;
197
+ height: 1.8rem;
198
+ `]),G0=x(pe).withConfig({displayName:"ChatMessages__BadgeTitle"})([`
199
+ font-weight: 500;
200
+ font-size: 1.6rem;
201
+ line-height: 1.6rem;
202
+ color: `,`;
203
+ `],g("foreground")),Y0=x(T).withConfig({displayName:"ChatMessages__BadgeDescriptionContainer"})([`
204
+ padding: 0.8rem;
205
+ width: 100%;
206
+ `]),X0=x(pe).withConfig({displayName:"ChatMessages__BadgeDescriptionText"})([`
207
+ font-size: 1.4rem;
208
+ line-height: 2.1rem;
209
+ color: `,`;
210
+ `],g("foreground")),J0=x(T).withConfig({displayName:"ChatMessages__SchemaNameDisplay"})([`
211
+ margin-left: 0.4rem;
212
+ padding: 0.8rem 1.2rem;
213
+ align-items: center;
214
+ gap: 1rem;
215
+ border-radius: 8px;
216
+ border: 1px solid `,`;
217
+ background: `,`;
218
+ `],g("selection"),g("backgroundDarker")),ei=x(pe).withConfig({displayName:"ChatMessages__SchemaName"})([`
219
+ font-size: 1.4rem;
220
+ color: `,`;
221
+ `],g("foreground")),Hn=x(pe).withConfig({displayName:"ChatMessages__MessageContent"})([`
222
+ font-size: 1.4rem;
223
+ line-height: 1.8rem;
224
+ color: `,`;
225
+ white-space: pre-wrap;
226
+ word-wrap: break-word;
227
+ overflow: visible;
228
+ `],g("foreground")),ti=x(T).withConfig({displayName:"ChatMessages__ExplanationBox"})([`
229
+ display: flex;
230
+ flex-direction: column;
231
+ gap: 0.5rem;
232
+ width: 100%;
233
+ align-self: flex-start;
234
+ text-align: left;
235
+ background: transparent;
236
+ padding: 0.4rem;
237
+ border-radius: 0.6rem;
238
+ flex-shrink: 0;
239
+ overflow: visible;
240
+
241
+ `,`
242
+
243
+ .assistant-label,
244
+ .token-display {
245
+ transition: opacity 0.2s;
246
+ opacity: 0;
247
+ }
248
+
249
+ &:hover {
250
+ .assistant-label,
251
+ .token-display {
252
+ opacity: 1;
253
+ }
254
+ }
255
+ `],({$hasOperationHistory:e})=>e&&fe([`
256
+ padding-top: 0;
257
+ `])),ni=x(T).attrs({alignItems:"center",gap:"1rem"}).withConfig({displayName:"ChatMessages__AssistantHeader"})([`
258
+ width: 100%;
259
+ padding: 0.4rem;
260
+ flex: 1 0 auto;
261
+ `]),ai=x(pe).attrs({className:"assistant-label"}).withConfig({displayName:"ChatMessages__AssistantLabel"})([`
262
+ font-family: `,`;
263
+ font-size: 1.4rem;
264
+ text-transform: uppercase;
265
+ color: `,`;
266
+ line-height: 1;
267
+ `],({theme:e})=>e.fontMonospace,g("foreground")),ri=x(T).attrs({className:"token-display"}).withConfig({displayName:"ChatMessages__TokenDisplay"})([`
268
+ align-items: center;
269
+ gap: 0.9rem;
270
+ margin: 0 0 0 auto;
271
+ `]),ii=x(T).withConfig({displayName:"ChatMessages__ExplanationContent"})([`
272
+ display: flex;
273
+ flex-direction: column;
274
+ border-radius: 0.6rem;
275
+ padding: 0.8rem;
276
+ overflow: visible;
277
+ flex-shrink: 0;
278
+ width: 100%;
279
+ `]),oi=x.div.withConfig({displayName:"ChatMessages__Divider"})([`
280
+ width: 100%;
281
+ height: 1px;
282
+ background: linear-gradient(90deg, #9c274b 0%, rgba(54, 14, 26, 0) 100%);
283
+ margin-bottom: 1.5rem;
284
+ `]),li=x.div.withConfig({displayName:"ChatMessages__OperationHistoryContainer"})([`
285
+ margin-bottom: 1rem;
286
+ padding-bottom: 1rem;
287
+ width: 100%;
288
+ `,`
289
+ `],({$trimBottom:e})=>e&&fe([`
290
+ margin-bottom: 0;
291
+ padding-bottom: 0.3rem;
292
+ `])),si=x.div.withConfig({displayName:"ChatMessages__ErrorContainer"})([`
293
+ display: flex;
294
+ align-items: center;
295
+ flex-shrink: 0;
296
+ gap: 1rem;
297
+ padding: 1rem 1.2rem;
298
+ border-radius: 0.6rem;
299
+ border: 1px solid `,`;
300
+ color: `,`;
301
+ font-size: 1.4rem;
302
+ line-height: 2rem;
303
+ width: 100%;
304
+ `],g("red"),g("foreground")),ci=x.div.withConfig({displayName:"ChatMessages__MarkdownContent"})([`
305
+ margin: 0;
306
+ width: 100%;
307
+ font-family: `,`;
308
+ font-size: 1.4rem;
309
+ line-height: 2.1rem;
310
+ color: `,`;
311
+ overflow: visible;
312
+ word-break: break-word;
313
+
314
+ p {
315
+ margin: 0 0 1rem 0;
316
+ &:last-child {
317
+ margin-bottom: 0;
318
+ }
319
+ }
320
+
321
+ code {
322
+ background: `,`;
323
+ border: 1px solid `,`;
324
+ border-radius: 0.4rem;
325
+ padding: 0.1rem 0.4rem;
326
+ font-family: `,`;
327
+ font-size: 1.3rem;
328
+ color: `,`;
329
+ white-space: pre-wrap;
330
+ }
331
+
332
+ strong {
333
+ font-weight: 600;
334
+ color: `,`;
335
+ }
336
+
337
+ em {
338
+ font-style: italic;
339
+ }
340
+
341
+ ul,
342
+ ol {
343
+ margin: 0.5rem 0;
344
+ padding-left: 2rem;
345
+ }
346
+
347
+ li {
348
+ margin-bottom: 0.3rem;
349
+ }
350
+
351
+ a {
352
+ color: `,`;
353
+ text-decoration: none;
354
+ &:hover {
355
+ text-decoration: underline;
356
+ }
357
+ }
358
+
359
+ h1,
360
+ h2,
361
+ h3,
362
+ h4 {
363
+ margin: 1rem 0 0.5rem 0;
364
+ font-weight: 600;
365
+ }
366
+
367
+ h1 {
368
+ font-size: 1.8rem;
369
+ }
370
+ h2 {
371
+ font-size: 1.6rem;
372
+ }
373
+ h3 {
374
+ font-size: 1.5rem;
375
+ }
376
+ h4 {
377
+ font-size: 1.4rem;
378
+ }
379
+
380
+ blockquote {
381
+ border-left: 3px solid `,`;
382
+ margin: 1rem 0;
383
+ padding-left: 1rem;
384
+ color: `,`;
385
+ }
386
+
387
+ .table-wrapper {
388
+ overflow-x: auto;
389
+ margin: 1rem 0;
390
+ }
391
+
392
+ table {
393
+ border-collapse: collapse;
394
+ min-width: max-content;
395
+ border-radius: 0.8rem;
396
+ }
397
+
398
+ th,
399
+ td {
400
+ padding: 0.6rem 0.8rem;
401
+ border: 1px solid `,`;
402
+ text-align: left;
403
+ white-space: nowrap;
404
+ }
405
+
406
+ th {
407
+ background: `,`;
408
+ font-weight: 600;
409
+ }
410
+
411
+ td:last-child {
412
+ white-space: normal;
413
+ min-width: 200px;
414
+ }
415
+ `],({theme:e})=>e.font,g("foreground"),g("background"),g("selection"),({theme:e})=>e.fontMonospace,g("purple"),g("foreground"),({theme:e})=>e.color.cyan,g("selection"),g("gray2"),g("selection"),g("backgroundDarker")),di=x(T).withConfig({displayName:"ChatMessages__DiffContainer"})([`
416
+ display: flex;
417
+ flex-direction: column;
418
+ gap: 10px;
419
+ margin-top: 1rem;
420
+ padding: 8px 12px;
421
+ border: 1px solid `,`;
422
+ border-radius: 8px;
423
+ background: `,`;
424
+ width: 100%;
425
+ `],g("selection"),g("backgroundDarker")),ui=x(T).withConfig({displayName:"ChatMessages__DiffHeader"})([`
426
+ display: flex;
427
+ align-items: center;
428
+ justify-content: space-between;
429
+ padding-bottom: 8px;
430
+ border-bottom: 1px solid `,`;
431
+ width: 100%;
432
+ `,`
433
+ `],g("selectionDarker"),({$isExpanded:e})=>!e&&fe([`
434
+ border-bottom: 0;
435
+ padding-bottom: 0;
436
+ `])),hi=x(T).withConfig({displayName:"ChatMessages__DiffHeaderLeft"})([`
437
+ display: flex;
438
+ align-items: center;
439
+ gap: 1rem;
440
+ padding: 4px 0;
441
+ `]),mi=x.span.withConfig({displayName:"ChatMessages__DiffHeaderLabel"})([`
442
+ font-size: 1.4rem;
443
+ color: `,`;
444
+ `],g("offWhite")),pi=x(T).withConfig({displayName:"ChatMessages__DiffHeaderRight"})([`
445
+ display: flex;
446
+ align-items: center;
447
+ gap: 1.8rem;
448
+ margin-left: auto;
449
+ `]),fi=x(T).withConfig({displayName:"ChatMessages__DiffHeaderStatus"})([`
450
+ display: flex;
451
+ align-items: center;
452
+ gap: 0.8rem;
453
+ color: `,`;
454
+ font-size: 1.3rem;
455
+ `],({$isAccepted:e,$isRejected:n,$isRejectedWithFollowUp:a})=>n?g("red"):a?g("cyan"):e?g("greenDarker"):g("gray2")),gi=x.span.withConfig({displayName:"ChatMessages__StatusIcon"})([`
456
+ display: flex;
457
+ align-items: center;
458
+ color: `,`;
459
+ `],({$isAccepted:e,$isRejected:n,$isRejectedWithFollowUp:a})=>n?g("red"):a?g("cyan"):e?g("greenDarker"):g("gray2")),xt=x.button.withConfig({displayName:"ChatMessages__IconButton"})([`
460
+ display: flex;
461
+ align-items: center;
462
+ justify-content: center;
463
+ padding: 0;
464
+ background: transparent;
465
+ border: none;
466
+ cursor: pointer;
467
+ height: 22px;
468
+ width: 22px;
469
+ color: `,`;
470
+
471
+ &:hover {
472
+ svg {
473
+ filter: brightness(1.3);
474
+ }
475
+ }
476
+ `],g("gray2")),xi=x(xt).withConfig({displayName:"ChatMessages__ExpandButton"})([`
477
+ width: 16px;
478
+ height: 16px;
479
+ `]),yi=x.div.withConfig({displayName:"ChatMessages__DiffEditorWrapper"})([`
480
+ position: relative;
481
+ height: 300px;
482
+ width: 100%;
483
+ `]),bi=x(T).withConfig({displayName:"ChatMessages__ButtonBar"})([`
484
+ padding: 0.5rem;
485
+ gap: 1rem;
486
+ justify-content: center;
487
+ flex-shrink: 0;
488
+ width: fit-content;
489
+ margin: 0 auto;
490
+ background: `,`;
491
+ border: 1px solid `,`;
492
+ border-radius: 0.4rem;
493
+ `],g("backgroundDarker"),g("selection")),ki=x.div.withConfig({displayName:"ChatMessages__CodeBlockWrapper"})([`
494
+ margin: 1rem 0;
495
+ width: 100%;
496
+ `]),wi=x(se).withConfig({displayName:"ChatMessages__AcceptButton"})([`
497
+ background: `,`;
498
+ color: `,`;
499
+ border: 0.1rem solid `,`;
500
+ width: 10rem;
501
+
502
+ &:hover:not(:disabled) {
503
+ background: `,`;
504
+ border-color: `,`;
505
+ filter: brightness(1.2);
506
+ }
507
+ `],({theme:e})=>e.color.pinkDarker,g("foreground"),({theme:e})=>e.color.pinkDarker,({theme:e})=>e.color.pinkDarker,({theme:e})=>e.color.pinkDarker),Ci=x(se).withConfig({displayName:"ChatMessages__RejectButton"})([`
508
+ background: `,`;
509
+ color: `,`;
510
+ border: 0.1rem solid `,`;
511
+ width: 10rem;
512
+
513
+ &:hover:not(:disabled) {
514
+ background: `,`;
515
+ border-color: `,`;
516
+ }
517
+ `],g("background"),g("foreground"),({theme:e})=>e.color.pinkDarker,g("selection"),({theme:e})=>e.color.pinkDarker),vi=e=>{switch(e){case"fix_request":return{icon:"/assets/icon-fix-queries.svg",title:"Fix Query",description:"Help me debug and fix the error with the attached SQL query"};case"explain_request":return{icon:"/assets/icon-explain-queries.svg",title:"Explain Query",description:"Explain this query in detail"};case"schema_explain_request":return{icon:"/assets/icon-explain-schema.svg",title:"Explain Schema",description:"Provide an overview, detailed column descriptions and storage details."};default:return null}},Ai=e=>{switch(e){case"loading":return s.jsx(O0,{});case"success":return s.jsx(ma,{});case"error":return s.jsx(ha,{});default:return s.jsx(ua,{})}},Hi=({messages:e,onAcceptChange:n,onRejectChange:a,onRunQuery:r,onExpandDiff:l,onApplyToEditor:o,running:i,aiSuggestionRequest:d,queryNotifications:u,queryStartOffset:f=0,isOperationInProgress:m,editorSQL:c})=>{const y=It(),b=t.useRef(null),p=t.useRef(null),{status:C}=ye(),[v,k]=t.useState(!1),E=t.useRef(!1),A=t.useCallback(()=>{if(v&&E.current)return;const w=v?"smooth":"instant";setTimeout(()=>{var _;(_=b.current)==null||_.scrollIntoView({behavior:w}),k(!0)})},[v]);t.useEffect(()=>{const w=p.current;if(!w)return;const _=()=>{E.current=!0};return w.addEventListener("wheel",_),()=>w.removeEventListener("wheel",_)},[]),t.useEffect(()=>{E.current=!1},[e.length]);const Z=t.useMemo(()=>{for(let w=e.length-1;w>=0;w--){const _=e[w];if(_.role==="assistant"&&_.sql)return w}return-1},[e]),V=t.useRef(Z>=0?Z:-1),[R,M]=t.useState(Z>=0?new Set([Z]):new Set);t.useEffect(()=>{Z>=0&&Z!==V.current&&(M(w=>new Set([...w,Z])),V.current=Z)},[Z]);const I=w=>w>=1e3?`${(w/1e3).toFixed(1)}K`:w.toString(),L=t.useMemo(()=>e.reduce((w,_)=>{var Y;return w+(_.hideFromUI?0:(((Y=_.operationHistory)==null?void 0:Y.length)??0)+(_.error||_.content?1:0))},0),[e]);t.useEffect(()=>{A()},[L]);const h=[];e.forEach((w,_)=>{w.hideFromUI||h.push({message:w,originalIndex:_})});const F=h.length>0?h[h.length-1].originalIndex:-1,B=t.useMemo(()=>{for(let w=e.length-1;w>=0;w--)if(e[w].role==="assistant"&&!e[w].hideFromUI)return w;return-1},[e]),S=w=>{for(let _=w+1;_<e.length;_++)if(e[_].role==="user"&&!e[_].hideFromUI)return!0;return!1};return s.jsxs($0,{ref:p,$scrolled:v,"data-hook":"chat-messages-container",children:[h.map(({message:w,originalIndex:_})=>{var Ve;const Y=`${w.id}`;if(w.role==="user"){const ee=w.displayType,U=w.sql;if(ee&&(ee==="fix_request"||ee==="explain_request"||ee==="schema_explain_request")){const z=vi(ee);let H=null;if(ee==="schema_explain_request"&&w.displaySchemaData){const P=w.displaySchemaData;H=s.jsx(gt,{children:s.jsxs(J0,{children:[s.jsx(Mt,{kind:P.kind,partitionBy:P.partitionBy,walEnabled:P.walEnabled,designatedTimestamp:P.designatedTimestamp}),s.jsx(ei,{children:P.tableName})]})})}else if(U){const P=U.split(`
518
+ `).length,ae=Math.min(P*20+16,200);H=s.jsx(gt,{children:s.jsx(An,{style:{height:ae},"data-hook":"user-request-sql-editor",children:s.jsx(Ze,{value:U})})})}return s.jsxs(vn,{"data-hook":"chat-message-user",children:[s.jsxs(P0,{children:[s.jsx(Q0,{children:s.jsx(K0,{src:z==null?void 0:z.icon,alt:z==null?void 0:z.title})}),s.jsx(G0,{children:z==null?void 0:z.title})]}),(z==null?void 0:z.description)&&s.jsx(Y0,{children:s.jsx(X0,{children:z.description})}),H]},Y)}if(ee==="ask_request"&&U){const z=w.displayUserMessage||w.content,H=U.split(`
519
+ `).length,P=Math.min(H*20+16,200);return s.jsxs(vn,{"data-hook":"chat-message-user",children:[s.jsx(U0,{children:s.jsx(Hn,{children:z})}),s.jsx(gt,{children:s.jsx(An,{style:{height:P},"data-hook":"user-request-sql-editor",children:s.jsx(Ze,{value:U})})})]},Y)}return s.jsx(W0,{"data-hook":"chat-message-user",children:s.jsx(Hn,{children:w.content})},Y)}else{const ee=w.explanation||w.content,U=w.tokenUsage;let z=null;U&&typeof U.inputTokens=="number"&&typeof U.outputTokens=="number"&&(z=s.jsxs(s.Fragment,{children:[s.jsx("span",{style:{fontWeight:600},children:I(U.inputTokens)})," ","input /"," ",s.jsx("span",{style:{fontWeight:600},children:I(U.outputTokens)})," ","output tokens"]}));const H=!!w.sql,P=R.has(_),ae=w.isAccepted===!0,te=w.isRejected===!0,q=H&&!ae&&!te&&S(_),ne=H&&!ae&&!te&&!q&&_===F;let K="neutral";if(w.sql){const N=qe(w.sql);if(i===Et.AI_SUGGESTION&&d&&qe(d.query)===N)K="loading";else if(u){const O=ia(N,f),J=(Ve=u[O])==null?void 0:Ve.latest;J&&(J.type===lt.ERROR?K="error":(J.type===lt.SUCCESS||J.type===lt.INFO)&&(K="success"))}}const Te=st(w.previousSQL),oe=st(w.sql),ve=w.operationHistory,X=!!w.error,Be=_===B&&m===!0,Ae=!!ve&&ve.length>0;return s.jsxs(ti,{$hasOperationHistory:Ae,"data-hook":"chat-message-assistant",children:[Ae&&s.jsxs(s.Fragment,{children:[s.jsx(oi,{}),s.jsx(li,{$trimBottom:X||!w.content,children:s.jsx(oa,{operationHistory:ve,status:C,isLive:Be,onScrollNeeded:A})})]}),X&&s.jsxs(si,{"data-hook":"chat-message-error",children:[s.jsx(_t,{size:16,color:y.color.red,style:{flexShrink:0}}),w.error]}),w.content&&s.jsxs(s.Fragment,{children:[s.jsxs(ni,{"data-hook":"assistant-header",children:[s.jsx(De,{size:20,variant:"filled"}),s.jsx(ai,{children:"Assistant"}),z&&s.jsxs(ri,{className:"token-display",children:[s.jsx(zt,{size:"16px",color:y.color.gray2}),s.jsx(pe,{size:"sm",color:"gray2",children:z})]})]}),s.jsxs(ii,{children:[s.jsx(ci,{children:s.jsx(la,{remarkPlugins:[z0],components:{a:({children:N,href:O,...J})=>s.jsx("a",{...typeof O=="string"&&O.startsWith("http")?{target:"_blank",rel:"noopener noreferrer"}:{},href:O,...J,children:N}),table:({children:N,...O})=>s.jsx("div",{className:"table-wrapper",children:s.jsx("table",{...O,children:N})}),pre:({children:N})=>s.jsx(s.Fragment,{children:N}),code:({children:N,className:O})=>{if(typeof O=="string"&&O.includes("language-")){const J=(Array.isArray(N)?N.join(""):typeof N=="string"?N:"").replace(/\n$/,""),Oe=J.split(`
520
+ `).length,$e=Math.min(Oe*20+16,316);return s.jsx(ki,{style:{height:$e},"data-hook":"chat-message-code-block",children:s.jsx(Ze,{value:J})},`${w.id}-${J}`)}return s.jsx("code",{children:N})}},children:ee})}),H&&s.jsxs(di,{"data-hook":"inline-diff-container",children:[s.jsxs(ui,{$isExpanded:P,children:[s.jsxs(hi,{children:[s.jsx(Rt,{size:22,color:"#BDBDBD"}),s.jsx(mi,{children:"Suggested change"})]}),(ae||te||q)&&s.jsxs(fi,{$isAccepted:ae,$isRejected:te,$isRejectedWithFollowUp:q,"data-hook":te?"diff-status-rejected":q?"diff-status-followed-up":"diff-status-accepted",children:[s.jsx(gi,{$isAccepted:ae,$isRejected:te,$isRejectedWithFollowUp:q,children:te?s.jsx(sa,{size:"14px"}):q?s.jsx(Nt,{size:"14px"}):s.jsx(ca,{size:"14px"})}),te?"Rejected":q?"Followed up":"Accepted"]}),s.jsxs(pi,{children:[s.jsx(xt,{onClick:N=>{N.stopPropagation(),w.sql&&r&&r(w.sql)},title:"Run this query","data-hook":"message-action-run-sql",children:Ai(K)}),!ne&&o&&!(_===Z&&ae)&&qe(w.sql||"")!==qe(c||"")&&s.jsx(xt,{onClick:N=>{N.stopPropagation(),w.id&&w.sql&&!m&&o(w.id,w.sql)},title:"Apply to editor",disabled:m,style:{opacity:m?.5:1,cursor:m?"not-allowed":"pointer"},"data-hook":"message-action-apply",children:s.jsx(Tt,{size:22,color:"#BDBDBD"})}),s.jsx(xi,{title:"Expand diff view","data-hook":"diff-expand-button",onClick:()=>{M(N=>{const O=new Set(N);return O.has(_)?O.delete(_):O.add(_),O})},children:s.jsx(da,{})})]})]}),P&&s.jsxs(s.Fragment,{children:[s.jsx(yi,{children:s.jsx(Ze,{diffEditor:!0,original:Te,modified:oe,noBorder:!0,onExpandDiff:l?()=>l(w.previousSQL||"",w.sql||""):void 0})}),ne&&s.jsxs(bi,{align:"center",justifyContent:"center",children:[a&&w.id&&s.jsx(Ci,{onClick:()=>a(w.id),"data-hook":"message-action-reject",children:"Reject"}),n&&w.id&&s.jsx(wi,{onClick:()=>n(w.id),"data-hook":"message-action-accept",children:"Accept"})]})]})]})]})]})]},Y)}}),s.jsx("div",{ref:b})]})},Mi=x(T).withConfig({displayName:"ChatInput__InputContainer"})([`
521
+ display: flex;
522
+ flex-direction: column;
523
+ align-items: stretch;
524
+ gap: 0.8rem;
525
+ padding: 1rem 1.2rem;
526
+ flex-shrink: 0;
527
+ width: 100%;
528
+ margin-top: auto;
529
+ border-top: 1px solid `,`;
530
+ `],g("selection")),Ei=x(T).withConfig({displayName:"ChatInput__InputWrapper"})([`
531
+ display: flex;
532
+ position: relative;
533
+ width: 100%;
534
+ overflow: hidden;
535
+ `]),_i=x.textarea.withConfig({displayName:"ChatInput__StyledTextArea"})([`
536
+ flex: 1;
537
+ min-height: 8rem;
538
+ max-height: 30rem;
539
+ line-height: 1.3;
540
+ padding: `,`;
541
+ background: `,`;
542
+ border: 1px solid `,`;
543
+ border-radius: 0.6rem;
544
+ color: `,`;
545
+ font-size: 1.4rem;
546
+ font-family: `,`;
547
+ resize: none;
548
+ outline: none;
549
+
550
+ &:focus {
551
+ border-color: `,`;
552
+ }
553
+
554
+ &::placeholder {
555
+ color: `,`;
556
+ }
557
+
558
+ &:disabled {
559
+ opacity: 0.5;
560
+ }
561
+ `],({$hasContext:e})=>e?"4.4rem 4.5rem 1.2rem 1.2rem":"1.2rem 4.5rem 1.2rem 1.2rem",g("backgroundDarker"),g("selection"),g("foreground"),({theme:e})=>e.font,g("pinkDarker"),g("gray2")),ji=x.button.withConfig({displayName:"ChatInput__ActionButton"})([`
562
+ position: absolute;
563
+ right: 0.8rem;
564
+ bottom: 0.8rem;
565
+ padding: 0.6rem;
566
+ border: none;
567
+ display: flex;
568
+ align-items: center;
569
+ justify-content: center;
570
+ border-radius: 0.4rem;
571
+ cursor: pointer;
572
+ `]),Zi=x.div.withConfig({displayName:"ChatInput__ContextBadgeContainer"})([`
573
+ position: absolute;
574
+ padding: 0.8rem;
575
+ top: 2px;
576
+ border-radius: 0.6rem;
577
+ left: 1px;
578
+ width: calc(100% - 0.2rem);
579
+ display: inline-flex;
580
+ background: `,`;
581
+ `],g("backgroundDarker")),Vi=x.div.withConfig({displayName:"ChatInput__ContextBadge"})([`
582
+ display: flex;
583
+ padding: 0.3rem 0.6rem;
584
+ align-items: center;
585
+ gap: 0.4rem;
586
+ line-height: 1.4;
587
+ border-radius: 0.6rem;
588
+ border: 1px solid `,`;
589
+ background: `,`;
590
+ color: `,`;
591
+ font-size: 1.3rem;
592
+ user-select: none;
593
+
594
+ `,`
595
+ `],g("selection"),g("chatBackground"),g("gray2"),({$type:e})=>e==="sql"&&fe([`
596
+ cursor: pointer;
597
+
598
+ &:hover {
599
+ border: 1px solid `,`;
600
+ color: `,`;
601
+ }
602
+ `],g("offWhite"),g("offWhite"))),Ii=x.div.withConfig({displayName:"ChatInput__ContextBadgeIcon"})([`
603
+ display: flex;
604
+ align-items: center;
605
+ color: `,`;
606
+ flex-shrink: 0;
607
+
608
+ svg {
609
+ color: `,`;
610
+ }
611
+ `],g("gray2"),g("gray2")),Li=x(ji).withConfig({displayName:"ChatInput__SendButton"})([`
612
+ background: `,`;
613
+ color: `,`;
614
+
615
+ &:hover:not(:disabled) {
616
+ background: `,`;
617
+ }
618
+
619
+ &:disabled {
620
+ opacity: 0.5;
621
+ cursor: not-allowed;
622
+ }
623
+ `],g("pinkDarker"),g("foreground"),g("pink")),Ni=x.div.withConfig({displayName:"ChatInput__ThoughtStream"})([`
624
+ display: flex;
625
+ position: relative;
626
+ width: 100%;
627
+ background: `,`;
628
+ border: 1px solid transparent;
629
+ background:
630
+ linear-gradient(`,", ",`)
631
+ padding-box,
632
+ `,` border-box;
633
+ border-radius: 0.6rem;
634
+ height: 4rem;
635
+
636
+ `,`
637
+ `],g("backgroundDarker"),g("backgroundDarker"),g("backgroundDarker"),xa,({$aborted:e})=>e&&fe([`
638
+ background: `,`;
639
+ border: 1px solid `,`;
640
+ `],g("backgroundDarker"),g("red"))),Fi=x.div.withConfig({displayName:"ChatInput__ThoughtStreamContent"})([`
641
+ display: flex;
642
+ align-items: center;
643
+ background: `,`;
644
+ gap: 0.8rem;
645
+ width: 100%;
646
+ height: 100%;
647
+ border-radius: 0.6rem;
648
+ padding: 0 1.2rem;
649
+ padding-right: `,`;
650
+ `],g("backgroundDarker"),({$aborted:e})=>e?"1.2rem":"4.5rem"),Di=x(_t).withConfig({displayName:"ChatInput__CloseCircleIcon"})([`
651
+ width: 2rem;
652
+ height: 2rem;
653
+ color: `,`;
654
+ flex-shrink: 0;
655
+ `],g("red")),Si=x.div.withConfig({displayName:"ChatInput__ThoughtText"})([`
656
+ font-weight: 500;
657
+ font-size: 1.4rem;
658
+ color: `,`;
659
+ `,`
660
+ `],g("gray2"),({$aborted:e})=>!e&&ya),qi=x.button.withConfig({displayName:"ChatInput__StopButton"})([`
661
+ position: absolute;
662
+ right: 0.8rem;
663
+ top: 50%;
664
+ transform: translateY(-50%);
665
+ width: 2.6rem;
666
+ height: 2.6rem;
667
+ border-radius: 50%;
668
+ border: none;
669
+ display: flex;
670
+ align-items: center;
671
+ justify-content: center;
672
+ cursor: pointer;
673
+ transition: all 0.15s ease;
674
+ background: #da152832;
675
+ color: #da1e28;
676
+
677
+ &:hover {
678
+ background: `,`;
679
+ color: `,`;
680
+ }
681
+ `],g("red"),g("foreground")),Mn=(e,n=30)=>{if(!e)return"";const a=e.trim().replace(/\s+/g," ");return a.length<=n?a:a.slice(0,n)+"..."},Ri=e=>{switch(e){case"T":return"table";case"M":return"matview";case"V":return"view";default:return"table"}},zi=t.forwardRef(({onSend:e,disabled:n=!1,placeholder:a="Ask a question or request a refinement...",contextSQL:r,contextTableId:l,onContextClick:o},i)=>{const[d,u]=t.useState(""),f=t.useRef(null),m=de(le.query.getTables),c=t.useMemo(()=>l==null?null:m.find(M=>M.id===l)??null,[l,m]),y=c!=null&&c.table_name?Mn(c.table_name):r?Mn(r):null,b=!!y;t.useImperativeHandle(i,()=>({focus:()=>{var M;(M=f.current)==null||M.focus()}}));const{status:p,abortOperation:C}=ye(),v=ce(p),k=p===fa.Aborted;t.useEffect(()=>{f.current&&(f.current.style.height="auto",f.current.style.height=`${f.current.scrollHeight}px`)},[d]);const E=()=>{const M=d.trim();M&&!n&&!v&&(e(M),u(""),f.current&&(f.current.style.height="auto"))},A=M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),E())},Z=()=>{c||o()},V=()=>{C()},R=v||k;return s.jsxs(Mi,{children:[R?s.jsxs(Ni,{$aborted:k,"data-hook":"chat-assistant-modes",children:[s.jsxs(Fi,{$aborted:k,children:[k?s.jsx(Di,{}):s.jsx(jt,{size:20}),s.jsx(Si,{$aborted:k,children:p})]}),!k&&s.jsx(qi,{onClick:V,title:"Stop generation","data-hook":"chat-stop-button",children:s.jsx(ga,{size:"14px"})})]}):s.jsxs(Ei,{children:[b&&s.jsx(Zi,{children:s.jsxs(Vi,{role:"presentation",onClick:Z,$type:c?"table":"sql","data-hook":"chat-context-badge",children:[s.jsx(Ii,{children:c?s.jsx(Mt,{kind:Ri(c.table_type??"T"),partitionBy:c.partitionBy,walEnabled:c.walEnabled,designatedTimestamp:c.designatedTimestamp}):s.jsx(qt,{size:14,weight:"regular"})}),y]})}),s.jsx(_i,{ref:f,value:d,onChange:M=>u(M.target.value),onKeyDown:A,placeholder:a,disabled:n,rows:1,$hasContext:b,"data-hook":"chat-input-textarea"}),s.jsx(Li,{onClick:E,disabled:!d.trim()||n,title:"Send (Enter) \u2022 New line (Shift+Enter)","data-hook":"chat-send-button",children:s.jsx(Lt,{size:20,weight:"bold"})})]}),s.jsx(pe,{color:"gray2",size:"sm",align:"center",children:"Chats are connected to a single query to improve responses."})]})}),En=x.div.withConfig({displayName:"ChatHistoryItem__Container"})([`
682
+ display: flex;
683
+ align-items: center;
684
+ gap: 0.6rem;
685
+ padding: 0.4rem 0.8rem;
686
+ border-radius: 4px;
687
+ cursor: `,`;
688
+ background: `,`;
689
+ opacity: `,`;
690
+
691
+ &:hover {
692
+ background: `,`;
693
+
694
+ .chat-title {
695
+ color: `,`;
696
+ }
697
+ }
698
+ `],({$disabled:e})=>e?"not-allowed":"pointer",g("transparent"),({$disabled:e})=>e?.5:1,({$disabled:e})=>e?"transparent":g("selection"),({$disabled:e})=>e?g("offWhite"):g("foreground")),Ti=x.div.withConfig({displayName:"ChatHistoryItem__IconWrapper"})([`
699
+ display: flex;
700
+ align-items: center;
701
+ justify-content: center;
702
+ flex-shrink: 0;
703
+ color: `,`;
704
+ `],g("gray2")),Bi=x.div.withConfig({displayName:"ChatHistoryItem__Content"})([`
705
+ display: flex;
706
+ flex-direction: column;
707
+ flex: 1;
708
+ min-width: 0;
709
+ padding-left: 0.4rem;
710
+ `]),Oi=x.div.attrs({className:"chat-title"}).withConfig({displayName:"ChatHistoryItem__Title"})([`
711
+ padding: 0.2rem 0.4rem;
712
+ border: 1px solid transparent;
713
+ color: `,`;
714
+ white-space: nowrap;
715
+ overflow: hidden;
716
+ text-overflow: ellipsis;
717
+ transform: translateX(-0.4rem);
718
+ `],g("offWhite")),$i=x.input.withConfig({displayName:"ChatHistoryItem__TitleInput"})([`
719
+ color: `,`;
720
+ background: transparent;
721
+ border: 1px solid `,`;
722
+ border-radius: 6px;
723
+ outline: none;
724
+ padding: 0.2rem 0.4rem;
725
+ font-family: inherit;
726
+ transform: translateX(-0.4rem);
727
+
728
+ &:focus {
729
+ outline: none;
730
+ }
731
+
732
+ &::selection {
733
+ background: `,`;
734
+ }
735
+ &::-moz-selection {
736
+ background: `,`;
737
+ }
738
+ &::-webkit-selection {
739
+ background: `,`;
740
+ }
741
+ `],g("foreground"),g("pinkDarker"),g("pinkPrimary"),g("pinkPrimary"),g("pinkPrimary")),Wi=x.div.withConfig({displayName:"ChatHistoryItem__Subtitle"})([`
742
+ font-size: 1.2rem;
743
+ line-height: 1.5;
744
+ color: `,`;
745
+ white-space: nowrap;
746
+ overflow: hidden;
747
+ text-overflow: ellipsis;
748
+ `],g("gray2")),Ui=x.div.withConfig({displayName:"ChatHistoryItem__ActionsContainer"})([`
749
+ display: flex;
750
+ align-items: center;
751
+ gap: 0.4rem;
752
+ flex-shrink: 0;
753
+ `]),_n=x.button.withConfig({displayName:"ChatHistoryItem__ActionButton"})([`
754
+ display: flex;
755
+ align-items: center;
756
+ justify-content: center;
757
+ padding: 0.4rem;
758
+ background: transparent;
759
+ border: none;
760
+ border-radius: 4px;
761
+ cursor: pointer;
762
+ color: `,`;
763
+ opacity: 0;
764
+
765
+ `,`:hover & {
766
+ opacity: 1;
767
+ }
768
+
769
+ &:hover {
770
+ background: `,`;
771
+ }
772
+ `],g("foreground"),En,g("backgroundDarker")),Pi=x.span.withConfig({displayName:"ChatHistoryItem__CurrentIndicator"})([`
773
+ font-size: 1.2rem;
774
+ line-height: 1.5rem;
775
+ color: #9ca3af;
776
+ white-space: nowrap;
777
+ `]),Qi=({conversation:e,subtitle:n,isCurrent:a,hasOngoingProcess:r,disabled:l,onSelect:o,onRename:i,onDelete:d})=>{const[u,f]=t.useState(!1),[m,c]=t.useState(e.conversationName),y=t.useRef(null);t.useEffect(()=>{u&&y.current&&(y.current.focus(),y.current.select())},[u]);const b=A=>{A.stopPropagation(),c(e.conversationName),f(!0)},p=A=>{A.stopPropagation(),d(e.id)},C=()=>{const A=m.trim();A&&A!==e.conversationName&&i(e.id,A),f(!1)},v=A=>{A.key==="Enter"?C():A.key==="Escape"&&(c(e.conversationName),f(!1))},k=()=>{C()},E=()=>{!u&&!l&&o(e.id)};return s.jsxs(En,{onClick:E,$disabled:l,"data-hook":"chat-history-item",children:[s.jsx(Ti,{children:s.jsx(Ft,{size:18})}),s.jsxs(Bi,{children:[u?s.jsx($i,{ref:y,value:m,onChange:A=>c(A.target.value),onKeyDown:v,onBlur:k,onClick:A=>A.stopPropagation(),"data-hook":"chat-history-rename"}):s.jsx(Oi,{"data-hook":"chat-history-title",children:e.conversationName}),n&&s.jsx(Wi,{children:n})]}),s.jsxs(Ui,{children:[!u&&s.jsxs(s.Fragment,{children:[s.jsx(_n,{onClick:b,title:"Edit title","data-hook":"chat-history-edit",children:s.jsx(Ot,{size:18})}),!r&&s.jsx(_n,{onClick:p,title:"Delete","data-hook":"chat-history-delete",children:s.jsx(Ut,{size:18})})]}),a&&s.jsx(Pi,{children:"Current"})]})]})},Ki=x.div.withConfig({displayName:"DateSeparator__Container"})([`
778
+ display: flex;
779
+ align-items: center;
780
+ gap: 1rem;
781
+ padding: 0.4rem 0;
782
+ width: 100%;
783
+ `]),jn=x.div.withConfig({displayName:"DateSeparator__Line"})([`
784
+ flex: 1;
785
+ height: 1px;
786
+ background: `,`;
787
+ `],g("selection")),Gi=x.div.withConfig({displayName:"DateSeparator__LabelContainer"})([`
788
+ display: flex;
789
+ align-items: center;
790
+ gap: 0.8rem;
791
+ color: `,`;
792
+ `],g("gray2")),Yi=x.span.withConfig({displayName:"DateSeparator__Label"})([`
793
+ font-size: 1.3rem;
794
+ letter-spacing: 0.016rem;
795
+ white-space: nowrap;
796
+ `]),Xi=({label:e})=>s.jsxs(Ki,{children:[s.jsx(jn,{}),s.jsxs(Gi,{children:[s.jsx(Dt,{size:16}),s.jsx(Yi,{children:e})]}),s.jsx(jn,{})]}),Ji=6e4;function Zn(e){const n=ba(),a=wa(n);return ka(e,new Date().getTime(),{locale:a})+" ago"}function e1(e){const n=[...e].sort((o,i)=>i.updatedAt-o.updatedAt),a=new Map;for(const o of n){const i=Zn(o.updatedAt),d=a.get(i)||[];a.set(i,[...d,o])}const r=[],l=new Set;for(const o of n){const i=Zn(o.updatedAt);l.has(i)||(l.add(i),r.push({label:i,conversations:a.get(i)||[]}))}return r}function t1(e){const[n,a]=t.useState(0);return t.useEffect(()=>{const r=setInterval(()=>{a(l=>l+1)},Ji);return()=>clearInterval(r)},[]),t.useMemo(()=>e1(e),[e,n])}function n1(e,n){if(!n.trim())return e;const a=n.toLowerCase().trim();return e.filter(r=>r.conversationName.toLowerCase().includes(a))}const Vn=x.div.withConfig({displayName:"ChatHistoryView__Container"})([`
797
+ display: flex;
798
+ flex-direction: column;
799
+ height: 100%;
800
+ width: 100%;
801
+ padding: 2rem 1rem 4rem 1rem;
802
+ background: `,`;
803
+ overflow: hidden;
804
+ `],g("chatBackground")),a1=x.div.withConfig({displayName:"ChatHistoryView__SearchContainer"})([`
805
+ position: relative;
806
+ display: flex;
807
+ align-items: center;
808
+ flex-shrink: 0;
809
+ `]),r1=x.div.withConfig({displayName:"ChatHistoryView__SearchIcon"})([`
810
+ position: absolute;
811
+ left: 1.2rem;
812
+ display: flex;
813
+ align-items: center;
814
+ color: `,`;
815
+ pointer-events: none;
816
+ z-index: 1;
817
+ `],g("gray2")),i1=x.button.withConfig({displayName:"ChatHistoryView__ClearButton"})([`
818
+ position: absolute;
819
+ right: 0.8rem;
820
+ display: flex;
821
+ align-items: center;
822
+ justify-content: center;
823
+ padding: 0.2rem;
824
+ background: transparent;
825
+ border: none;
826
+ border-radius: 4px;
827
+ cursor: pointer;
828
+ color: `,`;
829
+
830
+ &:hover {
831
+ color: `,`;
832
+ }
833
+ `],g("gray2"),g("foreground")),o1=x(Aa).withConfig({displayName:"ChatHistoryView__SearchInput"})([`
834
+ width: 100%;
835
+ background: transparent;
836
+ color: `,`;
837
+ padding: 0.8rem 3.6rem 0.8rem 3.6rem;
838
+ border: 1px solid `,`4d;
839
+ height: 3rem;
840
+ border-radius: 0.6rem;
841
+
842
+ &:focus {
843
+ background: transparent;
844
+ border-color: `,`;
845
+ }
846
+ `],g("foreground"),g("gray2"),g("pinkDarker")),l1=x.div.withConfig({displayName:"ChatHistoryView__ListContainer"})([`
847
+ display: flex;
848
+ flex-direction: column;
849
+ gap: 0.6rem;
850
+ padding: 2rem 0.4rem;
851
+ overflow-y: auto;
852
+ flex: 1;
853
+ min-height: 0;
854
+ `]),In=x.div.withConfig({displayName:"ChatHistoryView__EmptyState"})([`
855
+ display: flex;
856
+ flex-direction: column;
857
+ align-items: center;
858
+ justify-content: center;
859
+ flex: 1;
860
+ color: `,`;
861
+ font-size: 1.3rem;
862
+ text-align: center;
863
+ padding: 2rem;
864
+ `],g("gray2")),s1=x(we.Content).withConfig({displayName:"ChatHistoryView__AlertDialogContent"})([`
865
+ background: `,`;
866
+ `],g("chatBackground")),c1=x.div.withConfig({displayName:"ChatHistoryView__DialogHeader"})([`
867
+ display: flex;
868
+ align-items: center;
869
+ justify-content: space-between;
870
+ padding: 1.5rem 2rem;
871
+ border-bottom: 1px solid `,`;
872
+ `],g("selection")),d1=x.h3.withConfig({displayName:"ChatHistoryView__DialogTitle"})([`
873
+ margin: 0;
874
+ font-weight: 500;
875
+ color: `,`;
876
+ `],g("foreground")),u1=x.p.withConfig({displayName:"ChatHistoryView__DialogDescription"})([`
877
+ margin: 2rem;
878
+ font-size: 1.4rem;
879
+ line-height: 1.5;
880
+ `]),h1=x.div.withConfig({displayName:"ChatHistoryView__DialogButtons"})([`
881
+ display: flex;
882
+ justify-content: flex-end;
883
+ gap: 1rem;
884
+ padding: 0 2rem 0 2rem;
885
+ `]),m1=x(se).attrs({skin:"secondary"}).withConfig({displayName:"ChatHistoryView__CancelButton"})([""]),p1=x(se).withConfig({displayName:"ChatHistoryView__DeleteButton"})([`
886
+ background: `,`;
887
+ border-color: `,`;
888
+
889
+ &:hover:not(:disabled) {
890
+ background: `,`;
891
+ filter: brightness(1.1);
892
+ }
893
+ `],g("red"),g("red"),g("red")),f1=({currentConversationId:e})=>{const[n,a]=t.useState(""),[r,l]=t.useState(!1),[o,i]=t.useState(null),d=t.useRef(null),{conversationMetas:u,chatWindowState:f,openChatWindow:m,updateConversationName:c,deleteConversation:y}=Fe(),{status:b}=ye(),{buffers:p}=at(),C=de(le.query.getTables),v=t.useMemo(()=>Array.from(u.values()),[u]),k=t.useMemo(()=>n1(v,n),[v,n]),E=t1(k),A=(L,h)=>{if(L){if(h==="buffer"){const F=p.find(B=>B.id===L);if(F)return F.label}else if(h==="table"){const F=C.find(B=>B.id===L);if(F)return F.table_name}}},Z=L=>{m(L)},V=(L,h)=>{c(L,h)},R=L=>{i(L),l(!0)},M=()=>{o&&y(o),l(!1),i(null)},I=()=>{l(!1),i(null)};return t.useEffect(()=>{d.current&&d.current.scrollIntoView({block:"center"})},[]),v.length===0?s.jsx(Vn,{children:s.jsx(In,{"data-hook":"chat-history-empty",children:"No conversations yet"})}):s.jsxs(Vn,{children:[s.jsxs(a1,{children:[s.jsx(r1,{children:s.jsx(Bt,{size:18})}),s.jsx(o1,{type:"text",placeholder:"Search chats",value:n,onChange:L=>a(L.target.value),onKeyDown:L=>{L.key==="Escape"&&n&&a("")},"data-hook":"chat-history-search"}),n&&s.jsx(i1,{onClick:()=>a(""),title:"Clear search",children:s.jsx(Zt,{size:16})})]}),s.jsxs(l1,{"data-hook":"chat-history-list",children:[E.map((L,h)=>s.jsxs(Vt.Fragment,{children:[h>0&&s.jsx(Xi,{label:L.label}),L.conversations.map(F=>{const B=F.id===e;return s.jsx("div",{ref:B?d:void 0,children:s.jsx(Qi,{conversation:F,subtitle:F.bufferId??F.tableId?A(F.bufferId??F.tableId,F.bufferId?"buffer":"table"):void 0,isCurrent:B,hasOngoingProcess:F.id===f.activeConversationId&&ce(b),disabled:ce(b)&&F.id!==f.activeConversationId,onSelect:Z,onRename:V,onDelete:R})},F.id)})]},L.label)),k.length===0&&n&&s.jsx(In,{children:"No chats match your search"})]}),s.jsx(we.Root,{open:r,onOpenChange:l,children:s.jsxs(we.Portal,{children:[s.jsx(Ca,{children:s.jsx(va,{primitive:we.Overlay})}),s.jsxs(s1,{maxwidth:"40rem",children:[s.jsx(c1,{children:s.jsx(d1,{children:"Delete conversation"})}),s.jsx(u1,{children:"Are you sure you want to delete this conversation? This action cannot be undone."}),s.jsxs(h1,{children:[s.jsx(we.Cancel,{asChild:!0,children:s.jsx(m1,{onClick:I,children:"Cancel"})}),s.jsx(we.Action,{asChild:!0,children:s.jsx(p1,{onClick:M,children:"Delete"})})]})]})]})})]})},g1=x.div.withConfig({displayName:"AIChatWindow__Container"})([`
894
+ display: flex;
895
+ flex-direction: column;
896
+ height: 100%;
897
+ width: 100%;
898
+ overflow: hidden;
899
+ background: `,`;
900
+ border-left: 0.2rem `,` solid;
901
+ `],g("chatBackground"),g("backgroundDarker")),x1=x.div.withConfig({displayName:"AIChatWindow__Header"})([`
902
+ height: 46px;
903
+ padding: 0 1.5rem;
904
+ display: flex;
905
+ align-items: center;
906
+ justify-content: space-between;
907
+ background: `,`;
908
+ flex-shrink: 0;
909
+ `],g("backgroundLighter")),y1=x.div.withConfig({displayName:"AIChatWindow__HeaderLeft"})([`
910
+ display: flex;
911
+ align-items: center;
912
+ gap: 1rem;
913
+ flex: 1;
914
+ min-width: 0;
915
+ overflow: hidden;
916
+ `]),b1=x.span.withConfig({displayName:"AIChatWindow__HeaderTitle"})([`
917
+ white-space: nowrap;
918
+ overflow: hidden;
919
+ text-overflow: ellipsis;
920
+ font-size: 1.6rem;
921
+ `]),yt=x(se).attrs(({$active:e})=>({skin:"transparent",$active:e})).withConfig({displayName:"AIChatWindow__HeaderButton"})([`
922
+ color: `,`;
923
+ padding: 0.6rem;
924
+
925
+ `,`
926
+ `],g("foreground"),({$active:e})=>e&&fe([`
927
+ background: `,`;
928
+ `],g("selection"))),k1=x.div.withConfig({displayName:"AIChatWindow__HeaderRight"})([`
929
+ display: flex;
930
+ align-items: center;
931
+ gap: 0.5rem;
932
+ flex-shrink: 0;
933
+ `]),w1=x.div.withConfig({displayName:"AIChatWindow__ChatWindowContent"})([`
934
+ display: flex;
935
+ height: calc(100% - 46px);
936
+ width: 100%;
937
+ overflow: hidden;
938
+ `]),C1=x.div.withConfig({displayName:"AIChatWindow__InitialQueryContainer"})([`
939
+ display: flex;
940
+ flex-direction: column;
941
+ gap: 1rem;
942
+ padding: 1.5rem;
943
+ overflow-y: auto;
944
+ flex: 1 1 auto;
945
+ min-height: 0;
946
+ width: 100%;
947
+ `]),v1=x.div.withConfig({displayName:"AIChatWindow__InitialQueryBox"})([`
948
+ display: flex;
949
+ flex-direction: column;
950
+ align-self: flex-end;
951
+ flex-shrink: 0;
952
+ overflow: hidden;
953
+ width: 100%;
954
+ `]),A1=x.div.withConfig({displayName:"AIChatWindow__InitialQueryEditor"})([`
955
+ width: 100%;
956
+ overflow: hidden;
957
+ `]),H1=x.div.withConfig({displayName:"AIChatWindow__ButtonContainer"})([`
958
+ display: flex;
959
+ justify-content: flex-start;
960
+ align-items: center;
961
+ gap: 1rem;
962
+ width: 100%;
963
+ margin-top: 0.5rem;
964
+ `]),M1=x.div.withConfig({displayName:"AIChatWindow__BlankChatContainer"})([`
965
+ display: flex;
966
+ flex-direction: column;
967
+ align-items: flex-start;
968
+ justify-content: center;
969
+ gap: 1.2rem;
970
+ padding: 1.8rem;
971
+ flex: 1 1 auto;
972
+ min-height: 0;
973
+ max-width: 40rem;
974
+ text-align: center;
975
+ margin: 0 auto;
976
+ `]),E1=x.h2.withConfig({displayName:"AIChatWindow__BlankChatHeading"})([`
977
+ font-size: 2rem;
978
+ font-weight: 600;
979
+ text-align: left;
980
+ color: `,`;
981
+ margin: 0;
982
+ `],g("foreground")),_1=x.p.withConfig({displayName:"AIChatWindow__BlankChatSubheading"})([`
983
+ font-size: 1.4rem;
984
+ font-weight: 400;
985
+ color: `,`;
986
+ text-align: left;
987
+ margin: 0;
988
+ line-height: 1.5;
989
+ `],g("gray2")),Ln=x(T).withConfig({displayName:"AIChatWindow__ChatPanel"})([`
990
+ display: flex;
991
+ flex-direction: column;
992
+ align-items: stretch;
993
+ height: 100%;
994
+ width: 100%;
995
+ gap: 0;
996
+ `]),j1=()=>{const e=Za(),n=de(le.console.getActiveSidebar),{quest:a}=t.useContext(Ge),{editorRef:r,buffers:l,activeBuffer:o,setActiveBuffer:i,showDiffBuffer:d,closeDiffBufferForConversation:u,executionRefs:f}=at(),{conversationMetas:m,activeConversationMessages:c,chatWindowState:y,isLoadingMessages:b,closeChatWindow:p,openBlankChatWindow:C,openHistoryView:v,closeHistoryView:k,getConversationMeta:E,addMessage:A,updateMessage:Z,replaceConversationMessages:V,updateConversationName:R,acceptSuggestion:M,rejectSuggestion:I,persistMessages:L}=Fe(),{status:h,setStatus:F,abortController:B,canUse:S,hasSchemaAccess:w,currentModel:_,apiKey:Y}=ye(),Ve=de(le.query.getTables),ee=de(le.query.getRunning),U=de(le.query.getAISuggestionRequest),z=y.activeConversationId?E(y.activeConversationId):null,H=t.useMemo(()=>z?{...z,messages:c}:null,[z,c]),P=H==null?void 0:H.bufferId,ae=de(le.query.getQueryNotificationsForBuffer(P??-1)),te=t.useRef(null),q=t.useMemo(()=>st(H==null?void 0:H.currentSQL),[H]),ne=t.useMemo(()=>Ha(H==null?void 0:H.queryKey),[H==null?void 0:H.queryKey]),K=c,Te=t.useMemo(()=>Ma(K),[K]),oe=t.useMemo(()=>{if(!H)return{type:"none"};const j=H.bufferId,D=l.find(W=>W.id===j);return D?D.archived?{type:"archived",buffer:D}:D.id===o.id?{type:"active",buffer:D}:{type:"inactive",buffer:D}:{type:"deleted"}},[H,l,o]),ve=t.useMemo(()=>K.length>0&&!b,[K,b]),X=t.useMemo(()=>K.length===0&&q&&q.trim()!==`
997
+ `&&S&&!ce(h),[K.length,q,S,h]),Be=t.useMemo(()=>!X||!H||!H.queryKey||!H.bufferId||!r.current?!1:Pt(H.queryKey,H.bufferId,f,r)!==null,[X,H,r,f]),Ae=X&&Be&&S&&!ce(h),N=y.isHistoryOpen??!1,O=m.size>0,J=t.useMemo(()=>ce(h)?!0:H?H.messages.length===0&&!H.queryKey&&!H.tableId:!1,[H,h]),Oe=t.useMemo(()=>{if(N)return"Chat history";if(!H)return"";if(H.conversationName)return H.conversationName;const j=H.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";default:return"AI Assistant"}return"AI Assistant"},[H,N]),$e=t.useCallback(()=>{N?k():v()},[N,k,v]),Nn=()=>K.length>0?"Ask a follow up question or request refinement...":(H==null?void 0:H.tableId)!=null||q!=null&&q.trim()?"Ask a question or request an edit...":"Ask AI about your tables, or generate a query...",Fn=(j,D=!1)=>{if(!S||!y.activeConversationId||!H)return;const W=y.activeConversationId;D&&u(W);const me=H.messages.some(re=>re.role==="assistant");let Le=j,Ue,Pe,Qe;!me&&q&&q.trim()&&(Le=`Current SQL query:
998
+ \`\`\`sql
999
+ ${q}
1000
+ \`\`\`
1001
+
1002
+ User request: ${j}`,Ue="ask_request",Pe=q.trim(),Qe=j),me||He.publish(Me.AI_QUERY_HIGHLIGHT,W);const Bn={role:"user",content:Le,timestamp:Date.now(),...Ue&&{displayType:Ue},...Pe&&{sql:Pe},...Qe&&{displayUserMessage:Qe}};A(Bn);const Ne=crypto.randomUUID();A({id:Ne,role:"assistant",content:"",timestamp:Date.now(),operationHistory:[]});const Ke=Ye(_),On={model:_,provider:Ke,apiKey:Y};if(!me){const re=Xe.find($=>$.isTestModel&&$.provider===Ke);re&&Je({firstUserMessage:Le,settings:{model:re.value,provider:Ke,apiKey:Y}}).then($=>{$&&R(W,$)})}const $n=re=>{Z(W,Ne,{operationHistory:[...re]})};(async()=>{const re=await et({userMessage:Le,conversationHistory:H.messages.filter(xe=>!xe.isCompacted),currentSQL:q,settings:On,modelToolsClient:nt(a,w?Ve:void 0),setStatus:(xe,Wn)=>F(xe,{...Wn??{},conversationId:W},$n),abortSignal:B==null?void 0:B.signal});if(tt(re)){const xe=re;Z(W,Ne,{error:xe.type!=="aborted"?xe.message:"Operation has been cancelled"});return}const $=re;let wt=$.explanation||"Response received";const Ct="sql"in $&&$.sql&&$.sql.trim()!=="";Ct&&(wt=`SQL Query:
1003
+ \`\`\`sql
1004
+ ${$.sql}
1005
+ \`\`\`
1006
+
1007
+ Explanation:
1008
+ ${$.explanation||""}`),$.compactedConversationHistory&&V(W,$.compactedConversationHistory),Z(W,Ne,{content:wt,...Ct&&{sql:$.sql},explanation:$.explanation,tokenUsage:$.tokenUsage})})().then(async()=>{await L(W)})},Dn=t.useCallback((j,D)=>{y.activeConversationId&&d({original:j,modified:D,conversationId:y.activeConversationId})},[d,y.activeConversationId]),Sn=t.useCallback(async j=>{y.activeConversationId&&(await M({conversationId:y.activeConversationId,messageId:j}),e(ct.query.setAISuggestionRequest(null)))},[y.activeConversationId,M]),qn=t.useCallback(async j=>{y.activeConversationId&&(await I(y.activeConversationId,j),setTimeout(()=>{var D;(D=te.current)==null||D.focus()},100))},[y.activeConversationId,I]),Rn=t.useCallback(j=>{const D=j.trim().endsWith(";")?j.trim().slice(0,-1):j.trim();e(ct.query.setAISuggestionRequest({query:D,startOffset:ne.startOffset})),e(ct.query.toggleRunning(Et.AI_SUGGESTION))},[ne.startOffset]),bt=t.useCallback(async()=>{if(oe.type==="deleted"||oe.type==="archived"||oe.type==="none")return!1;try{return oe.type==="inactive"&&oe.buffer&&(await i(oe.buffer),await new Promise(j=>setTimeout(j,100))),!0}catch(j){return console.error("Error navigating to buffer:",j),!1}},[oe,i]),zn=t.useCallback(async()=>{if(!(!H||!r.current||!H.queryKey||!await bt()))try{const j=r.current.getModel();if(!j)return;const D=j.getPositionAt(ne.startOffset),W=j.getPositionAt(ne.endOffset);r.current.revealPositionNearTop(D),r.current.setPosition(D);const me=j.deltaDecorations([],[{range:{startLineNumber:D.lineNumber,startColumn:D.column,endLineNumber:W.lineNumber,endColumn:W.column},options:{isWholeLine:!1,className:"aiQueryHighlight"}}]);r.current.focus(),setTimeout(()=>{j.deltaDecorations(me,[])},1e3)}catch(j){console.error("Error highlighting query:",j)}},[H,r,bt,ne]),Tn=t.useCallback(async(j,D)=>{if(!y.activeConversationId)return;const W=Ea(D,!1);try{await M({conversationId:y.activeConversationId,messageId:j,skipDefaultMessage:!0}),A({role:"user",content:`User replaced query with one of your previous suggestions. Now the query is:
1009
+
1010
+ \`\`\`sql
1011
+ ${W.replaceAll(/\s+/g," ").trim()}
1012
+ \`\`\``,timestamp:Date.now(),hideFromUI:!0}),await L(y.activeConversationId)}catch(me){console.error("Error applying SQL to editor:",me),_a.error("Failed to apply changes to editor")}},[y.activeConversationId,M,A,L]),kt=t.useRef(null),Ie=t.useCallback(()=>{var j,D;(D=(j=kt.current)==null?void 0:j.querySelector('button[data-hook="button-explain-query"]'))==null||D.click()},[]),We=t.useCallback(j=>{X&&(j.metaKey||j.ctrlKey)&&(j.key==="e"||j.key==="E")&&(j.preventDefault(),Ie())},[X]);return t.useEffect(()=>{if(X)return He.subscribe(Me.EXPLAIN_QUERY_EXEC,Ie),document.addEventListener("keydown",We),()=>{document.removeEventListener("keydown",We),He.unsubscribe(Me.EXPLAIN_QUERY_EXEC,Ie)}},[X,We,Ie]),n!=="aiChat"||!H&&!N?null:s.jsxs(g1,{"data-hook":"ai-chat-window",children:[s.jsxs(x1,{children:[s.jsxs(y1,{children:[s.jsx(De,{size:20,variant:"filled"}),s.jsx(b1,{"data-hook":"chat-window-title",children:Oe})]}),s.jsxs(k1,{children:[s.jsx(yt,{onClick:C,title:"New chat",disabled:J,"data-hook":"chat-window-new",children:s.jsx($t,{size:16,weight:"bold"})}),s.jsx(yt,{$active:N,onClick:$e,title:N?"Back to chat":"Chat history",disabled:!O||ce(h),"data-hook":"chat-window-history",children:s.jsx(St,{size:16,weight:"bold"})}),s.jsx(yt,{onClick:p,title:"Close","data-hook":"chat-window-close",children:s.jsx(Zt,{size:16,weight:"bold"})})]})]}),s.jsx(w1,{children:b?s.jsx(Ln,{children:s.jsx(jt,{size:20,style:{margin:"auto"}})}):N?s.jsx(f1,{currentConversationId:y.previousConversationId??null}):s.jsxs(Ln,{children:[ve?s.jsx(Hi,{messages:K,onAcceptChange:Sn,onRejectChange:qn,onRunQuery:Rn,onExpandDiff:Dn,onApplyToEditor:Tn,running:ee,aiSuggestionRequest:U,queryNotifications:ae,queryStartOffset:ne.startOffset,isOperationInProgress:ce(h),editorSQL:ne.queryText}):q&&q.trim()?s.jsxs(C1,{children:[s.jsx(v1,{"data-hook":"chat-initial-query-box",children:s.jsx(A1,{"data-hook":"chat-lite-editor",style:{height:Math.min(q.trim().split(`
1013
+ `).length*20+16,200)},children:s.jsx(Ze,{value:q.trim()})})}),(X||Ae)&&s.jsxs(H1,{ref:kt,children:[X&&s.jsx(Ka,{conversationId:H.id,queryText:q.trim()}),Ae&&s.jsx(Ya,{})]})]}):s.jsxs(M1,{"data-hook":"chat-blank-state",children:[s.jsx(E1,{children:"Leverage AI directly in your database"}),s.jsx(_1,{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."})]}),s.jsx(zi,{ref:te,onSend:j=>Fn(j,Te),disabled:!S||ce(h),placeholder:Nn(),contextSQL:ne.queryText,contextTableId:H==null?void 0:H.tableId,onContextClick:zn})]})})]})};export{j1 as default};