db-studio 1.24.0 → 1.24.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +81 -83
- package/dist/index.js.map +1 -1
- package/dist/web-dist/assets/{_pathlessLayout-CB8Z8IH1.js → _pathlessLayout-BdGKkBoI.js} +2 -2
- package/dist/web-dist/assets/{_pathlessLayout-CBZWPtVx.js → _pathlessLayout-DR0xmAEe.js} +1 -1
- package/dist/web-dist/assets/{_queryId-2wchukJ_.js → _queryId-B366cOMu.js} +1 -1
- package/dist/web-dist/assets/{_table--BjwnIM-.js → _table--08cFUXm.js} +1 -1
- package/dist/web-dist/assets/{_table-BI6bCR2Y.js → _table-BUhoKmyX.js} +1 -1
- package/dist/web-dist/assets/{_table-DOiK9HT-.js → _table-MYNamF30.js} +1 -1
- package/dist/web-dist/assets/{abap-Bq2SF2ze.js → abap-Cr3Wj4u-.js} +1 -1
- package/dist/web-dist/assets/{apex-CvF3BxEV.js → apex-CkolLxTe.js} +1 -1
- package/dist/web-dist/assets/{azcli-B4auVtoa.js → azcli-EQzWRQuF.js} +1 -1
- package/dist/web-dist/assets/{badge-BDq0-MGZ.js → badge-DDylQPR6.js} +1 -1
- package/dist/web-dist/assets/{bat-Dgzfdvgu.js → bat-Lmimo2RD.js} +1 -1
- package/dist/web-dist/assets/{bicep-BCqDeEGY.js → bicep-DR-9-QmA.js} +1 -1
- package/dist/web-dist/assets/{browser-Bz0aS3wt.js → browser-BSPQwshU.js} +1 -1
- package/dist/web-dist/assets/{bundle-mjs-Czg11uv-.js → bundle-mjs-CkOje67l.js} +1 -1
- package/dist/web-dist/assets/{cameligo-DYa2RnKC.js → cameligo-BD_SJlqP.js} +1 -1
- package/dist/web-dist/assets/{chat-sidebar-XCnj-kCg.js → chat-sidebar-BX995Yr1.js} +4 -4
- package/dist/web-dist/assets/{clojure-BbDsvL5e.js → clojure-CR2FIkS9.js} +1 -1
- package/dist/web-dist/assets/{code-editor-CeKukbpw.js → code-editor-DLaMoTPg.js} +1 -1
- package/dist/web-dist/assets/{coffee-CsaUF2V_.js → coffee-_RMK1-Uq.js} +1 -1
- package/dist/web-dist/assets/{connect-CjcuNXdF.js → connect-Db8e3ev_.js} +1 -1
- package/dist/web-dist/assets/{constants-BmHYxRwL.js → constants-CK9YDygv.js} +3 -3
- package/dist/web-dist/assets/{cpp-BUVD_5yb.js → cpp-Dkqi_fZY.js} +1 -1
- package/dist/web-dist/assets/{csharp-zs4B3O4X.js → csharp-82U4022-.js} +1 -1
- package/dist/web-dist/assets/{csp-BK9lGLNX.js → csp-BGvk2oOh.js} +1 -1
- package/dist/web-dist/assets/{css-b1JV3oRC.js → css-BdpC37eA.js} +1 -1
- package/dist/web-dist/assets/{cssMode-CQCx-Amk.js → cssMode-B3Jx5dyf.js} +1 -1
- package/dist/web-dist/assets/{cypher-BqBU8Z2b.js → cypher-BK9DaNjE.js} +1 -1
- package/dist/web-dist/assets/{dart-DSDIxxqa.js → dart-BPjrsICI.js} +1 -1
- package/dist/web-dist/assets/{database.store-B5nYwx6g.js → database.store-COTWzU5x.js} +2 -2
- package/dist/web-dist/assets/{dist-BzdAqvqB.js → dist-BW-TarB3.js} +1 -1
- package/dist/web-dist/assets/{dist-CbondfsI.js → dist-BbTrC9ET.js} +1 -1
- package/dist/web-dist/assets/{dockerfile-Dgyg8Vn1.js → dockerfile-CNJRHICn.js} +1 -1
- package/dist/web-dist/assets/{ecl-BqCo88uM.js → ecl-BnT5zX3_.js} +1 -1
- package/dist/web-dist/assets/{editor.api-DwxoFYQ2.js → editor.api-C3XWCrXI.js} +1 -1
- package/dist/web-dist/assets/{elixir-CTUGPZ6C.js → elixir-1M4R8B5k.js} +1 -1
- package/dist/web-dist/assets/{esm-DFZkY2_t.js → esm-DvtsWsZW.js} +1 -1
- package/dist/web-dist/assets/{flow9-D4BWoch3.js → flow9-CxVom3E4.js} +1 -1
- package/dist/web-dist/assets/{format-cell-value-Bl9a_el7.js → format-cell-value-DeIyb5qF.js} +1 -1
- package/dist/web-dist/assets/{freemarker2-CDPCStHA.js → freemarker2-CVTLPKvC.js} +1 -1
- package/dist/web-dist/assets/{fsharp-D3hSCsYp.js → fsharp-CU6NZgCg.js} +1 -1
- package/dist/web-dist/assets/{go-BQ5Amm1L.js → go-Cet0LxBY.js} +1 -1
- package/dist/web-dist/assets/{graphql-iD1Jte7G.js → graphql-BRqDg70d.js} +1 -1
- package/dist/web-dist/assets/{handlebars-DGCxQ8J4.js → handlebars-xtUVXWSH.js} +1 -1
- package/dist/web-dist/assets/{hcl-D47OjiCw.js → hcl-DqcZcEQX.js} +1 -1
- package/dist/web-dist/assets/{highlighted-body-OFNGDK62-DwmD8iTj.js → highlighted-body-OFNGDK62-BlIYTcDK.js} +1 -1
- package/dist/web-dist/assets/{html-s4rwfaEL.js → html-BJ_1aKKi.js} +1 -1
- package/dist/web-dist/assets/{htmlMode-CLgwngSs.js → htmlMode-Hg4GfZvB.js} +1 -1
- package/dist/web-dist/assets/{icons-Cp2j-kCt.js → icons-CR59yTaA.js} +1 -1
- package/dist/web-dist/assets/{index-bHd_PHGE.js → index-BDPIeMPK.js} +4 -4
- package/dist/web-dist/assets/{indexes-CC7CSOZI.js → indexes-ez4OmPR7.js} +1 -1
- package/dist/web-dist/assets/{ini-DNs4UNBm.js → ini-DAVBBvGM.js} +1 -1
- package/dist/web-dist/assets/{java-C844kcMX.js → java-CPUr-3oI.js} +1 -1
- package/dist/web-dist/assets/{javascript-CM6qxDQg.js → javascript-CvzYHnHf.js} +1 -1
- package/dist/web-dist/assets/{json-editor-DhzLauWb.js → json-editor-C-7HFGJ2.js} +1 -1
- package/dist/web-dist/assets/{jsonMode-ktYHQ7k4.js → jsonMode-CyOYWfPp.js} +1 -1
- package/dist/web-dist/assets/{julia-DBbgm8bE.js → julia-Cu-j-vXr.js} +1 -1
- package/dist/web-dist/assets/{keys-B79aFFUM.js → keys-VBmR2NsV.js} +1 -1
- package/dist/web-dist/assets/{kotlin-CczUn3Bo.js → kotlin-D2vv2tT1.js} +1 -1
- package/dist/web-dist/assets/{label-BxAgnFDj.js → label-hsxz5VOl.js} +1 -1
- package/dist/web-dist/assets/{less-BDndQXE2.js → less-CKzCbMvG.js} +1 -1
- package/dist/web-dist/assets/{lexon-DrJKrLHU.js → lexon-DKD4i4jk.js} +1 -1
- package/dist/web-dist/assets/{liquid-BOxI8WO7.js → liquid-s8v6KVAN.js} +1 -1
- package/dist/web-dist/assets/{logs-CKGCAlGi.js → logs-DlQvMAY7.js} +1 -1
- package/dist/web-dist/assets/{lspLanguageFeatures-B-pTo3Bn.js → lspLanguageFeatures-D9k63sBz.js} +1 -1
- package/dist/web-dist/assets/{lua-B-DZsKtS.js → lua-BjtFPVFc.js} +1 -1
- package/dist/web-dist/assets/{m3-Owy8TjS4.js → m3-CW0-q7dZ.js} +1 -1
- package/dist/web-dist/assets/{markdown-D79UG6z3.js → markdown-0274iNTO.js} +1 -1
- package/dist/web-dist/assets/{mdx-DGvwS7WO.js → mdx-CZ8q31gq.js} +1 -1
- package/dist/web-dist/assets/{mermaid-GHXKKRXX-BedrloC7.js → mermaid-GHXKKRXX-CQ1xUr5j.js} +1 -1
- package/dist/web-dist/assets/{middleware-CgadqUs_.js → middleware-DF6TlQS2.js} +1 -1
- package/dist/web-dist/assets/{mips--YcTYhla.js → mips-FR3oRusR.js} +1 -1
- package/dist/web-dist/assets/{module-DMKyVt4Z.js → module-Bek148sg.js} +1 -1
- package/dist/web-dist/assets/{monaco-theme-DDFn4QWa.js → monaco-theme-tSfqYsPo.js} +4 -4
- package/dist/web-dist/assets/{msdax-BT5TAMyz.js → msdax-CntWW6qe.js} +1 -1
- package/dist/web-dist/assets/{mysql-DiqG_FKN.js → mysql-CJACC3-m.js} +1 -1
- package/dist/web-dist/assets/{objective-c-C_BfMpoA.js → objective-c-BUNGcP5B.js} +1 -1
- package/dist/web-dist/assets/{pascal-BJsCnNJo.js → pascal-BKy15MaV.js} +1 -1
- package/dist/web-dist/assets/{pascaligo-IucQKKBl.js → pascaligo-DWESqQVQ.js} +1 -1
- package/dist/web-dist/assets/{perl-D1p264f9.js → perl-CBAgjcGX.js} +1 -1
- package/dist/web-dist/assets/{personal-preferences.store-BiMq0Y52.js → personal-preferences.store-Bfb2buXG.js} +1 -1
- package/dist/web-dist/assets/{pgsql-BVu_MjK3.js → pgsql-BqeSk0nE.js} +1 -1
- package/dist/web-dist/assets/{php-DIWn0kxW.js → php-CzFJAlvL.js} +1 -1
- package/dist/web-dist/assets/{pla-BriG1dlB.js → pla-DRvt3H-m.js} +1 -1
- package/dist/web-dist/assets/{postiats-Cb0eCw4F.js → postiats-ZvjXAa_2.js} +1 -1
- package/dist/web-dist/assets/{powerquery-D-S-D3uG.js → powerquery-DryHEA6Q.js} +1 -1
- package/dist/web-dist/assets/{powershell-Br0yPko5.js → powershell-QEI9APgx.js} +1 -1
- package/dist/web-dist/assets/{preload-helper-iAe7doxP.js → preload-helper-LZO0i3yF.js} +1 -1
- package/dist/web-dist/assets/{protobuf-DXgwoXmw.js → protobuf-DvBD3fs_.js} +1 -1
- package/dist/web-dist/assets/{pug-CkrU_Its.js → pug-CDF3vmYa.js} +1 -1
- package/dist/web-dist/assets/{python-DtkdMPl6.js → python-BsOu3xjW.js} +1 -1
- package/dist/web-dist/assets/{qsharp-BFgaE9um.js → qsharp-BbZVBun6.js} +1 -1
- package/dist/web-dist/assets/{queries.store-BjfGDMSV.js → queries.store-Dn4T9Cna.js} +1 -1
- package/dist/web-dist/assets/{query-runner-DcgFi94b.js → query-runner-C0YRZT1P.js} +3 -3
- package/dist/web-dist/assets/{r-Cy-L7tzv.js → r-CpYjNGnw.js} +1 -1
- package/dist/web-dist/assets/{radix-ui-DsfBT21F.js → radix-ui-CGydzmrQ.js} +1 -1
- package/dist/web-dist/assets/{razor-NF3TzW48.js → razor-DAnkRgyU.js} +1 -1
- package/dist/web-dist/assets/{react-dom-Dc3YY6Lb.js → react-dom-B0mgdSUa.js} +1 -1
- package/dist/web-dist/assets/{react-CXUHf7G9.js → react-ffmTauEL.js} +1 -1
- package/dist/web-dist/assets/{redis-Dz00h2PU.js → redis-QErEcnOD.js} +1 -1
- package/dist/web-dist/assets/{redis-value-ZB2FU0Y3.js → redis-value--1z4IxUa.js} +1 -1
- package/dist/web-dist/assets/{redshift-DqNXfDmg.js → redshift-CXgK11sI.js} +1 -1
- package/dist/web-dist/assets/{restructuredtext-B5fKLW7g.js → restructuredtext-BBt1qpNc.js} +1 -1
- package/dist/web-dist/assets/{rolldown-runtime-BpaiXjxi.js → rolldown-runtime-C5zEKjJh.js} +1 -1
- package/dist/web-dist/assets/{ruby-CCPPZ85l.js → ruby-CgCIxh0i.js} +1 -1
- package/dist/web-dist/assets/{runner-DWDNo8PW.js → runner-KV8hbPPA.js} +1 -1
- package/dist/web-dist/assets/{rust-BshObZ-f.js → rust-Copg69WU.js} +1 -1
- package/dist/web-dist/assets/{sb-qkcFW9ML.js → sb-BuyF0y3x.js} +1 -1
- package/dist/web-dist/assets/{scala-BqGFtNCK.js → scala-CZ7bI4SO.js} +1 -1
- package/dist/web-dist/assets/{schema-B06aGalT.js → schema-DR8Tuvdp.js} +1 -1
- package/dist/web-dist/assets/{schema-DLKXOflr.js → schema-ruIelo5n.js} +1 -1
- package/dist/web-dist/assets/{scheme-CSDCifY0.js → scheme-BI3ohyII.js} +1 -1
- package/dist/web-dist/assets/{scss-DDU3Surn.js → scss-bqQKlHUB.js} +1 -1
- package/dist/web-dist/assets/{select-XrU76gkU.js → select-BedKPksO.js} +1 -1
- package/dist/web-dist/assets/{separator-jMywB-2c.js → separator-Cd_a7h-Q.js} +1 -1
- package/dist/web-dist/assets/{sheet-sidebar-CatxqUMS.js → sheet-sidebar-V9ImpjT9.js} +1 -1
- package/dist/web-dist/assets/{shell-B9GKK-mC.js → shell-CXx2Kidi.js} +1 -1
- package/dist/web-dist/assets/{solidity-T4nLiSrl.js → solidity-DQP2nWvP.js} +1 -1
- package/dist/web-dist/assets/{sophia-CxHxp787.js → sophia-DA8TX309.js} +1 -1
- package/dist/web-dist/assets/{sparql-Cc68XDZz.js → sparql-CVI98ZbO.js} +1 -1
- package/dist/web-dist/assets/{spinner-C5eJUcQ8.js → spinner-J26L87h5.js} +1 -1
- package/dist/web-dist/assets/{sql-DuSKWG0U.js → sql-BRi0aIjG.js} +1 -1
- package/dist/web-dist/assets/{st-CvDv-80q.js → st-DlSkr5cV.js} +1 -1
- package/dist/web-dist/assets/{swift-CS9QIYkd.js → swift-DrB4uoi-.js} +1 -1
- package/dist/web-dist/assets/{systemverilog-BnPj7u1A.js → systemverilog-DHk_Dhpc.js} +1 -1
- package/dist/web-dist/assets/{table-Ddncv8yc.js → table-CT86qs6B.js} +1 -1
- package/dist/web-dist/assets/tables-TbUO18cr.js +13 -0
- package/dist/web-dist/assets/{tanstack-BPG3IW5e.js → tanstack-B9dfs2ya.js} +1 -1
- package/dist/web-dist/assets/{tcl-B6jg-5Cb.js → tcl-BB6i8hBF.js} +1 -1
- package/dist/web-dist/assets/{tooltip-5N-vnBUx.js → tooltip-Bcb91KP1.js} +1 -1
- package/dist/web-dist/assets/{tsMode-CQfgMr7J.js → tsMode-C7nq1NR4.js} +1 -1
- package/dist/web-dist/assets/{twig-ldZgB-wD.js → twig-DtkDzK6Y.js} +1 -1
- package/dist/web-dist/assets/{typescript-CANwj-Sa.js → typescript-CfEpyYkn.js} +1 -1
- package/dist/web-dist/assets/{typespec-DjERUFVV.js → typespec-Cxei4Exd.js} +1 -1
- package/dist/web-dist/assets/{use-database-engine-BUPMYqQP.js → use-database-engine-Ds7pAy-l.js} +1 -1
- package/dist/web-dist/assets/{use-theme-DBziCVvW.js → use-theme-BrgSRf8C.js} +1 -1
- package/dist/web-dist/assets/{utils-BDZEB_LK.js → utils-Bcpfbua-.js} +1 -1
- package/dist/web-dist/assets/{vb-BZwS3C6o.js → vb-CAxS_9xB.js} +1 -1
- package/dist/web-dist/assets/{visualizer-R12YQrWQ.js → visualizer-DMSktlIB.js} +1 -1
- package/dist/web-dist/assets/{vscode-B0k_qsbq.js → vscode-D8MAi5Oo.js} +1 -1
- package/dist/web-dist/assets/{wgsl-DNuFR9Dj.js → wgsl-DmW6KOpe.js} +1 -1
- package/dist/web-dist/assets/{workers-B2aTtOoy.js → workers-9Tb8vu2S.js} +1 -1
- package/dist/web-dist/assets/{xml-CmdBBiXu.js → xml-Awyed4za.js} +1 -1
- package/dist/web-dist/assets/{yaml-DeyJxOQB.js → yaml-VoM4GTAy.js} +1 -1
- package/dist/web-dist/index.html +30 -30
- package/package.json +2 -1
- package/dist/web-dist/assets/tables-BCWRd0qR.js +0 -12
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chat-sidebar-
|
|
2
|
-
import{n as cs,r as ds}from"./rolldown-runtime-BpaiXjxi.js";import{_ as oe,b as he,f as us,g as Be,n as hs,s as se,v as te,w as ms}from"./tanstack-BPG3IW5e.js";import{$ as xs,A as fs,Ct as bs,E as Z,Et as ps,G as gs,H as vs,It as js,N as ys,Ot as Cs,P as He,Q as Ss,R as Ns,T as qe,X as ws,Z as Ue,_ as ks,a as Ts,b as we,bt as Ae,ct as Es,f as _s,g as Ds,k as ke,m as Rs,mt as Is,nt as Os,p as As,r as Fs,rt as Ls,s as Te,tt as Ms,ut as zs,v as Ps,x as $s}from"./icons-Cp2j-kCt.js";import{a as Ks,i as Qs,jt as Vs,n as Bs,o as Hs,r as qs,t as Us}from"./radix-ui-DsfBT21F.js";import{n as z}from"./dist-CbondfsI.js";import{t as T}from"./utils-BDZEB_LK.js";import{t as Ws}from"./spinner-C5eJUcQ8.js";import{n as O}from"./dist-BzdAqvqB.js";import{C as Gs,G as q,J as U,K as W,S as Ys,W as G,Y,c as We,d as Se,f as Ge,h as Ye,l as Xs,m as Xe,n as Js,p as Je,q as X,s as Ze,u as I,v as Ee}from"./schema-B06aGalT.js";import{n as M,t as Fe}from"./label-BxAgnFDj.js";import{a as J,i as _e,n as De,o as S,t as Re}from"./tooltip-5N-vnBUx.js";import{i as Zs,n as et,s as st,t as tt}from"./sheet-sidebar-CatxqUMS.js";import{c as at,d as ee,l as rt,r as nt,s as es,u as lt}from"./tables-BCWRd0qR.js";import{B as it,r as ot,t as R}from"./constants-BmHYxRwL.js";import{i as ct,t as ss}from"./database.store-B5nYwx6g.js";import{t as dt}from"./preload-helper-iAe7doxP.js";import{c as ut,d as ht,f as mt,l as xt,o as ft,p as bt,s as pt,t as gt,u as vt}from"./badge-BDq0-MGZ.js";import{a as ae,i as re,n as ne,r as P,t as le}from"./select-XrU76gkU.js";import{t as Q}from"./use-database-engine-BUPMYqQP.js";import{t as jt}from"./keys-B79aFFUM.js";import{r as yt,t as Ct}from"./separator-jMywB-2c.js";import{r as Ie}from"./personal-preferences.store-BiMq0Y52.js";import{t as St}from"./use-theme-DBziCVvW.js";import{C as Nt,S as B,a as wt,b as Le,c as kt,g as Tt,h as Et,l as _t,p as Dt,u as Rt,v as It,x as Ot,y as H}from"./index-bHd_PHGE.js";import{t as me}from"./queries.store-BjfGDMSV.js";import{i as At,n as ye,o as Ft,r as Lt,s as Mt}from"./redis-value-ZB2FU0Y3.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"db-studio@1.24.0"};var t=new s.Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="2874c903-9e27-4360-a4ff-c155a02095c2",s._sentryDebugIdIdentifier="sentry-dbid-2874c903-9e27-4360-a4ff-c155a02095c2")}catch{}})();var Me={AUTHOR:"Hüsam 🥑 <husam@ql3.dev>",AUTHOR_NAME:"Hüsam",AUTHOR_AVATAR:"/avocado.png",AUTHOR_USERNAME:"husamql3",AUTHOR_GITHUB_LINK:"https://github.com/husamql3",SITE_DESCRIPTION:"The modern pgAdmin alternative that works with every database.",SITE_KEYWORDS:["pgadmin alternative","database client","database gui","database browser","sql editor","postgresql client","mysql client","table editor","ai sql","er diagram"],SITE_TITLE:"db-studio",SITE_NAME:"dbstudio.sh",SITE_URL:"https://dbstudio.sh",SITE_X_LINK:"https://x.com/dbstudio_sh",SITE_GITHUB_LINK:"https://github.com/husamql3/db-studio",SITE_GITHUB_NEW_ISSUE_LINK:"https://github.com/husamql3/db-studio/issues/new/choose",SITE_DOCS_LINK:"https://dbstudio.sh/docs",SITE_CHANGELOG_LINK:"https://dbstudio.sh/changelog",SITE_ROADMAP_LINK:"https://dbstudio.sh/roadmap",SITE_IMAGE:"https://dbstudio.sh/og-image.png",SITE_IMAGE_WIDTH:"1200",SITE_IMAGE_HEIGHT:"630",SITE_IMAGE_ALT:"dbstudio.sh – Modern database management studio",SITE_COLOR:"#1447e6"},l=ds(js(),1),zt=({enabled:s=!0}={})=>{const{data:t,isLoading:a,error:r,refetch:n}=ms({queryKey:jt.rateLimit(),queryFn:async()=>(await it()).data,enabled:s});return{rateLimit:t,isLoadingRateLimit:a,errorRateLimit:r,refetchRateLimit:n}},ts={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ze=l.createContext&&l.createContext(ts),Pt=["attr","size","title"];function $t(s,t){if(s==null)return{};var a,r,n=Kt(s,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(s);for(r=0;r<o.length;r++)a=o[r],t.indexOf(a)===-1&&{}.propertyIsEnumerable.call(s,a)&&(n[a]=s[a])}return n}function Kt(s,t){if(s==null)return{};var a={};for(var r in s)if({}.hasOwnProperty.call(s,r)){if(t.indexOf(r)!==-1)continue;a[r]=s[r]}return a}function de(){return de=Object.assign?Object.assign.bind():function(s){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(s[r]=a[r])}return s},de.apply(null,arguments)}function Pe(s,t){var a=Object.keys(s);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),a.push.apply(a,r)}return a}function ue(s){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Pe(Object(a),!0).forEach(function(r){Qt(s,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(a)):Pe(Object(a)).forEach(function(r){Object.defineProperty(s,r,Object.getOwnPropertyDescriptor(a,r))})}return s}function Qt(s,t,a){return(t=Vt(t))in s?Object.defineProperty(s,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):s[t]=a,s}function Vt(s){var t=Bt(s,"string");return typeof t=="symbol"?t:t+""}function Bt(s,t){if(typeof s!="object"||!s)return s;var a=s[Symbol.toPrimitive];if(a!==void 0){var r=a.call(s,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(s)}function as(s){return s&&s.map((t,a)=>l.createElement(t.tag,ue({key:a},t.attr),as(t.child)))}function Ht(s){return t=>l.createElement(qt,de({attr:ue({},s.attr)},t),as(s.child))}function qt(s){var t=a=>{var{attr:r,size:n,title:o}=s,c=$t(s,Pt),i=n||a.size||"1em",u;return a.className&&(u=a.className),s.className&&(u=(u?u+" ":"")+s.className),l.createElement("svg",de({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,r,c,{className:u,style:ue(ue({color:s.color||a.color},a.style),s.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),o&&l.createElement("title",null,o),s.children)};return ze!==void 0?l.createElement(ze.Consumer,null,a=>t(a)):t(ts)}function Ut(s){return Ht({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"},child:[]},{tag:"path",attr:{d:"M9 18c-4.51 2-5-2-7-2"},child:[]}]})(s)}var e=Vs(),Ne=()=>dt(()=>import("./chat-sidebar-XCnj-kCg.js").then(s=>s.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31])),Wt=(0,l.lazy)(()=>Ne().then(s=>({default:s.ChatSidebar}))),Gt=()=>{const{openOverlay:s,isOverlayOpen:t}=J(),[a,r]=(0,l.useState)(!1);t("chat.assistant")&&!a&&r(!0);const{dbType:n}=ss(),{provider:o}=_t(),c=Rt(Dt),i=wt(),u=c.status[o],f=u?.state==="set"||u?.state==="locked",{rateLimit:g,isLoadingRateLimit:x,errorRateLimit:h}=zt({enabled:i&&o==="gemini"&&!f}),{remaining:p=0,limit:m=0}=g??{remaining:0,limit:0},y=f?"bg-emerald-500":x||h?"bg-zinc-500":o!=="gemini"||p===0?"bg-red-500":p<=5?"bg-yellow-500":"bg-emerald-500";return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(Re,{children:[(0,e.jsx)(_e,{asChild:!0,children:(0,e.jsxs)(S,{variant:"ghost",className:"rounded-none size-12 relative text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors","aria-label":"Open AI assistant",onPointerEnter:Ne,onFocus:Ne,onClick:()=>{s("chat.assistant"),n&&ct.capture("chat_opened",{db_type:n})},children:[(0,e.jsx)(ks,{className:"size-5"}),(0,e.jsx)("span",{"data-testid":"chat-status-indicator",className:T("absolute top-2 right-2 h-2 w-2 rounded-full ring-2 ring-background",y)})]})}),(0,e.jsx)(De,{side:"right",className:"text-xs",children:f?(0,e.jsxs)("p",{children:["AI Assistant · personal ",o," key"]}):!x&&!h?p>0?(0,e.jsxs)("p",{children:[p,"/",m," messages remaining"]}):(0,e.jsx)("p",{children:"AI Assistant"}):(0,e.jsx)("p",{children:"AI status unavailable"})})]}),a&&(0,e.jsx)(l.Suspense,{children:(0,e.jsx)(Wt,{})})]})},Yt={table:_s,runner:Ds,schema:zs,indexes:Ns,logs:$s,visualizer:Fs,browser:Ss},xe="relative flex size-12 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",fe=({label:s,children:t})=>(0,e.jsxs)(Re,{children:[(0,e.jsx)(_e,{asChild:!0,children:t}),(0,e.jsx)(De,{side:"right",children:(0,e.jsx)("p",{className:"capitalize",children:s})})]}),Xt=()=>{const{pathname:s}=se(),t=he({strict:!1}),a=Q(),r=s.split("/")[1]||"table",n=a?.dataModel==="key-value"?["browser","runner","logs"]:ot.filter(i=>(i!=="indexes"||a?.indexes)&&(i!=="logs"||a?.serverLogs)),o=t.table,c=Ee();return n.map(i=>{const u=Yt[i],f=(i==="table"||i==="schema"||i==="indexes")&&o,g=r===i;return(0,e.jsx)(fe,{label:i,children:(0,e.jsx)(Be,{to:f?`/${i}/$table`:`/${i}`,params:f?{table:o}:void 0,search:f?{[R.TABLE_SCHEMA]:c}:void 0,"aria-label":i,"aria-current":g?"page":void 0,className:T(xe,g&&"bg-muted text-foreground"),children:(0,e.jsx)(u,{className:"size-5"})})},i)})},Jt=()=>{const{sidebar:{isOpen:s},setSidebarOpen:t,setSidebarPinned:a}=Ie();return(0,e.jsx)(fe,{label:s?"Hide sidebar":"Show sidebar",children:(0,e.jsx)("button",{type:"button","aria-label":"Toggle sidebar",className:xe,onClick:()=>{t(!s),a(!s)},children:(0,e.jsx)(fs,{className:"size-5"})})})},$e=[{value:"light",label:"Light",icon:As},{value:"dark",label:"Dark",icon:ys},{value:"system",label:"System",icon:He}],Zt=()=>{const{theme:s,setTheme:t}=St(),a=$e.find(r=>r.value===s)?.icon??He;return(0,e.jsxs)(Ze,{children:[(0,e.jsx)(fe,{label:"More",children:(0,e.jsx)(Ye,{asChild:!0,children:(0,e.jsx)("button",{type:"button","aria-label":"More",className:xe,children:(0,e.jsx)(Ms,{className:"size-5"})})})}),(0,e.jsxs)(We,{side:"right",align:"end",sideOffset:8,className:"w-48",children:[(0,e.jsxs)(Ge,{children:[(0,e.jsxs)(Xe,{children:[(0,e.jsx)(a,{}),"Theme"]}),(0,e.jsx)(Je,{children:$e.map(({value:r,label:n,icon:o})=>(0,e.jsxs)(I,{onClick:()=>t(r),children:[(0,e.jsx)(o,{}),n,s===r&&(0,e.jsx)(bs,{className:"ml-auto"})]},r))})]}),(0,e.jsx)(Se,{}),(0,e.jsx)(I,{asChild:!0,children:(0,e.jsxs)("a",{href:Me.SITE_GITHUB_NEW_ISSUE_LINK,target:"_blank",rel:"noopener noreferrer",children:[(0,e.jsx)(ps,{}),"Report a bug"]})}),(0,e.jsx)(I,{asChild:!0,children:(0,e.jsxs)("a",{href:Me.SITE_GITHUB_LINK,target:"_blank",rel:"noopener noreferrer",children:[(0,e.jsx)(Ut,{}),"View on GitHub"]})})]})]})},Ke=()=>(0,e.jsx)("div",{className:"h-px w-full shrink-0 bg-border"}),ea=()=>{const{openOverlay:s}=J();return(0,e.jsxs)("nav",{"aria-label":"Main",className:"flex shrink-0 flex-col border-r border-border bg-background",style:{width:R.RAIL_WIDTH},children:[(0,e.jsx)(Jt,{}),(0,e.jsx)(Ke,{}),(0,e.jsx)(Xt,{}),(0,e.jsxs)("div",{className:"mt-auto flex flex-col",children:[(0,e.jsx)(Ke,{}),(0,e.jsx)(Gt,{}),(0,e.jsx)(fe,{label:"Settings",children:(0,e.jsx)("button",{type:"button","aria-label":"Open settings",className:xe,onClick:()=>s("settings.app"),children:(0,e.jsx)(Ps,{className:"size-5"})})}),(0,e.jsx)(Zt,{})]})]})};function rs({...s}){return(0,e.jsx)(Qs,{"data-slot":"context-menu",...s})}function ns({className:s,...t}){return(0,e.jsx)(Hs,{"data-slot":"context-menu-trigger",className:T("select-none",s),...t})}function ls({className:s,...t}){return(0,e.jsx)(qs,{children:(0,e.jsx)(Us,{"data-slot":"context-menu-content",className:T("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-context-menu-content-available-height) origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto",s),...t})})}function $({className:s,inset:t,variant:a="default",...r}){return(0,e.jsx)(Bs,{"data-slot":"context-menu-item","data-inset":t,"data-variant":a,className:T("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 group/context-menu-item relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",s),...r})}function Qe({className:s,...t}){return(0,e.jsx)(Ks,{"data-slot":"context-menu-separator",className:T("bg-border/50 -mx-1 my-1 h-px",s),...t})}var Ce=({folderId:s,isExpanded:t,onToggle:a,count:r,name:n,showContextMenu:o=!1})=>{const c=te(),{deleteFolder:i,getQueriesByFolder:u,addQuery:f,updateFolder:g}=me(),[x,h]=(0,l.useState)(!1),[p,m]=(0,l.useState)(""),[v,y]=(0,l.useState)(!1),b=(0,l.useCallback)(()=>{if(s){if(u(s).length>0){y(!0);return}i(s)}},[i,s,u]),w=(0,l.useCallback)(()=>{s&&(i(s),y(!1))},[i,s]),E=(0,l.useCallback)(()=>{const k=f(void 0,s);c({to:"/runner/$queryId",params:{queryId:k}})},[f,s,c]),d=(0,l.useCallback)(()=>{m(n),h(!0)},[n]),j=(0,l.useCallback)(()=>{s&&p.trim()&&(g(s,{name:p.trim()}),h(!1),m(""))},[s,p,g]);return(0,e.jsxs)(e.Fragment,{children:[o?(0,e.jsxs)(rs,{children:[(0,e.jsx)(ns,{asChild:!0,children:(0,e.jsxs)("button",{type:"button",onClick:a,className:T("w-full flex gap-2 px-4 py-2 text-sm transition-colors text-left","hover:bg-sidebar-accent/50 hover:text-sidebar-foreground focus:outline-none focus:bg-sidebar-accent focus:text-sidebar-accent-foreground","text-sidebar-foreground/70 items-center"),children:[(0,e.jsx)(Ae,{className:T("size-4 transition-transform duration-200",t?"rotate-90":"")}),(0,e.jsx)("span",{className:"flex-1",children:n}),(0,e.jsx)(ee,{children:r})]})}),(0,e.jsxs)(ls,{children:[(0,e.jsxs)($,{onClick:E,children:[(0,e.jsx)(Z,{className:"size-4"}),"Add a new query"]}),(0,e.jsxs)($,{onClick:d,children:[(0,e.jsx)(ke,{className:"size-4"}),"Rename folder"]}),(0,e.jsxs)($,{onClick:b,children:[(0,e.jsx)(Te,{className:"size-4"}),"Delete folder"]})]})]}):(0,e.jsxs)("button",{type:"button",onClick:a,className:T("w-full flex gap-2 px-4 py-2 text-sm transition-colors text-left","hover:bg-sidebar-accent/50 hover:text-sidebar-foreground focus:outline-none focus:bg-sidebar-accent focus:text-sidebar-accent-foreground","text-sidebar-foreground/70 items-center"),children:[(0,e.jsx)(Ae,{className:T("size-4 transition-transform duration-200",t?"rotate-90":"")}),(0,e.jsx)("span",{className:"flex-1",children:n}),(0,e.jsx)(ee,{children:r})]}),(0,e.jsx)(G,{open:x,onOpenChange:h,children:(0,e.jsxs)(q,{children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Rename Folder"}),(0,e.jsx)(W,{children:"Enter a new name for this folder."})]}),(0,e.jsx)(M,{value:p,onChange:k=>m(k.target.value),placeholder:"Folder name",onKeyDown:k=>{k.key==="Enter"&&j()},autoFocus:!0}),(0,e.jsxs)(X,{children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>{h(!1),m("")},children:"Cancel"}),(0,e.jsx)(S,{onClick:j,disabled:!p.trim(),children:"Rename"})]})]})}),(0,e.jsx)(ft,{open:v,onOpenChange:y,children:(0,e.jsxs)(xt,{children:[(0,e.jsxs)(mt,{children:[(0,e.jsx)(bt,{children:"Delete Folder"}),(0,e.jsxs)(vt,{children:["This folder contains ",r," ",r===1?"query":"queries",". Deleting this folder will also delete all queries inside it. This action cannot be undone."]})]}),(0,e.jsxs)(ht,{children:[(0,e.jsx)(ut,{children:"Cancel"}),(0,e.jsx)(pt,{onClick:w,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Folder"})]})]})})]})},ce=({id:s,tableName:t,isNested:a=!1,showContextMenu:r=!0})=>{const n=te(),{deleteQuery:o,addQuery:c,getQuery:i,toggleFavorite:u,updateQuery:f,moveQuery:g,folders:x,addFolder:h}=me(),{queryId:p}=he({strict:!1}),m=p===s,v=i(s),y=v?.isFavorite??!1,[b,w]=(0,l.useState)(!1),[E,d]=(0,l.useState)(""),[j,k]=(0,l.useState)(!1),[V,A]=(0,l.useState)(void 0),[F,_]=(0,l.useState)(!1),[D,L]=(0,l.useState)(""),ie=(0,l.useCallback)(()=>{n({to:"/runner/$queryId",params:{queryId:s}})},[n,s]),be=(0,l.useCallback)(()=>{o(s),p===s&&n({to:"/runner"}),z.success("Query deleted successfully")},[o,s,n,p]),pe=(0,l.useCallback)(()=>{const C=i(s),os=c(`${C?.name} (Copy)`);n({to:"/runner/$queryId",params:{queryId:os}}),z.success("Query duplicated successfully")},[c,i,n,s]),ge=(0,l.useCallback)(()=>{u(s),z.success("Query favorited successfully")},[u,s]),ve=(0,l.useCallback)(()=>{d(v?.name??""),w(!0)},[v?.name]),N=(0,l.useCallback)(()=>{E.trim()&&(f(s,{name:E.trim()}),w(!1),d(""),z.success("Query renamed successfully"))},[s,E,f]),je=(0,l.useCallback)(()=>{A(v?.folderId),_(!1),L(""),k(!0)},[v?.folderId]),is=(0,l.useCallback)(C=>{C==="__create_new__"?(_(!0),A(void 0)):(_(!1),A(C==="__none__"?void 0:C))},[]),Oe=(0,l.useCallback)(()=>{if(F&&D.trim()){const C=Math.random().toString(36).substring(2,15);h({id:C,name:D.trim(),isExpanded:!0,isFavorite:!1}),g(s,C),z.success("Query moved to new folder successfully")}else F||(g(s,V),z.success("Query moved to selected folder successfully"));k(!1),_(!1),L(""),A(void 0)},[F,D,V,s,h,g]);return(0,e.jsxs)("li",{className:"relative",children:[r?(0,e.jsxs)(rs,{children:[(0,e.jsx)(ns,{asChild:!0,children:(0,e.jsxs)("button",{type:"button",onClick:ie,className:T("w-full flex gap-2 py-2 text-sm transition-colors text-left justify-start items-center focus:outline-none",m?"text-sidebar-accent-foreground bg-sidebar-accent font-medium":"text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent/50 focus:bg-sidebar-accent focus:text-sidebar-accent-foreground",a?"px-4 pl-12":"px-4"),children:[m&&(0,e.jsx)("span",{className:"absolute left-0 top-0 bottom-0 w-1 bg-primary"}),(0,e.jsx)("span",{className:"flex-1",children:t})]})}),(0,e.jsxs)(ls,{children:[(0,e.jsxs)($,{onClick:ve,children:[(0,e.jsx)(ke,{className:"size-4"}),"Rename query"]}),(0,e.jsxs)($,{onClick:pe,children:[(0,e.jsx)(Es,{className:"size-4"}),"Duplicate query"]}),(0,e.jsxs)($,{onClick:ge,children:[(0,e.jsx)(Rs,{className:y?"size-4 fill-current":"size-4"}),y?"Remove from favorites":"Add to favorites"]}),(0,e.jsx)(Qe,{}),(0,e.jsxs)($,{onClick:je,children:[(0,e.jsx)(ws,{className:"size-4"}),"Move to folder"]}),(0,e.jsx)(Qe,{}),(0,e.jsxs)($,{onClick:be,children:[(0,e.jsx)(Te,{className:"size-4"}),"Delete query"]})]})]}):(0,e.jsxs)("button",{type:"button",onClick:ie,className:T("w-full flex gap-2 py-2 text-sm transition-colors text-left justify-start items-center focus:outline-none",m?"text-sidebar-accent-foreground bg-sidebar-accent font-medium":"text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent/50 focus:bg-sidebar-accent focus:text-sidebar-accent-foreground",a?"px-4 pl-12":"px-4"),children:[m&&(0,e.jsx)("span",{className:"absolute left-0 top-0 bottom-0 w-1 bg-primary"}),(0,e.jsx)("span",{className:"flex-1",children:t})]}),(0,e.jsx)(G,{open:b,onOpenChange:w,children:(0,e.jsxs)(q,{children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Rename Query"}),(0,e.jsx)(W,{children:"Enter a new name for this query."})]}),(0,e.jsx)(M,{value:E,onChange:C=>d(C.target.value),placeholder:"Query name",onKeyDown:C=>{C.key==="Enter"&&N()},autoFocus:!0}),(0,e.jsxs)(X,{children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>{w(!1),d("")},children:"Cancel"}),(0,e.jsx)(S,{onClick:N,disabled:!E.trim(),children:"Rename"})]})]})}),(0,e.jsx)(G,{open:j,onOpenChange:C=>{k(C),C||(_(!1),L(""),A(void 0))},children:(0,e.jsxs)(q,{children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Move to Folder"}),(0,e.jsx)(W,{children:"Select a folder to move this query to."})]}),(0,e.jsx)("div",{className:"space-y-4",children:F?(0,e.jsx)(M,{value:D,onChange:C=>L(C.target.value),placeholder:"Folder name",onKeyDown:C=>{C.key==="Enter"&&D.trim()&&Oe(),C.key==="Escape"&&(_(!1),L(""))},autoFocus:!0}):(0,e.jsxs)(le,{value:V??"__none__",onValueChange:is,children:[(0,e.jsx)(re,{className:"w-full",children:(0,e.jsx)(ae,{placeholder:"Select a folder"})}),(0,e.jsxs)(ne,{children:[(0,e.jsx)(P,{value:"__none__",children:"No folder"}),x.map(C=>(0,e.jsx)(P,{value:C.id,children:C.name},C.id)),(0,e.jsx)(P,{value:"__create_new__",children:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(Ue,{className:"size-4"}),"Create a new folder"]})})]})]})}),(0,e.jsxs)(X,{children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>{k(!1),_(!1),L(""),A(void 0)},children:"Cancel"}),(0,e.jsx)(S,{onClick:Oe,disabled:F&&!D.trim(),children:F?"Create & Move":"Move"})]})]})})]})},sa=()=>{const[s]=O(R.SIDEBAR_SEARCH,{defaultValue:""}),{folders:t,queries:a,getFavoriteQueries:r,getQueriesByFolder:n,toggleFolder:o}=me(),[c,i]=(0,l.useState)(!0),[u,f]=(0,l.useState)(!0),g=a.filter(m=>!m.isFavorite).length,x=r(),h=x.length,p=a.filter(m=>!m.folderId&&!m.isFavorite);if(s){const m=a.filter(v=>v.name.toLowerCase().includes(s.toLowerCase()));return m.length===0?(0,e.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:"No queries found matching"}):(0,e.jsx)("div",{className:"flex-1 overflow-y-auto",children:m.map(v=>(0,e.jsx)(ce,{id:v.id,tableName:v.name},v.id))})}return(0,e.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[(0,e.jsx)(Ce,{name:"Favorites",isExpanded:c,onToggle:()=>i(!c),count:h}),c&&x.map(m=>(0,e.jsx)(ce,{id:m.id,tableName:m.name},m.id)),(0,e.jsx)(Ct,{className:"bg-sidebar-border"}),(0,e.jsx)(Ce,{name:"Queries",isExpanded:u,onToggle:()=>f(!u),count:g}),u&&(0,e.jsxs)(e.Fragment,{children:[t.map(m=>{const v=n(m.id),y=v.length;return(0,e.jsxs)("div",{children:[(0,e.jsx)(Ce,{folderId:m.id,name:m.name,isExpanded:m.isExpanded,onToggle:()=>o(m.id),count:y,showContextMenu:!0}),m.isExpanded&&v.map(b=>(0,e.jsx)(ce,{id:b.id,tableName:b.name,isNested:!0,showContextMenu:!0},b.id))]},m.id)}),p.map(m=>(0,e.jsx)(ce,{id:m.id,tableName:m.name,showContextMenu:!0},m.id))]})]})},ta=()=>{const{addQuery:s,addFolder:t}=me(),a=te(),r=(0,l.useRef)(null),[n,o]=O(R.SIDEBAR_SEARCH,{defaultValue:""}),c=f=>{o(f.target.value)},i=()=>{const f=s();a({to:"/runner/$queryId",params:{queryId:f}})},u=()=>{const f=Math.random().toString(36).substring(2,15);t({id:f,name:"New Folder",isExpanded:!0,isFavorite:!1})};return(0,e.jsxs)("div",{className:"p-3 space-y-2 border-b border-sidebar-border",children:[(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsxs)(S,{className:"flex-1 justify-start h-8",onClick:i,children:[(0,e.jsx)(Z,{className:"size-4"}),"Add Query"]}),(0,e.jsxs)(S,{className:"flex-1 justify-start h-8",onClick:u,children:[(0,e.jsx)(Ue,{className:"size-4"}),"Add Folder"]})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)(we,{className:"absolute left-2 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),(0,e.jsx)(M,{ref:r,placeholder:"Search queries",value:n??"",onChange:c,className:"rounded-sm h-8 pl-8 pr-8"}),(0,e.jsx)(ee,{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs",children:"/"})]})]})},aa=()=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ta,{}),(0,e.jsx)(sa,{})]}),ra=({tableName:s,schemaName:t})=>{const a=te(),r=he({strict:!1}),{pathname:n}=se(),o=Ee(),{copyTableSchema:c,isCopyingSchema:i}=Nt(),{exportFile:u,isExportingFile:f}=rt(),{deleteTable:g,forceDeleteTable:x,isDeletingTable:h}=lt(),{renameTable:p,isRenamingTable:m}=at({tableName:s,schemaName:t}),{openOverlay:v,closeOverlay:y,isOverlayOpen:b}=J(),{setEditingTable:w}=Gs(),E=Js(),[d,j]=(0,l.useState)(s),[k,V]=(0,l.useState)([]),A=t?`${t}.${s}`:s,F=`tables.rename-table.${A}`,_=`tables.delete-table.${A}`,D=`tables.force-delete-table.${A}`,L=N=>{N?(j(s),v(F)):y(F)},ie=async()=>{const N=d.trim();if(!(!N||N===s))try{if(await p({newTableName:N,schemaName:t}),L(!1),r.table===s&&o===t){const je=n.startsWith("/schema")?"/schema/$table":n.startsWith("/indexes")?"/indexes/$table":"/table/$table";a({to:je,params:{table:N},search:{[R.TABLE_SCHEMA]:t}})}}catch{}},be=()=>{navigator.clipboard.writeText(s),z.success("Table name copied to clipboard")},pe=async()=>{const N=await g(s,t);N.fkViolation?(V(N.relatedRecords),y(_),v(D)):(y(_),a({to:"/"}))},ge=async()=>{await x(s,t),y(D),a({to:"/"})},ve=()=>{y(D),V([])};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(Ze,{children:[(0,e.jsx)(Ye,{asChild:!0,children:(0,e.jsx)(S,{variant:"ghost",size:"icon-sm",onClick:N=>{N.stopPropagation(),N.preventDefault()},onPointerDown:N=>{N.stopPropagation()},children:(0,e.jsx)(Os,{})})}),(0,e.jsx)(We,{className:"w-56",align:"start",children:(0,e.jsxs)(Xs,{children:[(0,e.jsxs)(I,{onClick:be,children:[(0,e.jsx)(Is,{className:"size-4"}),"Copy name"]}),(0,e.jsxs)(I,{onClick:()=>c(s,t),disabled:i,children:[(0,e.jsx)(xs,{className:"size-4"}),"Copy table schema"]}),(0,e.jsx)(Se,{}),(0,e.jsxs)(I,{onClick:()=>L(!0),children:[(0,e.jsx)(Ts,{className:"size-4"}),"Rename table"]}),!E&&(0,e.jsxs)(I,{onClick:()=>{w({tableName:s,schemaName:t}),v("schema.edit-table")},children:[(0,e.jsx)(ke,{className:"size-4"}),"Edit table"]}),(0,e.jsxs)(Ge,{children:[(0,e.jsxs)(Xe,{children:[(0,e.jsx)(Ls,{className:"size-4"}),"Export data"]}),(0,e.jsxs)(Je,{children:[(0,e.jsx)(I,{onClick:()=>u({tableName:s,schemaName:t,format:"csv"}),disabled:f,children:"Export as CSV"}),(0,e.jsx)(I,{onClick:()=>u({tableName:s,schemaName:t,format:"json"}),disabled:f,children:"Export as JSON"}),(0,e.jsx)(I,{onClick:()=>u({tableName:s,schemaName:t,format:"xlsx"}),disabled:f,children:"Export as Excel"})]})]}),(0,e.jsx)(Se,{}),(0,e.jsxs)(I,{variant:"destructive",onClick:()=>v(_),children:[(0,e.jsx)(Te,{className:"size-4"}),"Delete table"]})]})})]}),(0,e.jsx)(na,{tableName:s,newTableName:d,setNewTableName:j,isOpen:b(F),onOpenChange:L,onRename:ie,isRenaming:m}),(0,e.jsx)(la,{isOpen:b(_),onOpenChange:N=>{N||y(_)},tableName:s,onDelete:pe,isDeleting:h}),(0,e.jsx)(ia,{isOpen:b(D),onOpenChange:N=>{N||y(D)},tableName:s,relatedRecords:k,onForceDelete:ge,onCancel:ve,isDeleting:h})]})},na=({tableName:s,newTableName:t,setNewTableName:a,isOpen:r,onOpenChange:n,onRename:o,isRenaming:c})=>{const i=t.trim(),u=!i||i===s;return(0,e.jsx)(G,{open:r,onOpenChange:n,children:(0,e.jsxs)(q,{className:"max-w-md",children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Rename Table"}),(0,e.jsx)(W,{children:"Update the table name while keeping all data and schema unchanged."})]}),(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(Fe,{htmlFor:"current-table-name",children:"Current name"}),(0,e.jsx)(M,{id:"current-table-name",value:s,readOnly:!0,disabled:!0})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(Fe,{htmlFor:"new-table-name",children:"New name"}),(0,e.jsx)(M,{id:"new-table-name",value:t,onChange:f=>a(f.target.value),placeholder:"table_name",autoFocus:!0,disabled:c,onKeyDown:f=>{f.key==="Enter"&&!u&&!c&&o()}})]})]}),(0,e.jsxs)(X,{className:"gap-2",children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>n(!1),disabled:c,children:"Cancel"}),(0,e.jsx)(S,{onClick:o,disabled:u||c,children:c?"Renaming...":"Rename Table"})]})]})})},la=({isOpen:s,onOpenChange:t,tableName:a,onDelete:r,isDeleting:n})=>(0,e.jsx)(G,{open:s,onOpenChange:t,children:(0,e.jsxs)(q,{className:"max-w-md",children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Delete Table"}),(0,e.jsxs)(W,{children:["Are you sure you want to delete the table"," ",(0,e.jsxs)("span",{className:"font-semibold text-foreground",children:['"',a,'"']}),"? This action cannot be undone and all data will be permanently lost."]})]}),(0,e.jsxs)(X,{className:"gap-2",children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>t(!1),disabled:n,children:"Cancel"}),(0,e.jsx)(S,{variant:"destructive",onClick:r,disabled:n,children:n?"Deleting...":"Delete Table"})]})]})}),ia=({isOpen:s,onOpenChange:t,tableName:a,relatedRecords:r,onForceDelete:n,onCancel:o,isDeleting:c})=>(0,e.jsx)(G,{open:s,onOpenChange:t,children:(0,e.jsxs)(q,{className:"max-w-xl! max-h-[calc(100vh-1rem)]!",children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Cannot Delete - Foreign Key Constraint"}),(0,e.jsxs)(W,{children:["The table ",(0,e.jsxs)("span",{className:"font-semibold text-foreground",children:['"',a,'"']})," ","cannot be deleted because it is referenced by records in other tables. You can either cancel the operation or force delete, which will also delete all related records."]})]}),(0,e.jsx)("div",{className:"space-y-4 max-h-64 overflow-y-auto",children:r.map((i,u)=>(0,e.jsxs)("div",{className:"border border-border rounded-md p-3",children:[(0,e.jsxs)("div",{className:"font-medium text-sm mb-2",children:["Table: ",(0,e.jsx)("span",{className:"text-primary",children:i.tableName}),(0,e.jsxs)("span",{className:"text-muted-foreground ml-2",children:["(",i.records.length," record",i.records.length!==1?"s":"",")"]})]}),(0,e.jsxs)("div",{className:"text-xs text-muted-foreground mb-2",children:["References column: ",i.columnName]}),(0,e.jsx)("div",{className:"bg-muted rounded p-2 text-xs overflow-x-auto",children:(0,e.jsxs)("pre",{className:"whitespace-pre-wrap",children:[JSON.stringify(i.records.slice(0,5),null,2),i.records.length>5&&(0,e.jsxs)("div",{className:"text-muted-foreground mt-2",children:["... and ",i.records.length-5," more"]})]})})]},`${i.tableName}-${i.columnName}-${u}`))}),(0,e.jsxs)(X,{className:"gap-2",children:[(0,e.jsx)(S,{variant:"outline",onClick:o,disabled:c,children:"Cancel"}),(0,e.jsx)(S,{variant:"destructive",onClick:n,disabled:c,children:c?"Deleting...":"Force Delete All"})]})]})}),oa=({tableName:s,rowCount:t,rowCountEstimated:a,schemaName:r,showSchemaName:n})=>{const o=he({strict:!1}),{pathname:c}=se(),i=o.table,[u,f]=O(R.ACTIVE_TABLE),g=c.startsWith("/visualizer"),x=It({schemaName:r,tableName:s}),h=Ee(),p=g?u===x:i===s&&(h===void 0||h===r),m=c.startsWith("/schema")?"/schema/$table":c.startsWith("/indexes")?"/indexes/$table":"/table/$table",v=(0,e.jsxs)("span",{className:"flex-1 truncate",children:[n&&r&&r!=="public"&&(0,e.jsxs)("span",{className:"text-muted-foreground/60",children:[r,"."]}),s]});return(0,e.jsxs)("li",{className:"relative group",children:[p&&(0,e.jsx)("span",{className:"absolute left-0 top-0 bottom-0 w-1 bg-primary z-10"}),(0,e.jsxs)("div",{className:T("w-full flex gap-0.5 pl-4 pr-2 py-1.5 text-sm transition-colors text-left justify-start items-center focus:outline-none",p?"text-sidebar-accent-foreground bg-sidebar-accent font-medium":"text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent/50 focus:bg-sidebar-accent focus:text-sidebar-accent-foreground"),children:[g?(0,e.jsx)("button",{type:"button",onClick:()=>{f(x)},className:"flex-1 flex items-center gap-1 min-w-0 text-left focus:outline-none",children:v}):(0,e.jsx)(Be,{to:m,params:{table:s},search:{[R.TABLE_SCHEMA]:r},className:"flex-1 flex items-center gap-1 min-w-0 focus:outline-none",children:v}),(0,e.jsxs)("div",{className:"flex items-center gap-1 h-5 shrink-0",children:[(0,e.jsx)("div",{className:T(p?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),children:(0,e.jsx)(ra,{tableName:s,schemaName:r})}),(0,e.jsxs)(ee,{children:[a&&"~",t]})]})]})]})},ca=()=>{const[s]=O(R.SIDEBAR_SEARCH,{defaultValue:""}),[t,a]=O(R.ACTIVE_SCHEMA,{defaultValue:"all"}),r=Q(),{tablesList:n=[],isLoadingTablesList:o,errorTablesList:c}=es(),i=(0,l.useMemo)(()=>Array.from(new Set(n.reduce((x,h)=>(h.schemaName&&x.push(h.schemaName),x),[]))).sort(),[n]),u=(r?.schemaSelector??!1)&&i.length>1,f=t==="all"&&i.length>1,g=n?.filter(x=>{const h=t==="all"||x.schemaName===t,p=x.tableName.toLowerCase().includes(s.toLowerCase());return h&&p});return(0,l.useEffect)(()=>{!u||t==="all"||i.includes(t)||a("all")},[i,t,a,u]),o?(0,e.jsx)("div",{className:"flex-1 h-full overflow-y-auto pb-3 flex items-center justify-center",children:(0,e.jsx)(Ws,{size:"size-6"})}):c?(0,e.jsxs)("div",{className:"flex-1 overflow-y-auto pb-3 h-full flex items-center justify-center",children:["Error: ",c.message]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"flex-1 overflow-y-auto pb-3",children:g&&g.length>0?(0,e.jsx)("ul",{children:g?.map(x=>(0,e.jsx)(oa,{schemaName:x.schemaName,showSchemaName:f,tableName:x.tableName,rowCount:x.rowCount,rowCountEstimated:x.rowCountEstimated},x.schemaName?`${x.schemaName}.${x.tableName}`:x.tableName))}):s?(0,e.jsx)("div",{className:"flex-1 overflow-y-auto pb-3 h-full flex items-center justify-center",children:"No tables found matching"}):(0,e.jsx)("div",{className:"flex-1 overflow-y-auto pb-3 h-full flex items-center justify-center",children:"No tables available"})}),(0,e.jsx)(Ys,{})]})},da=()=>{const s=(0,l.useRef)(null),[t,a]=O(R.SIDEBAR_SEARCH,{defaultValue:""}),{openOverlay:r}=J(),n=Q();return nt("/",o=>{o.preventDefault(),s.current&&s.current.focus()},{preventDefault:!0}),(0,e.jsx)("div",{className:"px-3 pb-3 pt-2 space-y-2",children:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,e.jsx)(we,{className:"absolute left-2 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),(0,e.jsx)(M,{ref:s,variant:"outline",placeholder:"Search tables",value:t??"",onChange:o=>a(o.target.value.trim()),className:"rounded-sm h-8 pl-8 pr-8"}),(0,e.jsx)(ee,{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs",children:"/"})]}),n?.dataModel!=="document"&&(0,e.jsx)(S,{size:"icon-lg",className:"shrink-0 rounded-sm",onClick:()=>r("table-builder.create-table"),"aria-label":"Add table",children:(0,e.jsx)(Z,{className:"size-4"})})]})})},ua=()=>{const[s,t]=O(R.ACTIVE_SCHEMA,{defaultValue:"all"}),a=Q(),{tablesList:r=[]}=es(),n=(0,l.useMemo)(()=>Array.from(new Set(r.reduce((o,c)=>(c.schemaName&&o.push(c.schemaName),o),[]))).sort(),[r]);return(a?.schemaSelector??!1)&&n.length>1?(0,e.jsx)("div",{className:"px-3 pt-3",children:(0,e.jsxs)(le,{value:s,onValueChange:t,children:[(0,e.jsx)(re,{variant:"outline",className:"h-8! w-full justify-between rounded-sm",children:(0,e.jsx)(ae,{placeholder:"Select schema"})}),(0,e.jsxs)(ne,{children:[(0,e.jsx)(P,{value:"all",children:"All schemas"}),n.map(o=>(0,e.jsx)(P,{value:o,children:o},o))]})]})}):null},Ve=()=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ua,{}),(0,e.jsx)(da,{}),(0,e.jsx)(yt,{className:"flex-1 overflow-y-auto pb-3 block h-full w-full [&_[data-slot=scroll-area-viewport]>div]:block!",children:(0,e.jsx)(ca,{})})]});function ha(){const{databases:s,isLoadingDatabases:t,refetchDatabases:a,isRefetchingDatabases:r}=Tt(),{selectedDatabase:n,setSelectedDatabase:o}=ss(),c=Q(),i=te(),u=t||r,f=x=>{o(x),i({to:c?.dataModel==="key-value"?"/browser":"/table",search:{}})},g=async()=>{await a(),z.success("Databases refreshed")};return(0,e.jsxs)("div",{className:"mt-auto flex h-11 items-center gap-0.5 border-t border-sidebar-border bg-sidebar px-2 text-sidebar-foreground",children:[(0,e.jsx)(Et,{databasesCount:s?.length??0}),(0,e.jsx)("span",{"aria-hidden":!0,className:"text-xs text-muted-foreground/50",children:"/"}),(0,e.jsxs)(le,{value:n||"",onValueChange:f,children:[(0,e.jsx)(re,{variant:"outline","aria-label":"Database",disabled:u,className:"h-7 min-w-0 flex-1 border-0 px-2 font-mono shadow-none hover:bg-muted/60",children:(0,e.jsx)(ae,{placeholder:"Select database…"})}),(0,e.jsx)(ne,{children:s?.map(x=>(0,e.jsx)(P,{value:x.name,className:"font-mono text-xs",children:x.name},x.name))})]}),(0,e.jsxs)(Re,{children:[(0,e.jsx)(_e,{asChild:!0,children:(0,e.jsx)(S,{variant:"ghost",size:"icon-sm","aria-label":"Refresh databases",onClick:g,disabled:u,children:(0,e.jsx)(qe,{className:T(u&&"animate-spin")})})}),(0,e.jsx)(De,{children:"Refresh databases"})]})]})}var ma=({children:s})=>{const{sidebar:{width:t,isOpen:a,isPinned:r},setSidebarWidth:n,setSidebarOpen:o}=Ie(),c=(0,l.useRef)(!1),i=(0,l.useRef)(0),u=(0,l.useRef)(0),f=(0,l.useRef)(null),g=(0,l.useRef)(d=>{}),x=(0,l.useRef)(()=>{}),h=(0,l.useRef)(()=>{}),p=(0,l.useRef)(()=>{}),m=(0,l.useCallback)(d=>{c.current&&requestAnimationFrame(()=>{const j=d.clientX-i.current,k=u.current+j;n(Math.abs(k-300)<=16?300:k)})},[n]),v=(0,l.useCallback)(()=>{c.current=!1,Object.assign(document.body.style,{cursor:"",userSelect:""});const d=document.getElementById("resize-overlay");d&&d.remove()},[]),y=(0,l.useCallback)(d=>{d.preventDefault(),c.current=!0,i.current=d.clientX,u.current=t,Object.assign(document.body.style,{cursor:"col-resize",userSelect:"none"});const j=document.createElement("div");j.id="resize-overlay",j.style.cssText="position:fixed;inset:0;z-index:9999;cursor:col-resize;",document.body.appendChild(j)},[t]),b=(0,l.useCallback)(()=>{r||o(!0)},[r,o]),w=(0,l.useCallback)(()=>{r||o(!1)},[r,o]);g.current=m,x.current=v,h.current=b,p.current=w;const E=d=>{r||o(d)};return(0,l.useEffect)(()=>{const d=k=>g.current(k),j=()=>x.current();return document.addEventListener("mousemove",d),document.addEventListener("mouseup",j),()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",j)}},[]),(0,l.useEffect)(()=>{const d=f.current;if(!d)return;const j=()=>h.current(),k=()=>p.current();return d.addEventListener("mouseenter",j),d.addEventListener("mouseleave",k),()=>{d.removeEventListener("mouseenter",j),d.removeEventListener("mouseleave",k)}},[]),(0,e.jsxs)(et,{open:a,onOpenChange:E,modal:!1,children:[(0,e.jsx)(st,{className:"sr-only",children:"Open Sidebar"}),(0,e.jsx)(Zs,{ref:f,side:"left",showCloseButton:!1,isPinned:r,className:"sidebar-behind-rail bg-sidebar border-r border-sidebar-border text-sidebar-foreground p-0",style:{width:`${t}px`,left:`${R.RAIL_WIDTH}px`},onOpenAutoFocus:d=>d.preventDefault(),children:(0,e.jsxs)("div",{className:"relative h-full flex flex-col",children:[s,(0,e.jsx)("div",{role:"button",tabIndex:0,onMouseDown:y,className:T("absolute inset-y-0 -right-1.5 w-3 cursor-col-resize z-50 outline-none","after:absolute after:inset-y-0 after:left-1/2 after:w-px after:transition-colors","hover:after:bg-blue-400/70 active:after:bg-blue-400/70 focus-visible:after:bg-blue-400/70"),title:"Drag to resize sidebar"})]})})]})},xa=["string","hash","list","set","zset","stream"],K=At(""),fa=()=>{const{closeOverlay:s,isOverlayOpen:t}=J(),[a,r]=(0,l.useState)(K),[n,o]=(0,l.useState)("string"),[c,i]=(0,l.useState)(K),[u,f]=(0,l.useState)(K),[g,x]=(0,l.useState)("0"),[h,p]=(0,l.useState)(""),{createKey:m,isPending:v}=Ft(),y=t("redis-browser.create-key"),b=n==="hash"||n==="stream",w=a===null||c===null||b&&u===null,E=async()=>{const d=b?u:K;if(a===null||c===null||d===null)return;let j;switch(n){case"string":j={kind:"string",value:c};break;case"hash":j={kind:"hash",entries:[{field:c,value:d}]};break;case"list":j={kind:"list",entries:[c]};break;case"set":j={kind:"set",members:[c]};break;case"zset":j={kind:"zset",entries:[{member:c,score:Number(g)}]};break;case"stream":j={kind:"stream",id:"*",fields:[{field:c,value:d}]}}await m({key:a,type:n,value:j,ttlMs:h?Number(h)*1e3:null}),r(K),o("string"),i(K),f(K),x("0"),p(""),s("redis-browser.create-key")};return(0,e.jsxs)(tt,{title:"Create Redis key",description:"Creates the key atomically and never overwrites an existing key.",open:y,onOpenChange:d=>{d||s("redis-browser.create-key")},size:"sm:max-w-md!",headerClassName:"border-b border-border p-4",titleClassName:"text-sm font-medium",contentClassName:"space-y-4 px-4 py-4",children:[(0,e.jsxs)(Ot,{className:"gap-4",children:[(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-name",children:"Key"}),(0,e.jsx)(ye,{id:"redis-key-name",value:a,onChange:r,className:"h-8",placeholder:"cache:user:42"}),(0,e.jsx)(Le,{children:"Text, hexadecimal, and Base64 keys are supported."})]}),(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-type",children:"Type"}),(0,e.jsxs)(le,{value:n,onValueChange:d=>o(d),children:[(0,e.jsx)(re,{id:"redis-key-type",className:"h-8!",children:(0,e.jsx)(ae,{})}),(0,e.jsx)(ne,{children:xa.map(d=>(0,e.jsx)(P,{value:d,children:d},d))})]})]}),(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-first-value",children:n==="hash"||n==="stream"?"Initial field":n==="zset"?"Initial member":"Initial value"}),(0,e.jsx)(ye,{id:"redis-key-first-value",value:c,onChange:i})]}),(n==="hash"||n==="stream")&&(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-second-value",children:"Initial value"}),(0,e.jsx)(ye,{id:"redis-key-second-value",value:u,onChange:f})]}),n==="zset"&&(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-score",children:"Score"}),(0,e.jsx)(M,{id:"redis-key-score",type:"number",value:g,onChange:d=>x(d.target.value),className:"font-mono"})]}),(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-ttl",children:"TTL in seconds"}),(0,e.jsx)(M,{id:"redis-key-ttl",type:"number",min:1,value:h,onChange:d=>p(d.target.value),placeholder:"Persistent",className:"font-mono h-8"}),(0,e.jsx)(Le,{children:"Leave empty to create a persistent key."})]})]}),(0,e.jsxs)("div",{className:"flex justify-end gap-2 border-t border-border pt-4",children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>s("redis-browser.create-key"),children:"Cancel"}),(0,e.jsx)(S,{disabled:v||w,onClick:E,children:"Create key"})]})]})},ba=["string","hash","list","set","zset","stream"],pa={string:"STR",hash:"HASH",list:"LIST",set:"SET",zset:"ZSET",stream:"XSTR"},ga=s=>s===-1?"∞":s<0?"gone":s<1e3?`${s}ms`:s<6e4?`${Math.ceil(s/1e3)}s`:s<36e5?`${Math.ceil(s/6e4)}m`:`${Math.ceil(s/36e5)}h`,va=s=>s===null?"—":s<1024?`${s} B`:`${(s/1024).toFixed(1)} KiB`,ja=(s,t)=>t!==void 0?t||"(empty key)":`0x${Array.from(Lt(s),a=>a.toString(16).padStart(2,"0")).join("")}`,ya=()=>{const{openOverlay:s}=J(),[t,a]=O("key"),[r,n]=O("search",{defaultValue:""}),[o,c]=(0,l.useState)(r),[i,u]=O("type",{defaultValue:""}),[f,g]=O("glob",{defaultValue:"false"}),x=f==="true",h=Mt({search:o,type:i,exactPattern:x}),p=(0,l.useMemo)(()=>h.data?.pages.flatMap(b=>b.keys)??[],[h.data]),m=(0,l.useRef)(null),v=hs({count:p.length,getScrollElement:()=>m.current,estimateSize:()=>33,overscan:10}),y=v.getVirtualItems();return(0,l.useEffect)(()=>{const b=window.setTimeout(()=>c(r),250);return()=>window.clearTimeout(b)},[r]),(0,l.useEffect)(()=>{const b=y.at(-1);b&&b.index>=p.length-5&&h.hasNextPage&&!h.isFetchingNextPage&&h.fetchNextPage()},[y,p.length,h.hasNextPage,h.isFetchingNextPage,h.fetchNextPage]),(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col bg-background font-mono",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"space-y-2 px-3 pb-3 pt-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,e.jsx)(we,{className:"absolute left-2 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),(0,e.jsx)(M,{variant:"outline",value:r,onChange:b=>n(b.target.value),placeholder:x?"Redis glob pattern":"Find keys","aria-label":"Find Redis keys",className:"h-8 rounded-sm pl-8"})]}),(0,e.jsx)(S,{variant:"outline",size:"icon-lg",className:"shrink-0 rounded-sm",onClick:()=>z.promise(h.refetch({throwOnError:!0}),{loading:"Refreshing Redis keys...",success:"Redis keys refreshed",error:"Failed to refresh Redis keys"}),disabled:h.isFetching,"aria-label":"Refresh Redis keys",children:(0,e.jsx)(qe,{className:T(h.isFetching&&"animate-spin")})}),(0,e.jsx)(S,{size:"icon-lg",className:"shrink-0 rounded-sm",onClick:()=>s("redis-browser.create-key"),"aria-label":"Create Redis key",children:(0,e.jsx)(Z,{})})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)(le,{value:i||"all",onValueChange:b=>u(b==="all"?"":b),children:[(0,e.jsx)(re,{variant:"outline","aria-label":"Filter Redis key type",className:"h-8! min-w-0 flex-1 justify-between rounded-sm",children:(0,e.jsx)(ae,{})}),(0,e.jsxs)(ne,{children:[(0,e.jsx)(P,{value:"all",children:"All types"}),ba.map(b=>(0,e.jsx)(P,{value:b,children:b},b))]})]}),(0,e.jsxs)(kt,{variant:"outline",size:"lg",pressed:x,onPressedChange:b=>g(b?"true":"false"),className:"shrink-0 rounded-sm px-2 text-xs/relaxed uppercase","aria-label":"Use Redis glob pattern",children:[(0,e.jsx)(Cs,{className:"size-4"})," Glob"]})]})]}),(0,e.jsxs)("div",{className:"flex h-6 items-center justify-between px-4 text-[9px] uppercase tracking-wider text-muted-foreground",children:[(0,e.jsxs)("span",{children:[p.length," loaded"]}),(0,e.jsx)("span",{children:h.dataUpdatedAt>0?new Date(h.dataUpdatedAt).toLocaleTimeString():"not scanned"})]})]}),(0,e.jsxs)("div",{ref:m,className:"min-h-0 flex-1 overflow-auto",children:[h.isLoading?(0,e.jsx)("div",{className:"px-3 py-4 text-xs text-muted-foreground",children:"Scanning keyspace…"}):p.length===0?(0,e.jsxs)("div",{className:"flex min-h-32 flex-col items-center justify-center gap-2 px-4 text-center text-muted-foreground",children:[(0,e.jsx)(vs,{className:"size-4"}),(0,e.jsx)("span",{className:"text-xs",children:"No keys in this scan."}),(0,e.jsxs)(S,{variant:"outline",size:"sm",onClick:()=>s("redis-browser.create-key"),children:[(0,e.jsx)(Z,{})," Create key"]})]}):(0,e.jsx)("div",{className:"relative w-full",style:{height:`${v.getTotalSize()}px`},children:y.map(b=>{const w=p[b.index],E=w.key.base64||"-",d=ja(w.key.base64,w.key.utf8);return(0,e.jsxs)(S,{variant:"ghost",onClick:()=>a(E),className:T("absolute left-0 top-0 h-auto w-full justify-start gap-2 rounded-none px-4 py-1.5 text-sm font-normal transition-colors",t===E?"bg-sidebar-accent text-sidebar-accent-foreground font-medium before:absolute before:inset-y-0 before:left-0 before:w-1 before:bg-primary":"text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),style:{transform:`translateY(${b.start}px)`},title:d,children:[(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate text-left text-current",children:d}),(0,e.jsx)(gt,{variant:"outline",className:"h-4 w-10 shrink-0 justify-center rounded-sm px-1 text-[8px] font-normal text-muted-foreground",children:pa[w.type]??"?"}),(0,e.jsxs)("span",{className:"shrink-0 text-[9px] text-muted-foreground",children:[va(w.memoryBytes)," ·"," ",w.ttlMs===-1?(0,e.jsx)(gs,{className:"inline size-3 align-[-2px]","aria-label":"No expiry"}):ga(w.ttlMs)]})]},`${E}-${b.index}`)})}),h.isFetchingNextPage&&(0,e.jsx)("div",{className:"px-2 py-1 text-center text-[10px] text-muted-foreground",children:"Scanning more…"})]}),(0,e.jsx)(fa,{})]})},Ca=()=>{const{pathname:s}=se(),t=s.split("/")[1],a=Q()?.dataModel==="key-value",r=(0,l.useMemo)(()=>{if(a&&t!=="runner")return(0,e.jsx)(ya,{});switch(t){case"":case"table":case"schema":case"indexes":return(0,e.jsx)(Ve,{});case"runner":return(0,e.jsx)(aa,{});default:return(0,e.jsx)(Ve,{})}},[a,t]);return(0,e.jsxs)(ma,{children:[r,(0,e.jsx)(ha,{})]})},Ya=cs({component:()=>Sa});function Sa(){const s=Q(),t=s?.dataModel==="key-value",{pathname:a}=se(),r=a.split("/")[1],{sidebar:{isPinned:n,width:o}}=Ie();return t&&r!=="browser"&&r!=="runner"&&r!=="logs"?(0,e.jsx)(oe,{to:"/browser"}):!t&&r==="browser"?(0,e.jsx)(oe,{to:"/"}):s&&!s.indexes&&r==="indexes"?(0,e.jsx)(oe,{to:"/table"}):s&&!s.serverLogs&&r==="logs"?(0,e.jsx)(oe,{to:"/table"}):(0,e.jsxs)("div",{className:"bg-background text-foreground w-dvw flex h-dvh max-h-dvh overflow-hidden relative",children:[(0,e.jsx)(ea,{}),(0,e.jsx)(Ca,{}),(0,e.jsx)("div",{className:"rail-content relative flex-1 flex flex-col h-full overflow-hidden",style:{marginLeft:n?`${o}px`:"0"},children:(0,e.jsx)(us,{})})]})}export{Sa as component,zt as n,Ya as t};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/chat-sidebar-BX995Yr1.js","assets/rolldown-runtime-C5zEKjJh.js","assets/icons-CR59yTaA.js","assets/radix-ui-CGydzmrQ.js","assets/bundle-mjs-CkOje67l.js","assets/utils-Bcpfbua-.js","assets/tooltip-Bcb91KP1.js","assets/react-ffmTauEL.js","assets/sheet-sidebar-V9ImpjT9.js","assets/label-hsxz5VOl.js","assets/constants-CK9YDygv.js","assets/database.store-COTWzU5x.js","assets/preload-helper-LZO0i3yF.js","assets/separator-Cd_a7h-Q.js","assets/index-BDPIeMPK.js","assets/tanstack-B9dfs2ya.js","assets/react-dom-B0mgdSUa.js","assets/dist-BbTrC9ET.js","assets/spinner-J26L87h5.js","assets/dist-BW-TarB3.js","assets/schema-DR8Tuvdp.js","assets/badge-DDylQPR6.js","assets/use-database-engine-Ds7pAy-l.js","assets/keys-VBmR2NsV.js","assets/format-cell-value-DeIyb5qF.js","assets/tables-TbUO18cr.js","assets/select-BedKPksO.js","assets/middleware-DF6TlQS2.js","assets/personal-preferences.store-Bfb2buXG.js","assets/vscode-D8MAi5Oo.js","assets/use-theme-BrgSRf8C.js","assets/index-DqujaEeP.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as cs,r as ds}from"./rolldown-runtime-C5zEKjJh.js";import{_ as oe,b as he,f as us,g as Be,n as hs,s as se,v as te,w as ms}from"./tanstack-B9dfs2ya.js";import{$ as xs,A as fs,Ct as bs,E as Z,Et as ps,G as gs,H as vs,It as js,N as ys,Ot as Cs,P as He,Q as Ss,R as Ns,T as qe,X as ws,Z as Ue,_ as ks,a as Ts,b as we,bt as Ae,ct as Es,f as _s,g as Ds,k as ke,m as Rs,mt as Is,nt as Os,p as As,r as Fs,rt as Ls,s as Te,tt as Ms,ut as zs,v as Ps,x as $s}from"./icons-CR59yTaA.js";import{a as Ks,i as Qs,jt as Vs,n as Bs,o as Hs,r as qs,t as Us}from"./radix-ui-CGydzmrQ.js";import{n as z}from"./dist-BbTrC9ET.js";import{t as T}from"./utils-Bcpfbua-.js";import{t as Ws}from"./spinner-J26L87h5.js";import{n as O}from"./dist-BW-TarB3.js";import{C as Gs,G as q,J as U,K as W,S as Ys,W as G,Y,c as We,d as Se,f as Ge,h as Ye,l as Xs,m as Xe,n as Js,p as Je,q as X,s as Ze,u as I,v as Ee}from"./schema-DR8Tuvdp.js";import{n as M,t as Fe}from"./label-hsxz5VOl.js";import{a as J,i as _e,n as De,o as S,t as Re}from"./tooltip-Bcb91KP1.js";import{i as Zs,n as et,s as st,t as tt}from"./sheet-sidebar-V9ImpjT9.js";import{c as at,d as ee,l as rt,r as nt,s as es,u as lt}from"./tables-TbUO18cr.js";import{B as it,r as ot,t as R}from"./constants-CK9YDygv.js";import{i as ct,t as ss}from"./database.store-COTWzU5x.js";import{t as dt}from"./preload-helper-LZO0i3yF.js";import{c as ut,d as ht,f as mt,l as xt,o as ft,p as bt,s as pt,t as gt,u as vt}from"./badge-DDylQPR6.js";import{a as ae,i as re,n as ne,r as P,t as le}from"./select-BedKPksO.js";import{t as Q}from"./use-database-engine-Ds7pAy-l.js";import{t as jt}from"./keys-VBmR2NsV.js";import{r as yt,t as Ct}from"./separator-Cd_a7h-Q.js";import{r as Ie}from"./personal-preferences.store-Bfb2buXG.js";import{t as St}from"./use-theme-BrgSRf8C.js";import{C as Nt,S as B,a as wt,b as Le,c as kt,g as Tt,h as Et,l as _t,p as Dt,u as Rt,v as It,x as Ot,y as H}from"./index-BDPIeMPK.js";import{t as me}from"./queries.store-Dn4T9Cna.js";import{i as At,n as ye,o as Ft,r as Lt,s as Mt}from"./redis-value--1z4IxUa.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"db-studio@1.24.1"};var t=new s.Error().stack;t&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[t]="2874c903-9e27-4360-a4ff-c155a02095c2",s._sentryDebugIdIdentifier="sentry-dbid-2874c903-9e27-4360-a4ff-c155a02095c2")}catch{}})();var Me={AUTHOR:"Hüsam 🥑 <husam@ql3.dev>",AUTHOR_NAME:"Hüsam",AUTHOR_AVATAR:"/avocado.png",AUTHOR_USERNAME:"husamql3",AUTHOR_GITHUB_LINK:"https://github.com/husamql3",SITE_DESCRIPTION:"The modern pgAdmin alternative that works with every database.",SITE_KEYWORDS:["pgadmin alternative","database client","database gui","database browser","sql editor","postgresql client","mysql client","table editor","ai sql","er diagram"],SITE_TITLE:"db-studio",SITE_NAME:"dbstudio.sh",SITE_URL:"https://dbstudio.sh",SITE_X_LINK:"https://x.com/dbstudio_sh",SITE_GITHUB_LINK:"https://github.com/husamql3/db-studio",SITE_GITHUB_NEW_ISSUE_LINK:"https://github.com/husamql3/db-studio/issues/new/choose",SITE_DOCS_LINK:"https://dbstudio.sh/docs",SITE_CHANGELOG_LINK:"https://dbstudio.sh/changelog",SITE_ROADMAP_LINK:"https://dbstudio.sh/roadmap",SITE_IMAGE:"https://dbstudio.sh/og-image.png",SITE_IMAGE_WIDTH:"1200",SITE_IMAGE_HEIGHT:"630",SITE_IMAGE_ALT:"dbstudio.sh – Modern database management studio",SITE_COLOR:"#1447e6"},l=ds(js(),1),zt=({enabled:s=!0}={})=>{const{data:t,isLoading:a,error:r,refetch:n}=ms({queryKey:jt.rateLimit(),queryFn:async()=>(await it()).data,enabled:s});return{rateLimit:t,isLoadingRateLimit:a,errorRateLimit:r,refetchRateLimit:n}},ts={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},ze=l.createContext&&l.createContext(ts),Pt=["attr","size","title"];function $t(s,t){if(s==null)return{};var a,r,n=Kt(s,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(s);for(r=0;r<o.length;r++)a=o[r],t.indexOf(a)===-1&&{}.propertyIsEnumerable.call(s,a)&&(n[a]=s[a])}return n}function Kt(s,t){if(s==null)return{};var a={};for(var r in s)if({}.hasOwnProperty.call(s,r)){if(t.indexOf(r)!==-1)continue;a[r]=s[r]}return a}function de(){return de=Object.assign?Object.assign.bind():function(s){for(var t=1;t<arguments.length;t++){var a=arguments[t];for(var r in a)({}).hasOwnProperty.call(a,r)&&(s[r]=a[r])}return s},de.apply(null,arguments)}function Pe(s,t){var a=Object.keys(s);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(s);t&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(s,n).enumerable})),a.push.apply(a,r)}return a}function ue(s){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?Pe(Object(a),!0).forEach(function(r){Qt(s,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(a)):Pe(Object(a)).forEach(function(r){Object.defineProperty(s,r,Object.getOwnPropertyDescriptor(a,r))})}return s}function Qt(s,t,a){return(t=Vt(t))in s?Object.defineProperty(s,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):s[t]=a,s}function Vt(s){var t=Bt(s,"string");return typeof t=="symbol"?t:t+""}function Bt(s,t){if(typeof s!="object"||!s)return s;var a=s[Symbol.toPrimitive];if(a!==void 0){var r=a.call(s,t||"default");if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(s)}function as(s){return s&&s.map((t,a)=>l.createElement(t.tag,ue({key:a},t.attr),as(t.child)))}function Ht(s){return t=>l.createElement(qt,de({attr:ue({},s.attr)},t),as(s.child))}function qt(s){var t=a=>{var{attr:r,size:n,title:o}=s,c=$t(s,Pt),i=n||a.size||"1em",u;return a.className&&(u=a.className),s.className&&(u=(u?u+" ":"")+s.className),l.createElement("svg",de({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},a.attr,r,c,{className:u,style:ue(ue({color:s.color||a.color},a.style),s.style),height:i,width:i,xmlns:"http://www.w3.org/2000/svg"}),o&&l.createElement("title",null,o),s.children)};return ze!==void 0?l.createElement(ze.Consumer,null,a=>t(a)):t(ts)}function Ut(s){return Ht({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4"},child:[]},{tag:"path",attr:{d:"M9 18c-4.51 2-5-2-7-2"},child:[]}]})(s)}var e=Vs(),Ne=()=>dt(()=>import("./chat-sidebar-BX995Yr1.js").then(s=>s.t),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31])),Wt=(0,l.lazy)(()=>Ne().then(s=>({default:s.ChatSidebar}))),Gt=()=>{const{openOverlay:s,isOverlayOpen:t}=J(),[a,r]=(0,l.useState)(!1);t("chat.assistant")&&!a&&r(!0);const{dbType:n}=ss(),{provider:o}=_t(),c=Rt(Dt),i=wt(),u=c.status[o],f=u?.state==="set"||u?.state==="locked",{rateLimit:g,isLoadingRateLimit:x,errorRateLimit:h}=zt({enabled:i&&o==="gemini"&&!f}),{remaining:p=0,limit:m=0}=g??{remaining:0,limit:0},y=f?"bg-emerald-500":x||h?"bg-zinc-500":o!=="gemini"||p===0?"bg-red-500":p<=5?"bg-yellow-500":"bg-emerald-500";return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(Re,{children:[(0,e.jsx)(_e,{asChild:!0,children:(0,e.jsxs)(S,{variant:"ghost",className:"rounded-none size-12 relative text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors","aria-label":"Open AI assistant",onPointerEnter:Ne,onFocus:Ne,onClick:()=>{s("chat.assistant"),n&&ct.capture("chat_opened",{db_type:n})},children:[(0,e.jsx)(ks,{className:"size-5"}),(0,e.jsx)("span",{"data-testid":"chat-status-indicator",className:T("absolute top-2 right-2 h-2 w-2 rounded-full ring-2 ring-background",y)})]})}),(0,e.jsx)(De,{side:"right",className:"text-xs",children:f?(0,e.jsxs)("p",{children:["AI Assistant · personal ",o," key"]}):!x&&!h?p>0?(0,e.jsxs)("p",{children:[p,"/",m," messages remaining"]}):(0,e.jsx)("p",{children:"AI Assistant"}):(0,e.jsx)("p",{children:"AI status unavailable"})})]}),a&&(0,e.jsx)(l.Suspense,{children:(0,e.jsx)(Wt,{})})]})},Yt={table:_s,runner:Ds,schema:zs,indexes:Ns,logs:$s,visualizer:Fs,browser:Ss},xe="relative flex size-12 shrink-0 items-center justify-center text-muted-foreground transition-colors hover:bg-muted/60 hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ring",fe=({label:s,children:t})=>(0,e.jsxs)(Re,{children:[(0,e.jsx)(_e,{asChild:!0,children:t}),(0,e.jsx)(De,{side:"right",children:(0,e.jsx)("p",{className:"capitalize",children:s})})]}),Xt=()=>{const{pathname:s}=se(),t=he({strict:!1}),a=Q(),r=s.split("/")[1]||"table",n=a?.dataModel==="key-value"?["browser","runner","logs"]:ot.filter(i=>(i!=="indexes"||a?.indexes)&&(i!=="logs"||a?.serverLogs)),o=t.table,c=Ee();return n.map(i=>{const u=Yt[i],f=(i==="table"||i==="schema"||i==="indexes")&&o,g=r===i;return(0,e.jsx)(fe,{label:i,children:(0,e.jsx)(Be,{to:f?`/${i}/$table`:`/${i}`,params:f?{table:o}:void 0,search:f?{[R.TABLE_SCHEMA]:c}:void 0,"aria-label":i,"aria-current":g?"page":void 0,className:T(xe,g&&"bg-muted text-foreground"),children:(0,e.jsx)(u,{className:"size-5"})})},i)})},Jt=()=>{const{sidebar:{isOpen:s},setSidebarOpen:t,setSidebarPinned:a}=Ie();return(0,e.jsx)(fe,{label:s?"Hide sidebar":"Show sidebar",children:(0,e.jsx)("button",{type:"button","aria-label":"Toggle sidebar",className:xe,onClick:()=>{t(!s),a(!s)},children:(0,e.jsx)(fs,{className:"size-5"})})})},$e=[{value:"light",label:"Light",icon:As},{value:"dark",label:"Dark",icon:ys},{value:"system",label:"System",icon:He}],Zt=()=>{const{theme:s,setTheme:t}=St(),a=$e.find(r=>r.value===s)?.icon??He;return(0,e.jsxs)(Ze,{children:[(0,e.jsx)(fe,{label:"More",children:(0,e.jsx)(Ye,{asChild:!0,children:(0,e.jsx)("button",{type:"button","aria-label":"More",className:xe,children:(0,e.jsx)(Ms,{className:"size-5"})})})}),(0,e.jsxs)(We,{side:"right",align:"end",sideOffset:8,className:"w-48",children:[(0,e.jsxs)(Ge,{children:[(0,e.jsxs)(Xe,{children:[(0,e.jsx)(a,{}),"Theme"]}),(0,e.jsx)(Je,{children:$e.map(({value:r,label:n,icon:o})=>(0,e.jsxs)(I,{onClick:()=>t(r),children:[(0,e.jsx)(o,{}),n,s===r&&(0,e.jsx)(bs,{className:"ml-auto"})]},r))})]}),(0,e.jsx)(Se,{}),(0,e.jsx)(I,{asChild:!0,children:(0,e.jsxs)("a",{href:Me.SITE_GITHUB_NEW_ISSUE_LINK,target:"_blank",rel:"noopener noreferrer",children:[(0,e.jsx)(ps,{}),"Report a bug"]})}),(0,e.jsx)(I,{asChild:!0,children:(0,e.jsxs)("a",{href:Me.SITE_GITHUB_LINK,target:"_blank",rel:"noopener noreferrer",children:[(0,e.jsx)(Ut,{}),"View on GitHub"]})})]})]})},Ke=()=>(0,e.jsx)("div",{className:"h-px w-full shrink-0 bg-border"}),ea=()=>{const{openOverlay:s}=J();return(0,e.jsxs)("nav",{"aria-label":"Main",className:"flex shrink-0 flex-col border-r border-border bg-background",style:{width:R.RAIL_WIDTH},children:[(0,e.jsx)(Jt,{}),(0,e.jsx)(Ke,{}),(0,e.jsx)(Xt,{}),(0,e.jsxs)("div",{className:"mt-auto flex flex-col",children:[(0,e.jsx)(Ke,{}),(0,e.jsx)(Gt,{}),(0,e.jsx)(fe,{label:"Settings",children:(0,e.jsx)("button",{type:"button","aria-label":"Open settings",className:xe,onClick:()=>s("settings.app"),children:(0,e.jsx)(Ps,{className:"size-5"})})}),(0,e.jsx)(Zt,{})]})]})};function rs({...s}){return(0,e.jsx)(Qs,{"data-slot":"context-menu",...s})}function ns({className:s,...t}){return(0,e.jsx)(Hs,{"data-slot":"context-menu-trigger",className:T("select-none",s),...t})}function ls({className:s,...t}){return(0,e.jsx)(qs,{children:(0,e.jsx)(Us,{"data-slot":"context-menu-content",className:T("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--radix-context-menu-content-available-height) origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto",s),...t})})}function $({className:s,inset:t,variant:a="default",...r}){return(0,e.jsx)(Bs,{"data-slot":"context-menu-item","data-inset":t,"data-variant":a,className:T("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 group/context-menu-item relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",s),...r})}function Qe({className:s,...t}){return(0,e.jsx)(Ks,{"data-slot":"context-menu-separator",className:T("bg-border/50 -mx-1 my-1 h-px",s),...t})}var Ce=({folderId:s,isExpanded:t,onToggle:a,count:r,name:n,showContextMenu:o=!1})=>{const c=te(),{deleteFolder:i,getQueriesByFolder:u,addQuery:f,updateFolder:g}=me(),[x,h]=(0,l.useState)(!1),[p,m]=(0,l.useState)(""),[v,y]=(0,l.useState)(!1),b=(0,l.useCallback)(()=>{if(s){if(u(s).length>0){y(!0);return}i(s)}},[i,s,u]),w=(0,l.useCallback)(()=>{s&&(i(s),y(!1))},[i,s]),E=(0,l.useCallback)(()=>{const k=f(void 0,s);c({to:"/runner/$queryId",params:{queryId:k}})},[f,s,c]),d=(0,l.useCallback)(()=>{m(n),h(!0)},[n]),j=(0,l.useCallback)(()=>{s&&p.trim()&&(g(s,{name:p.trim()}),h(!1),m(""))},[s,p,g]);return(0,e.jsxs)(e.Fragment,{children:[o?(0,e.jsxs)(rs,{children:[(0,e.jsx)(ns,{asChild:!0,children:(0,e.jsxs)("button",{type:"button",onClick:a,className:T("w-full flex gap-2 px-4 py-2 text-sm transition-colors text-left","hover:bg-sidebar-accent/50 hover:text-sidebar-foreground focus:outline-none focus:bg-sidebar-accent focus:text-sidebar-accent-foreground","text-sidebar-foreground/70 items-center"),children:[(0,e.jsx)(Ae,{className:T("size-4 transition-transform duration-200",t?"rotate-90":"")}),(0,e.jsx)("span",{className:"flex-1",children:n}),(0,e.jsx)(ee,{children:r})]})}),(0,e.jsxs)(ls,{children:[(0,e.jsxs)($,{onClick:E,children:[(0,e.jsx)(Z,{className:"size-4"}),"Add a new query"]}),(0,e.jsxs)($,{onClick:d,children:[(0,e.jsx)(ke,{className:"size-4"}),"Rename folder"]}),(0,e.jsxs)($,{onClick:b,children:[(0,e.jsx)(Te,{className:"size-4"}),"Delete folder"]})]})]}):(0,e.jsxs)("button",{type:"button",onClick:a,className:T("w-full flex gap-2 px-4 py-2 text-sm transition-colors text-left","hover:bg-sidebar-accent/50 hover:text-sidebar-foreground focus:outline-none focus:bg-sidebar-accent focus:text-sidebar-accent-foreground","text-sidebar-foreground/70 items-center"),children:[(0,e.jsx)(Ae,{className:T("size-4 transition-transform duration-200",t?"rotate-90":"")}),(0,e.jsx)("span",{className:"flex-1",children:n}),(0,e.jsx)(ee,{children:r})]}),(0,e.jsx)(G,{open:x,onOpenChange:h,children:(0,e.jsxs)(q,{children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Rename Folder"}),(0,e.jsx)(W,{children:"Enter a new name for this folder."})]}),(0,e.jsx)(M,{value:p,onChange:k=>m(k.target.value),placeholder:"Folder name",onKeyDown:k=>{k.key==="Enter"&&j()},autoFocus:!0}),(0,e.jsxs)(X,{children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>{h(!1),m("")},children:"Cancel"}),(0,e.jsx)(S,{onClick:j,disabled:!p.trim(),children:"Rename"})]})]})}),(0,e.jsx)(ft,{open:v,onOpenChange:y,children:(0,e.jsxs)(xt,{children:[(0,e.jsxs)(mt,{children:[(0,e.jsx)(bt,{children:"Delete Folder"}),(0,e.jsxs)(vt,{children:["This folder contains ",r," ",r===1?"query":"queries",". Deleting this folder will also delete all queries inside it. This action cannot be undone."]})]}),(0,e.jsxs)(ht,{children:[(0,e.jsx)(ut,{children:"Cancel"}),(0,e.jsx)(pt,{onClick:w,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"Delete Folder"})]})]})})]})},ce=({id:s,tableName:t,isNested:a=!1,showContextMenu:r=!0})=>{const n=te(),{deleteQuery:o,addQuery:c,getQuery:i,toggleFavorite:u,updateQuery:f,moveQuery:g,folders:x,addFolder:h}=me(),{queryId:p}=he({strict:!1}),m=p===s,v=i(s),y=v?.isFavorite??!1,[b,w]=(0,l.useState)(!1),[E,d]=(0,l.useState)(""),[j,k]=(0,l.useState)(!1),[V,A]=(0,l.useState)(void 0),[F,_]=(0,l.useState)(!1),[D,L]=(0,l.useState)(""),ie=(0,l.useCallback)(()=>{n({to:"/runner/$queryId",params:{queryId:s}})},[n,s]),be=(0,l.useCallback)(()=>{o(s),p===s&&n({to:"/runner"}),z.success("Query deleted successfully")},[o,s,n,p]),pe=(0,l.useCallback)(()=>{const C=i(s),os=c(`${C?.name} (Copy)`);n({to:"/runner/$queryId",params:{queryId:os}}),z.success("Query duplicated successfully")},[c,i,n,s]),ge=(0,l.useCallback)(()=>{u(s),z.success("Query favorited successfully")},[u,s]),ve=(0,l.useCallback)(()=>{d(v?.name??""),w(!0)},[v?.name]),N=(0,l.useCallback)(()=>{E.trim()&&(f(s,{name:E.trim()}),w(!1),d(""),z.success("Query renamed successfully"))},[s,E,f]),je=(0,l.useCallback)(()=>{A(v?.folderId),_(!1),L(""),k(!0)},[v?.folderId]),is=(0,l.useCallback)(C=>{C==="__create_new__"?(_(!0),A(void 0)):(_(!1),A(C==="__none__"?void 0:C))},[]),Oe=(0,l.useCallback)(()=>{if(F&&D.trim()){const C=Math.random().toString(36).substring(2,15);h({id:C,name:D.trim(),isExpanded:!0,isFavorite:!1}),g(s,C),z.success("Query moved to new folder successfully")}else F||(g(s,V),z.success("Query moved to selected folder successfully"));k(!1),_(!1),L(""),A(void 0)},[F,D,V,s,h,g]);return(0,e.jsxs)("li",{className:"relative",children:[r?(0,e.jsxs)(rs,{children:[(0,e.jsx)(ns,{asChild:!0,children:(0,e.jsxs)("button",{type:"button",onClick:ie,className:T("w-full flex gap-2 py-2 text-sm transition-colors text-left justify-start items-center focus:outline-none",m?"text-sidebar-accent-foreground bg-sidebar-accent font-medium":"text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent/50 focus:bg-sidebar-accent focus:text-sidebar-accent-foreground",a?"px-4 pl-12":"px-4"),children:[m&&(0,e.jsx)("span",{className:"absolute left-0 top-0 bottom-0 w-1 bg-primary"}),(0,e.jsx)("span",{className:"flex-1",children:t})]})}),(0,e.jsxs)(ls,{children:[(0,e.jsxs)($,{onClick:ve,children:[(0,e.jsx)(ke,{className:"size-4"}),"Rename query"]}),(0,e.jsxs)($,{onClick:pe,children:[(0,e.jsx)(Es,{className:"size-4"}),"Duplicate query"]}),(0,e.jsxs)($,{onClick:ge,children:[(0,e.jsx)(Rs,{className:y?"size-4 fill-current":"size-4"}),y?"Remove from favorites":"Add to favorites"]}),(0,e.jsx)(Qe,{}),(0,e.jsxs)($,{onClick:je,children:[(0,e.jsx)(ws,{className:"size-4"}),"Move to folder"]}),(0,e.jsx)(Qe,{}),(0,e.jsxs)($,{onClick:be,children:[(0,e.jsx)(Te,{className:"size-4"}),"Delete query"]})]})]}):(0,e.jsxs)("button",{type:"button",onClick:ie,className:T("w-full flex gap-2 py-2 text-sm transition-colors text-left justify-start items-center focus:outline-none",m?"text-sidebar-accent-foreground bg-sidebar-accent font-medium":"text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent/50 focus:bg-sidebar-accent focus:text-sidebar-accent-foreground",a?"px-4 pl-12":"px-4"),children:[m&&(0,e.jsx)("span",{className:"absolute left-0 top-0 bottom-0 w-1 bg-primary"}),(0,e.jsx)("span",{className:"flex-1",children:t})]}),(0,e.jsx)(G,{open:b,onOpenChange:w,children:(0,e.jsxs)(q,{children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Rename Query"}),(0,e.jsx)(W,{children:"Enter a new name for this query."})]}),(0,e.jsx)(M,{value:E,onChange:C=>d(C.target.value),placeholder:"Query name",onKeyDown:C=>{C.key==="Enter"&&N()},autoFocus:!0}),(0,e.jsxs)(X,{children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>{w(!1),d("")},children:"Cancel"}),(0,e.jsx)(S,{onClick:N,disabled:!E.trim(),children:"Rename"})]})]})}),(0,e.jsx)(G,{open:j,onOpenChange:C=>{k(C),C||(_(!1),L(""),A(void 0))},children:(0,e.jsxs)(q,{children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Move to Folder"}),(0,e.jsx)(W,{children:"Select a folder to move this query to."})]}),(0,e.jsx)("div",{className:"space-y-4",children:F?(0,e.jsx)(M,{value:D,onChange:C=>L(C.target.value),placeholder:"Folder name",onKeyDown:C=>{C.key==="Enter"&&D.trim()&&Oe(),C.key==="Escape"&&(_(!1),L(""))},autoFocus:!0}):(0,e.jsxs)(le,{value:V??"__none__",onValueChange:is,children:[(0,e.jsx)(re,{className:"w-full",children:(0,e.jsx)(ae,{placeholder:"Select a folder"})}),(0,e.jsxs)(ne,{children:[(0,e.jsx)(P,{value:"__none__",children:"No folder"}),x.map(C=>(0,e.jsx)(P,{value:C.id,children:C.name},C.id)),(0,e.jsx)(P,{value:"__create_new__",children:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(Ue,{className:"size-4"}),"Create a new folder"]})})]})]})}),(0,e.jsxs)(X,{children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>{k(!1),_(!1),L(""),A(void 0)},children:"Cancel"}),(0,e.jsx)(S,{onClick:Oe,disabled:F&&!D.trim(),children:F?"Create & Move":"Move"})]})]})})]})},sa=()=>{const[s]=O(R.SIDEBAR_SEARCH,{defaultValue:""}),{folders:t,queries:a,getFavoriteQueries:r,getQueriesByFolder:n,toggleFolder:o}=me(),[c,i]=(0,l.useState)(!0),[u,f]=(0,l.useState)(!0),g=a.filter(m=>!m.isFavorite).length,x=r(),h=x.length,p=a.filter(m=>!m.folderId&&!m.isFavorite);if(s){const m=a.filter(v=>v.name.toLowerCase().includes(s.toLowerCase()));return m.length===0?(0,e.jsx)("div",{className:"flex-1 overflow-y-auto p-4",children:"No queries found matching"}):(0,e.jsx)("div",{className:"flex-1 overflow-y-auto",children:m.map(v=>(0,e.jsx)(ce,{id:v.id,tableName:v.name},v.id))})}return(0,e.jsxs)("div",{className:"flex-1 overflow-y-auto",children:[(0,e.jsx)(Ce,{name:"Favorites",isExpanded:c,onToggle:()=>i(!c),count:h}),c&&x.map(m=>(0,e.jsx)(ce,{id:m.id,tableName:m.name},m.id)),(0,e.jsx)(Ct,{className:"bg-sidebar-border"}),(0,e.jsx)(Ce,{name:"Queries",isExpanded:u,onToggle:()=>f(!u),count:g}),u&&(0,e.jsxs)(e.Fragment,{children:[t.map(m=>{const v=n(m.id),y=v.length;return(0,e.jsxs)("div",{children:[(0,e.jsx)(Ce,{folderId:m.id,name:m.name,isExpanded:m.isExpanded,onToggle:()=>o(m.id),count:y,showContextMenu:!0}),m.isExpanded&&v.map(b=>(0,e.jsx)(ce,{id:b.id,tableName:b.name,isNested:!0,showContextMenu:!0},b.id))]},m.id)}),p.map(m=>(0,e.jsx)(ce,{id:m.id,tableName:m.name,showContextMenu:!0},m.id))]})]})},ta=()=>{const{addQuery:s,addFolder:t}=me(),a=te(),r=(0,l.useRef)(null),[n,o]=O(R.SIDEBAR_SEARCH,{defaultValue:""}),c=f=>{o(f.target.value)},i=()=>{const f=s();a({to:"/runner/$queryId",params:{queryId:f}})},u=()=>{const f=Math.random().toString(36).substring(2,15);t({id:f,name:"New Folder",isExpanded:!0,isFavorite:!1})};return(0,e.jsxs)("div",{className:"p-3 space-y-2 border-b border-sidebar-border",children:[(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsxs)(S,{className:"flex-1 justify-start h-8",onClick:i,children:[(0,e.jsx)(Z,{className:"size-4"}),"Add Query"]}),(0,e.jsxs)(S,{className:"flex-1 justify-start h-8",onClick:u,children:[(0,e.jsx)(Ue,{className:"size-4"}),"Add Folder"]})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)(we,{className:"absolute left-2 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),(0,e.jsx)(M,{ref:r,placeholder:"Search queries",value:n??"",onChange:c,className:"rounded-sm h-8 pl-8 pr-8"}),(0,e.jsx)(ee,{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs",children:"/"})]})]})},aa=()=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ta,{}),(0,e.jsx)(sa,{})]}),ra=({tableName:s,schemaName:t})=>{const a=te(),r=he({strict:!1}),{pathname:n}=se(),o=Ee(),{copyTableSchema:c,isCopyingSchema:i}=Nt(),{exportFile:u,isExportingFile:f}=rt(),{deleteTable:g,forceDeleteTable:x,isDeletingTable:h}=lt(),{renameTable:p,isRenamingTable:m}=at({tableName:s,schemaName:t}),{openOverlay:v,closeOverlay:y,isOverlayOpen:b}=J(),{setEditingTable:w}=Gs(),E=Js(),[d,j]=(0,l.useState)(s),[k,V]=(0,l.useState)([]),A=t?`${t}.${s}`:s,F=`tables.rename-table.${A}`,_=`tables.delete-table.${A}`,D=`tables.force-delete-table.${A}`,L=N=>{N?(j(s),v(F)):y(F)},ie=async()=>{const N=d.trim();if(!(!N||N===s))try{if(await p({newTableName:N,schemaName:t}),L(!1),r.table===s&&o===t){const je=n.startsWith("/schema")?"/schema/$table":n.startsWith("/indexes")?"/indexes/$table":"/table/$table";a({to:je,params:{table:N},search:{[R.TABLE_SCHEMA]:t}})}}catch{}},be=()=>{navigator.clipboard.writeText(s),z.success("Table name copied to clipboard")},pe=async()=>{const N=await g(s,t);N.fkViolation?(V(N.relatedRecords),y(_),v(D)):(y(_),a({to:"/"}))},ge=async()=>{await x(s,t),y(D),a({to:"/"})},ve=()=>{y(D),V([])};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)(Ze,{children:[(0,e.jsx)(Ye,{asChild:!0,children:(0,e.jsx)(S,{variant:"ghost",size:"icon-sm",onClick:N=>{N.stopPropagation(),N.preventDefault()},onPointerDown:N=>{N.stopPropagation()},children:(0,e.jsx)(Os,{})})}),(0,e.jsx)(We,{className:"w-56",align:"start",children:(0,e.jsxs)(Xs,{children:[(0,e.jsxs)(I,{onClick:be,children:[(0,e.jsx)(Is,{className:"size-4"}),"Copy name"]}),(0,e.jsxs)(I,{onClick:()=>c(s,t),disabled:i,children:[(0,e.jsx)(xs,{className:"size-4"}),"Copy table schema"]}),(0,e.jsx)(Se,{}),(0,e.jsxs)(I,{onClick:()=>L(!0),children:[(0,e.jsx)(Ts,{className:"size-4"}),"Rename table"]}),!E&&(0,e.jsxs)(I,{onClick:()=>{w({tableName:s,schemaName:t}),v("schema.edit-table")},children:[(0,e.jsx)(ke,{className:"size-4"}),"Edit table"]}),(0,e.jsxs)(Ge,{children:[(0,e.jsxs)(Xe,{children:[(0,e.jsx)(Ls,{className:"size-4"}),"Export data"]}),(0,e.jsxs)(Je,{children:[(0,e.jsx)(I,{onClick:()=>u({tableName:s,schemaName:t,format:"csv"}),disabled:f,children:"Export as CSV"}),(0,e.jsx)(I,{onClick:()=>u({tableName:s,schemaName:t,format:"json"}),disabled:f,children:"Export as JSON"}),(0,e.jsx)(I,{onClick:()=>u({tableName:s,schemaName:t,format:"xlsx"}),disabled:f,children:"Export as Excel"})]})]}),(0,e.jsx)(Se,{}),(0,e.jsxs)(I,{variant:"destructive",onClick:()=>v(_),children:[(0,e.jsx)(Te,{className:"size-4"}),"Delete table"]})]})})]}),(0,e.jsx)(na,{tableName:s,newTableName:d,setNewTableName:j,isOpen:b(F),onOpenChange:L,onRename:ie,isRenaming:m}),(0,e.jsx)(la,{isOpen:b(_),onOpenChange:N=>{N||y(_)},tableName:s,onDelete:pe,isDeleting:h}),(0,e.jsx)(ia,{isOpen:b(D),onOpenChange:N=>{N||y(D)},tableName:s,relatedRecords:k,onForceDelete:ge,onCancel:ve,isDeleting:h})]})},na=({tableName:s,newTableName:t,setNewTableName:a,isOpen:r,onOpenChange:n,onRename:o,isRenaming:c})=>{const i=t.trim(),u=!i||i===s;return(0,e.jsx)(G,{open:r,onOpenChange:n,children:(0,e.jsxs)(q,{className:"max-w-md",children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Rename Table"}),(0,e.jsx)(W,{children:"Update the table name while keeping all data and schema unchanged."})]}),(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(Fe,{htmlFor:"current-table-name",children:"Current name"}),(0,e.jsx)(M,{id:"current-table-name",value:s,readOnly:!0,disabled:!0})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(Fe,{htmlFor:"new-table-name",children:"New name"}),(0,e.jsx)(M,{id:"new-table-name",value:t,onChange:f=>a(f.target.value),placeholder:"table_name",autoFocus:!0,disabled:c,onKeyDown:f=>{f.key==="Enter"&&!u&&!c&&o()}})]})]}),(0,e.jsxs)(X,{className:"gap-2",children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>n(!1),disabled:c,children:"Cancel"}),(0,e.jsx)(S,{onClick:o,disabled:u||c,children:c?"Renaming...":"Rename Table"})]})]})})},la=({isOpen:s,onOpenChange:t,tableName:a,onDelete:r,isDeleting:n})=>(0,e.jsx)(G,{open:s,onOpenChange:t,children:(0,e.jsxs)(q,{className:"max-w-md",children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Delete Table"}),(0,e.jsxs)(W,{children:["Are you sure you want to delete the table"," ",(0,e.jsxs)("span",{className:"font-semibold text-foreground",children:['"',a,'"']}),"? This action cannot be undone and all data will be permanently lost."]})]}),(0,e.jsxs)(X,{className:"gap-2",children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>t(!1),disabled:n,children:"Cancel"}),(0,e.jsx)(S,{variant:"destructive",onClick:r,disabled:n,children:n?"Deleting...":"Delete Table"})]})]})}),ia=({isOpen:s,onOpenChange:t,tableName:a,relatedRecords:r,onForceDelete:n,onCancel:o,isDeleting:c})=>(0,e.jsx)(G,{open:s,onOpenChange:t,children:(0,e.jsxs)(q,{className:"max-w-xl! max-h-[calc(100vh-1rem)]!",children:[(0,e.jsxs)(U,{children:[(0,e.jsx)(Y,{children:"Cannot Delete - Foreign Key Constraint"}),(0,e.jsxs)(W,{children:["The table ",(0,e.jsxs)("span",{className:"font-semibold text-foreground",children:['"',a,'"']})," ","cannot be deleted because it is referenced by records in other tables. You can either cancel the operation or force delete, which will also delete all related records."]})]}),(0,e.jsx)("div",{className:"space-y-4 max-h-64 overflow-y-auto",children:r.map((i,u)=>(0,e.jsxs)("div",{className:"border border-border rounded-md p-3",children:[(0,e.jsxs)("div",{className:"font-medium text-sm mb-2",children:["Table: ",(0,e.jsx)("span",{className:"text-primary",children:i.tableName}),(0,e.jsxs)("span",{className:"text-muted-foreground ml-2",children:["(",i.records.length," record",i.records.length!==1?"s":"",")"]})]}),(0,e.jsxs)("div",{className:"text-xs text-muted-foreground mb-2",children:["References column: ",i.columnName]}),(0,e.jsx)("div",{className:"bg-muted rounded p-2 text-xs overflow-x-auto",children:(0,e.jsxs)("pre",{className:"whitespace-pre-wrap",children:[JSON.stringify(i.records.slice(0,5),null,2),i.records.length>5&&(0,e.jsxs)("div",{className:"text-muted-foreground mt-2",children:["... and ",i.records.length-5," more"]})]})})]},`${i.tableName}-${i.columnName}-${u}`))}),(0,e.jsxs)(X,{className:"gap-2",children:[(0,e.jsx)(S,{variant:"outline",onClick:o,disabled:c,children:"Cancel"}),(0,e.jsx)(S,{variant:"destructive",onClick:n,disabled:c,children:c?"Deleting...":"Force Delete All"})]})]})}),oa=({tableName:s,rowCount:t,rowCountEstimated:a,schemaName:r,showSchemaName:n})=>{const o=he({strict:!1}),{pathname:c}=se(),i=o.table,[u,f]=O(R.ACTIVE_TABLE),g=c.startsWith("/visualizer"),x=It({schemaName:r,tableName:s}),h=Ee(),p=g?u===x:i===s&&(h===void 0||h===r),m=c.startsWith("/schema")?"/schema/$table":c.startsWith("/indexes")?"/indexes/$table":"/table/$table",v=(0,e.jsxs)("span",{className:"flex-1 truncate",children:[n&&r&&r!=="public"&&(0,e.jsxs)("span",{className:"text-muted-foreground/60",children:[r,"."]}),s]});return(0,e.jsxs)("li",{className:"relative group",children:[p&&(0,e.jsx)("span",{className:"absolute left-0 top-0 bottom-0 w-1 bg-primary z-10"}),(0,e.jsxs)("div",{className:T("w-full flex gap-0.5 pl-4 pr-2 py-1.5 text-sm transition-colors text-left justify-start items-center focus:outline-none",p?"text-sidebar-accent-foreground bg-sidebar-accent font-medium":"text-sidebar-foreground/70 hover:text-sidebar-foreground hover:bg-sidebar-accent/50 focus:bg-sidebar-accent focus:text-sidebar-accent-foreground"),children:[g?(0,e.jsx)("button",{type:"button",onClick:()=>{f(x)},className:"flex-1 flex items-center gap-1 min-w-0 text-left focus:outline-none",children:v}):(0,e.jsx)(Be,{to:m,params:{table:s},search:{[R.TABLE_SCHEMA]:r},className:"flex-1 flex items-center gap-1 min-w-0 focus:outline-none",children:v}),(0,e.jsxs)("div",{className:"flex items-center gap-1 h-5 shrink-0",children:[(0,e.jsx)("div",{className:T(p?"opacity-100":"opacity-0 group-hover:opacity-100 focus-within:opacity-100"),children:(0,e.jsx)(ra,{tableName:s,schemaName:r})}),(0,e.jsxs)(ee,{children:[a&&"~",t]})]})]})]})},ca=()=>{const[s]=O(R.SIDEBAR_SEARCH,{defaultValue:""}),[t,a]=O(R.ACTIVE_SCHEMA,{defaultValue:"all"}),r=Q(),{tablesList:n=[],isLoadingTablesList:o,errorTablesList:c}=es(),i=(0,l.useMemo)(()=>Array.from(new Set(n.reduce((x,h)=>(h.schemaName&&x.push(h.schemaName),x),[]))).sort(),[n]),u=(r?.schemaSelector??!1)&&i.length>1,f=t==="all"&&i.length>1,g=n?.filter(x=>{const h=t==="all"||x.schemaName===t,p=x.tableName.toLowerCase().includes(s.toLowerCase());return h&&p});return(0,l.useEffect)(()=>{!u||t==="all"||i.includes(t)||a("all")},[i,t,a,u]),o?(0,e.jsx)("div",{className:"flex-1 h-full overflow-y-auto pb-3 flex items-center justify-center",children:(0,e.jsx)(Ws,{size:"size-6"})}):c?(0,e.jsxs)("div",{className:"flex-1 overflow-y-auto pb-3 h-full flex items-center justify-center",children:["Error: ",c.message]}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"flex-1 overflow-y-auto pb-3",children:g&&g.length>0?(0,e.jsx)("ul",{children:g?.map(x=>(0,e.jsx)(oa,{schemaName:x.schemaName,showSchemaName:f,tableName:x.tableName,rowCount:x.rowCount,rowCountEstimated:x.rowCountEstimated},x.schemaName?`${x.schemaName}.${x.tableName}`:x.tableName))}):s?(0,e.jsx)("div",{className:"flex-1 overflow-y-auto pb-3 h-full flex items-center justify-center",children:"No tables found matching"}):(0,e.jsx)("div",{className:"flex-1 overflow-y-auto pb-3 h-full flex items-center justify-center",children:"No tables available"})}),(0,e.jsx)(Ys,{})]})},da=()=>{const s=(0,l.useRef)(null),[t,a]=O(R.SIDEBAR_SEARCH,{defaultValue:""}),{openOverlay:r}=J(),n=Q();return nt("/",o=>{o.preventDefault(),s.current&&s.current.focus()},{preventDefault:!0}),(0,e.jsx)("div",{className:"px-3 pb-3 pt-2 space-y-2",children:(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,e.jsx)(we,{className:"absolute left-2 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),(0,e.jsx)(M,{ref:s,variant:"outline",placeholder:"Search tables",value:t??"",onChange:o=>a(o.target.value.trim()),className:"rounded-sm h-8 pl-8 pr-8"}),(0,e.jsx)(ee,{className:"absolute right-2 top-1/2 -translate-y-1/2 text-xs",children:"/"})]}),n?.dataModel!=="document"&&(0,e.jsx)(S,{size:"icon-lg",className:"shrink-0 rounded-sm",onClick:()=>r("table-builder.create-table"),"aria-label":"Add table",children:(0,e.jsx)(Z,{className:"size-4"})})]})})},ua=()=>{const[s,t]=O(R.ACTIVE_SCHEMA,{defaultValue:"all"}),a=Q(),{tablesList:r=[]}=es(),n=(0,l.useMemo)(()=>Array.from(new Set(r.reduce((o,c)=>(c.schemaName&&o.push(c.schemaName),o),[]))).sort(),[r]);return(a?.schemaSelector??!1)&&n.length>1?(0,e.jsx)("div",{className:"px-3 pt-3",children:(0,e.jsxs)(le,{value:s,onValueChange:t,children:[(0,e.jsx)(re,{variant:"outline",className:"h-8! w-full justify-between rounded-sm",children:(0,e.jsx)(ae,{placeholder:"Select schema"})}),(0,e.jsxs)(ne,{children:[(0,e.jsx)(P,{value:"all",children:"All schemas"}),n.map(o=>(0,e.jsx)(P,{value:o,children:o},o))]})]})}):null},Ve=()=>(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(ua,{}),(0,e.jsx)(da,{}),(0,e.jsx)(yt,{className:"flex-1 overflow-y-auto pb-3 block h-full w-full [&_[data-slot=scroll-area-viewport]>div]:block!",children:(0,e.jsx)(ca,{})})]});function ha(){const{databases:s,isLoadingDatabases:t,refetchDatabases:a,isRefetchingDatabases:r}=Tt(),{selectedDatabase:n,setSelectedDatabase:o}=ss(),c=Q(),i=te(),u=t||r,f=x=>{o(x),i({to:c?.dataModel==="key-value"?"/browser":"/table",search:{}})},g=async()=>{await a(),z.success("Databases refreshed")};return(0,e.jsxs)("div",{className:"mt-auto flex h-11 items-center gap-0.5 border-t border-sidebar-border bg-sidebar px-2 text-sidebar-foreground",children:[(0,e.jsx)(Et,{databasesCount:s?.length??0}),(0,e.jsx)("span",{"aria-hidden":!0,className:"text-xs text-muted-foreground/50",children:"/"}),(0,e.jsxs)(le,{value:n||"",onValueChange:f,children:[(0,e.jsx)(re,{variant:"outline","aria-label":"Database",disabled:u,className:"h-7 min-w-0 flex-1 border-0 px-2 font-mono shadow-none hover:bg-muted/60",children:(0,e.jsx)(ae,{placeholder:"Select database…"})}),(0,e.jsx)(ne,{children:s?.map(x=>(0,e.jsx)(P,{value:x.name,className:"font-mono text-xs",children:x.name},x.name))})]}),(0,e.jsxs)(Re,{children:[(0,e.jsx)(_e,{asChild:!0,children:(0,e.jsx)(S,{variant:"ghost",size:"icon-sm","aria-label":"Refresh databases",onClick:g,disabled:u,children:(0,e.jsx)(qe,{className:T(u&&"animate-spin")})})}),(0,e.jsx)(De,{children:"Refresh databases"})]})]})}var ma=({children:s})=>{const{sidebar:{width:t,isOpen:a,isPinned:r},setSidebarWidth:n,setSidebarOpen:o}=Ie(),c=(0,l.useRef)(!1),i=(0,l.useRef)(0),u=(0,l.useRef)(0),f=(0,l.useRef)(null),g=(0,l.useRef)(d=>{}),x=(0,l.useRef)(()=>{}),h=(0,l.useRef)(()=>{}),p=(0,l.useRef)(()=>{}),m=(0,l.useCallback)(d=>{c.current&&requestAnimationFrame(()=>{const j=d.clientX-i.current,k=u.current+j;n(Math.abs(k-300)<=16?300:k)})},[n]),v=(0,l.useCallback)(()=>{c.current=!1,Object.assign(document.body.style,{cursor:"",userSelect:""});const d=document.getElementById("resize-overlay");d&&d.remove()},[]),y=(0,l.useCallback)(d=>{d.preventDefault(),c.current=!0,i.current=d.clientX,u.current=t,Object.assign(document.body.style,{cursor:"col-resize",userSelect:"none"});const j=document.createElement("div");j.id="resize-overlay",j.style.cssText="position:fixed;inset:0;z-index:9999;cursor:col-resize;",document.body.appendChild(j)},[t]),b=(0,l.useCallback)(()=>{r||o(!0)},[r,o]),w=(0,l.useCallback)(()=>{r||o(!1)},[r,o]);g.current=m,x.current=v,h.current=b,p.current=w;const E=d=>{r||o(d)};return(0,l.useEffect)(()=>{const d=k=>g.current(k),j=()=>x.current();return document.addEventListener("mousemove",d),document.addEventListener("mouseup",j),()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",j)}},[]),(0,l.useEffect)(()=>{const d=f.current;if(!d)return;const j=()=>h.current(),k=()=>p.current();return d.addEventListener("mouseenter",j),d.addEventListener("mouseleave",k),()=>{d.removeEventListener("mouseenter",j),d.removeEventListener("mouseleave",k)}},[]),(0,e.jsxs)(et,{open:a,onOpenChange:E,modal:!1,children:[(0,e.jsx)(st,{className:"sr-only",children:"Open Sidebar"}),(0,e.jsx)(Zs,{ref:f,side:"left",showCloseButton:!1,isPinned:r,className:"sidebar-behind-rail bg-sidebar border-r border-sidebar-border text-sidebar-foreground p-0",style:{width:`${t}px`,left:`${R.RAIL_WIDTH}px`},onOpenAutoFocus:d=>d.preventDefault(),children:(0,e.jsxs)("div",{className:"relative h-full flex flex-col",children:[s,(0,e.jsx)("div",{role:"button",tabIndex:0,onMouseDown:y,className:T("absolute inset-y-0 -right-1.5 w-3 cursor-col-resize z-50 outline-none","after:absolute after:inset-y-0 after:left-1/2 after:w-px after:transition-colors","hover:after:bg-blue-400/70 active:after:bg-blue-400/70 focus-visible:after:bg-blue-400/70"),title:"Drag to resize sidebar"})]})})]})},xa=["string","hash","list","set","zset","stream"],K=At(""),fa=()=>{const{closeOverlay:s,isOverlayOpen:t}=J(),[a,r]=(0,l.useState)(K),[n,o]=(0,l.useState)("string"),[c,i]=(0,l.useState)(K),[u,f]=(0,l.useState)(K),[g,x]=(0,l.useState)("0"),[h,p]=(0,l.useState)(""),{createKey:m,isPending:v}=Ft(),y=t("redis-browser.create-key"),b=n==="hash"||n==="stream",w=a===null||c===null||b&&u===null,E=async()=>{const d=b?u:K;if(a===null||c===null||d===null)return;let j;switch(n){case"string":j={kind:"string",value:c};break;case"hash":j={kind:"hash",entries:[{field:c,value:d}]};break;case"list":j={kind:"list",entries:[c]};break;case"set":j={kind:"set",members:[c]};break;case"zset":j={kind:"zset",entries:[{member:c,score:Number(g)}]};break;case"stream":j={kind:"stream",id:"*",fields:[{field:c,value:d}]}}await m({key:a,type:n,value:j,ttlMs:h?Number(h)*1e3:null}),r(K),o("string"),i(K),f(K),x("0"),p(""),s("redis-browser.create-key")};return(0,e.jsxs)(tt,{title:"Create Redis key",description:"Creates the key atomically and never overwrites an existing key.",open:y,onOpenChange:d=>{d||s("redis-browser.create-key")},size:"sm:max-w-md!",headerClassName:"border-b border-border p-4",titleClassName:"text-sm font-medium",contentClassName:"space-y-4 px-4 py-4",children:[(0,e.jsxs)(Ot,{className:"gap-4",children:[(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-name",children:"Key"}),(0,e.jsx)(ye,{id:"redis-key-name",value:a,onChange:r,className:"h-8",placeholder:"cache:user:42"}),(0,e.jsx)(Le,{children:"Text, hexadecimal, and Base64 keys are supported."})]}),(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-type",children:"Type"}),(0,e.jsxs)(le,{value:n,onValueChange:d=>o(d),children:[(0,e.jsx)(re,{id:"redis-key-type",className:"h-8!",children:(0,e.jsx)(ae,{})}),(0,e.jsx)(ne,{children:xa.map(d=>(0,e.jsx)(P,{value:d,children:d},d))})]})]}),(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-first-value",children:n==="hash"||n==="stream"?"Initial field":n==="zset"?"Initial member":"Initial value"}),(0,e.jsx)(ye,{id:"redis-key-first-value",value:c,onChange:i})]}),(n==="hash"||n==="stream")&&(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-second-value",children:"Initial value"}),(0,e.jsx)(ye,{id:"redis-key-second-value",value:u,onChange:f})]}),n==="zset"&&(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-score",children:"Score"}),(0,e.jsx)(M,{id:"redis-key-score",type:"number",value:g,onChange:d=>x(d.target.value),className:"font-mono"})]}),(0,e.jsxs)(H,{children:[(0,e.jsx)(B,{htmlFor:"redis-key-ttl",children:"TTL in seconds"}),(0,e.jsx)(M,{id:"redis-key-ttl",type:"number",min:1,value:h,onChange:d=>p(d.target.value),placeholder:"Persistent",className:"font-mono h-8"}),(0,e.jsx)(Le,{children:"Leave empty to create a persistent key."})]})]}),(0,e.jsxs)("div",{className:"flex justify-end gap-2 border-t border-border pt-4",children:[(0,e.jsx)(S,{variant:"outline",onClick:()=>s("redis-browser.create-key"),children:"Cancel"}),(0,e.jsx)(S,{disabled:v||w,onClick:E,children:"Create key"})]})]})},ba=["string","hash","list","set","zset","stream"],pa={string:"STR",hash:"HASH",list:"LIST",set:"SET",zset:"ZSET",stream:"XSTR"},ga=s=>s===-1?"∞":s<0?"gone":s<1e3?`${s}ms`:s<6e4?`${Math.ceil(s/1e3)}s`:s<36e5?`${Math.ceil(s/6e4)}m`:`${Math.ceil(s/36e5)}h`,va=s=>s===null?"—":s<1024?`${s} B`:`${(s/1024).toFixed(1)} KiB`,ja=(s,t)=>t!==void 0?t||"(empty key)":`0x${Array.from(Lt(s),a=>a.toString(16).padStart(2,"0")).join("")}`,ya=()=>{const{openOverlay:s}=J(),[t,a]=O("key"),[r,n]=O("search",{defaultValue:""}),[o,c]=(0,l.useState)(r),[i,u]=O("type",{defaultValue:""}),[f,g]=O("glob",{defaultValue:"false"}),x=f==="true",h=Mt({search:o,type:i,exactPattern:x}),p=(0,l.useMemo)(()=>h.data?.pages.flatMap(b=>b.keys)??[],[h.data]),m=(0,l.useRef)(null),v=hs({count:p.length,getScrollElement:()=>m.current,estimateSize:()=>33,overscan:10}),y=v.getVirtualItems();return(0,l.useEffect)(()=>{const b=window.setTimeout(()=>c(r),250);return()=>window.clearTimeout(b)},[r]),(0,l.useEffect)(()=>{const b=y.at(-1);b&&b.index>=p.length-5&&h.hasNextPage&&!h.isFetchingNextPage&&h.fetchNextPage()},[y,p.length,h.hasNextPage,h.isFetchingNextPage,h.fetchNextPage]),(0,e.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col bg-background font-mono",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"space-y-2 px-3 pb-3 pt-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)("div",{className:"relative min-w-0 flex-1",children:[(0,e.jsx)(we,{className:"absolute left-2 top-1/2 -translate-y-1/2 size-4 text-muted-foreground"}),(0,e.jsx)(M,{variant:"outline",value:r,onChange:b=>n(b.target.value),placeholder:x?"Redis glob pattern":"Find keys","aria-label":"Find Redis keys",className:"h-8 rounded-sm pl-8"})]}),(0,e.jsx)(S,{variant:"outline",size:"icon-lg",className:"shrink-0 rounded-sm",onClick:()=>z.promise(h.refetch({throwOnError:!0}),{loading:"Refreshing Redis keys...",success:"Redis keys refreshed",error:"Failed to refresh Redis keys"}),disabled:h.isFetching,"aria-label":"Refresh Redis keys",children:(0,e.jsx)(qe,{className:T(h.isFetching&&"animate-spin")})}),(0,e.jsx)(S,{size:"icon-lg",className:"shrink-0 rounded-sm",onClick:()=>s("redis-browser.create-key"),"aria-label":"Create Redis key",children:(0,e.jsx)(Z,{})})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsxs)(le,{value:i||"all",onValueChange:b=>u(b==="all"?"":b),children:[(0,e.jsx)(re,{variant:"outline","aria-label":"Filter Redis key type",className:"h-8! min-w-0 flex-1 justify-between rounded-sm",children:(0,e.jsx)(ae,{})}),(0,e.jsxs)(ne,{children:[(0,e.jsx)(P,{value:"all",children:"All types"}),ba.map(b=>(0,e.jsx)(P,{value:b,children:b},b))]})]}),(0,e.jsxs)(kt,{variant:"outline",size:"lg",pressed:x,onPressedChange:b=>g(b?"true":"false"),className:"shrink-0 rounded-sm px-2 text-xs/relaxed uppercase","aria-label":"Use Redis glob pattern",children:[(0,e.jsx)(Cs,{className:"size-4"})," Glob"]})]})]}),(0,e.jsxs)("div",{className:"flex h-6 items-center justify-between px-4 text-[9px] uppercase tracking-wider text-muted-foreground",children:[(0,e.jsxs)("span",{children:[p.length," loaded"]}),(0,e.jsx)("span",{children:h.dataUpdatedAt>0?new Date(h.dataUpdatedAt).toLocaleTimeString():"not scanned"})]})]}),(0,e.jsxs)("div",{ref:m,className:"min-h-0 flex-1 overflow-auto",children:[h.isLoading?(0,e.jsx)("div",{className:"px-3 py-4 text-xs text-muted-foreground",children:"Scanning keyspace…"}):p.length===0?(0,e.jsxs)("div",{className:"flex min-h-32 flex-col items-center justify-center gap-2 px-4 text-center text-muted-foreground",children:[(0,e.jsx)(vs,{className:"size-4"}),(0,e.jsx)("span",{className:"text-xs",children:"No keys in this scan."}),(0,e.jsxs)(S,{variant:"outline",size:"sm",onClick:()=>s("redis-browser.create-key"),children:[(0,e.jsx)(Z,{})," Create key"]})]}):(0,e.jsx)("div",{className:"relative w-full",style:{height:`${v.getTotalSize()}px`},children:y.map(b=>{const w=p[b.index],E=w.key.base64||"-",d=ja(w.key.base64,w.key.utf8);return(0,e.jsxs)(S,{variant:"ghost",onClick:()=>a(E),className:T("absolute left-0 top-0 h-auto w-full justify-start gap-2 rounded-none px-4 py-1.5 text-sm font-normal transition-colors",t===E?"bg-sidebar-accent text-sidebar-accent-foreground font-medium before:absolute before:inset-y-0 before:left-0 before:w-1 before:bg-primary":"text-sidebar-foreground/70 hover:bg-sidebar-accent/50 hover:text-sidebar-foreground"),style:{transform:`translateY(${b.start}px)`},title:d,children:[(0,e.jsx)("span",{className:"min-w-0 flex-1 truncate text-left text-current",children:d}),(0,e.jsx)(gt,{variant:"outline",className:"h-4 w-10 shrink-0 justify-center rounded-sm px-1 text-[8px] font-normal text-muted-foreground",children:pa[w.type]??"?"}),(0,e.jsxs)("span",{className:"shrink-0 text-[9px] text-muted-foreground",children:[va(w.memoryBytes)," ·"," ",w.ttlMs===-1?(0,e.jsx)(gs,{className:"inline size-3 align-[-2px]","aria-label":"No expiry"}):ga(w.ttlMs)]})]},`${E}-${b.index}`)})}),h.isFetchingNextPage&&(0,e.jsx)("div",{className:"px-2 py-1 text-center text-[10px] text-muted-foreground",children:"Scanning more…"})]}),(0,e.jsx)(fa,{})]})},Ca=()=>{const{pathname:s}=se(),t=s.split("/")[1],a=Q()?.dataModel==="key-value",r=(0,l.useMemo)(()=>{if(a&&t!=="runner")return(0,e.jsx)(ya,{});switch(t){case"":case"table":case"schema":case"indexes":return(0,e.jsx)(Ve,{});case"runner":return(0,e.jsx)(aa,{});default:return(0,e.jsx)(Ve,{})}},[a,t]);return(0,e.jsxs)(ma,{children:[r,(0,e.jsx)(ha,{})]})},Ya=cs({component:()=>Sa});function Sa(){const s=Q(),t=s?.dataModel==="key-value",{pathname:a}=se(),r=a.split("/")[1],{sidebar:{isPinned:n,width:o}}=Ie();return t&&r!=="browser"&&r!=="runner"&&r!=="logs"?(0,e.jsx)(oe,{to:"/browser"}):!t&&r==="browser"?(0,e.jsx)(oe,{to:"/"}):s&&!s.indexes&&r==="indexes"?(0,e.jsx)(oe,{to:"/table"}):s&&!s.serverLogs&&r==="logs"?(0,e.jsx)(oe,{to:"/table"}):(0,e.jsxs)("div",{className:"bg-background text-foreground w-dvw flex h-dvh max-h-dvh overflow-hidden relative",children:[(0,e.jsx)(ea,{}),(0,e.jsx)(Ca,{}),(0,e.jsx)("div",{className:"rail-content relative flex-1 flex flex-col h-full overflow-hidden",style:{marginLeft:n?`${o}px`:"0"},children:(0,e.jsx)(us,{})})]})}export{Sa as component,zt as n,Ya as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as n}from"./tanstack-
|
|
1
|
+
import{_ as n}from"./tanstack-B9dfs2ya.js";import{jt as a}from"./radix-ui-CGydzmrQ.js";import{t as o}from"./use-database-engine-Ds7pAy-l.js";import"./index-BDPIeMPK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.24.1"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a4ba724e-d30b-4f65-830b-f89adc4095de",e._sentryDebugIdIdentifier="sentry-dbid-a4ba724e-d30b-4f65-830b-f89adc4095de")}catch{}})();var r=a();function b(){return o()?.dataModel==="key-value"?(0,r.jsx)(n,{to:"/browser"}):(0,r.jsx)("main",{className:"flex-1 flex items-center justify-center",children:"Select a tab to get started"})}export{b as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jt as r}from"./radix-ui-
|
|
1
|
+
import{jt as r}from"./radix-ui-CGydzmrQ.js";import{n as t}from"./index-BDPIeMPK.js";import{t as o}from"./query-runner-C0YRZT1P.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.24.1"};var n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="69eb2631-2aee-477c-bd29-7a26b3141d45",e._sentryDebugIdIdentifier="sentry-dbid-69eb2631-2aee-477c-bd29-7a26b3141d45")}catch{}})();var d=r();function b(){const{queryId:e}=t.useParams();return(0,d.jsx)(o,{queryId:e})}export{b as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jt as n}from"./radix-ui-
|
|
1
|
+
import{jt as n}from"./radix-ui-CGydzmrQ.js";import{n as a,t as o}from"./tables-TbUO18cr.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.24.1"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="1f90e252-45fe-4ac0-9caa-0861976ed6a5",e._sentryDebugIdIdentifier="sentry-dbid-1f90e252-45fe-4ac0-9caa-0861976ed6a5")}catch{}})();var r=n();function f(){const{table:e}=a.useParams();return(0,r.jsx)(o,{tableName:e})}export{f as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jt as o}from"./radix-ui-
|
|
1
|
+
import{jt as o}from"./radix-ui-CGydzmrQ.js";import{t as d}from"./schema-DR8Tuvdp.js";import{t as r}from"./index-BDPIeMPK.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.24.1"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="d1f764d0-86a8-4a06-99d9-622ba7e77d00",e._sentryDebugIdIdentifier="sentry-dbid-d1f764d0-86a8-4a06-99d9-622ba7e77d00")}catch{}})();var n=o();function l(){const{table:e}=r.useParams();return(0,n.jsx)("main",{className:"flex-1 flex flex-col overflow-hidden",children:(0,n.jsx)(d,{tableName:e})})}export{l as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as Y}from"./rolldown-runtime-BpaiXjxi.js";import{C as $,E,g as H,w as J}from"./tanstack-BPG3IW5e.js";import{E as L,I as W,It as X,T as Z,f as ee,o as se,s as ne}from"./icons-Cp2j-kCt.js";import{jt as te}from"./radix-ui-DsfBT21F.js";import{n as R}from"./dist-CbondfsI.js";import{t as ae}from"./utils-BDZEB_LK.js";import{t as P}from"./spinner-C5eJUcQ8.js";import{G as re,J as ie,K as de,M as oe,O as le,W as ce,Y as xe,_ as F,b as me,k as O,q as ue,v as I,w as he,y as fe}from"./schema-B06aGalT.js";import{n as A,t as g}from"./label-BxAgnFDj.js";import{a as f,i as pe,n as ge,o as u,t as je}from"./tooltip-5N-vnBUx.js";import{t as be}from"./sheet-sidebar-CatxqUMS.js";import"./tables-BCWRd0qR.js";import{t as ye}from"./react-CXUHf7G9.js";import{h as ve,o as Ne,u as Ie}from"./constants-BmHYxRwL.js";import{o as Ce,t as C}from"./database.store-B5nYwx6g.js";import{t as b}from"./badge-BDq0-MGZ.js";import{a as Se,i as De,n as Te,r as ze,t as ke}from"./select-XrU76gkU.js";import{t as we}from"./use-database-engine-BUPMYqQP.js";import{i as S}from"./keys-B79aFFUM.js";import{i as qe}from"./index-bHd_PHGE.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"db-studio@1.24.0"};var a=new s.Error().stack;a&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[a]="4d186159-02e1-47ac-b0d0-6ec8e88ceef7",s._sentryDebugIdIdentifier="sentry-dbid-4d186159-02e1-47ac-b0d0-6ec8e88ceef7")}catch{}})();var N=Y(X(),1),_e=({tableName:s,schemaName:a})=>{const r=E(),{closeOverlay:i}=f(),{selectedDatabase:o}=C(),{mutateAsync:x,isPending:l}=$({mutationFn:async d=>(await Ne({tableName:s,schemaName:a,data:d,db:o})).data.data,onSuccess:async()=>{await r.invalidateQueries({queryKey:S.byTable(s),exact:!1}),i("indexes.create-index")}});return{createIndex:async d=>R.promise(x(d),{loading:"Creating index...",success:n=>n||"Index created successfully",error:n=>typeof n.details=="string"&&n.details||n.message||"Failed to create index"}),isCreatingIndex:l}},e=te(),Fe=({tableName:s})=>{const{closeOverlay:a}=f(),r=I(),{createIndex:i,isCreatingIndex:o}=_e({tableName:s,schemaName:r}),{tableCols:x,isLoadingTableCols:l}=he({tableName:s,schemaName:r}),m=we(),d=m?.indexes||null,n=d?.methods??[],{control:h,register:K,handleSubmit:U,setValue:D,watch:V,formState:{errors:y,dirtyFields:B,isSubmitted:T}}=oe({mode:"onSubmit",defaultValues:{indexName:"",columns:[],isUnique:!1,method:n[0]},resolver:le(Ce)}),p=V("columns"),Q=m?.dataModel==="document",[z,G]=(0,N.useState)([]),[v,k]=(0,N.useState)(""),w=[...new Set([...x?.map(({columnName:t})=>t)??[],...z])],q=t=>{const c=p.includes(t)?p.filter(j=>j!==t):[...p,t];D("columns",c,{shouldValidate:T}),B.indexName||D("indexName",c.length?`${s}_${c.join("_").replaceAll(".","_")}_idx`:"",{shouldValidate:T})},_=()=>{const t=v.trim();t&&(w.includes(t)||G([...z,t]),p.includes(t)||q(t),k(""))};return(0,e.jsxs)("form",{onSubmit:U(t=>i(t)),className:"space-y-6",children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(g,{className:"text-xs",children:"Columns, in index order"}),l?(0,e.jsx)(P,{size:"size-5"}):(0,e.jsx)("div",{className:"space-y-1",children:w.map(t=>{const c=p.indexOf(t),j=`create-index-column-${t}`;return(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(F,{id:j,checked:c!==-1,onCheckedChange:()=>q(t)}),(0,e.jsx)(g,{htmlFor:j,className:"font-mono font-normal cursor-pointer",children:t}),c!==-1&&(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:["#",c+1]})]},t)})}),Q&&(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(A,{value:v,onChange:t=>k(t.target.value),onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),_())},placeholder:"Add field path, e.g. address.city","aria-label":"Add field path",className:"font-mono"}),(0,e.jsx)(u,{type:"button",variant:"outline",onClick:_,disabled:!v.trim(),children:"Add"})]}),y.columns&&(0,e.jsx)("p",{className:"text-xs text-destructive",children:"Select at least one column."})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(g,{htmlFor:"create-index-name",className:"text-xs",children:"Name"}),(0,e.jsx)(A,{id:"create-index-name",...K("indexName"),placeholder:`${s}_column_idx`,className:ae("font-mono",y.indexName&&"border-destructive ring-destructive ring-1")}),y.indexName&&(0,e.jsx)("p",{className:"text-xs text-destructive",children:"Enter an index name."})]}),(0,e.jsxs)("div",{className:"flex items-center gap-6",children:[(0,e.jsx)(O,{control:h,name:"isUnique",render:({field:t})=>(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(F,{id:"create-index-unique",checked:t.value,onCheckedChange:c=>t.onChange(c===!0)}),(0,e.jsx)(g,{htmlFor:"create-index-unique",className:"cursor-pointer",children:"Unique"})]})}),n.length>0&&(0,e.jsx)(O,{control:h,name:"method",render:({field:t})=>(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(g,{htmlFor:"create-index-method",children:"Method"}),(0,e.jsxs)(ke,{value:t.value,onValueChange:t.onChange,children:[(0,e.jsx)(De,{id:"create-index-method",className:"font-mono",children:(0,e.jsx)(Se,{})}),(0,e.jsx)(Te,{children:n.map(c=>(0,e.jsx)(ze,{value:c,className:"font-mono",children:c},c))})]})]})})]}),d?.createNote&&(0,e.jsxs)("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,e.jsx)(se,{className:"size-3.5 shrink-0"}),d.createNote]}),(0,e.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,e.jsx)(u,{type:"button",variant:"outline",size:"lg",onClick:()=>a("indexes.create-index"),disabled:o,children:"Cancel"}),(0,e.jsx)(u,{type:"submit",variant:"default",size:"lg",disabled:o,children:o?"Creating...":"Create index"})]})]})},Oe=({tableName:s})=>{const{closeOverlay:a,isOverlayOpen:r}=f();return(0,e.jsx)(be,{title:"Create index",description:`Create an index on "${s}".`,open:r("indexes.create-index"),onOpenChange:i=>{i||a("indexes.create-index")},children:(0,e.jsx)(Fe,{tableName:s})})},Ae=({tableName:s,schemaName:a})=>{const r=E(),{closeOverlay:i}=f(),{selectedDatabase:o}=C(),{mutateAsync:x,isPending:l}=$({mutationFn:async d=>(await Ie({tableName:s,schemaName:a,indexName:d,db:o})).data.data,onSuccess:async()=>{await r.invalidateQueries({queryKey:S.byTable(s),exact:!1}),i("indexes.drop-index")}});return{dropIndex:async d=>R.promise(x(d),{loading:"Dropping index...",success:n=>n||"Index dropped successfully",error:n=>typeof n.details=="string"&&n.details||n.message||"Failed to drop index"}),isDroppingIndex:l}},M=ye()(s=>({droppingIndex:null,setDroppingIndex:a=>s({droppingIndex:a})})),$e=({tableName:s})=>{const{closeOverlay:a,isOverlayOpen:r}=f(),{droppingIndex:i}=M(),o=I(),{dropIndex:x,isDroppingIndex:l}=Ae({tableName:s,schemaName:o});return i?(0,e.jsx)(ce,{open:r("indexes.drop-index"),onOpenChange:m=>{m||a("indexes.drop-index")},children:(0,e.jsxs)(re,{className:"max-w-md",children:[(0,e.jsxs)(ie,{children:[(0,e.jsx)(xe,{children:"Drop Index"}),(0,e.jsxs)(de,{children:["Drop the index"," ",(0,e.jsxs)("span",{className:"font-semibold text-foreground",children:['"',i.indexName,'"']})," ","from table ",(0,e.jsxs)("span",{className:"font-semibold text-foreground",children:['"',s,'"']}),"? No rows are deleted, but queries that rely on this index may get slower."]})]}),(0,e.jsxs)(ue,{className:"gap-2",children:[(0,e.jsx)(u,{variant:"outline",onClick:()=>a("indexes.drop-index"),disabled:l,children:"Cancel"}),(0,e.jsx)(u,{variant:"destructive",onClick:()=>x(i.indexName),disabled:l,children:l?"Dropping...":"Drop Index"})]})]})}):null},Ee=({index:s})=>{const{openOverlay:a}=f(),{setDroppingIndex:r}=M();return s.kind!=="index"?(0,e.jsxs)(je,{children:[(0,e.jsx)(pe,{asChild:!0,children:(0,e.jsx)("span",{className:"inline-flex text-muted-foreground/40",children:(0,e.jsx)(W,{className:"size-3.5"})})}),(0,e.jsx)(ge,{side:"left",children:(0,e.jsx)("p",{children:"Backs a constraint. Drop the constraint to remove it."})})]}):(0,e.jsx)(u,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive","aria-label":`Drop index ${s.indexName}`,onClick:()=>{r(s),a("indexes.drop-index")},children:(0,e.jsx)(ne,{className:"size-3.5"})})},Le=({tableName:s,refetch:a,isRefetching:r=!1})=>{const{openOverlay:i}=f();return(0,e.jsxs)("header",{className:"max-h-8 overflow-hidden border-b border-border w-full flex items-center bg-background text-foreground sticky top-0 left-0 right-0 z-0",children:[(0,e.jsx)(u,{type:"button",variant:"ghost",className:"size-8! aspect-square border-x-0 border-y-0 border-border rounded-none text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors",onClick:()=>{a()},"aria-label":`Refetch indexes for ${s}`,disabled:r,children:(0,e.jsx)(Z,{className:"size-4"})}),(0,e.jsx)(u,{variant:"ghost",asChild:!0,className:"h-8! border-l border-y-0 border-r-0 border-border rounded-none flex items-center gap-2 text-muted-foreground hover:text-foreground",children:(0,e.jsxs)(H,{to:"/table/$table",params:{table:s},"aria-label":`View data for ${s}`,children:[(0,e.jsx)(ee,{className:"size-4"}),"View data"]})}),(0,e.jsxs)(u,{type:"button",variant:"default",className:"h-8! border-l border-y-0 border-r-0 border-border rounded-none flex items-center gap-2",onClick:()=>i("indexes.create-index"),children:[(0,e.jsx)(L,{className:"size-4"}),"Create Index"]})]})},Re=({tableName:s,schemaName:a})=>{const{selectedDatabase:r}=C(),{data:i,isLoading:o,isRefetching:x,error:l,refetch:m}=J({queryKey:S.table(s,r,a),queryFn:()=>ve(s,r,a),select:d=>d.data.data,enabled:!!s&&!!r});return{tableIndexes:i,isLoadingTableIndexes:o,isRefetchingTableIndexes:x,errorTableIndexes:l,refetchTableIndexes:m}},Pe={primary:"Primary","unique-constraint":"Unique constraint",index:null},Me=({tableName:s})=>{const{tableIndexes:a,isLoadingTableIndexes:r,isRefetchingTableIndexes:i,errorTableIndexes:o,refetchTableIndexes:x}=Re({tableName:s,schemaName:I()}),{openOverlay:l}=f(),m=!!a?.some(n=>n.method!==null),d=(0,N.useMemo)(()=>[{id:"indexName",header:"Name",accessorKey:"indexName",cell:({row:n})=>{const h=Pe[n.original.kind];return(0,e.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,e.jsx)("span",{className:"font-mono text-foreground font-medium truncate",children:n.original.indexName}),h&&(0,e.jsx)(b,{variant:"secondary",className:"text-[0.6rem] px-1.5 shrink-0",children:h}),n.original.isSparse&&(0,e.jsx)(b,{variant:"secondary",className:"text-[0.6rem] px-1.5 shrink-0",children:"Sparse"}),n.original.expireAfterSeconds!==void 0&&(0,e.jsxs)(b,{variant:"secondary",className:"text-[0.6rem] px-1.5 shrink-0",children:["TTL (",n.original.expireAfterSeconds,"s)"]})]})},size:340,minSize:160},{id:"columns",header:"Columns",accessorFn:n=>n.columns.join(", "),cell:({getValue:n})=>(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground truncate",children:n()}),size:220,minSize:120},{id:"isUnique",header:"Unique",cell:({row:n})=>n.original.isUnique?(0,e.jsx)(b,{variant:"secondary",className:"text-[0.6rem] px-1.5",children:"Unique"}):(0,e.jsx)("span",{className:"text-xs text-muted-foreground/50",children:"no"}),size:90,minSize:80},...m?[{id:"method",header:"Method",cell:({row:n})=>(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:n.original.method}),size:100,minSize:80}]:[],{id:"definition",header:"Definition",accessorKey:"definition",cell:({getValue:n})=>{const h=n();return h?(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground truncate",children:h}):(0,e.jsx)("span",{className:"text-muted-foreground/50",children:"—"})},size:360,minSize:120},{id:"actions",header:"",cell:({row:n})=>(0,e.jsx)("div",{className:"flex flex-1 justify-center items-center",children:(0,e.jsx)(Ee,{index:n.original})}),size:50,enableResizing:!1}],[m]);return r?(0,e.jsx)("div",{className:"size-full flex items-center justify-center",children:(0,e.jsx)(P,{size:"size-7"})}):o?(0,e.jsxs)("div",{className:"size-full flex flex-col items-center justify-center gap-2",children:[(0,e.jsx)("div",{className:"text-sm font-medium",children:"Failed to load indexes"}),(0,e.jsx)("div",{className:"text-sm text-muted-foreground",children:o.message})]}):(0,e.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,e.jsx)(Le,{tableName:s,refetch:x,isRefetching:i}),a?.length?(0,e.jsx)(me,{columns:d,data:a,renderCellAccessory:n=>(0,e.jsx)(fe,{value:n})}):(0,e.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center gap-3",children:[(0,e.jsx)("div",{className:"text-sm text-muted-foreground",children:"This table has no indexes yet."}),(0,e.jsxs)(u,{type:"button",onClick:()=>l("indexes.create-index"),children:[(0,e.jsx)(L,{className:"size-4"}),"Create index"]})]}),(0,e.jsx)(Oe,{tableName:s}),(0,e.jsx)($e,{tableName:s})]})};function os(){const{table:s}=qe.useParams();return(0,e.jsx)("main",{className:"flex-1 flex flex-col overflow-hidden",children:(0,e.jsx)(Me,{tableName:s})})}export{os as component};
|
|
1
|
+
import{r as Y}from"./rolldown-runtime-C5zEKjJh.js";import{C as $,E,g as H,w as J}from"./tanstack-B9dfs2ya.js";import{E as L,I as W,It as X,T as Z,f as ee,o as se,s as ne}from"./icons-CR59yTaA.js";import{jt as te}from"./radix-ui-CGydzmrQ.js";import{n as R}from"./dist-BbTrC9ET.js";import{t as ae}from"./utils-Bcpfbua-.js";import{t as P}from"./spinner-J26L87h5.js";import{G as re,J as ie,K as de,M as oe,O as le,W as ce,Y as xe,_ as F,b as me,k as O,q as ue,v as I,w as he,y as fe}from"./schema-DR8Tuvdp.js";import{n as A,t as g}from"./label-hsxz5VOl.js";import{a as f,i as pe,n as ge,o as u,t as je}from"./tooltip-Bcb91KP1.js";import{t as be}from"./sheet-sidebar-V9ImpjT9.js";import"./tables-TbUO18cr.js";import{t as ye}from"./react-ffmTauEL.js";import{h as ve,o as Ne,u as Ie}from"./constants-CK9YDygv.js";import{o as Ce,t as C}from"./database.store-COTWzU5x.js";import{t as b}from"./badge-DDylQPR6.js";import{a as Se,i as De,n as Te,r as ze,t as ke}from"./select-BedKPksO.js";import{t as we}from"./use-database-engine-Ds7pAy-l.js";import{i as S}from"./keys-VBmR2NsV.js";import{i as qe}from"./index-BDPIeMPK.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};s.SENTRY_RELEASE={id:"db-studio@1.24.1"};var a=new s.Error().stack;a&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[a]="4d186159-02e1-47ac-b0d0-6ec8e88ceef7",s._sentryDebugIdIdentifier="sentry-dbid-4d186159-02e1-47ac-b0d0-6ec8e88ceef7")}catch{}})();var N=Y(X(),1),_e=({tableName:s,schemaName:a})=>{const r=E(),{closeOverlay:i}=f(),{selectedDatabase:o}=C(),{mutateAsync:x,isPending:l}=$({mutationFn:async d=>(await Ne({tableName:s,schemaName:a,data:d,db:o})).data.data,onSuccess:async()=>{await r.invalidateQueries({queryKey:S.byTable(s),exact:!1}),i("indexes.create-index")}});return{createIndex:async d=>R.promise(x(d),{loading:"Creating index...",success:n=>n||"Index created successfully",error:n=>typeof n.details=="string"&&n.details||n.message||"Failed to create index"}),isCreatingIndex:l}},e=te(),Fe=({tableName:s})=>{const{closeOverlay:a}=f(),r=I(),{createIndex:i,isCreatingIndex:o}=_e({tableName:s,schemaName:r}),{tableCols:x,isLoadingTableCols:l}=he({tableName:s,schemaName:r}),m=we(),d=m?.indexes||null,n=d?.methods??[],{control:h,register:K,handleSubmit:U,setValue:D,watch:V,formState:{errors:y,dirtyFields:B,isSubmitted:T}}=oe({mode:"onSubmit",defaultValues:{indexName:"",columns:[],isUnique:!1,method:n[0]},resolver:le(Ce)}),p=V("columns"),Q=m?.dataModel==="document",[z,G]=(0,N.useState)([]),[v,k]=(0,N.useState)(""),w=[...new Set([...x?.map(({columnName:t})=>t)??[],...z])],q=t=>{const c=p.includes(t)?p.filter(j=>j!==t):[...p,t];D("columns",c,{shouldValidate:T}),B.indexName||D("indexName",c.length?`${s}_${c.join("_").replaceAll(".","_")}_idx`:"",{shouldValidate:T})},_=()=>{const t=v.trim();t&&(w.includes(t)||G([...z,t]),p.includes(t)||q(t),k(""))};return(0,e.jsxs)("form",{onSubmit:U(t=>i(t)),className:"space-y-6",children:[(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(g,{className:"text-xs",children:"Columns, in index order"}),l?(0,e.jsx)(P,{size:"size-5"}):(0,e.jsx)("div",{className:"space-y-1",children:w.map(t=>{const c=p.indexOf(t),j=`create-index-column-${t}`;return(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(F,{id:j,checked:c!==-1,onCheckedChange:()=>q(t)}),(0,e.jsx)(g,{htmlFor:j,className:"font-mono font-normal cursor-pointer",children:t}),c!==-1&&(0,e.jsxs)("span",{className:"text-xs text-muted-foreground",children:["#",c+1]})]},t)})}),Q&&(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(A,{value:v,onChange:t=>k(t.target.value),onKeyDown:t=>{t.key==="Enter"&&(t.preventDefault(),_())},placeholder:"Add field path, e.g. address.city","aria-label":"Add field path",className:"font-mono"}),(0,e.jsx)(u,{type:"button",variant:"outline",onClick:_,disabled:!v.trim(),children:"Add"})]}),y.columns&&(0,e.jsx)("p",{className:"text-xs text-destructive",children:"Select at least one column."})]}),(0,e.jsxs)("div",{className:"space-y-2",children:[(0,e.jsx)(g,{htmlFor:"create-index-name",className:"text-xs",children:"Name"}),(0,e.jsx)(A,{id:"create-index-name",...K("indexName"),placeholder:`${s}_column_idx`,className:ae("font-mono",y.indexName&&"border-destructive ring-destructive ring-1")}),y.indexName&&(0,e.jsx)("p",{className:"text-xs text-destructive",children:"Enter an index name."})]}),(0,e.jsxs)("div",{className:"flex items-center gap-6",children:[(0,e.jsx)(O,{control:h,name:"isUnique",render:({field:t})=>(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(F,{id:"create-index-unique",checked:t.value,onCheckedChange:c=>t.onChange(c===!0)}),(0,e.jsx)(g,{htmlFor:"create-index-unique",className:"cursor-pointer",children:"Unique"})]})}),n.length>0&&(0,e.jsx)(O,{control:h,name:"method",render:({field:t})=>(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(g,{htmlFor:"create-index-method",children:"Method"}),(0,e.jsxs)(ke,{value:t.value,onValueChange:t.onChange,children:[(0,e.jsx)(De,{id:"create-index-method",className:"font-mono",children:(0,e.jsx)(Se,{})}),(0,e.jsx)(Te,{children:n.map(c=>(0,e.jsx)(ze,{value:c,className:"font-mono",children:c},c))})]})]})})]}),d?.createNote&&(0,e.jsxs)("p",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,e.jsx)(se,{className:"size-3.5 shrink-0"}),d.createNote]}),(0,e.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,e.jsx)(u,{type:"button",variant:"outline",size:"lg",onClick:()=>a("indexes.create-index"),disabled:o,children:"Cancel"}),(0,e.jsx)(u,{type:"submit",variant:"default",size:"lg",disabled:o,children:o?"Creating...":"Create index"})]})]})},Oe=({tableName:s})=>{const{closeOverlay:a,isOverlayOpen:r}=f();return(0,e.jsx)(be,{title:"Create index",description:`Create an index on "${s}".`,open:r("indexes.create-index"),onOpenChange:i=>{i||a("indexes.create-index")},children:(0,e.jsx)(Fe,{tableName:s})})},Ae=({tableName:s,schemaName:a})=>{const r=E(),{closeOverlay:i}=f(),{selectedDatabase:o}=C(),{mutateAsync:x,isPending:l}=$({mutationFn:async d=>(await Ie({tableName:s,schemaName:a,indexName:d,db:o})).data.data,onSuccess:async()=>{await r.invalidateQueries({queryKey:S.byTable(s),exact:!1}),i("indexes.drop-index")}});return{dropIndex:async d=>R.promise(x(d),{loading:"Dropping index...",success:n=>n||"Index dropped successfully",error:n=>typeof n.details=="string"&&n.details||n.message||"Failed to drop index"}),isDroppingIndex:l}},M=ye()(s=>({droppingIndex:null,setDroppingIndex:a=>s({droppingIndex:a})})),$e=({tableName:s})=>{const{closeOverlay:a,isOverlayOpen:r}=f(),{droppingIndex:i}=M(),o=I(),{dropIndex:x,isDroppingIndex:l}=Ae({tableName:s,schemaName:o});return i?(0,e.jsx)(ce,{open:r("indexes.drop-index"),onOpenChange:m=>{m||a("indexes.drop-index")},children:(0,e.jsxs)(re,{className:"max-w-md",children:[(0,e.jsxs)(ie,{children:[(0,e.jsx)(xe,{children:"Drop Index"}),(0,e.jsxs)(de,{children:["Drop the index"," ",(0,e.jsxs)("span",{className:"font-semibold text-foreground",children:['"',i.indexName,'"']})," ","from table ",(0,e.jsxs)("span",{className:"font-semibold text-foreground",children:['"',s,'"']}),"? No rows are deleted, but queries that rely on this index may get slower."]})]}),(0,e.jsxs)(ue,{className:"gap-2",children:[(0,e.jsx)(u,{variant:"outline",onClick:()=>a("indexes.drop-index"),disabled:l,children:"Cancel"}),(0,e.jsx)(u,{variant:"destructive",onClick:()=>x(i.indexName),disabled:l,children:l?"Dropping...":"Drop Index"})]})]})}):null},Ee=({index:s})=>{const{openOverlay:a}=f(),{setDroppingIndex:r}=M();return s.kind!=="index"?(0,e.jsxs)(je,{children:[(0,e.jsx)(pe,{asChild:!0,children:(0,e.jsx)("span",{className:"inline-flex text-muted-foreground/40",children:(0,e.jsx)(W,{className:"size-3.5"})})}),(0,e.jsx)(ge,{side:"left",children:(0,e.jsx)("p",{children:"Backs a constraint. Drop the constraint to remove it."})})]}):(0,e.jsx)(u,{variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-destructive","aria-label":`Drop index ${s.indexName}`,onClick:()=>{r(s),a("indexes.drop-index")},children:(0,e.jsx)(ne,{className:"size-3.5"})})},Le=({tableName:s,refetch:a,isRefetching:r=!1})=>{const{openOverlay:i}=f();return(0,e.jsxs)("header",{className:"max-h-8 overflow-hidden border-b border-border w-full flex items-center bg-background text-foreground sticky top-0 left-0 right-0 z-0",children:[(0,e.jsx)(u,{type:"button",variant:"ghost",className:"size-8! aspect-square border-x-0 border-y-0 border-border rounded-none text-muted-foreground hover:text-foreground hover:bg-muted/60 transition-colors",onClick:()=>{a()},"aria-label":`Refetch indexes for ${s}`,disabled:r,children:(0,e.jsx)(Z,{className:"size-4"})}),(0,e.jsx)(u,{variant:"ghost",asChild:!0,className:"h-8! border-l border-y-0 border-r-0 border-border rounded-none flex items-center gap-2 text-muted-foreground hover:text-foreground",children:(0,e.jsxs)(H,{to:"/table/$table",params:{table:s},"aria-label":`View data for ${s}`,children:[(0,e.jsx)(ee,{className:"size-4"}),"View data"]})}),(0,e.jsxs)(u,{type:"button",variant:"default",className:"h-8! border-l border-y-0 border-r-0 border-border rounded-none flex items-center gap-2",onClick:()=>i("indexes.create-index"),children:[(0,e.jsx)(L,{className:"size-4"}),"Create Index"]})]})},Re=({tableName:s,schemaName:a})=>{const{selectedDatabase:r}=C(),{data:i,isLoading:o,isRefetching:x,error:l,refetch:m}=J({queryKey:S.table(s,r,a),queryFn:()=>ve(s,r,a),select:d=>d.data.data,enabled:!!s&&!!r});return{tableIndexes:i,isLoadingTableIndexes:o,isRefetchingTableIndexes:x,errorTableIndexes:l,refetchTableIndexes:m}},Pe={primary:"Primary","unique-constraint":"Unique constraint",index:null},Me=({tableName:s})=>{const{tableIndexes:a,isLoadingTableIndexes:r,isRefetchingTableIndexes:i,errorTableIndexes:o,refetchTableIndexes:x}=Re({tableName:s,schemaName:I()}),{openOverlay:l}=f(),m=!!a?.some(n=>n.method!==null),d=(0,N.useMemo)(()=>[{id:"indexName",header:"Name",accessorKey:"indexName",cell:({row:n})=>{const h=Pe[n.original.kind];return(0,e.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,e.jsx)("span",{className:"font-mono text-foreground font-medium truncate",children:n.original.indexName}),h&&(0,e.jsx)(b,{variant:"secondary",className:"text-[0.6rem] px-1.5 shrink-0",children:h}),n.original.isSparse&&(0,e.jsx)(b,{variant:"secondary",className:"text-[0.6rem] px-1.5 shrink-0",children:"Sparse"}),n.original.expireAfterSeconds!==void 0&&(0,e.jsxs)(b,{variant:"secondary",className:"text-[0.6rem] px-1.5 shrink-0",children:["TTL (",n.original.expireAfterSeconds,"s)"]})]})},size:340,minSize:160},{id:"columns",header:"Columns",accessorFn:n=>n.columns.join(", "),cell:({getValue:n})=>(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground truncate",children:n()}),size:220,minSize:120},{id:"isUnique",header:"Unique",cell:({row:n})=>n.original.isUnique?(0,e.jsx)(b,{variant:"secondary",className:"text-[0.6rem] px-1.5",children:"Unique"}):(0,e.jsx)("span",{className:"text-xs text-muted-foreground/50",children:"no"}),size:90,minSize:80},...m?[{id:"method",header:"Method",cell:({row:n})=>(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground",children:n.original.method}),size:100,minSize:80}]:[],{id:"definition",header:"Definition",accessorKey:"definition",cell:({getValue:n})=>{const h=n();return h?(0,e.jsx)("span",{className:"font-mono text-xs text-muted-foreground truncate",children:h}):(0,e.jsx)("span",{className:"text-muted-foreground/50",children:"—"})},size:360,minSize:120},{id:"actions",header:"",cell:({row:n})=>(0,e.jsx)("div",{className:"flex flex-1 justify-center items-center",children:(0,e.jsx)(Ee,{index:n.original})}),size:50,enableResizing:!1}],[m]);return r?(0,e.jsx)("div",{className:"size-full flex items-center justify-center",children:(0,e.jsx)(P,{size:"size-7"})}):o?(0,e.jsxs)("div",{className:"size-full flex flex-col items-center justify-center gap-2",children:[(0,e.jsx)("div",{className:"text-sm font-medium",children:"Failed to load indexes"}),(0,e.jsx)("div",{className:"text-sm text-muted-foreground",children:o.message})]}):(0,e.jsxs)("div",{className:"flex-1 flex flex-col overflow-hidden",children:[(0,e.jsx)(Le,{tableName:s,refetch:x,isRefetching:i}),a?.length?(0,e.jsx)(me,{columns:d,data:a,renderCellAccessory:n=>(0,e.jsx)(fe,{value:n})}):(0,e.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center gap-3",children:[(0,e.jsx)("div",{className:"text-sm text-muted-foreground",children:"This table has no indexes yet."}),(0,e.jsxs)(u,{type:"button",onClick:()=>l("indexes.create-index"),children:[(0,e.jsx)(L,{className:"size-4"}),"Create index"]})]}),(0,e.jsx)(Oe,{tableName:s}),(0,e.jsx)($e,{tableName:s})]})};function os(){const{table:s}=qe.useParams();return(0,e.jsx)("main",{className:"flex-1 flex flex-col overflow-hidden",children:(0,e.jsx)(Me,{tableName:s})})}export{os as component};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.24.0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3c39b1bc-0997-4627-b32e-a588be4711ba",e._sentryDebugIdIdentifier="sentry-dbid-3c39b1bc-0997-4627-b32e-a588be4711ba")}catch{}})();var i={comments:{lineComment:"*"},brackets:[["[","]"],["(",")"]]},s={defaultToken:"invalid",ignoreCase:!0,tokenPostfix:".abap",keywords:["abap-source","abbreviated","abstract","accept","accepting","according","activation","actual","add","add-corresponding","adjacent","after","alias","aliases","align","all","allocate","alpha","analysis","analyzer","and","append","appendage","appending","application","archive","area","arithmetic","as","ascending","aspect","assert","assign","assigned","assigning","association","asynchronous","at","attributes","authority","authority-check","avg","back","background","backup","backward","badi","base","before","begin","between","big","binary","bintohex","bit","black","blank","blanks","blob","block","blocks","blue","bound","boundaries","bounds","boxed","break-point","buffer","by","bypassing","byte","byte-order","call","calling","case","cast","casting","catch","center","centered","chain","chain-input","chain-request","change","changing","channels","character","char-to-hex","check","checkbox","ci_","circular","class","class-coding","class-data","class-events","class-methods","class-pool","cleanup","clear","client","clob","clock","close","coalesce","code","coding","col_background","col_group","col_heading","col_key","col_negative","col_normal","col_positive","col_total","collect","color","column","columns","comment","comments","commit","common","communication","comparing","component","components","compression","compute","concat","concat_with_space","concatenate","cond","condense","condition","connect","connection","constants","context","contexts","continue","control","controls","conv","conversion","convert","copies","copy","corresponding","country","cover","cpi","create","creating","critical","currency","currency_conversion","current","cursor","cursor-selection","customer","customer-function","dangerous","data","database","datainfo","dataset","date","dats_add_days","dats_add_months","dats_days_between","dats_is_valid","daylight","dd/mm/yy","dd/mm/yyyy","ddmmyy","deallocate","decimal_shift","decimals","declarations","deep","default","deferred","define","defining","definition","delete","deleting","demand","department","descending","describe","destination","detail","dialog","directory","disconnect","display","display-mode","distinct","divide","divide-corresponding","division","do","dummy","duplicate","duplicates","duration","during","dynamic","dynpro","edit","editor-call","else","elseif","empty","enabled","enabling","encoding","end","endat","endcase","endcatch","endchain","endclass","enddo","endenhancement","end-enhancement-section","endexec","endform","endfunction","endian","endif","ending","endinterface","end-lines","endloop","endmethod","endmodule","end-of-definition","end-of-editing","end-of-file","end-of-page","end-of-selection","endon","endprovide","endselect","end-test-injection","end-test-seam","endtry","endwhile","endwith","engineering","enhancement","enhancement-point","enhancements","enhancement-section","entries","entry","enum","environment","equiv","errormessage","errors","escaping","event","events","exact","except","exception","exceptions","exception-table","exclude","excluding","exec","execute","exists","exit","exit-command","expand","expanding","expiration","explicit","exponent","export","exporting","extend","extended","extension","extract","fail","fetch","field","field-groups","fields","field-symbol","field-symbols","file","filter","filters","filter-table","final","find","first","first-line","fixed-point","fkeq","fkge","flush","font","for","form","format","forward","found","frame","frames","free","friends","from","function","functionality","function-pool","further","gaps","generate","get","giving","gkeq","gkge","global","grant","green","group","groups","handle","handler","harmless","hashed","having","hdb","header","headers","heading","head-lines","help-id","help-request","hextobin","hide","high","hint","hold","hotspot","icon","id","identification","identifier","ids","if","ignore","ignoring","immediately","implementation","implementations","implemented","implicit","import","importing","in","inactive","incl","include","includes","including","increment","index","index-line","infotypes","inheriting","init","initial","initialization","inner","inout","input","insert","instance","instances","instr","intensified","interface","interface-pool","interfaces","internal","intervals","into","inverse","inverted-date","is","iso","job","join","keep","keeping","kernel","key","keys","keywords","kind","language","last","late","layout","leading","leave","left","left-justified","leftplus","leftspace","legacy","length","let","level","levels","like","line","lines","line-count","linefeed","line-selection","line-size","list","listbox","list-processing","little","llang","load","load-of-program","lob","local","locale","locator","logfile","logical","log-point","long","loop","low","lower","lpad","lpi","ltrim","mail","main","major-id","mapping","margin","mark","mask","match","matchcode","max","maximum","medium","members","memory","mesh","message","message-id","messages","messaging","method","methods","min","minimum","minor-id","mm/dd/yy","mm/dd/yyyy","mmddyy","mode","modif","modifier","modify","module","move","move-corresponding","multiply","multiply-corresponding","name","nametab","native","nested","nesting","new","new-line","new-page","new-section","next","no","no-display","no-extension","no-gap","no-gaps","no-grouping","no-heading","no-scrolling","no-sign","no-title","no-topofpage","no-zero","node","nodes","non-unicode","non-unique","not","null","number","object","objects","obligatory","occurrence","occurrences","occurs","of","off","offset","ole","on","only","open","option","optional","options","or","order","other","others","out","outer","output","output-length","overflow","overlay","pack","package","pad","padding","page","pages","parameter","parameters","parameter-table","part","partially","pattern","percentage","perform","performing","person","pf1","pf10","pf11","pf12","pf13","pf14","pf15","pf2","pf3","pf4","pf5","pf6","pf7","pf8","pf9","pf-status","pink","places","pool","pos_high","pos_low","position","pragmas","precompiled","preferred","preserving","primary","print","print-control","priority","private","procedure","process","program","property","protected","provide","public","push","pushbutton","put","queue-only","quickinfo","radiobutton","raise","raising","range","ranges","read","reader","read-only","receive","received","receiver","receiving","red","redefinition","reduce","reduced","ref","reference","refresh","regex","reject","remote","renaming","replace","replacement","replacing","report","request","requested","reserve","reset","resolution","respecting","responsible","result","results","resumable","resume","retry","return","returncode","returning","returns","right","right-justified","rightplus","rightspace","risk","rmc_communication_failure","rmc_invalid_status","rmc_system_failure","role","rollback","rows","rpad","rtrim","run","sap","sap-spool","saving","scale_preserving","scale_preserving_scientific","scan","scientific","scientific_with_leading_zero","scroll","scroll-boundary","scrolling","search","secondary","seconds","section","select","selection","selections","selection-screen","selection-set","selection-sets","selection-table","select-options","send","separate","separated","set","shared","shift","short","shortdump-id","sign_as_postfix","single","size","skip","skipping","smart","some","sort","sortable","sorted","source","specified","split","spool","spots","sql","sqlscript","stable","stamp","standard","starting","start-of-editing","start-of-selection","state","statement","statements","static","statics","statusinfo","step-loop","stop","structure","structures","style","subkey","submatches","submit","subroutine","subscreen","subtract","subtract-corresponding","suffix","sum","summary","summing","supplied","supply","suppress","switch","switchstates","symbol","syncpoints","syntax","syntax-check","syntax-trace","system-call","system-exceptions","system-exit","tab","tabbed","table","tables","tableview","tabstrip","target","task","tasks","test","testing","test-injection","test-seam","text","textpool","then","throw","time","times","timestamp","timezone","tims_is_valid","title","titlebar","title-lines","to","tokenization","tokens","top-lines","top-of-page","trace-file","trace-table","trailing","transaction","transfer","transformation","translate","transporting","trmac","truncate","truncation","try","tstmp_add_seconds","tstmp_current_utctimestamp","tstmp_is_valid","tstmp_seconds_between","type","type-pool","type-pools","types","uline","unassign","under","unicode","union","unique","unit_conversion","unix","unpack","until","unwind","up","update","upper","user","user-command","using","utf-8","valid","value","value-request","values","vary","varying","verification-message","version","via","view","visible","wait","warning","when","whenever","where","while","width","window","windows","with","with-heading","without","with-title","word","work","write","writer","xml","xsd","yellow","yes","yymmdd","zero","zone","abap_system_timezone","abap_user_timezone","access","action","adabas","adjust_numbers","allow_precision_loss","allowed","amdp","applicationuser","as_geo_json","as400","associations","balance","behavior","breakup","bulk","cds","cds_client","check_before_save","child","clients","corr","corr_spearman","cross","cycles","datn_add_days","datn_add_months","datn_days_between","dats_from_datn","dats_tims_to_tstmp","dats_to_datn","db2","db6","ddl","dense_rank","depth","deterministic","discarding","entities","entity","error","failed","finalize","first_value","fltp_to_dec","following","fractional","full","graph","grouping","hierarchy","hierarchy_ancestors","hierarchy_ancestors_aggregate","hierarchy_descendants","hierarchy_descendants_aggregate","hierarchy_siblings","incremental","indicators","lag","last_value","lead","leaves","like_regexpr","link","locale_sap","lock","locks","many","mapped","matched","measures","median","mssqlnt","multiple","nodetype","ntile","nulls","occurrences_regexpr","one","operations","oracle","orphans","over","parent","parents","partition","pcre","period","pfcg_mapping","preceding","privileged","product","projection","rank","redirected","replace_regexpr","reported","response","responses","root","row","row_number","sap_system_date","save","schema","session","sets","shortdump","siblings","spantree","start","stddev","string_agg","subtotal","sybase","tims_from_timn","tims_to_timn","to_blob","to_clob","total","trace-entry","tstmp_to_dats","tstmp_to_dst","tstmp_to_tims","tstmpl_from_utcl","tstmpl_to_utcl","unbounded","utcl_add_seconds","utcl_current","utcl_seconds_between","uuid","var","verbatim"],builtinFunctions:["abs","acos","asin","atan","bit-set","boolc","boolx","ceil","char_off","charlen","cmax","cmin","concat_lines_of","contains","contains_any_not_of","contains_any_of","cos","cosh","count","count_any_not_of","count_any_of","dbmaxlen","distance","escape","exp","find_any_not_of","find_any_of","find_end","floor","frac","from_mixed","ipow","line_exists","line_index","log","log10","matches","nmax","nmin","numofchar","repeat","rescale","reverse","round","segment","shift_left","shift_right","sign","sin","sinh","sqrt","strlen","substring","substring_after","substring_before","substring_from","substring_to","tan","tanh","to_lower","to_mixed","to_upper","trunc","utclong_add","utclong_current","utclong_diff","xsdbool","xstrlen"],typeKeywords:["b","c","d","decfloat16","decfloat34","f","i","int8","n","p","s","string","t","utclong","x","xstring","any","clike","csequence","decfloat","numeric","simple","xsequence","accp","char","clnt","cuky","curr","datn","dats","d16d","d16n","d16r","d34d","d34n","d34r","dec","df16_dec","df16_raw","df34_dec","df34_raw","fltp","geom_ewkb","int1","int2","int4","lang","lchr","lraw","numc","quan","raw","rawstring","sstring","timn","tims","unit","utcl","df16_scl","df34_scl","prec","varc","abap_bool","abap_false","abap_true","abap_undefined","me","screen","space","super","sy","syst","table_line","*sys*"],builtinMethods:["class_constructor","constructor"],derivedTypes:["%CID","%CID_REF","%CONTROL","%DATA","%ELEMENT","%FAIL","%KEY","%MSG","%PARAM","%PID","%PID_ASSOC","%PID_PARENT","%_HINTS"],cdsLanguage:["@AbapAnnotation","@AbapCatalog","@AccessControl","@API","@ClientDependent","@ClientHandling","@CompatibilityContract","@DataAging","@EndUserText","@Environment","@LanguageDependency","@MappingRole","@Metadata","@MetadataExtension","@ObjectModel","@Scope","@Semantics","$EXTENSION","$SELF"],selectors:["->","->*","=>","~","~*"],operators:[" +"," -","/","*","**","div","mod","=","#","@","+=","-=","*=","/=","**=","&&=","?=","&","&&","bit-and","bit-not","bit-or","bit-xor","m","o","z","<"," >","<=",">=","<>","><","=<","=>","bt","byte-ca","byte-cn","byte-co","byte-cs","byte-na","byte-ns","ca","cn","co","cp","cs","eq","ge","gt","le","lt","na","nb","ne","np","ns","*/","*:","--","/*","//"],symbols:/[=><!~?&+\-*\/\^%#@]+/,tokenizer:{root:[[/[a-z_\/$%@]([\w\/$%]|-(?!>))*/,{cases:{"@typeKeywords":"type","@keywords":"keyword","@cdsLanguage":"annotation","@derivedTypes":"type","@builtinFunctions":"type","@builtinMethods":"type","@operators":"key","@default":"identifier"}}],[/<[\w]+>/,"identifier"],[/##[\w|_]+/,"comment"],{include:"@whitespace"},[/[:,.]/,"delimiter"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@selectors":"tag","@operators":"key","@default":""}}],[/'/,{token:"string",bracket:"@open",next:"@stringquote"}],[/`/,{token:"string",bracket:"@open",next:"@stringping"}],[/\|/,{token:"string",bracket:"@open",next:"@stringtemplate"}],[/\d+/,"number"]],stringtemplate:[[/[^\\\|]+/,"string"],[/\\\|/,"string"],[/\|/,{token:"string",bracket:"@close",next:"@pop"}]],stringping:[[/[^\\`]+/,"string"],[/`/,{token:"string",bracket:"@close",next:"@pop"}]],stringquote:[[/[^\\']+/,"string"],[/'/,{token:"string",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/^\*.*$/,"comment"],[/\".*$/,"comment"]]}};export{i as conf,s as language};
|
|
1
|
+
(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.24.1"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="3c39b1bc-0997-4627-b32e-a588be4711ba",e._sentryDebugIdIdentifier="sentry-dbid-3c39b1bc-0997-4627-b32e-a588be4711ba")}catch{}})();var i={comments:{lineComment:"*"},brackets:[["[","]"],["(",")"]]},s={defaultToken:"invalid",ignoreCase:!0,tokenPostfix:".abap",keywords:["abap-source","abbreviated","abstract","accept","accepting","according","activation","actual","add","add-corresponding","adjacent","after","alias","aliases","align","all","allocate","alpha","analysis","analyzer","and","append","appendage","appending","application","archive","area","arithmetic","as","ascending","aspect","assert","assign","assigned","assigning","association","asynchronous","at","attributes","authority","authority-check","avg","back","background","backup","backward","badi","base","before","begin","between","big","binary","bintohex","bit","black","blank","blanks","blob","block","blocks","blue","bound","boundaries","bounds","boxed","break-point","buffer","by","bypassing","byte","byte-order","call","calling","case","cast","casting","catch","center","centered","chain","chain-input","chain-request","change","changing","channels","character","char-to-hex","check","checkbox","ci_","circular","class","class-coding","class-data","class-events","class-methods","class-pool","cleanup","clear","client","clob","clock","close","coalesce","code","coding","col_background","col_group","col_heading","col_key","col_negative","col_normal","col_positive","col_total","collect","color","column","columns","comment","comments","commit","common","communication","comparing","component","components","compression","compute","concat","concat_with_space","concatenate","cond","condense","condition","connect","connection","constants","context","contexts","continue","control","controls","conv","conversion","convert","copies","copy","corresponding","country","cover","cpi","create","creating","critical","currency","currency_conversion","current","cursor","cursor-selection","customer","customer-function","dangerous","data","database","datainfo","dataset","date","dats_add_days","dats_add_months","dats_days_between","dats_is_valid","daylight","dd/mm/yy","dd/mm/yyyy","ddmmyy","deallocate","decimal_shift","decimals","declarations","deep","default","deferred","define","defining","definition","delete","deleting","demand","department","descending","describe","destination","detail","dialog","directory","disconnect","display","display-mode","distinct","divide","divide-corresponding","division","do","dummy","duplicate","duplicates","duration","during","dynamic","dynpro","edit","editor-call","else","elseif","empty","enabled","enabling","encoding","end","endat","endcase","endcatch","endchain","endclass","enddo","endenhancement","end-enhancement-section","endexec","endform","endfunction","endian","endif","ending","endinterface","end-lines","endloop","endmethod","endmodule","end-of-definition","end-of-editing","end-of-file","end-of-page","end-of-selection","endon","endprovide","endselect","end-test-injection","end-test-seam","endtry","endwhile","endwith","engineering","enhancement","enhancement-point","enhancements","enhancement-section","entries","entry","enum","environment","equiv","errormessage","errors","escaping","event","events","exact","except","exception","exceptions","exception-table","exclude","excluding","exec","execute","exists","exit","exit-command","expand","expanding","expiration","explicit","exponent","export","exporting","extend","extended","extension","extract","fail","fetch","field","field-groups","fields","field-symbol","field-symbols","file","filter","filters","filter-table","final","find","first","first-line","fixed-point","fkeq","fkge","flush","font","for","form","format","forward","found","frame","frames","free","friends","from","function","functionality","function-pool","further","gaps","generate","get","giving","gkeq","gkge","global","grant","green","group","groups","handle","handler","harmless","hashed","having","hdb","header","headers","heading","head-lines","help-id","help-request","hextobin","hide","high","hint","hold","hotspot","icon","id","identification","identifier","ids","if","ignore","ignoring","immediately","implementation","implementations","implemented","implicit","import","importing","in","inactive","incl","include","includes","including","increment","index","index-line","infotypes","inheriting","init","initial","initialization","inner","inout","input","insert","instance","instances","instr","intensified","interface","interface-pool","interfaces","internal","intervals","into","inverse","inverted-date","is","iso","job","join","keep","keeping","kernel","key","keys","keywords","kind","language","last","late","layout","leading","leave","left","left-justified","leftplus","leftspace","legacy","length","let","level","levels","like","line","lines","line-count","linefeed","line-selection","line-size","list","listbox","list-processing","little","llang","load","load-of-program","lob","local","locale","locator","logfile","logical","log-point","long","loop","low","lower","lpad","lpi","ltrim","mail","main","major-id","mapping","margin","mark","mask","match","matchcode","max","maximum","medium","members","memory","mesh","message","message-id","messages","messaging","method","methods","min","minimum","minor-id","mm/dd/yy","mm/dd/yyyy","mmddyy","mode","modif","modifier","modify","module","move","move-corresponding","multiply","multiply-corresponding","name","nametab","native","nested","nesting","new","new-line","new-page","new-section","next","no","no-display","no-extension","no-gap","no-gaps","no-grouping","no-heading","no-scrolling","no-sign","no-title","no-topofpage","no-zero","node","nodes","non-unicode","non-unique","not","null","number","object","objects","obligatory","occurrence","occurrences","occurs","of","off","offset","ole","on","only","open","option","optional","options","or","order","other","others","out","outer","output","output-length","overflow","overlay","pack","package","pad","padding","page","pages","parameter","parameters","parameter-table","part","partially","pattern","percentage","perform","performing","person","pf1","pf10","pf11","pf12","pf13","pf14","pf15","pf2","pf3","pf4","pf5","pf6","pf7","pf8","pf9","pf-status","pink","places","pool","pos_high","pos_low","position","pragmas","precompiled","preferred","preserving","primary","print","print-control","priority","private","procedure","process","program","property","protected","provide","public","push","pushbutton","put","queue-only","quickinfo","radiobutton","raise","raising","range","ranges","read","reader","read-only","receive","received","receiver","receiving","red","redefinition","reduce","reduced","ref","reference","refresh","regex","reject","remote","renaming","replace","replacement","replacing","report","request","requested","reserve","reset","resolution","respecting","responsible","result","results","resumable","resume","retry","return","returncode","returning","returns","right","right-justified","rightplus","rightspace","risk","rmc_communication_failure","rmc_invalid_status","rmc_system_failure","role","rollback","rows","rpad","rtrim","run","sap","sap-spool","saving","scale_preserving","scale_preserving_scientific","scan","scientific","scientific_with_leading_zero","scroll","scroll-boundary","scrolling","search","secondary","seconds","section","select","selection","selections","selection-screen","selection-set","selection-sets","selection-table","select-options","send","separate","separated","set","shared","shift","short","shortdump-id","sign_as_postfix","single","size","skip","skipping","smart","some","sort","sortable","sorted","source","specified","split","spool","spots","sql","sqlscript","stable","stamp","standard","starting","start-of-editing","start-of-selection","state","statement","statements","static","statics","statusinfo","step-loop","stop","structure","structures","style","subkey","submatches","submit","subroutine","subscreen","subtract","subtract-corresponding","suffix","sum","summary","summing","supplied","supply","suppress","switch","switchstates","symbol","syncpoints","syntax","syntax-check","syntax-trace","system-call","system-exceptions","system-exit","tab","tabbed","table","tables","tableview","tabstrip","target","task","tasks","test","testing","test-injection","test-seam","text","textpool","then","throw","time","times","timestamp","timezone","tims_is_valid","title","titlebar","title-lines","to","tokenization","tokens","top-lines","top-of-page","trace-file","trace-table","trailing","transaction","transfer","transformation","translate","transporting","trmac","truncate","truncation","try","tstmp_add_seconds","tstmp_current_utctimestamp","tstmp_is_valid","tstmp_seconds_between","type","type-pool","type-pools","types","uline","unassign","under","unicode","union","unique","unit_conversion","unix","unpack","until","unwind","up","update","upper","user","user-command","using","utf-8","valid","value","value-request","values","vary","varying","verification-message","version","via","view","visible","wait","warning","when","whenever","where","while","width","window","windows","with","with-heading","without","with-title","word","work","write","writer","xml","xsd","yellow","yes","yymmdd","zero","zone","abap_system_timezone","abap_user_timezone","access","action","adabas","adjust_numbers","allow_precision_loss","allowed","amdp","applicationuser","as_geo_json","as400","associations","balance","behavior","breakup","bulk","cds","cds_client","check_before_save","child","clients","corr","corr_spearman","cross","cycles","datn_add_days","datn_add_months","datn_days_between","dats_from_datn","dats_tims_to_tstmp","dats_to_datn","db2","db6","ddl","dense_rank","depth","deterministic","discarding","entities","entity","error","failed","finalize","first_value","fltp_to_dec","following","fractional","full","graph","grouping","hierarchy","hierarchy_ancestors","hierarchy_ancestors_aggregate","hierarchy_descendants","hierarchy_descendants_aggregate","hierarchy_siblings","incremental","indicators","lag","last_value","lead","leaves","like_regexpr","link","locale_sap","lock","locks","many","mapped","matched","measures","median","mssqlnt","multiple","nodetype","ntile","nulls","occurrences_regexpr","one","operations","oracle","orphans","over","parent","parents","partition","pcre","period","pfcg_mapping","preceding","privileged","product","projection","rank","redirected","replace_regexpr","reported","response","responses","root","row","row_number","sap_system_date","save","schema","session","sets","shortdump","siblings","spantree","start","stddev","string_agg","subtotal","sybase","tims_from_timn","tims_to_timn","to_blob","to_clob","total","trace-entry","tstmp_to_dats","tstmp_to_dst","tstmp_to_tims","tstmpl_from_utcl","tstmpl_to_utcl","unbounded","utcl_add_seconds","utcl_current","utcl_seconds_between","uuid","var","verbatim"],builtinFunctions:["abs","acos","asin","atan","bit-set","boolc","boolx","ceil","char_off","charlen","cmax","cmin","concat_lines_of","contains","contains_any_not_of","contains_any_of","cos","cosh","count","count_any_not_of","count_any_of","dbmaxlen","distance","escape","exp","find_any_not_of","find_any_of","find_end","floor","frac","from_mixed","ipow","line_exists","line_index","log","log10","matches","nmax","nmin","numofchar","repeat","rescale","reverse","round","segment","shift_left","shift_right","sign","sin","sinh","sqrt","strlen","substring","substring_after","substring_before","substring_from","substring_to","tan","tanh","to_lower","to_mixed","to_upper","trunc","utclong_add","utclong_current","utclong_diff","xsdbool","xstrlen"],typeKeywords:["b","c","d","decfloat16","decfloat34","f","i","int8","n","p","s","string","t","utclong","x","xstring","any","clike","csequence","decfloat","numeric","simple","xsequence","accp","char","clnt","cuky","curr","datn","dats","d16d","d16n","d16r","d34d","d34n","d34r","dec","df16_dec","df16_raw","df34_dec","df34_raw","fltp","geom_ewkb","int1","int2","int4","lang","lchr","lraw","numc","quan","raw","rawstring","sstring","timn","tims","unit","utcl","df16_scl","df34_scl","prec","varc","abap_bool","abap_false","abap_true","abap_undefined","me","screen","space","super","sy","syst","table_line","*sys*"],builtinMethods:["class_constructor","constructor"],derivedTypes:["%CID","%CID_REF","%CONTROL","%DATA","%ELEMENT","%FAIL","%KEY","%MSG","%PARAM","%PID","%PID_ASSOC","%PID_PARENT","%_HINTS"],cdsLanguage:["@AbapAnnotation","@AbapCatalog","@AccessControl","@API","@ClientDependent","@ClientHandling","@CompatibilityContract","@DataAging","@EndUserText","@Environment","@LanguageDependency","@MappingRole","@Metadata","@MetadataExtension","@ObjectModel","@Scope","@Semantics","$EXTENSION","$SELF"],selectors:["->","->*","=>","~","~*"],operators:[" +"," -","/","*","**","div","mod","=","#","@","+=","-=","*=","/=","**=","&&=","?=","&","&&","bit-and","bit-not","bit-or","bit-xor","m","o","z","<"," >","<=",">=","<>","><","=<","=>","bt","byte-ca","byte-cn","byte-co","byte-cs","byte-na","byte-ns","ca","cn","co","cp","cs","eq","ge","gt","le","lt","na","nb","ne","np","ns","*/","*:","--","/*","//"],symbols:/[=><!~?&+\-*\/\^%#@]+/,tokenizer:{root:[[/[a-z_\/$%@]([\w\/$%]|-(?!>))*/,{cases:{"@typeKeywords":"type","@keywords":"keyword","@cdsLanguage":"annotation","@derivedTypes":"type","@builtinFunctions":"type","@builtinMethods":"type","@operators":"key","@default":"identifier"}}],[/<[\w]+>/,"identifier"],[/##[\w|_]+/,"comment"],{include:"@whitespace"},[/[:,.]/,"delimiter"],[/[{}()\[\]]/,"@brackets"],[/@symbols/,{cases:{"@selectors":"tag","@operators":"key","@default":""}}],[/'/,{token:"string",bracket:"@open",next:"@stringquote"}],[/`/,{token:"string",bracket:"@open",next:"@stringping"}],[/\|/,{token:"string",bracket:"@open",next:"@stringtemplate"}],[/\d+/,"number"]],stringtemplate:[[/[^\\\|]+/,"string"],[/\\\|/,"string"],[/\|/,{token:"string",bracket:"@close",next:"@pop"}]],stringping:[[/[^\\`]+/,"string"],[/`/,{token:"string",bracket:"@close",next:"@pop"}]],stringquote:[[/[^\\']+/,"string"],[/'/,{token:"string",bracket:"@close",next:"@pop"}]],whitespace:[[/[ \t\r\n]+/,""],[/^\*.*$/,"comment"],[/\".*$/,"comment"]]}};export{i as conf,s as language};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.24.
|
|
1
|
+
(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.24.1"};var s=new e.Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="b63b13e9-254d-4208-948c-98ef9dce408e",e._sentryDebugIdIdentifier="sentry-dbid-b63b13e9-254d-4208-948c-98ef9dce408e")}catch{}})();var r={wordPattern:/(-?\d*\.\d\w*)|([^\`\~\!\#\%\^\&\*\(\)\-\=\+\[\{\]\}\\\|\;\:\'\"\,\.\<\>\/\?\s]+)/g,comments:{lineComment:"//",blockComment:["/*","*/"]},brackets:[["{","}"],["[","]"],["(",")"]],autoClosingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"}],surroundingPairs:[{open:"{",close:"}"},{open:"[",close:"]"},{open:"(",close:")"},{open:'"',close:'"'},{open:"'",close:"'"},{open:"<",close:">"}],folding:{markers:{start:new RegExp("^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))"),end:new RegExp("^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))")}}},n=["abstract","activate","and","any","array","as","asc","assert","autonomous","begin","bigdecimal","blob","boolean","break","bulk","by","case","cast","catch","char","class","collect","commit","const","continue","convertcurrency","decimal","default","delete","desc","do","double","else","end","enum","exception","exit","export","extends","false","final","finally","float","for","from","future","get","global","goto","group","having","hint","if","implements","import","in","inner","insert","instanceof","int","interface","into","join","last_90_days","last_month","last_n_days","last_week","like","limit","list","long","loop","map","merge","native","new","next_90_days","next_month","next_n_days","next_week","not","null","nulls","number","object","of","on","or","outer","override","package","parallel","pragma","private","protected","public","retrieve","return","returning","rollback","savepoint","search","select","set","short","sort","stat","static","strictfp","super","switch","synchronized","system","testmethod","then","this","this_month","this_week","throw","throws","today","tolabel","tomorrow","transaction","transient","trigger","true","try","type","undelete","update","upsert","using","virtual","void","volatile","webservice","when","where","while","yesterday"],o=e=>e.charAt(0).toUpperCase()+e.substr(1),t=[];n.forEach(e=>{t.push(e),t.push(e.toUpperCase()),t.push(o(e))});var a={defaultToken:"",tokenPostfix:".apex",keywords:t,operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],symbols:/[=><!~?:&|+\-*\/\^%]+/,escapes:/\\(?:[abfnrtv\\"']|x[0-9A-Fa-f]{1,4}|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})/,digits:/\d+(_+\d+)*/,octaldigits:/[0-7]+(_+[0-7]+)*/,binarydigits:/[0-1]+(_+[0-1]+)*/,hexdigits:/[[0-9a-fA-F]+(_+[0-9a-fA-F]+)*/,tokenizer:{root:[[/[a-z_$][\w$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"identifier"}}],[/[A-Z][\w\$]*/,{cases:{"@keywords":{token:"keyword.$0"},"@default":"type.identifier"}}],{include:"@whitespace"},[/[{}()\[\]]/,"@brackets"],[/[<>](?!@symbols)/,"@brackets"],[/@symbols/,{cases:{"@operators":"delimiter","@default":""}}],[/@\s*[a-zA-Z_\$][\w\$]*/,"annotation"],[/(@digits)[eE]([\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)\.(@digits)([eE][\-+]?(@digits))?[fFdD]?/,"number.float"],[/(@digits)[fFdD]/,"number.float"],[/(@digits)[lL]?/,"number"],[/[;,.]/,"delimiter"],[/"([^"\\]|\\.)*$/,"string.invalid"],[/'([^'\\]|\\.)*$/,"string.invalid"],[/"/,"string",'@string."'],[/'/,"string","@string.'"],[/'[^\\']'/,"string"],[/(')(@escapes)(')/,["string","string.escape","string"]],[/'/,"string.invalid"]],whitespace:[[/[ \t\r\n]+/,""],[/\/\*\*(?!\/)/,"comment.doc","@apexdoc"],[/\/\*/,"comment","@comment"],[/\/\/.*$/,"comment"]],comment:[[/[^\/*]+/,"comment"],[/\*\//,"comment","@pop"],[/[\/*]/,"comment"]],apexdoc:[[/[^\/*]+/,"comment.doc"],[/\*\//,"comment.doc","@pop"],[/[\/*]/,"comment.doc"]],string:[[/[^\\"']+/,"string"],[/@escapes/,"string.escape"],[/\\./,"string.escape.invalid"],[/["']/,{cases:{"$#==$S2":{token:"string",next:"@pop"},"@default":"string"}}]]}};export{r as conf,a as language};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.24.
|
|
1
|
+
(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"db-studio@1.24.1"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="bf9ae677-ef2b-449e-b821-9b20d55f8b83",e._sentryDebugIdIdentifier="sentry-dbid-bf9ae677-ef2b-449e-b821-9b20d55f8b83")}catch{}})();var o={comments:{lineComment:"#"}},s={defaultToken:"keyword",ignoreCase:!0,tokenPostfix:".azcli",str:/[^#\s]/,tokenizer:{root:[{include:"@comment"},[/\s-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}],[/^-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":{token:"key.identifier",next:"@type"}}}]],type:[{include:"@comment"},[/-+@str*\s*/,{cases:{"@eos":{token:"key.identifier",next:"@popall"},"@default":"key.identifier"}}],[/@str+\s*/,{cases:{"@eos":{token:"string",next:"@popall"},"@default":"string"}}]],comment:[[/#.*$/,{cases:{"@eos":{token:"comment",next:"@popall"}}}]]}};export{o as conf,s as language};
|