@questdb/web-console 1.1.12 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-CPCltHRD.js +1128 -0
- package/dist/assets/{index-BD25QvPt.js → index-CPUlU15B.js} +848 -794
- package/dist/assets/vs/base/browser/ui/codicons/codicon/codicon.ttf +0 -0
- package/dist/assets/vs/base/worker/workerMain.js +22 -18
- package/dist/assets/vs/editor/editor.main.css +4 -2
- package/dist/assets/vs/editor/editor.main.js +310 -257
- package/dist/assets/vs/loader.js +1 -1
- package/dist/index.html +1 -1
- package/package.json +5 -5
- package/dist/assets/index-CASK4XST.js +0 -1011
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.de.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.es.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.fr.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.it.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.ja.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.ko.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.ru.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.zh-cn.js +0 -8
- package/dist/assets/vs/base/common/worker/simpleWorker.nls.zh-tw.js +0 -8
- package/dist/assets/vs/editor/editor.main.nls.js +0 -29
|
@@ -0,0 +1,1128 @@
|
|
|
1
|
+
import{p as O,Q as st,s as se,u as Ee,a as Ke,j as r,A as Qe,K as Vt,c as f,B as re,b as Ge,e as fe,d as Zt,f as q,g as ia,h as lt,i as It,k as oa,F as Lt,l as sa,w as la,m as ca,C as da,n as ha,o as ct,q as Nt,r as xe,t as ua,T as ma,v as Ft,x as St,y as Dt,z as dt,D as Ne,E as G,G as je,H as ht,I as ga,J as Fe,L as pa,M as me,N as ut,O as fa,P as qt,R as Se,S as He,U as xa,V as ya,W as Ca,X as ba,Y as wa,Z as Xe,_ as zt,$ as Rt,a0 as ka,a1 as mt,a2 as gt,a3 as ye,a4 as va,a5 as Aa,a6 as Ma,a7 as Ea,a8 as ja,a9 as Ha,aa as _a,ab as Va,ac as Za,ad as le,ae as Ia,af as La,ag as Na,ah as Tt,ai as _e,aj as Fa,ak as Sa,al as Da,am as qa,an as za,ao as pt,ap as Ra,aq as Ye,ar as Bt,as as Ot,at as $t,au as Ta,av as Ba,aw as Oa}from"./index-CPUlU15B.js";import{b as t,E as ce,H as p,R as ft,Z as xt,C as K,U as Wt,D as $a}from"./vendor-DsPrTxrp.js";const Wa=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M228,128a100,100,0,0,1-98.66,100H128a99.39,99.39,0,0,1-68.62-27.29,12,12,0,0,1,16.48-17.45,76,76,0,1,0-1.57-109c-.13.13-.25.25-.39.37L54.89,92H72a12,12,0,0,1,0,24H24a12,12,0,0,1-12-12V56a12,12,0,0,1,24,0V76.72L57.48,57.06A100,100,0,0,1,228,128Z"}))],["duotone",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:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["fill",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L60.63,81.29l17,17A8,8,0,0,1,72,112H24a8,8,0,0,1-8-8V56A8,8,0,0,1,29.66,50.3L49.31,70,60.25,60A96,96,0,0,1,224,128Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M222,128a94,94,0,0,1-92.74,94H128a93.43,93.43,0,0,1-64.5-25.65,6,6,0,1,1,8.24-8.72A82,82,0,1,0,70,70l-.19.19L39.44,98H72a6,6,0,0,1,0,12H24a6,6,0,0,1-6-6V56a6,6,0,0,1,12,0V90.34L61.63,61.4A94,94,0,0,1,222,128Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M224,128a96,96,0,0,1-94.71,96H128A95.38,95.38,0,0,1,62.1,197.8a8,8,0,0,1,11-11.63A80,80,0,1,0,71.43,71.39a3.07,3.07,0,0,1-.26.25L44.59,96H72a8,8,0,0,1,0,16H24a8,8,0,0,1-8-8V56a8,8,0,0,1,16,0V85.8L60.25,60A96,96,0,0,1,224,128Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M220,128a92,92,0,0,1-90.77,92H128a91.47,91.47,0,0,1-63.13-25.1,4,4,0,1,1,5.5-5.82A84,84,0,1,0,68.6,68.57l-.13.12L34.3,100H72a4,4,0,0,1,0,8H24a4,4,0,0,1-4-4V56a4,4,0,0,1,8,0V94.89l35-32A92,92,0,0,1,220,128Z"}))]]),Pa=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"}))]]),Ua=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"}))]]),Ka=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"}))]]),Qa=new Map([["bold",t.createElement(t.Fragment,null,t.createElement("path",{d:"M232.49,80.49l-128,128a12,12,0,0,1-17,0l-56-56a12,12,0,1,1,17-17L96,183,215.51,63.51a12,12,0,0,1,17,17Z"}))],["duotone",t.createElement(t.Fragment,null,t.createElement("path",{d:"M232,56V200a16,16,0,0,1-16,16H40a16,16,0,0,1-16-16V56A16,16,0,0,1,40,40H216A16,16,0,0,1,232,56Z",opacity:"0.2"}),t.createElement("path",{d:"M205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["fill",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,40ZM205.66,85.66l-96,96a8,8,0,0,1-11.32,0l-40-40a8,8,0,0,1,11.32-11.32L104,164.69l90.34-90.35a8,8,0,0,1,11.32,11.32Z"}))],["light",t.createElement(t.Fragment,null,t.createElement("path",{d:"M228.24,76.24l-128,128a6,6,0,0,1-8.48,0l-56-56a6,6,0,0,1,8.48-8.48L96,191.51,219.76,67.76a6,6,0,0,1,8.48,8.48Z"}))],["regular",t.createElement(t.Fragment,null,t.createElement("path",{d:"M229.66,77.66l-128,128a8,8,0,0,1-11.32,0l-56-56a8,8,0,0,1,11.32-11.32L96,188.69,218.34,66.34a8,8,0,0,1,11.32,11.32Z"}))],["thin",t.createElement(t.Fragment,null,t.createElement("path",{d:"M226.83,74.83l-128,128a4,4,0,0,1-5.66,0l-56-56a4,4,0,0,1,5.66-5.66L96,194.34,221.17,69.17a4,4,0,1,1,5.66,5.66Z"}))]]),Ga=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"}))]]),Xa=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"}))]]),Ya=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"}))]]),Ja=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"}))]]),er=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"}))]]),tr=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"}))]]),nr=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"}))]]),ar=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"}))]]),rr=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"}))]]),ir=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"}))]]),or=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"}))]]),Pt=t.forwardRef((e,n)=>t.createElement(O,{ref:n,...e,weights:Wa}));Pt.displayName="ArrowCounterClockwiseIcon";const Ut=t.forwardRef((e,n)=>t.createElement(O,{ref:n,...e,weights:Pa}));Ut.displayName="ArrowUpIcon";const Kt=t.forwardRef((e,n)=>t.createElement(O,{ref:n,...e,weights:Ua}));Kt.displayName="ChatDotsIcon";const Qt=t.forwardRef((e,n)=>t.createElement(O,{ref:n,...e,weights:Ka}));Qt.displayName="ChatTextIcon";const Gt=t.forwardRef((e,n)=>t.createElement(O,{ref:n,...e,weights:Qa}));Gt.displayName="CheckIcon";const Xt=t.forwardRef((e,n)=>t.createElement(O,{ref:n,...e,weights:Ga}));Xt.displayName="ClockCountdownIcon";const Yt=t.forwardRef((e,n)=>t.createElement(O,{ref:n,...e,weights:Xa}));Yt.displayName="ClockCounterClockwiseIcon";const Jt=t.forwardRef((e,n)=>t.createElement(O,{ref:n,...e,weights:Ya}));Jt.displayName="CodeBlockIcon";const en=t.forwardRef((e,n)=>t.createElement(O,{ref:n,...e,weights:Ja}));en.displayName="CodeIcon";const tn=t.forwardRef((e,n)=>t.createElement(O,{ref:n,...e,weights:er}));tn.displayName="GaugeIcon";const nn=t.forwardRef((e,n)=>t.createElement(O,{ref:n,...e,weights:tr}));nn.displayName="KeyReturnIcon";const an=t.forwardRef((e,n)=>t.createElement(O,{ref:n,...e,weights:nr}));an.displayName="MagnifyingGlassIcon";const rn=t.forwardRef((e,n)=>t.createElement(O,{ref:n,...e,weights:ar}));rn.displayName="PencilSimpleLineIcon";const on=t.forwardRef((e,n)=>t.createElement(O,{ref:n,...e,weights:rr}));on.displayName="PlusIcon";const sn=t.forwardRef((e,n)=>t.createElement(O,{ref:n,...e,weights:ir}));sn.displayName="SquareSplitHorizontalIcon";const ln=t.forwardRef((e,n)=>t.createElement(O,{ref:n,...e,weights:or}));ln.displayName="TrashSimpleIcon";const sr=p(q).attrs({alignItems:"center",gap:"0"}).withConfig({displayName:"ExplainQueryButton__KeyBinding"})([`
|
|
2
|
+
color: `,`;
|
|
3
|
+
`],({theme:e})=>e.color.pinkPrimary),lr=Ge.isMacintosh||Ge.isIOS?"\u2318":"Ctrl",cr=Ge.isMacintosh||Ge.isIOS?"Cmd+E":"Ctrl+E",dr=p(re).withConfig({displayName:"ExplainQueryButton__ExplainButton"})([`
|
|
4
|
+
gap: 1rem;
|
|
5
|
+
`]),hr=({conversationId:e,queryText:n})=>{const{quest:a}=t.useContext(st),i=ce(se.query.getTables),{setStatus:l,abortController:o,hasSchemaAccess:s,currentModel:d,apiKey:h}=Ee(),{addMessage:g,updateMessage:u,updateConversationName:c,persistMessages:b,setIsStreaming:y}=Ke(),x=()=>{fe(Zt({conversationId:e,queryText:n,settings:{model:d,apiKey:h},questClient:a,tables:i,hasSchemaAccess:s,abortSignal:o==null?void 0:o.signal}),{addMessage:g,updateMessage:u,setStatus:l,setIsStreaming:y,persistMessages:b,updateConversationName:c})};return r.jsxs(dr,{skin:"gradient",gradientWeight:"thin",onClick:x,title:`Explain query with AI Assistant (${cr})`,"data-hook":"button-explain-query",children:[r.jsx(Qe,{size:12,variant:"hollow"}),"Explain query",r.jsxs(sr,{children:[r.jsx(Vt,{keyString:lr,color:f("pinkPrimary"),hoverColor:f("pinkPrimary")}),r.jsx(Vt,{keyString:"E",color:f("pinkPrimary"),hoverColor:f("pinkPrimary")})]})]})},cn=(e,n,a,i)=>{if(!(a!=null&&a.current)||!i.current)return null;const l=i.current.getModel();if(!l)return null;const o=a.current[n.toString()];if(!o)return null;const s=o[e];if(!s||!s.error)return null;const d=s.selection?s.selection.startOffset:s.startOffset,h=s.selection?s.selection.endOffset:s.endOffset,g=l.getPositionAt(d),u=l.getPositionAt(d+s.error.position),c=l.getWordAtPosition(u),b=l.getPositionAt(h),y=s.selection?l.getValueInRange({startLineNumber:g.lineNumber,startColumn:g.column,endLineNumber:b.lineNumber,endColumn:b.column}):ia(e).queryText;return{errorMessage:s.error.error||"Query execution failed",word:c?c.word:null,fixStart:d,fixEnd:h,queryText:y}},ur=p(re).withConfig({displayName:"FixQueryButton__FixButton"})([`
|
|
6
|
+
gap: 1rem;
|
|
7
|
+
`]),mr=()=>{const{quest:e}=t.useContext(st),{editorRef:n,executionRefs:a}=lt(),i=ce(se.query.getTables),{setStatus:l,abortController:o,hasSchemaAccess:s,currentModel:d,apiKey:h}=Ee(),{chatWindowState:g,getConversationMeta:u,addMessage:c,updateMessage:b,updateConversationName:y,persistMessages:x,setIsStreaming:v}=Ke(),A=()=>{const M=g.activeConversationId,C=u(M),k=cn(C.queryKey,C.bufferId,a,n),{errorMessage:j,queryText:L,word:H}=k;fe(It({conversationId:M,queryText:L,errorMessage:j,errorWord:H??void 0,settings:{model:d,apiKey:h},questClient:e,tables:i,hasSchemaAccess:s,abortSignal:o==null?void 0:o.signal}),{addMessage:c,updateMessage:b,setStatus:l,setIsStreaming:v,persistMessages:x,updateConversationName:y})};return r.jsxs(ur,{skin:"gradient",gradientWeight:"thin",onClick:A,title:"Fix query with AI Assistant","data-hook":"button-fix-query",children:[r.jsx(Qe,{size:12,variant:"hollow"}),"Fix query"]})},dn=p.div.withConfig({displayName:"LiteEditor__EditorWrapper"})([`
|
|
8
|
+
position: relative;
|
|
9
|
+
padding: `,`;
|
|
10
|
+
border-radius: 8px;
|
|
11
|
+
border: `,`;
|
|
12
|
+
background: `,`;
|
|
13
|
+
overflow-y: hidden;
|
|
14
|
+
|
|
15
|
+
.monaco-editor-background {
|
|
16
|
+
background: `,`;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.monaco-editor {
|
|
20
|
+
background: `,`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.editor.original {
|
|
24
|
+
display: none !important;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.editor-scrollable {
|
|
28
|
+
width: 100% !important;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.view-lines {
|
|
32
|
+
width: 100% !important;
|
|
33
|
+
pointer-events: none;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.current-line {
|
|
37
|
+
background: transparent !important;
|
|
38
|
+
border: 0 !important;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.margin {
|
|
42
|
+
display: none !important;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.monaco-scrollable-element {
|
|
46
|
+
left: 0 !important;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.scrollbar {
|
|
50
|
+
display: none !important;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.open-in-editor-btn {
|
|
54
|
+
opacity: 0;
|
|
55
|
+
transition: opacity 0.15s ease-in-out;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
&:hover .open-in-editor-btn {
|
|
59
|
+
opacity: 1;
|
|
60
|
+
}
|
|
61
|
+
`],({$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),gr=p(re).attrs({skin:"transparent"}).withConfig({displayName:"LiteEditor__OpenInEditorButton"})([`
|
|
62
|
+
gap: 1rem;
|
|
63
|
+
font-size: 1.2rem;
|
|
64
|
+
background: `,`;
|
|
65
|
+
border: 0;
|
|
66
|
+
color: `,`;
|
|
67
|
+
`],({theme:e})=>e.color.backgroundDarker,({theme:e})=>e.color.offWhite),hn=p(da).withConfig({displayName:"LiteEditor__SuccessIcon"})([`
|
|
68
|
+
position: absolute;
|
|
69
|
+
transform: translate(75%, -75%);
|
|
70
|
+
color: `,`;
|
|
71
|
+
`],({theme:e})=>e.color.green),pr=p.div.withConfig({displayName:"LiteEditor__ButtonsContainer"})([`
|
|
72
|
+
position: absolute;
|
|
73
|
+
top: 0.8rem;
|
|
74
|
+
right: 1.2rem;
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: flex-end;
|
|
78
|
+
gap: 1.2rem;
|
|
79
|
+
z-index: 10;
|
|
80
|
+
`]),un=p(re).withConfig({displayName:"LiteEditor__CopyButtonBase"})([`
|
|
81
|
+
color: #e5e7eb;
|
|
82
|
+
padding: 0 0.6rem;
|
|
83
|
+
background: `,`;
|
|
84
|
+
`],({theme:e})=>e.color.backgroundDarker),fr=p(un).withConfig({displayName:"LiteEditor__CopyButtonFloating"})([`
|
|
85
|
+
position: absolute;
|
|
86
|
+
top: 0.2rem;
|
|
87
|
+
right: 0.8rem;
|
|
88
|
+
z-index: 10;
|
|
89
|
+
`]),mn=({onOpenInEditor:e,onCopy:n,copied:a})=>{const i=xt();return r.jsxs(pr,{children:[r.jsxs(gr,{className:"open-in-editor-btn",onClick:e,title:"Open in editor","data-hook":"ai-open-in-editor-button",children:["Open in editor",r.jsx(sn,{size:"1.8rem",color:i.color.offWhite})]}),r.jsxs(un,{skin:"transparent",onClick:n,title:"Copy to clipboard",children:[a&&r.jsx(hn,{size:"1rem"}),r.jsx(Lt,{size:"1.8rem"})]})]})},gn=ft.memo(e=>{const{diffEditor:n,value:a,language:i,theme:l,fontSize:o,lineHeight:s,setContentHeight:d}=e,h=t.useRef(!1);return n?r.jsx(la,{height:"100%",language:i,original:e.original,modified:e.modified,theme:l,onMount:g=>{d(g.getModifiedEditor().getContentHeight()),g.getModifiedEditor().onDidContentSizeChange(u=>{u.contentHeightChanged&&d(u.contentHeight),e.handleScrollNeeded()}),g.onDidUpdateDiff(()=>{var c;if(h.current)return;const u=(c=g.getLineChanges())==null?void 0:c[0];u&&(h.current=!0,g.getModifiedEditor().revealLineNearTop(u.modifiedStartLineNumber))})},keepCurrentOriginalModel:!0,keepCurrentModifiedModel:!0,options:{readOnly:!0,lineNumbers:"off",minimap:{enabled:!1},scrollBeyondLastLine:!1,scrollbar:{useShadows:!1,vertical:"hidden",horizontal:"hidden",alwaysConsumeMouseWheel:!1,handleMouseWheel:!1},stickyScroll:{enabled:!1},automaticLayout:!0,folding:!1,wordWrap:"on",glyphMargin:!1,renderSideBySide:!1,enableSplitViewResizing:!1,renderIndicators:!1,renderOverviewRuler:!1,hideCursorInOverviewRuler:!0,originalEditable:!1,overviewRulerBorder:!1,fontSize:o,lineHeight:s}}):r.jsx(ca,{height:"100%",language:i,value:a,theme:l,onMount:g=>{d(g.getContentHeight()),g.onDidContentSizeChange(u=>{u.contentHeightChanged&&d(u.contentHeight)})},options:{automaticLayout:!0,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,wordWrap:"on",scrollbar:{useShadows:!1,vertical:"hidden",horizontal:"hidden",alwaysConsumeMouseWheel:!1,handleMouseWheel:!1},stickyScroll:{enabled:!1},fontSize:o,padding:{top:8,bottom:8},lineHeight:s}})},(e,n)=>e.value===n.value&&e.diffEditor===n.diffEditor&&e.original===n.original&&e.modified===n.modified),De=({language:e=oa,theme:n="dracula",fontSize:a=12,lineHeight:i=20,maxHeight:l,...o})=>{const[s,d]=t.useState(!1),[h,g]=t.useState(1),u=y=>{sa(y),d(!0),setTimeout(()=>d(!1),2e3)},c=Math.min(h,l),b=h>l;return o.diffEditor?r.jsxs(dn,{$noBorder:!0,style:{height:c,paddingTop:8,paddingBottom:8},children:[r.jsx(mn,{onOpenInEditor:o.onOpenInEditor,onCopy:()=>u(o.modified),copied:s}),r.jsx(gn,{diffEditor:!0,original:o.original,modified:o.modified,language:e,theme:n,fontSize:a,lineHeight:i,setContentHeight:g,handleScrollNeeded:o.handleScrollNeeded})]}):r.jsxs(dn,{style:{height:c},children:[b?r.jsx(mn,{onOpenInEditor:o.onOpenInEditor,onCopy:()=>u(o.value??""),copied:s}):r.jsxs(fr,{skin:"transparent",onClick:()=>u(o.value??""),title:"Copy to clipboard",children:[s&&r.jsx(hn,{size:"1rem"}),r.jsx(Lt,{size:"1.8rem"})]}),r.jsx(gn,{diffEditor:!1,value:o.value,language:e,theme:n,fontSize:a,lineHeight:i,setContentHeight:g})]})},pn=p.div.withConfig({displayName:"AssistantModesCompact__Container"})([`
|
|
90
|
+
display: flex;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
gap: 0.4rem;
|
|
93
|
+
align-items: flex-start;
|
|
94
|
+
width: 100%;
|
|
95
|
+
overflow-y: auto;
|
|
96
|
+
overflow-x: hidden;
|
|
97
|
+
min-height: 0;
|
|
98
|
+
`]),fn=p.div.withConfig({displayName:"AssistantModesCompact__ModeHeader"})([`
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-shrink: 0;
|
|
101
|
+
width: 100%;
|
|
102
|
+
|
|
103
|
+
`,`
|
|
104
|
+
`,`
|
|
105
|
+
gap: 0.8rem;
|
|
106
|
+
`],({$expanded:e})=>e?K([`
|
|
107
|
+
flex-direction: column;
|
|
108
|
+
align-items: flex-start;
|
|
109
|
+
`]):K([`
|
|
110
|
+
align-items: center;
|
|
111
|
+
justify-content: space-between;
|
|
112
|
+
padding: 0.4rem;
|
|
113
|
+
`]),({$abort:e})=>e&&K([`
|
|
114
|
+
opacity: 0.7;
|
|
115
|
+
`])),yt=p.div.withConfig({displayName:"AssistantModesCompact__ModeChevron"})([`
|
|
116
|
+
width: 1.4rem;
|
|
117
|
+
height: 1.4rem;
|
|
118
|
+
flex-shrink: 0;
|
|
119
|
+
display: flex;
|
|
120
|
+
align-items: center;
|
|
121
|
+
justify-content: center;
|
|
122
|
+
color: `,`;
|
|
123
|
+
margin-left: -0.3rem;
|
|
124
|
+
cursor: pointer;
|
|
125
|
+
transition:
|
|
126
|
+
color 0.2s,
|
|
127
|
+
transform 0.2s;
|
|
128
|
+
transform: rotate(`,`);
|
|
129
|
+
`],f("gray2"),({$expanded:e})=>e?"90deg":"0deg"),Ct=p.div.withConfig({displayName:"AssistantModesCompact__ModeTitle"})([`
|
|
130
|
+
font-weight: 500;
|
|
131
|
+
font-size: 1.4rem;
|
|
132
|
+
color: `,`;
|
|
133
|
+
text-align: center;
|
|
134
|
+
margin-right: auto;
|
|
135
|
+
transition: color 0.2s;
|
|
136
|
+
flex-shrink: 0;
|
|
137
|
+
|
|
138
|
+
`,`
|
|
139
|
+
`,`
|
|
140
|
+
`],f("gray2"),({$isActive:e})=>e&&Dt,({$isTopLevel:e})=>e&&K([`
|
|
141
|
+
color: `,`;
|
|
142
|
+
`],f("foreground"))),xn=p.div.withConfig({displayName:"AssistantModesCompact__ModeHeaderTop"})([`
|
|
143
|
+
display: flex;
|
|
144
|
+
gap: 0.8rem;
|
|
145
|
+
align-items: center;
|
|
146
|
+
flex-shrink: 0;
|
|
147
|
+
`,`
|
|
148
|
+
`,`
|
|
149
|
+
`,`
|
|
150
|
+
`],({$expanded:e})=>e&&K([`
|
|
151
|
+
padding: 0.4rem;
|
|
152
|
+
`]),({$expanded:e})=>!e&&K([`
|
|
153
|
+
min-height: 0;
|
|
154
|
+
min-width: 0;
|
|
155
|
+
`]),({$isExpandable:e})=>e&&K([`
|
|
156
|
+
cursor: pointer;
|
|
157
|
+
user-select: none;
|
|
158
|
+
&:hover `,", &:hover ",` {
|
|
159
|
+
color: `,`;
|
|
160
|
+
}
|
|
161
|
+
`],Ct,yt,f("foreground"))),yn=p.div.withConfig({displayName:"AssistantModesCompact__ExpandableWrapper"})([`
|
|
162
|
+
display: grid;
|
|
163
|
+
grid-template-rows: `,`;
|
|
164
|
+
transition:
|
|
165
|
+
grid-template-rows 0.1s ease-out,
|
|
166
|
+
opacity 0.3s ease-out;
|
|
167
|
+
width: 100%;
|
|
168
|
+
|
|
169
|
+
`,`
|
|
170
|
+
`],({$expanded:e})=>e?"1fr":"0fr",({$expanded:e})=>!e&&K([`
|
|
171
|
+
height: 0;
|
|
172
|
+
opacity: 0;
|
|
173
|
+
`])),Cn=p.div.withConfig({displayName:"AssistantModesCompact__ExpandableContent"})([`
|
|
174
|
+
min-height: 0;
|
|
175
|
+
overflow: hidden;
|
|
176
|
+
`]),xr=p.div.withConfig({displayName:"AssistantModesCompact__ReasoningThread"})([`
|
|
177
|
+
display: flex;
|
|
178
|
+
flex-direction: column;
|
|
179
|
+
gap: 0.8rem;
|
|
180
|
+
align-items: flex-start;
|
|
181
|
+
padding: 0 2.8rem;
|
|
182
|
+
`]),Je=p.div.withConfig({displayName:"AssistantModesCompact__ReasoningItem"})([`
|
|
183
|
+
display: flex;
|
|
184
|
+
gap: 0.5rem;
|
|
185
|
+
align-items: center;
|
|
186
|
+
padding: 0.4rem;
|
|
187
|
+
padding-left: 0;
|
|
188
|
+
`]),qe=p.div.withConfig({displayName:"AssistantModesCompact__ReasoningIcon"})([`
|
|
189
|
+
width: 1.4rem;
|
|
190
|
+
height: 1.4rem;
|
|
191
|
+
flex-shrink: 0;
|
|
192
|
+
display: flex;
|
|
193
|
+
align-items: center;
|
|
194
|
+
justify-content: center;
|
|
195
|
+
color: `,`;
|
|
196
|
+
`],f("foreground")),et=p.div.withConfig({displayName:"AssistantModesCompact__ReasoningText"})([`
|
|
197
|
+
display: flex;
|
|
198
|
+
flex-wrap: wrap;
|
|
199
|
+
gap: 0.4rem;
|
|
200
|
+
align-items: center;
|
|
201
|
+
min-height: 0;
|
|
202
|
+
min-width: 0;
|
|
203
|
+
`]),J=p.span.withConfig({displayName:"AssistantModesCompact__ReasoningTextPart"})([`
|
|
204
|
+
font-weight: 400;
|
|
205
|
+
font-size: 1.4rem;
|
|
206
|
+
color: `,`;
|
|
207
|
+
`],f("gray2")),Ce=p.div.withConfig({displayName:"AssistantModesCompact__CodeBadge"})([`
|
|
208
|
+
background: `,`;
|
|
209
|
+
border: 1px solid `,`;
|
|
210
|
+
border-radius: 0.4rem;
|
|
211
|
+
padding: 0 0.4rem;
|
|
212
|
+
display: flex;
|
|
213
|
+
align-items: center;
|
|
214
|
+
justify-content: center;
|
|
215
|
+
transform: translateY(1px);
|
|
216
|
+
`],f("background"),f("selection")),be=p.span.withConfig({displayName:"AssistantModesCompact__CodeBadgeText"})([`
|
|
217
|
+
font-family: `,`;
|
|
218
|
+
font-size: 1.2rem;
|
|
219
|
+
color: `,`;
|
|
220
|
+
`],({theme:e})=>e.fontMonospace,f("purple")),yr=p(Gt).withConfig({displayName:"AssistantModesCompact__CheckIcon"})([`
|
|
221
|
+
width: 1.6rem;
|
|
222
|
+
height: 1.6rem;
|
|
223
|
+
color: `,`;
|
|
224
|
+
flex-shrink: 0;
|
|
225
|
+
`],f("pink")),Cr=p(St).withConfig({displayName:"AssistantModesCompact__CloseCircleIcon"})([`
|
|
226
|
+
color: `,`;
|
|
227
|
+
flex-shrink: 0;
|
|
228
|
+
`],f("red")),br=({size:e=20})=>r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 256 256",style:{flexShrink:0},children:[r.jsx("defs",{children:r.jsxs("linearGradient",{id:"checkCircleGradient",x1:"128",x2:"128",y1:"24",y2:"232",gradientUnits:"userSpaceOnUse",children:[r.jsx("stop",{stopColor:"#d14671"}),r.jsx("stop",{offset:"1",stopColor:"#892c6c"})]})}),r.jsx("path",{fill:"url(#checkCircleGradient)",d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm45.66,85.66-56,56a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L112,148.69l50.34-50.35a8,8,0,0,1,11.32,11.32Z"})]}),wr=p.div.withConfig({displayName:"AssistantModesCompact__CollapsedSectionsWrapper"})([`
|
|
229
|
+
display: flex;
|
|
230
|
+
flex-direction: column;
|
|
231
|
+
gap: 0.8rem;
|
|
232
|
+
padding-left: 2.8rem;
|
|
233
|
+
`]),kr=(e,n)=>{if(e===xe.Processing&&n&&"type"in n)switch(n.type){case"fix":return"Processing fix request";case"explain":return"Processing explain request";default:return e}return e},bn=e=>[xe.InvestigatingTable,xe.InvestigatingDocs].includes(e.type),vr=({operationHistory:e,status:n,isLive:a=!1,onScrollNeeded:i,collapsed:l=!1,responseStart:o})=>{const s=xt(),[d,h]=t.useState({}),[g,u]=t.useState(!1),c=t.useRef(0),b=t.useRef(null),y=t.useMemo(()=>ha(e,n,a),[e,n,a]),x=t.useRef(a);t.useEffect(()=>{if(x.current&&!a){const C={};y.forEach(k=>{C[k.id]=!0}),h(C)}else if(a&&y.length>c.current){const C={};y.forEach((k,j)=>{j<y.length-1&&(C[k.id]=!0)}),h(C),i==null||i()}c.current=y.length,x.current=a},[y,a,i]);const v=C=>{h(k=>{const j=y.find(_=>_.id===C),L=j?bn(j):!1,H=y.findIndex(_=>_.id===C)===y.length-1,F=l?!1:a?H:!0;return k[C]===void 0?{...k,[C]:F&&L}:{...k,[C]:!k[C]}})},A=t.useMemo(()=>{var j;if(e.length===0)return null;const C=(j=e[0])==null?void 0:j.timestamp;if(!C||!o)return null;const k=o-C;return k<0?null:k<1e3?`${k}ms`:`${Math.round(k/1e3)}s`},[e,o]);if(e.length===0)return null;const M=y.map((C,k)=>{const j=bn(C),L=k===y.length-1,H=l?!1:a?L:!0,F=d[C.id]===void 0?H&&j:!d[C.id]&&j;return r.jsxs(fn,{$expanded:F,$abort:C.abort,children:[r.jsxs(xn,{$expanded:F,$isExpandable:j,"data-hook":`assistant-mode-${C.type.toLowerCase().replace(/\s+/g,"-")}`,role:"presentation",onClick:j?()=>v(C.id):void 0,children:[r.jsx(qe,{children:C.active?r.jsx(ct,{size:14}):C.abort?r.jsx(Cr,{size:14}):r.jsx(yr,{})}),r.jsx(Ct,{$isActive:C.active,children:C.type}),j&&r.jsx(yt,{$expanded:F,children:r.jsx(Nt,{size:14})})]}),j&&r.jsx(yn,{$expanded:F,children:r.jsx(Cn,{children:r.jsx(xr,{children:C.operations.map((_,S)=>{const m=`${C.id}-${S}-${JSON.stringify(_.args)}`;if(_.type===xe.Processing){const Z=kr(_.type,_.args);return r.jsxs(Je,{children:[r.jsx(qe,{children:r.jsx(ua,{style:{width:"14px",height:"14px"}})}),r.jsx(et,{children:r.jsx(J,{children:Z})})]},m)}if(_.type===xe.InvestigatingTable){const Z=_.args&&"name"in _.args?_.args.name:"table",D=_.args&&"tableOpType"in _.args?_.args.tableOpType:"details";return r.jsxs(Je,{children:[r.jsx(qe,{children:r.jsx(ma,{size:14,color:s.color.gray2})}),r.jsxs(et,{children:[r.jsx(J,{children:"Investigating"}),r.jsx(Ce,{children:r.jsx(be,{children:Z})}),r.jsx(J,{children:D})]})]},m)}if(_.type===xe.InvestigatingDocs){const Z=_.args&&"items"in _.args&&Array.isArray(_.args.items)?_.args.items:null;if(Z&&Z.length>0)return r.jsx(ft.Fragment,{children:Z.map((X,ke)=>{const ve=`${m}-item-${ke}`;return r.jsxs(Je,{children:[r.jsx(qe,{children:r.jsx(Ft,{size:14,color:s.color.gray2})}),r.jsx(et,{children:X.section?r.jsxs(r.Fragment,{children:[r.jsx(J,{children:"Investigating"}),r.jsx(Ce,{children:r.jsx(be,{children:X.section})}),r.jsx(J,{children:"in"}),r.jsx(Ce,{children:r.jsx(be,{children:X.name})})]}):r.jsxs(r.Fragment,{children:[r.jsx(J,{children:"Investigating"}),r.jsx(Ce,{children:r.jsx(be,{children:X.name})})]})})]},ve)})},m);const D=_.args&&"name"in _.args?_.args.name:null,R=_.args&&"section"in _.args?_.args.section:null;return r.jsxs(Je,{children:[r.jsx(qe,{children:r.jsx(Ft,{size:14})}),r.jsx(et,{children:D&&R?r.jsxs(r.Fragment,{children:[r.jsx(J,{children:"Investigating"}),r.jsx(Ce,{children:r.jsx(be,{children:R})}),r.jsx(J,{children:"in"}),r.jsx(Ce,{children:r.jsx(be,{children:D})}),r.jsx(J,{children:"documentation"})]}):D?r.jsxs(r.Fragment,{children:[r.jsx(J,{children:"Investigating"}),r.jsx(Ce,{children:r.jsx(be,{children:D})}),r.jsx(J,{children:"documentation"})]}):r.jsx(J,{children:"Investigating documentation"})})]},m)}return null})})})})]},C.id)});return l?r.jsx(pn,{ref:b,"data-hook":"assistant-modes-container",children:r.jsxs(fn,{$expanded:g,$abort:!1,children:[r.jsxs(xn,{$expanded:g,$isExpandable:!0,onClick:()=>u(C=>!C),"data-hook":"assistant-mode-processing-collapsed",role:"presentation",children:[r.jsx(br,{size:20}),r.jsx(Ct,{$isActive:!1,children:A?`Thought for ${A}`:"Thought"}),r.jsx(yt,{$expanded:g,children:r.jsx(Nt,{size:14})})]}),r.jsx(yn,{$expanded:g,children:r.jsx(Cn,{children:r.jsx(wr,{children:M})})})]})}):r.jsx(pn,{ref:b,"data-hook":"assistant-modes-container",children:M})},Ar={tokenize:Vr,partial:!0},wn={tokenize:Zr,partial:!0},kn={tokenize:Ir,partial:!0},vn={tokenize:Lr,partial:!0},Mr={tokenize:Nr,partial:!0},An={tokenize:Hr,previous:En},Mn={tokenize:_r,previous:jn},de={tokenize:jr,previous:Hn},ie={},Er={text:ie};let we=48;for(;we<123;)ie[we]=de,we++,we===58?we=65:we===91&&(we=97);ie[43]=de,ie[45]=de,ie[46]=de,ie[95]=de,ie[72]=[de,Mn],ie[104]=[de,Mn],ie[87]=[de,An],ie[119]=[de,An];function jr(e,n,a){const i=this;let l,o;return s;function s(c){return!bt(c)||!Hn.call(i,i.previous)||wt(i.events)?a(c):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(c))}function d(c){return bt(c)?(e.consume(c),d):c===64?(e.consume(c),h):a(c)}function h(c){return c===46?e.check(Mr,u,g)(c):c===45||c===95||dt(c)?(o=!0,e.consume(c),h):u(c)}function g(c){return e.consume(c),l=!0,h}function u(c){return o&&l&&Ne(i.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(c)):a(c)}}function Hr(e,n,a){const i=this;return l;function l(s){return s!==87&&s!==119||!En.call(i,i.previous)||wt(i.events)?a(s):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Ar,e.attempt(wn,e.attempt(kn,o),a),a)(s))}function o(s){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(s)}}function _r(e,n,a){const i=this;let l="",o=!1;return s;function s(c){return(c===72||c===104)&&jn.call(i,i.previous)&&!wt(i.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(c),e.consume(c),d):a(c)}function d(c){if(Ne(c)&&l.length<5)return l+=String.fromCodePoint(c),e.consume(c),d;if(c===58){const b=l.toLowerCase();if(b==="http"||b==="https")return e.consume(c),h}return a(c)}function h(c){return c===47?(e.consume(c),o?g:(o=!0,h)):a(c)}function g(c){return c===null||ga(c)||G(c)||je(c)||ht(c)?a(c):e.attempt(wn,e.attempt(kn,u),a)(c)}function u(c){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(c)}}function Vr(e,n,a){let i=0;return l;function l(s){return(s===87||s===119)&&i<3?(i++,e.consume(s),l):s===46&&i===3?(e.consume(s),o):a(s)}function o(s){return s===null?a(s):n(s)}}function Zr(e,n,a){let i,l,o;return s;function s(g){return g===46||g===95?e.check(vn,h,d)(g):g===null||G(g)||je(g)||g!==45&&ht(g)?h(g):(o=!0,e.consume(g),s)}function d(g){return g===95?i=!0:(l=i,i=void 0),e.consume(g),s}function h(g){return l||i||!o?a(g):n(g)}}function Ir(e,n){let a=0,i=0;return l;function l(s){return s===40?(a++,e.consume(s),l):s===41&&i<a?o(s):s===33||s===34||s===38||s===39||s===41||s===42||s===44||s===46||s===58||s===59||s===60||s===63||s===93||s===95||s===126?e.check(vn,n,o)(s):s===null||G(s)||je(s)?n(s):(e.consume(s),l)}function o(s){return s===41&&i++,e.consume(s),l}}function Lr(e,n,a){return i;function i(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),i):d===38?(e.consume(d),o):d===93?(e.consume(d),l):d===60||d===null||G(d)||je(d)?n(d):a(d)}function l(d){return d===null||d===40||d===91||G(d)||je(d)?n(d):i(d)}function o(d){return Ne(d)?s(d):a(d)}function s(d){return d===59?(e.consume(d),i):Ne(d)?(e.consume(d),s):a(d)}}function Nr(e,n,a){return i;function i(o){return e.consume(o),l}function l(o){return dt(o)?a(o):n(o)}}function En(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||G(e)}function jn(e){return!Ne(e)}function Hn(e){return!(e===47||bt(e))}function bt(e){return e===43||e===45||e===46||e===95||dt(e)}function wt(e){let n=e.length,a=!1;for(;n--;){const i=e[n][1];if((i.type==="labelLink"||i.type==="labelImage")&&!i._balanced){a=!0;break}if(i._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const Fr={tokenize:Or,partial:!0};function Sr(){return{document:{91:{tokenize:Rr,continuation:{tokenize:Tr},exit:Br}},text:{91:{tokenize:zr},93:{add:"after",tokenize:Dr,resolveTo:qr}}}}function Dr(e,n,a){const i=this;let l=i.events.length;const o=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let s;for(;l--;){const h=i.events[l][1];if(h.type==="labelImage"){s=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return d;function d(h){if(!s||!s._balanced)return a(h);const g=Fe(i.sliceSerialize({start:s.end,end:i.now()}));return g.codePointAt(0)!==94||!o.includes(g.slice(1))?a(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),n(h))}}function qr(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 i={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},s={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},d=[e[a+1],e[a+2],["enter",i,n],e[a+3],e[a+4],["enter",l,n],["exit",l,n],["enter",o,n],["enter",s,n],["exit",s,n],["exit",o,n],e[e.length-2],e[e.length-1],["exit",i,n]];return e.splice(a,e.length-a+1,...d),e}function zr(e,n,a){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o=0,s;return d;function d(c){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),h}function h(c){return c!==94?a(c):(e.enter("gfmFootnoteCallMarker"),e.consume(c),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",g)}function g(c){if(o>999||c===93&&!s||c===null||c===91||G(c))return a(c);if(c===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return l.includes(Fe(i.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(c),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):a(c)}return G(c)||(s=!0),o++,e.consume(c),c===92?u:g}function u(c){return c===91||c===92||c===93?(e.consume(c),o++,g):g(c)}}function Rr(e,n,a){const i=this,l=i.parser.gfmFootnotes||(i.parser.gfmFootnotes=[]);let o,s=0,d;return h;function h(x){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),g}function g(x){return x===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",u):a(x)}function u(x){if(s>999||x===93&&!d||x===null||x===91||G(x))return a(x);if(x===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return o=Fe(i.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(x),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return G(x)||(d=!0),s++,e.consume(x),x===92?c:u}function c(x){return x===91||x===92||x===93?(e.consume(x),s++,u):u(x)}function b(x){return x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),l.includes(o)||l.push(o),me(e,y,"gfmFootnoteDefinitionWhitespace")):a(x)}function y(x){return n(x)}}function Tr(e,n,a){return e.check(pa,n,e.attempt(Fr,n,a))}function Br(e){e.exit("gfmFootnoteDefinition")}function Or(e,n,a){const i=this;return me(e,l,"gfmFootnoteDefinitionIndent",5);function l(o){const s=i.events[i.events.length-1];return s&&s[1].type==="gfmFootnoteDefinitionIndent"&&s[2].sliceSerialize(s[1],!0).length===4?n(o):a(o)}}function $r(e){let n=(e||{}).singleTilde;const a={tokenize:l,resolveAll:i};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function i(o,s){let d=-1;for(;++d<o.length;)if(o[d][0]==="enter"&&o[d][1].type==="strikethroughSequenceTemporary"&&o[d][1]._close){let h=d;for(;h--;)if(o[h][0]==="exit"&&o[h][1].type==="strikethroughSequenceTemporary"&&o[h][1]._open&&o[d][1].end.offset-o[d][1].start.offset===o[h][1].end.offset-o[h][1].start.offset){o[d][1].type="strikethroughSequence",o[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},o[h][1].start),end:Object.assign({},o[d][1].end)},u={type:"strikethroughText",start:Object.assign({},o[h][1].end),end:Object.assign({},o[d][1].start)},c=[["enter",g,s],["enter",o[h][1],s],["exit",o[h][1],s],["enter",u,s]],b=s.parser.constructs.insideSpan.null;b&&ut(c,c.length,0,fa(b,o.slice(h+1,d),s)),ut(c,c.length,0,[["exit",u,s],["enter",o[d][1],s],["exit",o[d][1],s],["exit",g,s]]),ut(o,h-1,d-h+3,c),d=h+c.length-2;break}}for(d=-1;++d<o.length;)o[d][1].type==="strikethroughSequenceTemporary"&&(o[d][1].type="data");return o}function l(o,s,d){const h=this.previous,g=this.events;let u=0;return c;function c(y){return h===126&&g[g.length-1][1].type!=="characterEscape"?d(y):(o.enter("strikethroughSequenceTemporary"),b(y))}function b(y){const x=qt(h);if(y===126)return u>1?d(y):(o.consume(y),u++,b);if(u<2&&!n)return d(y);const v=o.exit("strikethroughSequenceTemporary"),A=qt(y);return v._open=!A||A===2&&!!x,v._close=!x||x===2&&!!A,s(y)}}}class Wr{constructor(){this.map=[]}add(n,a,i){Pr(this,n,a,i)}consume(n){if(this.map.sort((o,s)=>o[0]-s[0]),this.map.length===0)return;let a=this.map.length;const i=[];for(;a>0;)a-=1,i.push(n.slice(this.map[a][0]+this.map[a][1])),i.push(this.map[a][2]),n.length=this.map[a][0];i.push([...n]),n.length=0;let l=i.pop();for(;l;)n.push(...l),l=i.pop();this.map.length=0}}function Pr(e,n,a,i){let l=0;if(!(a===0&&i.length===0)){for(;l<e.map.length;){if(e.map[l][0]===n){e.map[l][1]+=a,e.map[l][2].push(...i);return}l+=1}e.map.push([n,a,i])}}function Ur(e,n){let a=!1;const i=[];for(;n<e.length;){const l=e[n];if(a){if(l[0]==="enter")l[1].type==="tableContent"&&i.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const o=i.length-1;i[o]=i[o]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(a=!0);n+=1}return i}const Kr={flow:{null:{tokenize:Qr,resolveAll:Gr}}};function Qr(e,n,a){const i=this;let l=0,o=0,s;return d;function d(m){let Z=i.events.length-1;for(;Z>-1;){const X=i.events[Z][1].type;if(X==="lineEnding"||X==="linePrefix")Z--;else break}const D=Z>-1?i.events[Z][1].type:null,R=D==="tableHead"||D==="tableRow"?H:h;return R===H&&i.parser.lazy[i.now().line]?a(m):R(m)}function h(m){return e.enter("tableHead"),e.enter("tableRow"),g(m)}function g(m){return m===124||(s=!0,o+=1),u(m)}function u(m){return m===null?a(m):Se(m)?o>1?(o=0,i.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),y):a(m):He(m)?me(e,u,"whitespace")(m):(o+=1,s&&(s=!1,l+=1),m===124?(e.enter("tableCellDivider"),e.consume(m),e.exit("tableCellDivider"),s=!0,u):(e.enter("data"),c(m)))}function c(m){return m===null||m===124||G(m)?(e.exit("data"),u(m)):(e.consume(m),m===92?b:c)}function b(m){return m===92||m===124?(e.consume(m),c):c(m)}function y(m){return i.interrupt=!1,i.parser.lazy[i.now().line]?a(m):(e.enter("tableDelimiterRow"),s=!1,He(m)?me(e,x,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(m):x(m))}function x(m){return m===45||m===58?A(m):m===124?(s=!0,e.enter("tableCellDivider"),e.consume(m),e.exit("tableCellDivider"),v):L(m)}function v(m){return He(m)?me(e,A,"whitespace")(m):A(m)}function A(m){return m===58?(o+=1,s=!0,e.enter("tableDelimiterMarker"),e.consume(m),e.exit("tableDelimiterMarker"),M):m===45?(o+=1,M(m)):m===null||Se(m)?j(m):L(m)}function M(m){return m===45?(e.enter("tableDelimiterFiller"),C(m)):L(m)}function C(m){return m===45?(e.consume(m),C):m===58?(s=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(m),e.exit("tableDelimiterMarker"),k):(e.exit("tableDelimiterFiller"),k(m))}function k(m){return He(m)?me(e,j,"whitespace")(m):j(m)}function j(m){return m===124?x(m):m===null||Se(m)?!s||l!==o?L(m):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(m)):L(m)}function L(m){return a(m)}function H(m){return e.enter("tableRow"),F(m)}function F(m){return m===124?(e.enter("tableCellDivider"),e.consume(m),e.exit("tableCellDivider"),F):m===null||Se(m)?(e.exit("tableRow"),n(m)):He(m)?me(e,F,"whitespace")(m):(e.enter("data"),_(m))}function _(m){return m===null||m===124||G(m)?(e.exit("data"),F(m)):(e.consume(m),m===92?S:_)}function S(m){return m===92||m===124?(e.consume(m),_):_(m)}}function Gr(e,n){let a=-1,i=!0,l=0,o=[0,0,0,0],s=[0,0,0,0],d=!1,h=0,g,u,c;const b=new Wr;for(;++a<e.length;){const y=e[a],x=y[1];y[0]==="enter"?x.type==="tableHead"?(d=!1,h!==0&&(_n(b,n,h,g,u),u=void 0,h=0),g={type:"table",start:Object.assign({},x.start),end:Object.assign({},x.end)},b.add(a,0,[["enter",g,n]])):x.type==="tableRow"||x.type==="tableDelimiterRow"?(i=!0,c=void 0,o=[0,0,0,0],s=[0,a+1,0,0],d&&(d=!1,u={type:"tableBody",start:Object.assign({},x.start),end:Object.assign({},x.end)},b.add(a,0,[["enter",u,n]])),l=x.type==="tableDelimiterRow"?2:u?3:1):l&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")?(i=!1,s[2]===0&&(o[1]!==0&&(s[0]=s[1],c=tt(b,n,o,l,void 0,c),o=[0,0,0,0]),s[2]=a)):x.type==="tableCellDivider"&&(i?i=!1:(o[1]!==0&&(s[0]=s[1],c=tt(b,n,o,l,void 0,c)),o=s,s=[o[1],a,0,0])):x.type==="tableHead"?(d=!0,h=a):x.type==="tableRow"||x.type==="tableDelimiterRow"?(h=a,o[1]!==0?(s[0]=s[1],c=tt(b,n,o,l,a,c)):s[1]!==0&&(c=tt(b,n,s,l,a,c)),l=0):l&&(x.type==="data"||x.type==="tableDelimiterMarker"||x.type==="tableDelimiterFiller")&&(s[3]=a)}for(h!==0&&_n(b,n,h,g,u),b.consume(n.events),a=-1;++a<n.events.length;){const y=n.events[a];y[0]==="enter"&&y[1].type==="table"&&(y[1]._align=Ur(n.events,a))}return e}function tt(e,n,a,i,l,o){const s=i===1?"tableHeader":i===2?"tableDelimiter":"tableData",d="tableContent";a[0]!==0&&(o.end=Object.assign({},Ve(n.events,a[0])),e.add(a[0],0,[["exit",o,n]]));const h=Ve(n.events,a[1]);if(o={type:s,start:Object.assign({},h),end:Object.assign({},h)},e.add(a[1],0,[["enter",o,n]]),a[2]!==0){const g=Ve(n.events,a[2]),u=Ve(n.events,a[3]),c={type:d,start:Object.assign({},g),end:Object.assign({},u)};if(e.add(a[2],0,[["enter",c,n]]),i!==2){const b=n.events[a[2]],y=n.events[a[3]];if(b[1].end=Object.assign({},y[1].end),b[1].type="chunkText",b[1].contentType="text",a[3]>a[2]+1){const x=a[2]+1,v=a[3]-a[2]-1;e.add(x,v,[])}}e.add(a[3]+1,0,[["exit",c,n]])}return l!==void 0&&(o.end=Object.assign({},Ve(n.events,l)),e.add(l,0,[["exit",o,n]]),o=void 0),o}function _n(e,n,a,i,l){const o=[],s=Ve(n.events,a);l&&(l.end=Object.assign({},s),o.push(["exit",l,n])),i.end=Object.assign({},s),o.push(["exit",i,n]),e.add(a+1,0,o)}function Ve(e,n){const a=e[n],i=a[0]==="enter"?"start":"end";return a[1][i]}const Xr={tokenize:Jr},Yr={text:{91:Xr}};function Jr(e,n,a){const i=this;return l;function l(h){return i.previous!==null||!i._gfmTasklistFirstContentOfListItem?a(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),o)}function o(h){return G(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),s):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),s):a(h)}function s(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):a(h)}function d(h){return Se(h)?n(h):He(h)?e.check({tokenize:e0},n,a)(h):a(h)}}function e0(e,n,a){return me(e,i,"whitespace");function i(l){return l===null?a(l):n(l)}}function t0(e){return xa([Er,Sr(),$r(e),Kr,Yr])}function Vn(e,n){const a=String(e);if(typeof n!="string")throw new TypeError("Expected character");let i=0,l=a.indexOf(n);for(;l!==-1;)i++,l=a.indexOf(n,l+n.length);return i}function n0(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}const a0={}.hasOwnProperty,r0=(function(e,n,a,i){let l,o;typeof n=="string"||n instanceof RegExp?(o=[[n,a]],l=i):(o=n,l=a),l||(l={});const s=ya(l.ignore||[]),d=i0(o);let h=-1;for(;++h<d.length;)Ca(e,"text",g);return e;function g(c,b){let y=-1,x;for(;++y<b.length;){const v=b[y];if(s(v,x?x.children.indexOf(v):void 0,x))return;x=v}if(x)return u(c,b)}function u(c,b){const y=b[b.length-1],x=d[h][0],v=d[h][1];let A=0;const M=y.children.indexOf(c);let C=!1,k=[];x.lastIndex=0;let j=x.exec(c.value);for(;j;){const L=j.index,H={index:j.index,input:j.input,stack:[...b,c]};let F=v(...j,H);if(typeof F=="string"&&(F=F.length>0?{type:"text",value:F}:void 0),F!==!1&&(A!==L&&k.push({type:"text",value:c.value.slice(A,L)}),Array.isArray(F)?k.push(...F):F&&k.push(F),A=L+j[0].length,C=!0),!x.global)break;j=x.exec(c.value)}return C?(A<c.value.length&&k.push({type:"text",value:c.value.slice(A)}),y.children.splice(M,1,...k)):k=[c],M+k.length}});function i0(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([Zn(e[a][0]),In(e[a][1])])}else{let a;for(a in e)a0.call(e,a)&&n.push([Zn(a),In(e[a])])}return n}function Zn(e){return typeof e=="string"?new RegExp(n0(e),"g"):e}function In(e){return typeof e=="function"?e:()=>e}const kt="phrasing",vt=["autolink","link","image","label"],o0={transforms:[m0],enter:{literalAutolink:l0,literalAutolinkEmail:At,literalAutolinkHttp:At,literalAutolinkWww:At},exit:{literalAutolink:u0,literalAutolinkEmail:h0,literalAutolinkHttp:c0,literalAutolinkWww:d0}},s0={unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:kt,notInConstruct:vt},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:kt,notInConstruct:vt},{character:":",before:"[ps]",after:"\\/",inConstruct:kt,notInConstruct:vt}]};function l0(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function At(e){this.config.enter.autolinkProtocol.call(this,e)}function c0(e){this.config.exit.autolinkProtocol.call(this,e)}function d0(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.url="http://"+this.sliceSerialize(e)}function h0(e){this.config.exit.autolinkEmail.call(this,e)}function u0(e){this.exit(e)}function m0(e){r0(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,g0],[/([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/g,p0]],{ignore:["link","linkReference"]})}function g0(e,n,a,i,l){let o="";if(!Ln(l)||(/^w/i.test(n)&&(a=n+a,n="",o="http://"),!f0(a)))return!1;const s=x0(a+i);if(!s[0])return!1;const d={type:"link",title:null,url:o+n+s[0],children:[{type:"text",value:n+s[0]}]};return s[1]?[d,{type:"text",value:s[1]}]:d}function p0(e,n,a,i){return!Ln(i,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+a,children:[{type:"text",value:n+"@"+a}]}}function f0(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 x0(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let a=n[0],i=a.indexOf(")");const l=Vn(e,"(");let o=Vn(e,")");for(;i!==-1&&l>o;)e+=a.slice(0,i+1),a=a.slice(i+1),i=a.indexOf(")"),o++;return[e,a]}function Ln(e,n){const a=e.input.charCodeAt(e.index-1);return(e.index===0||je(a)||ht(a))&&(!n||a!==47)}function Nn(e){return e.label||!e.identifier?e.label||"":ba(e.identifier)}function y0(e,n,a){const i=n.indexStack,l=e.children||[],o=n.createTracker(a),s=[];let d=-1;for(i.push(-1);++d<l.length;){const h=l[d];i[i.length-1]=d,s.push(o.move(n.handle(h,e,n,{before:`
|
|
234
|
+
`,after:`
|
|
235
|
+
`,...o.current()}))),h.type!=="list"&&(n.bulletLastUsed=void 0),d<l.length-1&&s.push(o.move(C0(h,l[d+1],e,n)))}return i.pop(),s.join("")}function C0(e,n,a,i){let l=i.join.length;for(;l--;){const o=i.join[l](e,n,a,i);if(o===!0||o===1)break;if(typeof o=="number")return`
|
|
236
|
+
`.repeat(1+o);if(o===!1)return`
|
|
237
|
+
|
|
238
|
+
<!---->
|
|
239
|
+
|
|
240
|
+
`}return`
|
|
241
|
+
|
|
242
|
+
`}const b0=/\r?\n|\r/g;function w0(e,n){const a=[];let i=0,l=0,o;for(;o=b0.exec(e);)s(e.slice(i,o.index)),a.push(o[0]),i=o.index+o[0].length,l++;return s(e.slice(i)),a.join("");function s(d){a.push(n(d,l,!d))}}function Fn(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 k0(e,n){return Sn(e,n.inConstruct,!0)&&!Sn(e,n.notInConstruct,!1)}function Sn(e,n,a){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return a;let i=-1;for(;++i<n.length;)if(e.includes(n[i]))return!0;return!1}function Dn(e,n,a){const i=(a.before||"")+(n||"")+(a.after||""),l=[],o=[],s={};let d=-1;for(;++d<e.unsafe.length;){const u=e.unsafe[d];if(!k0(e.stack,u))continue;const c=Fn(u);let b;for(;b=c.exec(i);){const y="before"in u||!!u.atBreak,x="after"in u,v=b.index+(y?b[1].length:0);l.includes(v)?(s[v].before&&!y&&(s[v].before=!1),s[v].after&&!x&&(s[v].after=!1)):(l.push(v),s[v]={before:y,after:x})}}l.sort(v0);let h=a.before?a.before.length:0;const g=i.length-(a.after?a.after.length:0);for(d=-1;++d<l.length;){const u=l[d];u<h||u>=g||u+1<g&&l[d+1]===u+1&&s[u].after&&!s[u+1].before&&!s[u+1].after||l[d-1]===u-1&&s[u].before&&!s[u-1].before&&!s[u-1].after||(h!==u&&o.push(qn(i.slice(h,u),"\\")),h=u,/[!-/:-@[-`{-~]/.test(i.charAt(u))&&(!a.encode||!a.encode.includes(i.charAt(u)))?o.push("\\"):(o.push("&#x"+i.charCodeAt(u).toString(16).toUpperCase()+";"),h++))}return o.push(qn(i.slice(h,g),a.after)),o.join("")}function v0(e,n){return e-n}function qn(e,n){const a=/\\(?=[!-/:-@[-`{-~])/g,i=[],l=[],o=e+n;let s=-1,d=0,h;for(;h=a.exec(o);)i.push(h.index);for(;++s<i.length;)d!==i[s]&&l.push(e.slice(d,i[s])),l.push("\\"),d=i[s];return l.push(e.slice(d)),l.join("")}function nt(e){const n=e||{},a=n.now||{};let i=n.lineShift||0,l=a.line||1,o=a.column||1;return{move:h,current:s,shift:d};function s(){return{now:{line:l,column:o},lineShift:i}}function d(g){i+=g}function h(g){const u=g||"",c=u.split(/\r?\n|\r/g),b=c[c.length-1];return l+=c.length-1,o=c.length===1?o+b.length:1+b.length+i,u}}zn.peek=N0;function A0(){return{enter:{gfmFootnoteDefinition:E0,gfmFootnoteDefinitionLabelString:j0,gfmFootnoteCall:V0,gfmFootnoteCallString:Z0},exit:{gfmFootnoteDefinition:_0,gfmFootnoteDefinitionLabelString:H0,gfmFootnoteCall:L0,gfmFootnoteCallString:I0}}}function M0(){return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]}],handlers:{footnoteDefinition:F0,footnoteReference:zn}}}function E0(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function j0(){this.buffer()}function H0(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.label=n,a.identifier=Fe(this.sliceSerialize(e)).toLowerCase()}function _0(e){this.exit(e)}function V0(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function Z0(){this.buffer()}function I0(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.label=n,a.identifier=Fe(this.sliceSerialize(e)).toLowerCase()}function L0(e){this.exit(e)}function zn(e,n,a,i){const l=nt(i);let o=l.move("[^");const s=a.enter("footnoteReference"),d=a.enter("reference");return o+=l.move(Dn(a,Nn(e),{...l.current(),before:o,after:"]"})),d(),s(),o+=l.move("]"),o}function N0(){return"["}function F0(e,n,a,i){const l=nt(i);let o=l.move("[^");const s=a.enter("footnoteDefinition"),d=a.enter("label");return o+=l.move(Dn(a,Nn(e),{...l.current(),before:o,after:"]"})),d(),o+=l.move("]:"+(e.children&&e.children.length>0?" ":"")),l.shift(4),o+=l.move(w0(y0(e,a,l.current()),S0)),s(),o}function S0(e,n,a){return n===0?e:(a?"":" ")+e}function Rn(e,n,a){const i=n.indexStack,l=e.children||[],o=[];let s=-1,d=a.before;i.push(-1);let h=n.createTracker(a);for(;++s<l.length;){const g=l[s];let u;if(i[i.length-1]=s,s+1<l.length){let c=n.handle.handlers[l[s+1].type];c&&c.peek&&(c=c.peek),u=c?c(l[s+1],e,n,{before:"",after:"",...h.current()}).charAt(0):""}else u=a.after;o.length>0&&(d==="\r"||d===`
|
|
243
|
+
`)&&g.type==="html"&&(o[o.length-1]=o[o.length-1].replace(/(\r?\n|\r)$/," "),d=" ",h=n.createTracker(a),h.move(o.join(""))),o.push(h.move(n.handle(g,e,n,{...h.current(),before:d,after:u}))),d=o[o.length-1].slice(-1)}return i.pop(),o.join("")}const D0=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Tn.peek=B0;const q0={canContainEols:["delete"],enter:{strikethrough:R0},exit:{strikethrough:T0}},z0={unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:D0}],handlers:{delete:Tn}};function R0(e){this.enter({type:"delete",children:[]},e)}function T0(e){this.exit(e)}function Tn(e,n,a,i){const l=nt(i),o=a.enter("strikethrough");let s=l.move("~~");return s+=Rn(e,a,{...l.current(),before:s,after:"~"}),s+=l.move("~~"),o(),s}function B0(){return"~"}Bn.peek=O0;function Bn(e,n,a){let i=e.value||"",l="`",o=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(i);)l+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++o<a.unsafe.length;){const s=a.unsafe[o],d=Fn(s);let h;if(s.atBreak)for(;h=d.exec(i);){let g=h.index;i.charCodeAt(g)===10&&i.charCodeAt(g-1)===13&&g--,i=i.slice(0,g)+" "+i.slice(h.index+1)}}return l+i+l}function O0(){return"`"}function $0(e){return e.length}function W0(e,n){const a=n||{},i=(a.align||[]).concat(),l=a.stringLength||$0,o=[],s=[],d=[],h=[];let g=0,u=-1;for(;++u<e.length;){const v=[],A=[];let M=-1;for(e[u].length>g&&(g=e[u].length);++M<e[u].length;){const C=P0(e[u][M]);if(a.alignDelimiters!==!1){const k=l(C);A[M]=k,(h[M]===void 0||k>h[M])&&(h[M]=k)}v.push(C)}s[u]=v,d[u]=A}let c=-1;if(typeof i=="object"&&"length"in i)for(;++c<g;)o[c]=On(i[c]);else{const v=On(i);for(;++c<g;)o[c]=v}c=-1;const b=[],y=[];for(;++c<g;){const v=o[c];let A="",M="";v===99?(A=":",M=":"):v===108?A=":":v===114&&(M=":");let C=a.alignDelimiters===!1?1:Math.max(1,h[c]-A.length-M.length);const k=A+"-".repeat(C)+M;a.alignDelimiters!==!1&&(C=A.length+C+M.length,C>h[c]&&(h[c]=C),y[c]=C),b[c]=k}s.splice(1,0,b),d.splice(1,0,y),u=-1;const x=[];for(;++u<s.length;){const v=s[u],A=d[u];c=-1;const M=[];for(;++c<g;){const C=v[c]||"";let k="",j="";if(a.alignDelimiters!==!1){const L=h[c]-(A[c]||0),H=o[c];H===114?k=" ".repeat(L):H===99?L%2?(k=" ".repeat(L/2+.5),j=" ".repeat(L/2-.5)):(k=" ".repeat(L/2),j=k):j=" ".repeat(L)}a.delimiterStart!==!1&&!c&&M.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&C==="")&&(a.delimiterStart!==!1||c)&&M.push(" "),a.alignDelimiters!==!1&&M.push(k),M.push(C),a.alignDelimiters!==!1&&M.push(j),a.padding!==!1&&M.push(" "),(a.delimiterEnd!==!1||c!==g-1)&&M.push("|")}x.push(a.delimiterEnd===!1?M.join("").replace(/ +$/,""):M.join(""))}return x.join(`
|
|
244
|
+
`)}function P0(e){return e==null?"":String(e)}function On(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 U0={enter:{table:K0,tableData:$n,tableHeader:$n,tableRow:G0},exit:{codeText:X0,table:Q0,tableData:Mt,tableHeader:Mt,tableRow:Mt}};function K0(e){const n=e._align;this.enter({type:"table",align:n.map(a=>a==="none"?null:a),children:[]},e),this.setData("inTable",!0)}function Q0(e){this.exit(e),this.setData("inTable")}function G0(e){this.enter({type:"tableRow",children:[]},e)}function Mt(e){this.exit(e)}function $n(e){this.enter({type:"tableCell",children:[]},e)}function X0(e){let n=this.resume();this.getData("inTable")&&(n=n.replace(/\\([\\|])/g,Y0));const a=this.stack[this.stack.length-1];a.value=n,this.exit(e)}function Y0(e,n){return n==="|"?n:e}function J0(e){const n=e||{},a=n.tableCellPadding,i=n.tablePipeAlign,l=n.stringLength,o=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
245
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{table:s,tableRow:d,tableCell:h,inlineCode:b}};function s(y,x,v,A){return g(u(y,v,A),y.align)}function d(y,x,v,A){const M=c(y,v,A),C=g([M]);return C.slice(0,C.indexOf(`
|
|
246
|
+
`))}function h(y,x,v,A){const M=v.enter("tableCell"),C=v.enter("phrasing"),k=Rn(y,v,{...A,before:o,after:o});return C(),M(),k}function g(y,x){return W0(y,{align:x,alignDelimiters:i,padding:a,stringLength:l})}function u(y,x,v){const A=y.children;let M=-1;const C=[],k=x.enter("table");for(;++M<A.length;)C[M]=c(A[M],x,v);return k(),C}function c(y,x,v){const A=y.children;let M=-1;const C=[],k=x.enter("tableRow");for(;++M<A.length;)C[M]=h(A[M],y,x,v);return k(),C}function b(y,x,v){let A=Bn(y,x,v);return v.stack.includes("tableCell")&&(A=A.replace(/\|/g,"\\$&")),A}}function ei(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 ti(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 ni(e,n,a,i){const l=ti(a);let o=a.bulletCurrent||ei(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 s=o.length+1;(l==="tab"||l==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(s=Math.ceil(s/4)*4);const d=a.createTracker(i);d.move(o+" ".repeat(s-o.length)),d.shift(s);const h=a.enter("listItem"),g=a.indentLines(a.containerFlow(e,d.current()),u);return h(),g;function u(c,b,y){return b?(y?"":" ".repeat(s))+c:(y?o:o+" ".repeat(s-o.length))+c}}const ai={exit:{taskListCheckValueChecked:Wn,taskListCheckValueUnchecked:Wn,paragraph:ii}},ri={unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:oi}};function Wn(e){const n=this.stack[this.stack.length-2];n.checked=e.type==="taskListCheckValueChecked"}function ii(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],i=a.children[0];if(i&&i.type==="text"){const l=n.children;let o=-1,s;for(;++o<l.length;){const d=l[o];if(d.type==="paragraph"){s=d;break}}s===a&&(i.value=i.value.slice(1),i.value.length===0?a.children.shift():a.position&&i.position&&typeof i.position.start.offset=="number"&&(i.position.start.column++,i.position.start.offset++,a.position.start=Object.assign({},i.position.start)))}}this.exit(e)}function oi(e,n,a,i){const l=e.children[0],o=typeof e.checked=="boolean"&&l&&l.type==="paragraph",s="["+(e.checked?"x":" ")+"] ",d=nt(i);o&&d.move(s);let h=ni(e,n,a,{...i,...d.current()});return o&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,g)),h;function g(u){return u+s}}function si(){return[o0,A0(),q0,U0,ai]}function li(e){return{extensions:[s0,M0(),z0,J0(e),ri]}}function ci(e={}){const n=this.data();a("micromarkExtensions",t0(e)),a("fromMarkdownExtensions",si()),a("toMarkdownExtensions",li(e));function a(i,l){(n[i]?n[i]:n[i]=[]).push(l)}}const di=p.div.withConfig({displayName:"AssistantMarkdown__CodeBlockWrapper"})([`
|
|
247
|
+
margin: 1rem 0;
|
|
248
|
+
width: 100%;
|
|
249
|
+
`]),hi=p.div.withConfig({displayName:"AssistantMarkdown__MarkdownContent"})([`
|
|
250
|
+
margin: 0;
|
|
251
|
+
width: 100%;
|
|
252
|
+
font-family: `,`;
|
|
253
|
+
font-size: 1.4rem;
|
|
254
|
+
line-height: 2.1rem;
|
|
255
|
+
color: `,`;
|
|
256
|
+
word-break: break-word;
|
|
257
|
+
|
|
258
|
+
p {
|
|
259
|
+
margin: 0 0 1rem 0;
|
|
260
|
+
&:last-child {
|
|
261
|
+
margin-bottom: 0;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
code {
|
|
266
|
+
background: `,`;
|
|
267
|
+
border: 1px solid `,`;
|
|
268
|
+
border-radius: 0.4rem;
|
|
269
|
+
padding: 0.1rem 0.4rem;
|
|
270
|
+
font-family: `,`;
|
|
271
|
+
font-size: 1.3rem;
|
|
272
|
+
color: `,`;
|
|
273
|
+
white-space: pre-wrap;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
strong {
|
|
277
|
+
font-weight: 600;
|
|
278
|
+
color: `,`;
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
em {
|
|
282
|
+
font-style: italic;
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
ul,
|
|
286
|
+
ol {
|
|
287
|
+
margin: 0.5rem 0;
|
|
288
|
+
padding-left: 2rem;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
li {
|
|
292
|
+
margin-bottom: 0.3rem;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
a {
|
|
296
|
+
color: `,`;
|
|
297
|
+
text-decoration: none;
|
|
298
|
+
&:hover {
|
|
299
|
+
text-decoration: underline;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
h1,
|
|
304
|
+
h2,
|
|
305
|
+
h3,
|
|
306
|
+
h4 {
|
|
307
|
+
margin: 1rem 0 0.5rem 0;
|
|
308
|
+
font-weight: 600;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
h1 {
|
|
312
|
+
font-size: 1.8rem;
|
|
313
|
+
}
|
|
314
|
+
h2 {
|
|
315
|
+
font-size: 1.6rem;
|
|
316
|
+
}
|
|
317
|
+
h3 {
|
|
318
|
+
font-size: 1.5rem;
|
|
319
|
+
}
|
|
320
|
+
h4 {
|
|
321
|
+
font-size: 1.4rem;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
blockquote {
|
|
325
|
+
border-left: 3px solid `,`;
|
|
326
|
+
margin: 1rem 0;
|
|
327
|
+
padding-left: 1rem;
|
|
328
|
+
color: `,`;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
.table-wrapper {
|
|
332
|
+
overflow-x: auto;
|
|
333
|
+
margin: 1rem 0;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
table {
|
|
337
|
+
border-collapse: collapse;
|
|
338
|
+
min-width: max-content;
|
|
339
|
+
border-radius: 0.8rem;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
th,
|
|
343
|
+
td {
|
|
344
|
+
padding: 0.6rem 0.8rem;
|
|
345
|
+
border: 1px solid `,`;
|
|
346
|
+
text-align: left;
|
|
347
|
+
white-space: nowrap;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
th {
|
|
351
|
+
background: `,`;
|
|
352
|
+
font-weight: 600;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
td:last-child {
|
|
356
|
+
white-space: normal;
|
|
357
|
+
min-width: 200px;
|
|
358
|
+
}
|
|
359
|
+
`],({theme:e})=>e.font,f("foreground"),f("background"),f("selection"),({theme:e})=>e.fontMonospace,f("purple"),f("foreground"),({theme:e})=>e.color.cyan,f("selection"),f("gray2"),f("selection"),f("backgroundDarker")),ui=e=>({a:({children:n,href:a,...i})=>r.jsx("a",{...typeof a=="string"&&a.startsWith("http")?{target:"_blank",rel:"noopener noreferrer"}:{},href:a,...i,children:n}),table:({children:n,...a})=>r.jsx("div",{className:"table-wrapper",children:r.jsx("table",{...a,children:n})}),pre:({children:n})=>r.jsx(r.Fragment,{children:n}),code:t.memo(({children:n,className:a})=>{if(typeof a=="string"&&a.includes("language-")){const i=(Array.isArray(n)?n.join(""):typeof n=="string"?n:"").replace(/\n$/,"");return r.jsx(di,{"data-hook":"chat-message-code-block",children:r.jsx(De,{value:i,maxHeight:216,onOpenInEditor:()=>{var l;(l=e.current)==null||l.call(e,{type:"code",value:i})}})},i)}return r.jsx("code",{children:n})},(n,a)=>n.children===a.children&&n.className===a.className)}),mi=({content:e,messageId:n,onOpenInEditor:a})=>{const i=t.useRef(a);t.useEffect(()=>{i.current=a},[a]);const l=t.useMemo(()=>ui(i),[]);return r.jsx(hi,{children:r.jsx(wa,{remarkPlugins:[ci],components:l,children:e})},n)},gi=Wt([`
|
|
360
|
+
from {
|
|
361
|
+
transform: rotate(0deg);
|
|
362
|
+
}
|
|
363
|
+
to {
|
|
364
|
+
transform: rotate(360deg);
|
|
365
|
+
}
|
|
366
|
+
`]),pi=p.span.withConfig({displayName:"ChatMessages__LoadingIconWrapper"})([`
|
|
367
|
+
display: flex;
|
|
368
|
+
align-items: center;
|
|
369
|
+
justify-content: center;
|
|
370
|
+
animation: `,` 3s linear infinite;
|
|
371
|
+
`],gi),fi=()=>r.jsx(pi,{children:r.jsx(_a,{})}),xi=p(q).withConfig({displayName:"ChatMessages__MessagesContainer"})([`
|
|
372
|
+
display: flex;
|
|
373
|
+
flex-direction: column;
|
|
374
|
+
gap: 1.5rem;
|
|
375
|
+
padding: 2rem 1rem;
|
|
376
|
+
overflow-y: auto;
|
|
377
|
+
flex: 1 1 auto;
|
|
378
|
+
min-height: 0;
|
|
379
|
+
width: 100%;
|
|
380
|
+
`,`
|
|
381
|
+
`],({$scrolled:e})=>!e&&K([`
|
|
382
|
+
opacity: 0;
|
|
383
|
+
`])),yi=p(q).attrs({align:"flex-start"}).withConfig({displayName:"ChatMessages__MessageBubble"})([`
|
|
384
|
+
display: flex;
|
|
385
|
+
flex-direction: column;
|
|
386
|
+
gap: 0.5rem;
|
|
387
|
+
padding: 0.8rem;
|
|
388
|
+
border-radius: 0.8rem;
|
|
389
|
+
width: 100%;
|
|
390
|
+
align-self: flex-end;
|
|
391
|
+
background: `,`;
|
|
392
|
+
border: 1px solid rgba(25, 26, 33, 0.32);
|
|
393
|
+
flex-shrink: 0;
|
|
394
|
+
`],f("loginBackground")),Pn=p(q).withConfig({displayName:"ChatMessages__UserRequestBox"})([`
|
|
395
|
+
display: flex;
|
|
396
|
+
flex-direction: column;
|
|
397
|
+
gap: 0.5rem;
|
|
398
|
+
padding: 0.8rem;
|
|
399
|
+
width: 100%;
|
|
400
|
+
align-self: flex-end;
|
|
401
|
+
background: `,`;
|
|
402
|
+
border: 1px solid rgba(25, 26, 33, 0.32);
|
|
403
|
+
border-radius: 0.6rem;
|
|
404
|
+
flex-shrink: 0;
|
|
405
|
+
`],f("loginBackground")),Ci=p(q).attrs({alignItems:"center",gap:"0.8rem"}).withConfig({displayName:"ChatMessages__UserRequestHeader"})([`
|
|
406
|
+
width: 100%;
|
|
407
|
+
padding: 0.4rem;
|
|
408
|
+
flex: 1 0 auto;
|
|
409
|
+
`]),Et=p(q).withConfig({displayName:"ChatMessages__UserRequestContent"})([`
|
|
410
|
+
display: flex;
|
|
411
|
+
flex-direction: column;
|
|
412
|
+
border-radius: 0.6rem;
|
|
413
|
+
overflow: hidden;
|
|
414
|
+
flex-shrink: 0;
|
|
415
|
+
width: 100%;
|
|
416
|
+
align-items: flex-start;
|
|
417
|
+
`]),Un=p.div.withConfig({displayName:"ChatMessages__InlineSQLEditor"})([`
|
|
418
|
+
width: 100%;
|
|
419
|
+
`]),bi=p(q).attrs({gap:"1rem",alignItems:"center"}).withConfig({displayName:"ChatMessages__OperationBadge"})([`
|
|
420
|
+
width: 100%;
|
|
421
|
+
padding: 0 0.4rem;
|
|
422
|
+
`]),wi=p(q).attrs({align:"center",justifyContent:"center"}).withConfig({displayName:"ChatMessages__BadgeIconContainer"})([`
|
|
423
|
+
background: #290a13;
|
|
424
|
+
border: 1px solid rgba(122, 31, 58, 0.64);
|
|
425
|
+
border-radius: 0.4rem;
|
|
426
|
+
padding: 0.8rem;
|
|
427
|
+
width: 4.8rem;
|
|
428
|
+
height: 4rem;
|
|
429
|
+
flex-shrink: 0;
|
|
430
|
+
`]),ki=p.img.withConfig({displayName:"ChatMessages__BadgeIcon"})([`
|
|
431
|
+
width: 1.8rem;
|
|
432
|
+
height: 1.8rem;
|
|
433
|
+
`]),vi=p(ye).withConfig({displayName:"ChatMessages__BadgeTitle"})([`
|
|
434
|
+
font-weight: 500;
|
|
435
|
+
font-size: 1.6rem;
|
|
436
|
+
line-height: 1.6rem;
|
|
437
|
+
color: `,`;
|
|
438
|
+
`],f("foreground")),Ai=p(q).withConfig({displayName:"ChatMessages__BadgeDescriptionContainer"})([`
|
|
439
|
+
padding: 0.8rem;
|
|
440
|
+
width: 100%;
|
|
441
|
+
`]),Mi=p(ye).withConfig({displayName:"ChatMessages__BadgeDescriptionText"})([`
|
|
442
|
+
font-size: 1.4rem;
|
|
443
|
+
line-height: 2.1rem;
|
|
444
|
+
color: `,`;
|
|
445
|
+
`],f("foreground")),Ei=p(q).withConfig({displayName:"ChatMessages__SchemaNameDisplay"})([`
|
|
446
|
+
margin-left: 0.4rem;
|
|
447
|
+
padding: 0.8rem 1.2rem;
|
|
448
|
+
align-items: center;
|
|
449
|
+
gap: 1rem;
|
|
450
|
+
border-radius: 8px;
|
|
451
|
+
border: 1px solid `,`;
|
|
452
|
+
background: `,`;
|
|
453
|
+
`],f("selection"),f("backgroundDarker")),ji=p(ye).withConfig({displayName:"ChatMessages__SchemaName"})([`
|
|
454
|
+
font-size: 1.4rem;
|
|
455
|
+
color: `,`;
|
|
456
|
+
`],f("foreground")),Kn=p(ye).withConfig({displayName:"ChatMessages__MessageContent"})([`
|
|
457
|
+
font-size: 1.4rem;
|
|
458
|
+
line-height: 1.8rem;
|
|
459
|
+
color: `,`;
|
|
460
|
+
white-space: pre-wrap;
|
|
461
|
+
word-wrap: break-word;
|
|
462
|
+
`],f("foreground")),Hi=p(q).withConfig({displayName:"ChatMessages__ExplanationBox"})([`
|
|
463
|
+
display: flex;
|
|
464
|
+
flex-direction: column;
|
|
465
|
+
gap: 0.5rem;
|
|
466
|
+
width: 100%;
|
|
467
|
+
align-self: flex-start;
|
|
468
|
+
text-align: left;
|
|
469
|
+
background: transparent;
|
|
470
|
+
padding: 0.4rem;
|
|
471
|
+
border-radius: 0.6rem;
|
|
472
|
+
flex-shrink: 0;
|
|
473
|
+
|
|
474
|
+
`,`
|
|
475
|
+
|
|
476
|
+
.assistant-label,
|
|
477
|
+
.token-display {
|
|
478
|
+
transition: opacity 0.2s;
|
|
479
|
+
opacity: 0;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
&:hover {
|
|
483
|
+
.assistant-label,
|
|
484
|
+
.token-display {
|
|
485
|
+
opacity: 1;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
`],({$hasOperationHistory:e})=>e&&K([`
|
|
489
|
+
padding-top: 0;
|
|
490
|
+
`])),_i=p(q).attrs({alignItems:"center",gap:"1rem"}).withConfig({displayName:"ChatMessages__AssistantHeader"})([`
|
|
491
|
+
width: 100%;
|
|
492
|
+
padding: 0.4rem;
|
|
493
|
+
flex: 1 0 auto;
|
|
494
|
+
`]),Vi=p(ye).attrs({className:"assistant-label"}).withConfig({displayName:"ChatMessages__AssistantLabel"})([`
|
|
495
|
+
font-family: `,`;
|
|
496
|
+
font-size: 1.4rem;
|
|
497
|
+
text-transform: uppercase;
|
|
498
|
+
color: `,`;
|
|
499
|
+
line-height: 1;
|
|
500
|
+
`],({theme:e})=>e.fontMonospace,f("foreground")),Zi=p(q).attrs({className:"token-display"}).withConfig({displayName:"ChatMessages__TokenDisplay"})([`
|
|
501
|
+
align-items: center;
|
|
502
|
+
gap: 0.9rem;
|
|
503
|
+
margin: 0 0 0 auto;
|
|
504
|
+
`]),Ii=p(q).withConfig({displayName:"ChatMessages__ExplanationContent"})([`
|
|
505
|
+
display: flex;
|
|
506
|
+
flex-direction: column;
|
|
507
|
+
border-radius: 0.6rem;
|
|
508
|
+
padding: 0.8rem;
|
|
509
|
+
flex-shrink: 0;
|
|
510
|
+
width: 100%;
|
|
511
|
+
`]),Li=p.div.withConfig({displayName:"ChatMessages__Divider"})([`
|
|
512
|
+
width: 100%;
|
|
513
|
+
height: 1px;
|
|
514
|
+
background: linear-gradient(90deg, #9c274b 0%, rgba(54, 14, 26, 0) 100%);
|
|
515
|
+
margin-bottom: 1rem;
|
|
516
|
+
`]),Ni=p.div.withConfig({displayName:"ChatMessages__OperationHistoryContainer"})([`
|
|
517
|
+
margin-bottom: 0.6rem;
|
|
518
|
+
width: 100%;
|
|
519
|
+
`,`
|
|
520
|
+
`],({$trimBottom:e})=>e&&K([`
|
|
521
|
+
margin-bottom: 0;
|
|
522
|
+
padding-bottom: 0.3rem;
|
|
523
|
+
`])),Fi=p.div.withConfig({displayName:"ChatMessages__ErrorContainer"})([`
|
|
524
|
+
display: flex;
|
|
525
|
+
align-items: center;
|
|
526
|
+
flex-shrink: 0;
|
|
527
|
+
gap: 0.5rem;
|
|
528
|
+
padding: 0.4rem 0.4rem 0.4rem 0.8rem;
|
|
529
|
+
border: 1px solid `,`;
|
|
530
|
+
border-radius: 0.6rem;
|
|
531
|
+
color: `,`;
|
|
532
|
+
font-size: 1.4rem;
|
|
533
|
+
line-height: 2rem;
|
|
534
|
+
width: 100%;
|
|
535
|
+
`],f("red"),f("foreground")),Si=p(re).withConfig({displayName:"ChatMessages__RetryButton"})([`
|
|
536
|
+
margin-left: auto;
|
|
537
|
+
flex-shrink: 0;
|
|
538
|
+
padding: 0.5rem 0.8rem;
|
|
539
|
+
height: auto;
|
|
540
|
+
`]),Di=Wt([`
|
|
541
|
+
0%, 50% { opacity: 1; }
|
|
542
|
+
51%, 100% { opacity: 0; }
|
|
543
|
+
`]),qi=p.span.withConfig({displayName:"ChatMessages__StreamingCursor"})([`
|
|
544
|
+
display: inline-block;
|
|
545
|
+
width: 2px;
|
|
546
|
+
height: 1.4em;
|
|
547
|
+
background: `,`;
|
|
548
|
+
margin-left: 2px;
|
|
549
|
+
margin-right: auto;
|
|
550
|
+
vertical-align: text-bottom;
|
|
551
|
+
animation: `,` 1s infinite;
|
|
552
|
+
`],f("foreground"),Di),zi=p.div.withConfig({displayName:"ChatMessages__MessagesEnd"})([`
|
|
553
|
+
min-height: 1px;
|
|
554
|
+
width: 100%;
|
|
555
|
+
background: transparent;
|
|
556
|
+
`]),Ri=p(q).withConfig({displayName:"ChatMessages__DiffContainer"})([`
|
|
557
|
+
display: flex;
|
|
558
|
+
flex-direction: column;
|
|
559
|
+
gap: 10px;
|
|
560
|
+
margin-top: 1rem;
|
|
561
|
+
padding: 8px 12px;
|
|
562
|
+
border: 1px solid `,`;
|
|
563
|
+
border-radius: 8px;
|
|
564
|
+
background: `,`;
|
|
565
|
+
width: 100%;
|
|
566
|
+
`],f("selection"),f("backgroundDarker")),Ti=p(q).withConfig({displayName:"ChatMessages__DiffHeader"})([`
|
|
567
|
+
display: flex;
|
|
568
|
+
align-items: center;
|
|
569
|
+
justify-content: space-between;
|
|
570
|
+
padding-bottom: 8px;
|
|
571
|
+
border-bottom: 1px solid `,`;
|
|
572
|
+
width: 100%;
|
|
573
|
+
`,`
|
|
574
|
+
`],f("selectionDarker"),({$isExpanded:e})=>!e&&K([`
|
|
575
|
+
border-bottom: 0;
|
|
576
|
+
padding-bottom: 0;
|
|
577
|
+
`])),Bi=p(q).withConfig({displayName:"ChatMessages__DiffHeaderLeft"})([`
|
|
578
|
+
display: flex;
|
|
579
|
+
align-items: center;
|
|
580
|
+
gap: 1rem;
|
|
581
|
+
padding: 4px 0;
|
|
582
|
+
`]),Oi=p.span.withConfig({displayName:"ChatMessages__DiffHeaderLabel"})([`
|
|
583
|
+
font-size: 1.4rem;
|
|
584
|
+
color: `,`;
|
|
585
|
+
`],f("offWhite")),$i=p(q).withConfig({displayName:"ChatMessages__DiffHeaderRight"})([`
|
|
586
|
+
display: flex;
|
|
587
|
+
align-items: center;
|
|
588
|
+
gap: 1.8rem;
|
|
589
|
+
margin-left: auto;
|
|
590
|
+
`]),Wi=p(q).withConfig({displayName:"ChatMessages__DiffHeaderStatus"})([`
|
|
591
|
+
display: flex;
|
|
592
|
+
align-items: center;
|
|
593
|
+
gap: 0.8rem;
|
|
594
|
+
color: `,`;
|
|
595
|
+
font-size: 1.3rem;
|
|
596
|
+
`],({$isAccepted:e,$isRejected:n,$isRejectedWithFollowUp:a})=>n?f("red"):a?f("cyan"):e?f("greenDarker"):f("gray2")),Pi=p.span.withConfig({displayName:"ChatMessages__StatusIcon"})([`
|
|
597
|
+
display: flex;
|
|
598
|
+
align-items: center;
|
|
599
|
+
color: `,`;
|
|
600
|
+
`],({$isAccepted:e,$isRejected:n,$isRejectedWithFollowUp:a})=>n?f("red"):a?f("cyan"):e?f("greenDarker"):f("gray2")),jt=p.button.withConfig({displayName:"ChatMessages__IconButton"})([`
|
|
601
|
+
display: flex;
|
|
602
|
+
align-items: center;
|
|
603
|
+
justify-content: center;
|
|
604
|
+
padding: 0;
|
|
605
|
+
background: transparent;
|
|
606
|
+
border: none;
|
|
607
|
+
cursor: pointer;
|
|
608
|
+
height: 22px;
|
|
609
|
+
width: 22px;
|
|
610
|
+
color: `,`;
|
|
611
|
+
|
|
612
|
+
&:hover {
|
|
613
|
+
svg {
|
|
614
|
+
filter: brightness(1.3);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
`],f("gray2")),Ui=p(jt).withConfig({displayName:"ChatMessages__ExpandButton"})([`
|
|
618
|
+
width: 16px;
|
|
619
|
+
height: 16px;
|
|
620
|
+
`]),Ki=p.div.withConfig({displayName:"ChatMessages__DiffEditorWrapper"})([`
|
|
621
|
+
position: relative;
|
|
622
|
+
width: 100%;
|
|
623
|
+
`]),Qi=p(q).withConfig({displayName:"ChatMessages__ButtonBar"})([`
|
|
624
|
+
padding: 0.5rem;
|
|
625
|
+
gap: 1rem;
|
|
626
|
+
justify-content: center;
|
|
627
|
+
flex-shrink: 0;
|
|
628
|
+
width: fit-content;
|
|
629
|
+
margin: 0 auto;
|
|
630
|
+
background: `,`;
|
|
631
|
+
border: 1px solid `,`;
|
|
632
|
+
border-radius: 0.4rem;
|
|
633
|
+
`],f("backgroundDarker"),f("selection")),Gi=p(re).withConfig({displayName:"ChatMessages__AcceptButton"})([`
|
|
634
|
+
background: `,`;
|
|
635
|
+
color: `,`;
|
|
636
|
+
border: 0.1rem solid `,`;
|
|
637
|
+
width: 10rem;
|
|
638
|
+
|
|
639
|
+
&:hover:not(:disabled) {
|
|
640
|
+
background: `,`;
|
|
641
|
+
border-color: `,`;
|
|
642
|
+
filter: brightness(1.2);
|
|
643
|
+
}
|
|
644
|
+
`],({theme:e})=>e.color.pinkDarker,f("foreground"),({theme:e})=>e.color.pinkDarker,({theme:e})=>e.color.pinkDarker,({theme:e})=>e.color.pinkDarker),Xi=p(re).withConfig({displayName:"ChatMessages__RejectButton"})([`
|
|
645
|
+
background: `,`;
|
|
646
|
+
color: `,`;
|
|
647
|
+
border: 1px solid transparent;
|
|
648
|
+
width: 10rem;
|
|
649
|
+
|
|
650
|
+
&:hover:not(:disabled) {
|
|
651
|
+
background: `,`;
|
|
652
|
+
border-color: transparent;
|
|
653
|
+
}
|
|
654
|
+
`],f("background"),f("foreground"),f("selection")),Yi=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}},Ji=e=>{switch(e){case"loading":return r.jsx(fi,{});case"success":return r.jsx(Ha,{});case"error":return r.jsx(ja,{});default:return r.jsx(Ea,{})}},e1=({messages:e,onAcceptChange:n,onRejectChange:a,onRunQuery:i,onOpenInEditor:l,onApplyToEditor:o,onRetry:s,running:d,aiSuggestionRequest:h,queryNotifications:g,queryStartOffset:u=0,isOperationInProgress:c,editorSQL:b,isStreaming:y})=>{const x=xt(),v=t.useRef(null),A=t.useRef(null),{status:M}=Ee(),[C,k]=t.useState(!1),j=t.useRef(!1),L=t.useCallback(()=>{if(C&&j.current)return;const w=C?"smooth":"instant";setTimeout(()=>{var I;(I=v.current)==null||I.scrollIntoView({behavior:w}),k(!0)})},[C]);t.useEffect(()=>{const w=A.current;if(!w)return;const I=()=>{j.current=!0};return w.addEventListener("wheel",I),()=>w.removeEventListener("wheel",I)},[]),t.useEffect(()=>{j.current=!1},[e.length]);const H=t.useMemo(()=>{for(let w=e.length-1;w>=0;w--){const I=e[w];if(I.role==="assistant"&&I.sql)return w}return-1},[e]),F=t.useRef(H>=0?H:-1),[_,S]=t.useState(H>=0?new Set([H]):new Set);t.useEffect(()=>{H>=0&&H!==F.current&&(S(w=>new Set([...w,H])),F.current=H)},[H]);const m=w=>w>=1e3?`${(w/1e3).toFixed(1)}K`:w.toString(),Z=t.useMemo(()=>e.reduce((w,I)=>{var oe;return w+(I.hideFromUI?0:(((oe=I.operationHistory)==null?void 0:oe.length)??0)+(I.error||I.content?1:0))},0),[e]),D=t.useMemo(()=>{var w,I;return y?((I=(w=e[e.length-1])==null?void 0:w.content)==null?void 0:I.length)??0:0},[e,y]);t.useEffect(()=>{L()},[Z,D]);const R=[];e.forEach((w,I)=>{w.hideFromUI||R.push({message:w,originalIndex:I})});const X=R.length>0?R[R.length-1].originalIndex:-1,ke=t.useMemo(()=>{for(let w=e.length-1;w>=0;w--)if(e[w].role==="assistant"&&!e[w].hideFromUI)return w;return-1},[e]),ve=w=>{for(let I=w+1;I<e.length;I++)if(e[I].role==="user"&&!e[I].hideFromUI)return!0;return!1};return r.jsxs(xi,{ref:A,$scrolled:C,"data-hook":"chat-messages-container",children:[R.map(({message:w,originalIndex:I})=>{var E,ze;const oe=`${w.id}`,ge=Xe(w.sql||"")===Xe(b||"");if(w.role==="user"){const ee=w.displayType,$=w.sql;if(ee&&(ee==="fix_request"||ee==="explain_request"||ee==="schema_explain_request")){const N=Yi(ee);let Q=null;if(ee==="schema_explain_request"&&w.displaySchemaData){const z=w.displaySchemaData;Q=r.jsx(Et,{children:r.jsxs(Ei,{children:[r.jsx(zt,{kind:z.kind,partitionBy:z.partitionBy,walEnabled:z.walEnabled,designatedTimestamp:z.designatedTimestamp}),r.jsx(ji,{children:z.tableName})]})})}else $&&(Q=r.jsx(Et,{children:r.jsx(Un,{"data-hook":"user-request-sql-editor",children:r.jsx(De,{value:$,maxHeight:216,onOpenInEditor:()=>l({type:"code",value:$},ge)})})}));return r.jsxs(Pn,{"data-hook":"chat-message-user",children:[r.jsxs(bi,{children:[r.jsx(wi,{children:r.jsx(ki,{src:N==null?void 0:N.icon,alt:N==null?void 0:N.title})}),r.jsx(vi,{children:N==null?void 0:N.title})]}),(N==null?void 0:N.description)&&r.jsx(Ai,{children:r.jsx(Mi,{children:N.description})}),Q]},oe)}if(ee==="ask_request"&&$){const N=w.displayUserMessage||w.content;return r.jsxs(Pn,{"data-hook":"chat-message-user",children:[r.jsx(Ci,{children:r.jsx(Kn,{children:N})}),r.jsx(Et,{children:r.jsx(Un,{"data-hook":"user-request-sql-editor",children:r.jsx(De,{value:$,maxHeight:216,onOpenInEditor:()=>l({type:"code",value:$},ge)})})})]},oe)}return r.jsx(yi,{"data-hook":"chat-message-user",children:r.jsx(Kn,{children:w.content})},oe)}else{const ee=w.explanation||w.content,$=w.tokenUsage;let N=null;$&&typeof $.inputTokens=="number"&&typeof $.outputTokens=="number"&&(N=r.jsxs(r.Fragment,{children:[r.jsx("span",{style:{fontWeight:600},children:m($.inputTokens)})," ","input /"," ",r.jsx("span",{style:{fontWeight:600},children:m($.outputTokens)})," ","output tokens"]}));const Q=!!w.sql,z=_.has(I),he=w.isAccepted===!0,ae=w.isRejected===!0,T=Q&&!he&&!ae&&ve(I),Ze=I===X,Ie=y&&Ze,te=Q&&!he&&!ae&&!T&&Ze;let Ae="neutral";if(w.sql){const W=Xe(w.sql);if(d===Rt.AI_SUGGESTION&&h&&Xe(h.query)===W)Ae="loading";else if(g){const Y=ka(W,u),pe=(E=g[Y])==null?void 0:E.latest;pe&&(pe.type===mt.ERROR?Ae="error":(pe.type===mt.SUCCESS||pe.type===mt.INFO)&&(Ae="success"))}}const Re=gt(w.previousSQL),Te=gt(w.sql),Le=(ze=w.operationHistory)==null?void 0:ze.filter(W=>W.type!==xe.Aborted),Be=!!w.error,at=Be&&!y&&!c&&Ze,rt=I===ke&&c===!0,Oe=!!Le&&Le.length>0;return r.jsxs(Hi,{$hasOperationHistory:Oe,"data-hook":"chat-message-assistant",children:[Oe&&r.jsxs(r.Fragment,{children:[r.jsx(Li,{}),r.jsx(Ni,{$trimBottom:!w.content,children:r.jsx(vr,{operationHistory:Le,status:M,isLive:rt,onScrollNeeded:L,collapsed:!!w.content||!!w.error,responseStart:w.responseStart})})]}),w.content&&r.jsxs(r.Fragment,{children:[r.jsxs(_i,{"data-hook":"assistant-header",children:[r.jsx(Qe,{size:20,variant:"filled"}),r.jsx(Vi,{children:"Assistant"}),N&&r.jsxs(Zi,{className:"token-display",children:[r.jsx(tn,{size:"16px",color:x.color.gray2}),r.jsx(ye,{size:"sm",color:"gray2",children:N})]})]}),r.jsxs(Ii,{children:[r.jsx(mi,{content:ee,messageId:w.id,onOpenInEditor:l}),Ie&&r.jsx(qi,{"data-hook":"streaming-cursor"}),Q&&!Ie&&r.jsxs(Ri,{"data-hook":"inline-diff-container",children:[r.jsxs(Ti,{$isExpanded:z,children:[r.jsxs(Bi,{children:[r.jsx(en,{size:22,color:"#BDBDBD"}),r.jsx(Oi,{children:"Suggested change"})]}),(he||ae||T)&&r.jsxs(Wi,{$isAccepted:he,$isRejected:ae,$isRejectedWithFollowUp:T,"data-hook":ae?"diff-status-rejected":T?"diff-status-followed-up":"diff-status-accepted",children:[r.jsx(Pi,{$isAccepted:he,$isRejected:ae,$isRejectedWithFollowUp:T,children:ae?r.jsx(va,{size:"14px"}):T?r.jsx(Kt,{size:"14px"}):r.jsx(Aa,{size:"14px"})}),ae?"Rejected":T?"Followed up":"Accepted"]}),r.jsxs($i,{children:[r.jsx(jt,{onClick:W=>{W.stopPropagation(),w.sql&&i&&i(w.sql)},title:"Run this query","data-hook":"message-action-run-sql",children:Ji(Ae)}),!te&&o&&!(I===H&&he)&&!ge&&r.jsx(jt,{onClick:W=>{W.stopPropagation(),w.id&&w.sql&&!c&&o(w.id,w.sql)},title:"Apply to editor",disabled:c,style:{opacity:c?.5:1,cursor:c?"not-allowed":"pointer"},"data-hook":"message-action-apply",children:r.jsx(nn,{size:22,color:"#BDBDBD"})}),r.jsx(Ui,{title:"Expand diff view","data-hook":"diff-expand-button",onClick:()=>{S(W=>{const Y=new Set(W);return Y.has(I)?Y.delete(I):Y.add(I),Y})},children:r.jsx(Ma,{})})]})]}),z&&r.jsxs(r.Fragment,{children:[r.jsx(Ki,{children:r.jsx(De,{diffEditor:!0,original:Re,modified:Te,maxHeight:300,onOpenInEditor:()=>l({type:"diff",original:Re??"",modified:Te??""}),handleScrollNeeded:L})}),te&&r.jsxs(Qi,{align:"center",justifyContent:"center",children:[a&&w.id&&r.jsx(Xi,{onClick:()=>a(w.id),"data-hook":"message-action-reject",children:"Reject"}),n&&w.id&&r.jsx(Gi,{onClick:()=>n(w.id),"data-hook":"message-action-accept",children:"Accept"})]})]})]})]})]}),Be&&r.jsxs(Fi,{"data-hook":"chat-message-error",children:[r.jsx(St,{size:16,color:x.color.red,style:{flexShrink:0}}),w.error,at&&s&&r.jsx(Si,{size:"sm",skin:"secondary",prefixIcon:r.jsx(Pt,{size:12}),onClick:()=>{const W=e.slice(0,I).findLastIndex(Y=>Y.role==="user");W>=0&&s(e[W].id,w.id)},"data-hook":"retry-button",children:"Retry"})]})]},oe)}}),r.jsx(zi,{ref:v,"data-hook":"messages-end"})]})},t1=p(q).withConfig({displayName:"ChatInput__InputContainer"})([`
|
|
655
|
+
display: flex;
|
|
656
|
+
flex-direction: column;
|
|
657
|
+
align-items: stretch;
|
|
658
|
+
gap: 0.8rem;
|
|
659
|
+
padding: 1rem 1.2rem;
|
|
660
|
+
flex-shrink: 0;
|
|
661
|
+
width: 100%;
|
|
662
|
+
margin-top: auto;
|
|
663
|
+
border-top: 1px solid `,`;
|
|
664
|
+
`],f("selection")),n1=p(q).withConfig({displayName:"ChatInput__InputWrapper"})([`
|
|
665
|
+
display: flex;
|
|
666
|
+
position: relative;
|
|
667
|
+
width: 100%;
|
|
668
|
+
overflow: hidden;
|
|
669
|
+
`]),a1=p.textarea.withConfig({displayName:"ChatInput__StyledTextArea"})([`
|
|
670
|
+
flex: 1;
|
|
671
|
+
min-height: 8rem;
|
|
672
|
+
max-height: 30rem;
|
|
673
|
+
line-height: 1.3;
|
|
674
|
+
padding: `,`;
|
|
675
|
+
background: `,`;
|
|
676
|
+
border: 1px solid `,`;
|
|
677
|
+
border-radius: 0.6rem;
|
|
678
|
+
color: `,`;
|
|
679
|
+
font-size: 1.4rem;
|
|
680
|
+
font-family: `,`;
|
|
681
|
+
resize: none;
|
|
682
|
+
outline: none;
|
|
683
|
+
|
|
684
|
+
&:focus {
|
|
685
|
+
border-color: `,`;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
&::placeholder {
|
|
689
|
+
color: `,`;
|
|
690
|
+
}
|
|
691
|
+
|
|
692
|
+
&:disabled {
|
|
693
|
+
opacity: 0.5;
|
|
694
|
+
}
|
|
695
|
+
`],({$hasContext:e})=>e?"4.4rem 4.5rem 1.2rem 1.2rem":"1.2rem 4.5rem 1.2rem 1.2rem",f("backgroundDarker"),f("selection"),f("foreground"),({theme:e})=>e.font,f("pinkDarker"),f("gray2")),r1=p.button.withConfig({displayName:"ChatInput__ActionButton"})([`
|
|
696
|
+
position: absolute;
|
|
697
|
+
right: 0.8rem;
|
|
698
|
+
bottom: 0.8rem;
|
|
699
|
+
padding: 0.6rem;
|
|
700
|
+
border: none;
|
|
701
|
+
display: flex;
|
|
702
|
+
align-items: center;
|
|
703
|
+
justify-content: center;
|
|
704
|
+
border-radius: 0.4rem;
|
|
705
|
+
cursor: pointer;
|
|
706
|
+
`]),i1=p.div.withConfig({displayName:"ChatInput__ContextBadgeContainer"})([`
|
|
707
|
+
position: absolute;
|
|
708
|
+
padding: 0.8rem;
|
|
709
|
+
top: 2px;
|
|
710
|
+
border-radius: 0.6rem;
|
|
711
|
+
left: 1px;
|
|
712
|
+
width: calc(100% - 0.2rem);
|
|
713
|
+
display: inline-flex;
|
|
714
|
+
background: `,`;
|
|
715
|
+
`],f("backgroundDarker")),o1=p.div.withConfig({displayName:"ChatInput__ContextBadge"})([`
|
|
716
|
+
display: flex;
|
|
717
|
+
padding: 0.3rem 0.6rem;
|
|
718
|
+
align-items: center;
|
|
719
|
+
gap: 0.4rem;
|
|
720
|
+
line-height: 1.4;
|
|
721
|
+
border-radius: 0.6rem;
|
|
722
|
+
border: 1px solid `,`;
|
|
723
|
+
background: `,`;
|
|
724
|
+
color: `,`;
|
|
725
|
+
font-size: 1.3rem;
|
|
726
|
+
user-select: none;
|
|
727
|
+
|
|
728
|
+
`,`
|
|
729
|
+
`],f("selection"),f("chatBackground"),f("gray2"),({$type:e})=>e==="sql"&&K([`
|
|
730
|
+
cursor: pointer;
|
|
731
|
+
|
|
732
|
+
&:hover {
|
|
733
|
+
border: 1px solid `,`;
|
|
734
|
+
color: `,`;
|
|
735
|
+
}
|
|
736
|
+
`],f("offWhite"),f("offWhite"))),s1=p.div.withConfig({displayName:"ChatInput__ContextBadgeIcon"})([`
|
|
737
|
+
display: flex;
|
|
738
|
+
align-items: center;
|
|
739
|
+
color: `,`;
|
|
740
|
+
flex-shrink: 0;
|
|
741
|
+
|
|
742
|
+
svg {
|
|
743
|
+
color: `,`;
|
|
744
|
+
}
|
|
745
|
+
`],f("gray2"),f("gray2")),l1=p(r1).withConfig({displayName:"ChatInput__SendButton"})([`
|
|
746
|
+
background: `,`;
|
|
747
|
+
color: `,`;
|
|
748
|
+
|
|
749
|
+
&:hover:not(:disabled) {
|
|
750
|
+
background: `,`;
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
&:disabled {
|
|
754
|
+
opacity: 0.5;
|
|
755
|
+
cursor: not-allowed;
|
|
756
|
+
}
|
|
757
|
+
`],f("pinkDarker"),f("foreground"),f("pink")),c1=p.div.withConfig({displayName:"ChatInput__ThoughtStream"})([`
|
|
758
|
+
display: flex;
|
|
759
|
+
position: relative;
|
|
760
|
+
width: 100%;
|
|
761
|
+
background: `,`;
|
|
762
|
+
border: 1px solid transparent;
|
|
763
|
+
background:
|
|
764
|
+
linear-gradient(`,", ",`)
|
|
765
|
+
padding-box,
|
|
766
|
+
`,` border-box;
|
|
767
|
+
border-radius: 0.6rem;
|
|
768
|
+
height: 4rem;
|
|
769
|
+
`],f("backgroundDarker"),f("backgroundDarker"),f("backgroundDarker"),Za),d1=p.div.withConfig({displayName:"ChatInput__ThoughtStreamContent"})([`
|
|
770
|
+
display: flex;
|
|
771
|
+
align-items: center;
|
|
772
|
+
background: `,`;
|
|
773
|
+
gap: 0.8rem;
|
|
774
|
+
width: 100%;
|
|
775
|
+
height: 100%;
|
|
776
|
+
border-radius: 0.6rem;
|
|
777
|
+
padding: 0 1.2rem;
|
|
778
|
+
padding-right: 4.5rem;
|
|
779
|
+
`],f("backgroundDarker")),h1=p.div.withConfig({displayName:"ChatInput__ThoughtText"})([`
|
|
780
|
+
font-weight: 500;
|
|
781
|
+
font-size: 1.4rem;
|
|
782
|
+
color: `,`;
|
|
783
|
+
`,`
|
|
784
|
+
`],f("gray2"),Dt),u1=p.button.withConfig({displayName:"ChatInput__StopButton"})([`
|
|
785
|
+
position: absolute;
|
|
786
|
+
right: 0.8rem;
|
|
787
|
+
top: 50%;
|
|
788
|
+
transform: translateY(-50%);
|
|
789
|
+
width: 2.6rem;
|
|
790
|
+
height: 2.6rem;
|
|
791
|
+
border-radius: 50%;
|
|
792
|
+
border: none;
|
|
793
|
+
display: flex;
|
|
794
|
+
align-items: center;
|
|
795
|
+
justify-content: center;
|
|
796
|
+
cursor: pointer;
|
|
797
|
+
transition: all 0.15s ease;
|
|
798
|
+
background: #da152832;
|
|
799
|
+
color: #da1e28;
|
|
800
|
+
|
|
801
|
+
&:hover {
|
|
802
|
+
background: `,`;
|
|
803
|
+
color: `,`;
|
|
804
|
+
}
|
|
805
|
+
`],f("red"),f("foreground")),Qn=(e,n=30)=>{if(!e)return"";const a=e.trim().replace(/\s+/g," ");return a.length<=n?a:a.slice(0,n)+"..."},m1=e=>{switch(e){case"T":return"table";case"M":return"matview";case"V":return"view";default:return"table"}},g1=t.forwardRef(({onSend:e,disabled:n=!1,placeholder:a="Ask a question or request a refinement...",contextSQL:i,contextTableId:l,onContextClick:o},s)=>{const[d,h]=t.useState(""),g=t.useRef(null),u=ce(se.query.getTables),c=t.useMemo(()=>l==null?null:u.find(H=>H.id===l)??null,[l,u]),b=c!=null&&c.table_name?Qn(c.table_name):i?Qn(i):null,y=!!b;t.useImperativeHandle(s,()=>({focus:()=>{var H;(H=g.current)==null||H.focus()}}));const{status:x,abortOperation:v}=Ee(),A=le(x);t.useEffect(()=>{g.current&&(g.current.style.height="auto",g.current.style.height=`${g.current.scrollHeight}px`)},[d]);const M=()=>{const H=d.trim();H&&!n&&!A&&(e(H),h(""),g.current&&(g.current.style.height="auto"))},C=H=>{H.key==="Enter"&&!H.shiftKey&&(H.preventDefault(),M())},k=()=>{c||o()},j=()=>{v()},L=A;return r.jsxs(t1,{children:[L?r.jsxs(c1,{"data-hook":"chat-assistant-modes",children:[r.jsxs(d1,{children:[r.jsx(ct,{size:20}),r.jsx(h1,{children:x})]}),r.jsx(u1,{onClick:j,title:"Stop generation","data-hook":"chat-stop-button",children:r.jsx(Va,{size:"14px"})})]}):r.jsxs(n1,{children:[y&&r.jsx(i1,{children:r.jsxs(o1,{role:"presentation",onClick:k,$type:c?"table":"sql","data-hook":"chat-context-badge",children:[r.jsx(s1,{children:c?r.jsx(zt,{kind:m1(c.table_type??"T"),partitionBy:c.partitionBy,walEnabled:c.walEnabled,designatedTimestamp:c.designatedTimestamp}):r.jsx(Jt,{size:14,weight:"regular"})}),b]})}),r.jsx(a1,{ref:g,value:d,onChange:H=>h(H.target.value),onKeyDown:C,placeholder:a,disabled:n,rows:1,$hasContext:y,"data-hook":"chat-input-textarea"}),r.jsx(l1,{onClick:M,disabled:!d.trim()||n,title:"Send (Enter) \u2022 New line (Shift+Enter)","data-hook":"chat-send-button",children:r.jsx(Ut,{size:20,weight:"bold"})})]}),r.jsx(ye,{color:"gray2",size:"sm",align:"center",children:"Chats are connected to a single query to improve responses."})]})}),Gn=p.button.withConfig({displayName:"ChatHistoryItem__Container"})([`
|
|
806
|
+
display: flex;
|
|
807
|
+
align-items: center;
|
|
808
|
+
gap: 0.6rem;
|
|
809
|
+
padding: 0.4rem 0.8rem;
|
|
810
|
+
border-radius: 4px;
|
|
811
|
+
cursor: `,`;
|
|
812
|
+
background: `,`;
|
|
813
|
+
opacity: `,`;
|
|
814
|
+
border: 0;
|
|
815
|
+
width: 100%;
|
|
816
|
+
text-align: left;
|
|
817
|
+
|
|
818
|
+
&:hover {
|
|
819
|
+
background: `,`;
|
|
820
|
+
|
|
821
|
+
.chat-title {
|
|
822
|
+
color: `,`;
|
|
823
|
+
}
|
|
824
|
+
}
|
|
825
|
+
`],({disabled:e})=>e?"not-allowed":"pointer",f("transparent"),({disabled:e})=>e?.5:1,({disabled:e})=>e?"transparent":f("selection"),({disabled:e})=>e?f("offWhite"):f("foreground")),p1=p.div.withConfig({displayName:"ChatHistoryItem__IconWrapper"})([`
|
|
826
|
+
display: flex;
|
|
827
|
+
align-items: center;
|
|
828
|
+
justify-content: center;
|
|
829
|
+
flex-shrink: 0;
|
|
830
|
+
color: `,`;
|
|
831
|
+
`],f("gray2")),f1=p.div.withConfig({displayName:"ChatHistoryItem__Content"})([`
|
|
832
|
+
display: flex;
|
|
833
|
+
flex-direction: column;
|
|
834
|
+
flex: 1;
|
|
835
|
+
min-width: 0;
|
|
836
|
+
padding-left: 0.4rem;
|
|
837
|
+
`]),x1=p.div.attrs({className:"chat-title"}).withConfig({displayName:"ChatHistoryItem__Title"})([`
|
|
838
|
+
padding: 0.2rem 0.4rem;
|
|
839
|
+
border: 1px solid transparent;
|
|
840
|
+
color: `,`;
|
|
841
|
+
white-space: nowrap;
|
|
842
|
+
overflow: hidden;
|
|
843
|
+
text-overflow: ellipsis;
|
|
844
|
+
transform: translateX(-0.4rem);
|
|
845
|
+
`],f("offWhite")),y1=p.input.withConfig({displayName:"ChatHistoryItem__TitleInput"})([`
|
|
846
|
+
color: `,`;
|
|
847
|
+
background: transparent;
|
|
848
|
+
border: 1px solid `,`;
|
|
849
|
+
border-radius: 6px;
|
|
850
|
+
outline: none;
|
|
851
|
+
padding: 0.2rem 0.4rem;
|
|
852
|
+
font-family: inherit;
|
|
853
|
+
transform: translateX(-0.4rem);
|
|
854
|
+
|
|
855
|
+
&:focus {
|
|
856
|
+
outline: none;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
&::selection {
|
|
860
|
+
background: `,`;
|
|
861
|
+
}
|
|
862
|
+
&::-moz-selection {
|
|
863
|
+
background: `,`;
|
|
864
|
+
}
|
|
865
|
+
&::-webkit-selection {
|
|
866
|
+
background: `,`;
|
|
867
|
+
}
|
|
868
|
+
`],f("foreground"),f("pinkDarker"),f("pinkPrimary"),f("pinkPrimary"),f("pinkPrimary")),C1=p.div.withConfig({displayName:"ChatHistoryItem__Subtitle"})([`
|
|
869
|
+
font-size: 1.2rem;
|
|
870
|
+
line-height: 1.5;
|
|
871
|
+
color: `,`;
|
|
872
|
+
white-space: nowrap;
|
|
873
|
+
overflow: hidden;
|
|
874
|
+
text-overflow: ellipsis;
|
|
875
|
+
`],f("gray2")),b1=p.div.withConfig({displayName:"ChatHistoryItem__ActionsContainer"})([`
|
|
876
|
+
display: flex;
|
|
877
|
+
align-items: center;
|
|
878
|
+
gap: 0.4rem;
|
|
879
|
+
flex-shrink: 0;
|
|
880
|
+
`]),Xn=p.button.withConfig({displayName:"ChatHistoryItem__ActionButton"})([`
|
|
881
|
+
display: flex;
|
|
882
|
+
align-items: center;
|
|
883
|
+
justify-content: center;
|
|
884
|
+
padding: 0.4rem;
|
|
885
|
+
background: transparent;
|
|
886
|
+
border: none;
|
|
887
|
+
border-radius: 4px;
|
|
888
|
+
cursor: pointer;
|
|
889
|
+
color: `,`;
|
|
890
|
+
opacity: 0;
|
|
891
|
+
|
|
892
|
+
`,`:hover & {
|
|
893
|
+
opacity: 1;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
&:hover {
|
|
897
|
+
background: `,`;
|
|
898
|
+
}
|
|
899
|
+
`],f("foreground"),Gn,f("backgroundDarker")),w1=p.span.withConfig({displayName:"ChatHistoryItem__CurrentIndicator"})([`
|
|
900
|
+
font-size: 1.2rem;
|
|
901
|
+
line-height: 1.5rem;
|
|
902
|
+
color: #9ca3af;
|
|
903
|
+
white-space: nowrap;
|
|
904
|
+
`]),k1=({conversation:e,subtitle:n,isCurrent:a,hasOngoingProcess:i,disabled:l,onSelect:o,onRename:s,onDelete:d})=>{const[h,g]=t.useState(!1),[u,c]=t.useState(e.conversationName),b=t.useRef(null);t.useEffect(()=>{h&&b.current&&(b.current.focus(),b.current.select())},[h]);const y=k=>{k.stopPropagation(),c(e.conversationName),g(!0)},x=k=>{k.stopPropagation(),d(e.id)},v=async()=>{const k=u.trim();k&&k!==e.conversationName&&await s(e.id,k),g(!1)},A=async k=>{k.key==="Enter"?await v():k.key==="Escape"&&(c(e.conversationName),g(!1))},M=async()=>{await v()},C=async()=>{!h&&!l&&await o(e.id)};return r.jsxs(Gn,{onClick:C,disabled:l,"data-hook":"chat-history-item",children:[r.jsx(p1,{children:r.jsx(Qt,{size:18})}),r.jsxs(f1,{children:[h?r.jsx(y1,{ref:b,value:u,onChange:k=>c(k.target.value),onKeyDown:A,onBlur:M,onClick:k=>k.stopPropagation(),"data-hook":"chat-history-rename"}):r.jsx(x1,{"data-hook":"chat-history-title",children:e.conversationName}),n&&r.jsx(C1,{children:n})]}),r.jsxs(b1,{children:[!h&&r.jsxs(r.Fragment,{children:[r.jsx(Xn,{onClick:y,title:"Edit title","data-hook":"chat-history-edit",children:r.jsx(rn,{size:18})}),!i&&r.jsx(Xn,{onClick:x,title:"Delete","data-hook":"chat-history-delete",children:r.jsx(ln,{size:18})})]}),a&&r.jsx(w1,{children:"Current"})]})]})},v1=p.div.withConfig({displayName:"DateSeparator__Container"})([`
|
|
905
|
+
display: flex;
|
|
906
|
+
align-items: center;
|
|
907
|
+
gap: 1rem;
|
|
908
|
+
padding: 0.4rem 0;
|
|
909
|
+
width: 100%;
|
|
910
|
+
`]),Yn=p.div.withConfig({displayName:"DateSeparator__Line"})([`
|
|
911
|
+
flex: 1;
|
|
912
|
+
height: 1px;
|
|
913
|
+
background: `,`;
|
|
914
|
+
`],f("selection")),A1=p.div.withConfig({displayName:"DateSeparator__LabelContainer"})([`
|
|
915
|
+
display: flex;
|
|
916
|
+
align-items: center;
|
|
917
|
+
gap: 0.8rem;
|
|
918
|
+
color: `,`;
|
|
919
|
+
`],f("gray2")),M1=p.span.withConfig({displayName:"DateSeparator__Label"})([`
|
|
920
|
+
font-size: 1.3rem;
|
|
921
|
+
letter-spacing: 0.016rem;
|
|
922
|
+
white-space: nowrap;
|
|
923
|
+
`]),E1=({label:e})=>r.jsxs(v1,{children:[r.jsx(Yn,{}),r.jsxs(A1,{children:[r.jsx(Xt,{size:16}),r.jsx(M1,{children:e})]}),r.jsx(Yn,{})]}),j1=6e4;function Jn(e){const n=Ia(),a=Na(n);return La(e,new Date().getTime(),{locale:a})+" ago"}function H1(e){const n=[...e].sort((o,s)=>s.updatedAt-o.updatedAt),a=new Map;for(const o of n){const s=Jn(o.updatedAt),d=a.get(s)||[];a.set(s,[...d,o])}const i=[],l=new Set;for(const o of n){const s=Jn(o.updatedAt);l.has(s)||(l.add(s),i.push({label:s,conversations:a.get(s)||[]}))}return i}function _1(e){const[n,a]=t.useState(0);return t.useEffect(()=>{const i=setInterval(()=>{a(l=>l+1)},j1);return()=>clearInterval(i)},[]),t.useMemo(()=>H1(e),[e,n])}function V1(e,n){if(!n.trim())return e;const a=n.toLowerCase().trim();return e.filter(i=>i.conversationName.toLowerCase().includes(a))}const ea=p.div.withConfig({displayName:"ChatHistoryView__Container"})([`
|
|
924
|
+
display: flex;
|
|
925
|
+
flex-direction: column;
|
|
926
|
+
height: 100%;
|
|
927
|
+
width: 100%;
|
|
928
|
+
padding: 2rem 1rem 4rem 1rem;
|
|
929
|
+
background: `,`;
|
|
930
|
+
overflow: hidden;
|
|
931
|
+
`],f("chatBackground")),Z1=p.div.withConfig({displayName:"ChatHistoryView__SearchContainer"})([`
|
|
932
|
+
position: relative;
|
|
933
|
+
display: flex;
|
|
934
|
+
align-items: center;
|
|
935
|
+
flex-shrink: 0;
|
|
936
|
+
`]),I1=p.div.withConfig({displayName:"ChatHistoryView__SearchIcon"})([`
|
|
937
|
+
position: absolute;
|
|
938
|
+
left: 1.2rem;
|
|
939
|
+
display: flex;
|
|
940
|
+
align-items: center;
|
|
941
|
+
color: `,`;
|
|
942
|
+
pointer-events: none;
|
|
943
|
+
z-index: 1;
|
|
944
|
+
`],f("gray2")),L1=p.button.withConfig({displayName:"ChatHistoryView__ClearButton"})([`
|
|
945
|
+
position: absolute;
|
|
946
|
+
right: 0.8rem;
|
|
947
|
+
display: flex;
|
|
948
|
+
align-items: center;
|
|
949
|
+
justify-content: center;
|
|
950
|
+
padding: 0.2rem;
|
|
951
|
+
background: transparent;
|
|
952
|
+
border: none;
|
|
953
|
+
border-radius: 4px;
|
|
954
|
+
cursor: pointer;
|
|
955
|
+
color: `,`;
|
|
956
|
+
|
|
957
|
+
&:hover {
|
|
958
|
+
color: `,`;
|
|
959
|
+
}
|
|
960
|
+
`],f("gray2"),f("foreground")),N1=p(Da).withConfig({displayName:"ChatHistoryView__SearchInput"})([`
|
|
961
|
+
width: 100%;
|
|
962
|
+
background: transparent;
|
|
963
|
+
color: `,`;
|
|
964
|
+
padding: 0.8rem 3.6rem 0.8rem 3.6rem;
|
|
965
|
+
border: 1px solid `,`4d;
|
|
966
|
+
height: 3rem;
|
|
967
|
+
border-radius: 0.6rem;
|
|
968
|
+
|
|
969
|
+
&:focus {
|
|
970
|
+
background: transparent;
|
|
971
|
+
border-color: `,`;
|
|
972
|
+
}
|
|
973
|
+
`],f("foreground"),f("gray2"),f("pinkDarker")),F1=p.div.withConfig({displayName:"ChatHistoryView__ListContainer"})([`
|
|
974
|
+
display: flex;
|
|
975
|
+
flex-direction: column;
|
|
976
|
+
gap: 0.6rem;
|
|
977
|
+
padding: 2rem 0.4rem;
|
|
978
|
+
overflow-y: auto;
|
|
979
|
+
flex: 1;
|
|
980
|
+
min-height: 0;
|
|
981
|
+
`]),ta=p.div.withConfig({displayName:"ChatHistoryView__EmptyState"})([`
|
|
982
|
+
display: flex;
|
|
983
|
+
flex-direction: column;
|
|
984
|
+
align-items: center;
|
|
985
|
+
justify-content: center;
|
|
986
|
+
flex: 1;
|
|
987
|
+
color: `,`;
|
|
988
|
+
font-size: 1.3rem;
|
|
989
|
+
text-align: center;
|
|
990
|
+
padding: 2rem;
|
|
991
|
+
`],f("gray2")),S1=p(_e.Content).withConfig({displayName:"ChatHistoryView__AlertDialogContent"})([`
|
|
992
|
+
background: `,`;
|
|
993
|
+
`],f("chatBackground")),D1=p.div.withConfig({displayName:"ChatHistoryView__DialogHeader"})([`
|
|
994
|
+
display: flex;
|
|
995
|
+
align-items: center;
|
|
996
|
+
justify-content: space-between;
|
|
997
|
+
padding: 1.5rem 2rem;
|
|
998
|
+
border-bottom: 1px solid `,`;
|
|
999
|
+
`],f("selection")),q1=p.h3.withConfig({displayName:"ChatHistoryView__DialogTitle"})([`
|
|
1000
|
+
margin: 0;
|
|
1001
|
+
font-weight: 500;
|
|
1002
|
+
color: `,`;
|
|
1003
|
+
`],f("foreground")),z1=p.p.withConfig({displayName:"ChatHistoryView__DialogDescription"})([`
|
|
1004
|
+
margin: 2rem;
|
|
1005
|
+
font-size: 1.4rem;
|
|
1006
|
+
line-height: 1.5;
|
|
1007
|
+
`]),R1=p.div.withConfig({displayName:"ChatHistoryView__DialogButtons"})([`
|
|
1008
|
+
display: flex;
|
|
1009
|
+
justify-content: flex-end;
|
|
1010
|
+
gap: 1rem;
|
|
1011
|
+
padding: 0 2rem 0 2rem;
|
|
1012
|
+
`]),T1=p(re).attrs({skin:"secondary"}).withConfig({displayName:"ChatHistoryView__CancelButton"})([""]),B1=p(re).withConfig({displayName:"ChatHistoryView__DeleteButton"})([`
|
|
1013
|
+
background: `,`;
|
|
1014
|
+
border-color: `,`;
|
|
1015
|
+
|
|
1016
|
+
&:hover:not(:disabled) {
|
|
1017
|
+
background: `,`;
|
|
1018
|
+
filter: brightness(1.1);
|
|
1019
|
+
}
|
|
1020
|
+
`],f("red"),f("red"),f("red")),O1=({currentConversationId:e})=>{const[n,a]=t.useState(""),[i,l]=t.useState(!1),[o,s]=t.useState(null),d=t.useRef(null),{conversationMetas:h,chatWindowState:g,openChatWindow:u,updateConversationName:c,deleteConversation:b}=Ke(),{status:y}=Ee(),{buffers:x}=lt(),v=ce(se.query.getTables),A=t.useMemo(()=>Array.from(h.values()),[h]),M=t.useMemo(()=>V1(A,n),[A,n]),C=_1(M),k=(S,m)=>{if(S){if(m==="buffer"){const Z=x.find(D=>D.id===S);if(Z)return Z.label}else if(m==="table"){const Z=v.find(D=>D.id===S);if(Z)return Z.table_name}}},j=async S=>{await u(S)},L=async(S,m)=>{await c(S,m)},H=S=>{s(S),l(!0)},F=async()=>{o&&await b(o),l(!1),s(null)},_=()=>{l(!1),s(null)};return t.useEffect(()=>{d.current&&d.current.scrollIntoView({block:"center"})},[]),A.length===0?r.jsx(ea,{children:r.jsx(ta,{"data-hook":"chat-history-empty",children:"No conversations yet"})}):r.jsxs(ea,{children:[r.jsxs(Z1,{children:[r.jsx(I1,{children:r.jsx(an,{size:18})}),r.jsx(N1,{type:"text",placeholder:"Search chats",value:n,onChange:S=>a(S.target.value),onKeyDown:S=>{S.key==="Escape"&&n&&a("")},"data-hook":"chat-history-search"}),n&&r.jsx(L1,{onClick:()=>a(""),title:"Clear search",children:r.jsx(Tt,{size:16})})]}),r.jsxs(F1,{"data-hook":"chat-history-list",children:[C.map((S,m)=>r.jsxs(ft.Fragment,{children:[m>0&&r.jsx(E1,{label:S.label}),S.conversations.map(Z=>{const D=Z.id===e;return r.jsx("div",{ref:D?d:void 0,children:r.jsx(k1,{conversation:Z,subtitle:Z.bufferId??Z.tableId?k(Z.bufferId??Z.tableId,Z.bufferId?"buffer":"table"):void 0,isCurrent:D,hasOngoingProcess:Z.id===g.activeConversationId&&le(y),disabled:le(y)&&Z.id!==g.activeConversationId,onSelect:j,onRename:L,onDelete:H})},Z.id)})]},S.label)),M.length===0&&n&&r.jsx(ta,{children:"No chats match your search"})]}),r.jsx(_e.Root,{open:i,onOpenChange:l,children:r.jsxs(_e.Portal,{children:[r.jsx(Fa,{children:r.jsx(Sa,{primitive:_e.Overlay})}),r.jsxs(S1,{maxwidth:"40rem",children:[r.jsx(D1,{children:r.jsx(q1,{children:"Delete conversation"})}),r.jsx(z1,{children:"Are you sure you want to delete this conversation? This action cannot be undone."}),r.jsxs(R1,{children:[r.jsx(_e.Cancel,{asChild:!0,children:r.jsx(T1,{onClick:_,children:"Cancel"})}),r.jsx(_e.Action,{asChild:!0,children:r.jsx(B1,{onClick:F,children:"Delete"})})]})]})]})})]})},$1=p.div.withConfig({displayName:"AIChatWindow__Container"})([`
|
|
1021
|
+
display: flex;
|
|
1022
|
+
flex-direction: column;
|
|
1023
|
+
height: 100%;
|
|
1024
|
+
width: 100%;
|
|
1025
|
+
overflow: hidden;
|
|
1026
|
+
background: `,`;
|
|
1027
|
+
border-left: 0.2rem `,` solid;
|
|
1028
|
+
`],f("chatBackground"),f("backgroundDarker")),W1=p.div.withConfig({displayName:"AIChatWindow__Header"})([`
|
|
1029
|
+
height: 46px;
|
|
1030
|
+
padding: 0 1.5rem;
|
|
1031
|
+
display: flex;
|
|
1032
|
+
align-items: center;
|
|
1033
|
+
justify-content: space-between;
|
|
1034
|
+
background: `,`;
|
|
1035
|
+
flex-shrink: 0;
|
|
1036
|
+
`],f("backgroundLighter")),P1=p.div.withConfig({displayName:"AIChatWindow__HeaderLeft"})([`
|
|
1037
|
+
display: flex;
|
|
1038
|
+
align-items: center;
|
|
1039
|
+
gap: 1rem;
|
|
1040
|
+
flex: 1;
|
|
1041
|
+
min-width: 0;
|
|
1042
|
+
overflow: hidden;
|
|
1043
|
+
`]),U1=p.span.withConfig({displayName:"AIChatWindow__HeaderTitle"})([`
|
|
1044
|
+
white-space: nowrap;
|
|
1045
|
+
overflow: hidden;
|
|
1046
|
+
text-overflow: ellipsis;
|
|
1047
|
+
font-size: 1.6rem;
|
|
1048
|
+
`]),Ht=p(re).attrs(({$active:e})=>({skin:"transparent",$active:e})).withConfig({displayName:"AIChatWindow__HeaderButton"})([`
|
|
1049
|
+
color: `,`;
|
|
1050
|
+
padding: 0.6rem;
|
|
1051
|
+
|
|
1052
|
+
`,`
|
|
1053
|
+
`],f("foreground"),({$active:e})=>e&&K([`
|
|
1054
|
+
background: `,`;
|
|
1055
|
+
`],f("selection"))),K1=p.div.withConfig({displayName:"AIChatWindow__HeaderRight"})([`
|
|
1056
|
+
display: flex;
|
|
1057
|
+
align-items: center;
|
|
1058
|
+
gap: 0.5rem;
|
|
1059
|
+
flex-shrink: 0;
|
|
1060
|
+
`]),Q1=p.div.withConfig({displayName:"AIChatWindow__ChatWindowContent"})([`
|
|
1061
|
+
display: flex;
|
|
1062
|
+
height: calc(100% - 46px);
|
|
1063
|
+
width: 100%;
|
|
1064
|
+
overflow: hidden;
|
|
1065
|
+
`]),G1=p.div.withConfig({displayName:"AIChatWindow__InitialQueryContainer"})([`
|
|
1066
|
+
display: flex;
|
|
1067
|
+
flex-direction: column;
|
|
1068
|
+
gap: 1rem;
|
|
1069
|
+
padding: 1.5rem;
|
|
1070
|
+
overflow-y: auto;
|
|
1071
|
+
flex: 1 1 auto;
|
|
1072
|
+
min-height: 0;
|
|
1073
|
+
width: 100%;
|
|
1074
|
+
`]),X1=p.div.withConfig({displayName:"AIChatWindow__InitialQueryBox"})([`
|
|
1075
|
+
display: flex;
|
|
1076
|
+
flex-direction: column;
|
|
1077
|
+
align-self: flex-end;
|
|
1078
|
+
flex-shrink: 0;
|
|
1079
|
+
overflow: hidden;
|
|
1080
|
+
width: 100%;
|
|
1081
|
+
`]),Y1=p.div.withConfig({displayName:"AIChatWindow__InitialQueryEditor"})([`
|
|
1082
|
+
width: 100%;
|
|
1083
|
+
overflow: hidden;
|
|
1084
|
+
`]),J1=p.div.withConfig({displayName:"AIChatWindow__ButtonContainer"})([`
|
|
1085
|
+
display: flex;
|
|
1086
|
+
justify-content: flex-start;
|
|
1087
|
+
align-items: center;
|
|
1088
|
+
gap: 1rem;
|
|
1089
|
+
width: 100%;
|
|
1090
|
+
margin-top: 0.5rem;
|
|
1091
|
+
`]),eo=p.div.withConfig({displayName:"AIChatWindow__BlankChatContainer"})([`
|
|
1092
|
+
display: flex;
|
|
1093
|
+
flex-direction: column;
|
|
1094
|
+
align-items: flex-start;
|
|
1095
|
+
justify-content: center;
|
|
1096
|
+
gap: 1.2rem;
|
|
1097
|
+
padding: 1.8rem;
|
|
1098
|
+
flex: 1 1 auto;
|
|
1099
|
+
min-height: 0;
|
|
1100
|
+
max-width: 40rem;
|
|
1101
|
+
text-align: center;
|
|
1102
|
+
margin: 0 auto;
|
|
1103
|
+
`]),to=p.h2.withConfig({displayName:"AIChatWindow__BlankChatHeading"})([`
|
|
1104
|
+
font-size: 2rem;
|
|
1105
|
+
font-weight: 600;
|
|
1106
|
+
text-align: left;
|
|
1107
|
+
color: `,`;
|
|
1108
|
+
margin: 0;
|
|
1109
|
+
`],f("foreground")),no=p.p.withConfig({displayName:"AIChatWindow__BlankChatSubheading"})([`
|
|
1110
|
+
font-size: 1.4rem;
|
|
1111
|
+
font-weight: 400;
|
|
1112
|
+
color: `,`;
|
|
1113
|
+
text-align: left;
|
|
1114
|
+
margin: 0;
|
|
1115
|
+
line-height: 1.5;
|
|
1116
|
+
`],f("gray2")),na=p(q).withConfig({displayName:"AIChatWindow__ChatPanel"})([`
|
|
1117
|
+
display: flex;
|
|
1118
|
+
flex-direction: column;
|
|
1119
|
+
align-items: stretch;
|
|
1120
|
+
height: 100%;
|
|
1121
|
+
width: 100%;
|
|
1122
|
+
gap: 0;
|
|
1123
|
+
`]),ao=()=>{const e=$a(),n=ce(se.console.getActiveSidebar),{quest:a}=t.useContext(st),{editorRef:i,showPreviewBuffer:l,closePreviewBuffer:o,executionRefs:s,highlightQuery:d}=lt(),{conversationMetas:h,activeConversationMessages:g,chatWindowState:u,isLoadingMessages:c,isStreaming:b,setIsStreaming:y,closeChatWindow:x,openBlankChatWindow:v,openHistoryView:A,closeHistoryView:M,getConversationMeta:C,addMessage:k,updateMessage:j,replaceConversationMessages:L,updateConversationName:H,acceptSuggestion:F,rejectSuggestion:_,persistMessages:S}=Ke(),{status:m,setStatus:Z,abortController:D,canUse:R,hasSchemaAccess:X,currentModel:ke,apiKey:ve}=Ee(),w=ce(se.query.getTables),I=ce(se.query.getRunning),oe=ce(se.query.getAISuggestionRequest),ge=u.activeConversationId?C(u.activeConversationId):null,E=t.useMemo(()=>ge?{...ge,messages:g}:null,[ge,g]),ze=E==null?void 0:E.bufferId,ee=ce(se.query.getQueryNotificationsForBuffer(ze??-1)),$=t.useRef(null),N=t.useMemo(()=>gt(E==null?void 0:E.currentSQL),[E]),Q=t.useMemo(()=>qa(E==null?void 0:E.queryKey),[E==null?void 0:E.queryKey]),z=g,he=t.useMemo(()=>za(z),[z]),ae=t.useMemo(()=>z.length>0&&!c,[z,c]),T=t.useMemo(()=>z.length===0&&N&&N.trim()!==`
|
|
1124
|
+
`&&R&&!le(m),[z.length,N,R,m]),Ze=t.useMemo(()=>!T||!E||!E.queryKey||!E.bufferId||!i.current?!1:cn(E.queryKey,E.bufferId,s,i)!==null,[T,E,i,s]),Ie=T&&Ze&&R&&!le(m),te=u.isHistoryOpen??!1,Ae=h.size>0,Re=t.useMemo(()=>le(m)?!0:E?E.messages.length===0&&!E.queryKey&&!E.tableId:!1,[E,m]),Te=t.useMemo(()=>{if(te)return"Chat history";if(!E)return"";if(E.conversationName)return E.conversationName;const V=E.messages[0];if(V!=null&&V.displayType)switch(V.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"},[E,te]),Le=t.useCallback(()=>{te?M():A()},[te,M,A]),Be=()=>z.length>0?"Ask a follow up question or request refinement...":(E==null?void 0:E.tableId)!=null||N!=null&&N.trim()?"Ask a question or request an edit...":"Ask AI about your tables, or generate a query...",at=(V,B=!1)=>{if(!R||!u.activeConversationId||!E)return;const ue=u.activeConversationId;B&&o();const P=E.messages.some(Me=>Me.role==="assistant");fe($t({conversationId:ue,userMessage:V,currentSQL:N,conversationHistory:E.messages,isFirstMessage:!P,settings:{model:ke,apiKey:ve},questClient:a,tables:w,hasSchemaAccess:X,abortSignal:D==null?void 0:D.signal}),{addMessage:k,updateMessage:j,setStatus:Z,setIsStreaming:y,persistMessages:S,updateConversationName:H,replaceConversationMessages:L})},rt=t.useCallback(async V=>{u.activeConversationId&&(await F({conversationId:u.activeConversationId,messageId:V}),e(pt.query.setAISuggestionRequest(null)))},[u.activeConversationId,F]),Oe=t.useCallback(async V=>{u.activeConversationId&&(await _(u.activeConversationId,V),setTimeout(()=>{var B;(B=$.current)==null||B.focus()},100))},[u.activeConversationId,_]),W=t.useCallback(V=>{const B=V.trim().endsWith(";")?V.trim().slice(0,-1):V.trim();e(pt.query.setAISuggestionRequest({query:B,startOffset:Q.startOffset})),e(pt.query.toggleRunning(Rt.AI_SUGGESTION))},[Q.startOffset]),Y=t.useCallback(async()=>!(E!=null&&E.queryKey)||!(E!=null&&E.bufferId)?!1:await d(E.queryKey,E.bufferId),[E==null?void 0:E.queryKey,E==null?void 0:E.bufferId,d]),pe=t.useCallback(async(V,B=!1)=>{if(!(B&&await Y()))if(V.type==="diff"){if(!u.activeConversationId)return;l({type:"diff",original:V.original,modified:V.modified,conversationId:u.activeConversationId})}else l({type:"code",value:V.value})},[l,u.activeConversationId,Y]),aa=t.useCallback(async(V,B)=>{if(!u.activeConversationId)return;const ue=Ra(B,!1);try{await F({conversationId:u.activeConversationId,messageId:V,skipDefaultMessage:!0}),k({role:"user",content:`User replaced query with one of your previous suggestions. Now the query is:
|
|
1125
|
+
|
|
1126
|
+
\`\`\`sql
|
|
1127
|
+
${ue.replaceAll(/\s+/g," ").trim()}
|
|
1128
|
+
\`\`\``,timestamp:Date.now(),hideFromUI:!0}),await S(u.activeConversationId)}catch(P){console.error("Error applying SQL to editor:",P),Ye.error("Failed to apply changes to editor")}},[u.activeConversationId,F,k,S]),ra=async(V,B)=>{if(!u.activeConversationId||!R)return;const ue=u.activeConversationId,P=z.find(U=>U.id===V);if(!P)return;const Me={settings:{model:ke,apiKey:ve},questClient:a,tables:w,hasSchemaAccess:X,abortSignal:D==null?void 0:D.signal};let ot=!1;const We={addMessage:U=>{k(U,ot?[]:[V,B]),ot||(ot=!0)},updateMessage:j,setStatus:Z,setIsStreaming:y,persistMessages:S,updateConversationName:H,replaceConversationMessages:L};switch(P.displayType){case"explain_request":{if(!P.sql)return;fe(Zt({conversationId:ue,queryText:P.sql,...Me}),We);break}case"fix_request":{if(!P.sql)return;fe(It({conversationId:ue,queryText:P.sql,...Me}),We);break}case"schema_explain_request":{if(!P.displaySchemaData)return;const U=P.displaySchemaData;try{const ne=U.kind==="matview"?await a.showMatViewDDL(U.tableName):U.kind==="view"?await a.showViewDDL(U.tableName):await a.showTableDDL(U.tableName);if((ne==null?void 0:ne.type)!==Ta.DQL||!ne.data||ne.data.length===0){Ye.error("Failed to fetch table schema for retry");return}const Pe=ne.data[0];if(!Pe.ddl){Ye.error("Failed to fetch table schema for retry");return}fe(Ba({conversationId:ue,tableName:U.tableName,schema:Pe.ddl,kindLabel:Oa(U.kind),schemaDisplayData:U,...Me}),We)}catch(ne){console.error("Error fetching DDL for retry:",ne),Ye.error("Failed to fetch table schema for retry")}break}case"ask_request":default:{const U=P.displayUserMessage||P.content,ne=z.filter(Ue=>Ue.id!==V&&Ue.id!==B),Pe=ne.some(Ue=>Ue.role==="assistant");fe($t({conversationId:ue,userMessage:U,currentSQL:P.sql||N,conversationHistory:ne,isFirstMessage:!Pe,...Me}),We);break}}},_t=t.useRef(null),$e=t.useCallback(()=>{var V,B;(B=(V=_t.current)==null?void 0:V.querySelector('button[data-hook="button-explain-query"]'))==null||B.click()},[]),it=t.useCallback(V=>{T&&(V.metaKey||V.ctrlKey)&&(V.key==="e"||V.key==="E")&&(V.preventDefault(),$e())},[T]);return t.useEffect(()=>{if(T)return Bt.subscribe(Ot.EXPLAIN_QUERY_EXEC,$e),document.addEventListener("keydown",it),()=>{document.removeEventListener("keydown",it),Bt.unsubscribe(Ot.EXPLAIN_QUERY_EXEC,$e)}},[T,it,$e]),n!=="aiChat"||!E&&!te?null:r.jsxs($1,{"data-hook":"ai-chat-window",children:[r.jsxs(W1,{children:[r.jsxs(P1,{children:[r.jsx(Qe,{size:20,variant:"filled"}),r.jsx(U1,{"data-hook":"chat-window-title",children:Te})]}),r.jsxs(K1,{children:[r.jsx(Ht,{onClick:v,title:"New chat",disabled:Re,"data-hook":"chat-window-new",children:r.jsx(on,{size:16,weight:"bold"})}),r.jsx(Ht,{$active:te,onClick:Le,title:te?"Back to chat":"Chat history",disabled:!Ae||le(m),"data-hook":"chat-window-history",children:r.jsx(Yt,{size:16,weight:"bold"})}),r.jsx(Ht,{onClick:x,title:"Close","data-hook":"chat-window-close",children:r.jsx(Tt,{size:16,weight:"bold"})})]})]}),r.jsx(Q1,{children:c?r.jsx(na,{children:r.jsx(ct,{size:20,style:{margin:"auto"}})}):te?r.jsx(O1,{currentConversationId:u.previousConversationId??null}):r.jsxs(na,{children:[ae?r.jsx(e1,{messages:z,onAcceptChange:rt,onRejectChange:Oe,onRunQuery:W,onOpenInEditor:pe,onApplyToEditor:aa,onRetry:ra,running:I,aiSuggestionRequest:oe,queryNotifications:ee,queryStartOffset:Q.startOffset,isOperationInProgress:le(m),editorSQL:Q.queryText,isStreaming:b}):N&&N.trim()?r.jsxs(G1,{children:[r.jsx(X1,{"data-hook":"chat-initial-query-box",children:r.jsx(Y1,{"data-hook":"chat-lite-editor",children:r.jsx(De,{value:N.trim(),maxHeight:216,onOpenInEditor:()=>pe({type:"code",value:N.trim()},!0)})})}),(T||Ie)&&r.jsxs(J1,{ref:_t,children:[T&&r.jsx(hr,{conversationId:E.id,queryText:N.trim()}),Ie&&r.jsx(mr,{})]})]}):r.jsxs(eo,{"data-hook":"chat-blank-state",children:[r.jsx(to,{children:"Leverage AI directly in your database"}),r.jsx(no,{children:"Our AI Assistant is a specialized programming and support agent that makes you more effective and helps you solve problems as you interface with your QuestDB database. Start a conversation."})]}),r.jsx(g1,{ref:$,onSend:V=>at(V,he),disabled:!R||le(m),placeholder:Be(),contextSQL:Q.queryText,contextTableId:E==null?void 0:E.tableId,onContextClick:Y})]})})]})};export{ao as default};
|