From 3b38d89275b1eab99083fa25ad44ecfa5e384a2f Mon Sep 17 00:00:00 2001 From: vwh Date: Mon, 29 Jul 2024 15:24:40 +0300 Subject: [PATCH] Updates --- assets/index-D1aL-xAe.js | 5 ----- assets/index-D1aL-xAe.js.gz | Bin 11378 -> 0 bytes assets/index-DKPTwSyp.js | 5 +++++ assets/index-DKPTwSyp.js.gz | Bin 0 -> 11399 bytes index.html | 2 +- index.html.gz | Bin 1739 -> 1741 bytes sw.js | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) delete mode 100644 assets/index-D1aL-xAe.js delete mode 100644 assets/index-D1aL-xAe.js.gz create mode 100644 assets/index-DKPTwSyp.js create mode 100644 assets/index-DKPTwSyp.js.gz diff --git a/assets/index-D1aL-xAe.js b/assets/index-D1aL-xAe.js deleted file mode 100644 index 34be9ec..0000000 --- a/assets/index-D1aL-xAe.js +++ /dev/null @@ -1,5 +0,0 @@ -import{r as n,j as e,R as L}from"./react-DmpIMwDM.js";import{c as ot}from"./react-dom-tIxIBQuZ.js";import{c as nt}from"./zustand-oOA47TU4.js";import{i as lt}from"./sql.js-lzln2bbd.js";import{F as Z}from"./file-saver-DhbZvGod.js";import{c as it}from"./clsx-B-dksMZM.js";import{t as ct}from"./tailwind-merge-BkWO730n.js";import{S as dt,c as X,I as ut,d as ee,e as te,f as mt,g as se,V as ft,L as ae,h as re,i as pt,j as xt,k as oe,l as ht,G as gt,m as bt,n as ne,o as yt,p as jt,q as wt,r as le,s as Nt,t as vt,u as ie,v as Ct,w as Rt,x as ce,y as St,z as de,A as ue,B as me,E as fe,F as Dt,H as pe,J as xe,K as he,M as ge,N as be,Q as ye,U as Tt,W as Et}from"./@radix-ui-Dtk-Z1Mr.js";import{c as q}from"./class-variance-authority-Bb4qSo10.js";import{C as Pt,a as Lt,b as je,c as kt,d as Ft,K as At,e as Mt,f as It,g as Ht,T as Ot,L as Qt,D as $t,P as qt,h as Bt,i as zt,M as Ut,j as Vt,k as _t,S as Gt,l as Kt,m as Jt,G as Wt}from"./lucide-react-Ch2vEKIM.js";import{f as Yt,a as M}from"./date-fns-fqmN70Xj.js";import{u as Zt}from"./react-dropzone-D-IBOhIS.js";import{J as H,T as Xt}from"./sonner-BJG0sXho.js";import{D as v}from"./vaul-Bkmv171v.js";import"./attr-accept-BWI1aNlo.js";import"./scheduler-CzFDRTuY.js";import"./use-sync-external-store-ByYeed7R.js";import"./aria-hidden-DQ5UC2Eg.js";import"./react-remove-scroll-BOyN_WUU.js";import"./tslib-CuZy2iRz.js";import"./react-remove-scroll-bar-DZjhPxUV.js";import"./react-style-singleton-CpxBwIWS.js";import"./get-nonce-C-Z93AgS.js";import"./use-sidecar-D8_hMcUG.js";import"./use-callback-ref-DRzK4jWO.js";import"./@floating-ui-DGkE6due.js";import"./prop-types-psm7UO16.js";import"./file-selector-CBHVlu32.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const l of o)if(l.type==="childList")for(const i of l.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function a(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=a(o);fetch(o.href,l)}})();const es="https://sql.js.org/dist/sql-wasm.wasm",ts=async t=>{try{const[s,a]=await Promise.all([t.arrayBuffer(),lt({locateFile:()=>es})]);return new a.Database(new Uint8Array(s))}catch(s){throw console.error("Failed to load database:",s),s}},B=t=>{var s;try{return((s=t.exec("SELECT name FROM sqlite_master WHERE type='table';")[0])==null?void 0:s.values.flat())||[]}catch(a){return console.error("Failed to get table names:",a),[]}},ss=async(t,s)=>{try{const[a,r]=t.exec(` - PRAGMA table_info("${s}"); - PRAGMA foreign_key_list("${s}"); - `),o=a.values.reduce((l,i)=>(l[i[1]]={type:i[2],isPrimaryKey:i[5]===1,isForeignKey:!1},l),{});return r==null||r.values.forEach(l=>{const i=l[3];o[i]&&(o[i].isForeignKey=!0)}),o}catch(a){throw console.error(`Failed to get schema for table "${s}":`,a),a}},O=t=>{if(t.length===0)return{data:[],columns:[]};const{columns:s,values:a}=t[0];return{data:a.map(o=>Object.fromEntries(s.map((l,i)=>[l,o[i]]))),columns:s}},as=t=>{try{const s=t.export(),a=new Blob([s],{type:"application/x-sqlite3"});Z.saveAs(a,"database.sqlite")}catch(s){throw console.error("Failed to export database:",s),s}},rs=(t,s)=>{const a=t.map(o=>`"${o}"`).join(","),r=s.map(o=>t.map(l=>`"${o[l]??""}"`).join(","));return[a,...r].join(` -`)},z=(t,s,a)=>{try{const r=s.exec(t);if(r.length===0)throw new Error(`Query "${t}" returned no results.`);const{data:o,columns:l}=O(r),i=rs(l,o),d=new Blob([i],{type:"text/csv;charset=utf-8;"});Z.saveAs(d,`${a}.csv`)}catch(r){throw console.error(`Failed to get CSV for query "${t}":`,r),r}},os=(t,s)=>{const r=B(t)[s],o=`SELECT * FROM "${r}"`;z(o,t,r)},ns=t=>{B(t).forEach(s=>{const a=`SELECT * FROM "${s}"`;z(a,t,s)})},ls=(t,s)=>{z(s,t,"custom_query")},R=nt((t,s)=>({db:null,isLoading:!1,queryError:null,tables:[],selectedTable:"0",tableSchemas:{},rowPerPageOrAuto:"auto",isCustomQuery:!1,loadDatabase:async a=>{t({isLoading:!0,queryError:null});try{const r=await ts(a),o=B(r),l=await Promise.all(o.map(async u=>{const m=r.exec(`SELECT COUNT(*) FROM "${u}"`),p=parseInt(m[0].values[0][0],10),x=await ss(r,u);return{name:u,count:p,schema:x}})),i=l.map(({name:u,count:m})=>({name:u,count:m})),d=l.reduce((u,{name:m,schema:p})=>(u[m]=p,u),{});t({db:r,tables:i,tableSchemas:d,isLoading:!1})}catch(r){console.error("Failed to load database:",r),t({isLoading:!1,queryError:"Failed to load database"})}},query:a=>{const{db:r}=s();return r?r.exec(a):(console.warn("Database is not loaded."),[])},setQueryError:a=>t({queryError:a}),setTables:a=>t({tables:a}),setSelectedTable:a=>t({selectedTable:a}),setTableSchemas:a=>t({tableSchemas:a}),setRowPerPageOrAuto:a=>t({rowPerPageOrAuto:a}),customQuery:"",setIsCustomQuery:a=>t({isCustomQuery:a}),setCustomQuery:a=>t({customQuery:a}),queryHestory:[],setQueryHestory:a=>t({queryHestory:a}),unShiftToQueryHestory:a=>t(r=>({queryHestory:[a,...r.queryHestory]})),expandPage:!1,setExpandPage:a=>t({expandPage:a}),dateFormatValue:"formatDateFormatted",setDateFormatValue:a=>t({dateFormatValue:a})}));function is(t,s,a,r){const{db:o,setQueryError:l,setIsCustomQuery:i,query:d,unShiftToQueryHestory:u,customQuery:m,setCustomQuery:p}=R(),[x,b]=n.useState([]),[f,h]=n.useState([]),[j,S]=n.useState(!0);n.useEffect(()=>{o&&t&&!r&&(S(!0),(async()=>{try{const g=`PRAGMA table_info("${t}");`,T=`SELECT ${d(g)[0].values.map(E=>({name:E[1],type:E[2]})).map(E=>E.type.toUpperCase()==="BLOB"?`hex(${E.name}) as ${E.name}`:E.name).join(", ")} FROM "${t}" LIMIT ${s} OFFSET ${a};`,k=d(T),{data:I,columns:C}=O(k);h(C),b(I),l(null),p(T),u(T)}catch(g){g instanceof Error&&l(g.message)}finally{S(!1)}})())},[o,t,a,s,r,l,d,p,u]);const w=n.useCallback(()=>{if(m.trim()===""){l(null);return}S(!0),(async()=>{try{const g=d(m),{data:P,columns:N}=O(g);h(N),b(P),i(!0),l(null)}catch(g){g instanceof Error&&l(g.message)}finally{S(!1)}})()},[m,d,l,i]);return{data:x,columns:f,customQuery:m,setCustomQuery:p,isQueryLoading:j,handleCustomQuery:w}}function cs(t){const{setIsCustomQuery:s}=R(),[a,r]=n.useState(0);n.useEffect(()=>{r(0),s(!1)},[s]);let o=30;if(t==="auto"){const l=window.innerHeight,i=[{height:1700,rowHeight:65},{height:1300,rowHeight:70},{height:1200,rowHeight:75},{height:1100,rowHeight:75},{height:1e3,rowHeight:80},{height:950,rowHeight:85},{height:900,rowHeight:90},{height:850,rowHeight:95},{height:800,rowHeight:100},{height:750,rowHeight:105},{height:700,rowHeight:110},{height:600,rowHeight:120},{height:550,rowHeight:150},{height:500,rowHeight:190},{height:0,rowHeight:280}];let u=120;for(const m of i)if(l>m.height){u=m.rowHeight;break}o=Math.max(1,Math.floor(l/u))}else o=t;return{page:a,setPage:r,rowsPerPage:o}}function c(...t){return ct(it(t))}const U=n.forwardRef(({className:t,type:s,...a},r)=>e.jsx("input",{type:s,className:c("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...a}));U.displayName="Input";const V=q("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),y=n.forwardRef(({className:t,variant:s,size:a,asChild:r=!1,...o},l)=>{const i=r?dt:"button";return e.jsx(i,{className:c(V({variant:s,size:a,className:t})),ref:l,...o})});y.displayName="Button";function ds({page:t,setPage:s,rowsPerPage:a,rowCount:r}){const o=Math.ceil(r/a),l=Math.floor(t/a)+1,i=()=>{l{l>1&&s(t-a)};return e.jsx("section",{className:"fixed bottom-[8px] left-0 right-0 z-10 mx-auto w-[270px]",children:e.jsxs("div",{className:"flex justify-between gap-2 rounded border bg-secondary p-[6px]",children:[e.jsx(y,{onClick:d,title:"Previous page",disabled:l===1,children:e.jsx(Pt,{className:"h-4 w-4"})}),e.jsxs("span",{className:"flex items-center justify-center text-sm",children:["Page ",l," of ",o]}),e.jsx(y,{onClick:i,title:"Next page",disabled:l>=o,children:e.jsx(Lt,{className:"h-4 w-4"})})]})})}const us=ht,ms=gt,fs=bt,we=n.forwardRef(({className:t,children:s,...a},r)=>e.jsxs(X,{ref:r,className:c("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...a,children:[s,e.jsx(ut,{asChild:!0,children:e.jsx(je,{className:"h-4 w-4 opacity-50"})})]}));we.displayName=X.displayName;const Ne=n.forwardRef(({className:t,...s},a)=>e.jsx(ee,{ref:a,className:c("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(kt,{className:"h-4 w-4"})}));Ne.displayName=ee.displayName;const ve=n.forwardRef(({className:t,...s},a)=>e.jsx(te,{ref:a,className:c("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(je,{className:"h-4 w-4"})}));ve.displayName=te.displayName;const Ce=n.forwardRef(({className:t,children:s,position:a="popper",...r},o)=>e.jsx(mt,{children:e.jsxs(se,{ref:o,className:c("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,...r,children:[e.jsx(Ne,{}),e.jsx(ft,{className:c("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),e.jsx(ve,{})]})}));Ce.displayName=se.displayName;const Re=n.forwardRef(({className:t,...s},a)=>e.jsx(ae,{ref:a,className:c("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...s}));Re.displayName=ae.displayName;const Se=n.forwardRef(({className:t,children:s,...a},r)=>e.jsxs(re,{ref:r,className:c("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...a,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(pt,{children:e.jsx(Ft,{className:"h-4 w-4"})})}),e.jsx(xt,{children:s})]}));Se.displayName=re.displayName;const ps=n.forwardRef(({className:t,...s},a)=>e.jsx(oe,{ref:a,className:c("-mx-1 my-1 h-px bg-muted",t),...s}));ps.displayName=oe.displayName;const xs=q("inline-flex items-center rounded border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function De({className:t,variant:s,...a}){return e.jsx("div",{className:c(xs({variant:s}),t),...a})}function hs(){const{tables:t,selectedTable:s,setSelectedTable:a}=R(),r=n.useMemo(()=>{var i;const l=parseInt(s);return isNaN(l)?0:((i=t[l])==null?void 0:i.count)||0},[t,s]),o=n.useMemo(()=>t.map((l,i)=>e.jsx(Se,{value:`${i}`,children:l.name},l.name)),[t]);return e.jsxs("section",{className:"flex grow items-center justify-center gap-1",children:[e.jsxs(us,{value:s,onValueChange:a,children:[e.jsx(we,{className:"grow",children:e.jsx(fs,{placeholder:"Select a table"})}),e.jsx(Ce,{children:e.jsxs(ms,{children:[e.jsx(Re,{children:"Tables"}),o]})})]}),e.jsx(De,{title:"Rows",className:"min-w-[100px] grow py-2 text-sm md:min-w-[200px]",variant:"outline",children:e.jsx("span",{className:"w-full text-center",children:r})})]})}const F=t=>t instanceof Date&&!isNaN(t.getTime()),gs=t=>{const s=new Date(t);return F(s)?Yt(s,{addSuffix:!0}):t},bs=t=>{const s=new Date(t);return F(s)?M(s,"MMMM do, yyyy"):t},ys=t=>{const s=new Date(t);return F(s)?M(s,"hh:mm a"):t},js=t=>{const s=new Date(t);return F(s)?M(s,"MM/dd/yyyy"):t},ws=t=>{const s=new Date(t);return F(s)?M(s,"EEEE, MMMM do, yyyy"):t},A={formatDateRelative:{label:"over 56 years ago",func:gs},formatDateFormatted:{label:"January 9th, 1968",func:bs},formatTime:{label:"12:00 am",func:ys},formatDateShort:{label:"01/09/1968",func:js},formatDateLong:{label:"Monday, January 9th, 1968",func:ws}},Te=yt,Ee=jt,_=n.forwardRef(({className:t,align:s="start",side:a="bottom",sideOffset:r=4,...o},l)=>e.jsx(ne,{ref:l,align:s,side:a,sideOffset:r,className:c("z-50 w-64 text-balance break-words rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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",t),...o}));_.displayName=ne.displayName;const Pe=n.forwardRef(({className:t,...s},a)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:a,className:c("w-full caption-bottom text-sm",t),...s})}));Pe.displayName="Table";const Le=n.forwardRef(({className:t,...s},a)=>e.jsx("thead",{ref:a,className:c("[&_tr]:border-b",t),...s}));Le.displayName="TableHeader";const ke=n.forwardRef(({className:t,...s},a)=>e.jsx("tbody",{ref:a,className:c("[&_tr:last-child]:border-0",t),...s}));ke.displayName="TableBody";const Ns=n.forwardRef(({className:t,...s},a)=>e.jsx("tfoot",{ref:a,className:c("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...s}));Ns.displayName="TableFooter";const Q=n.forwardRef(({className:t,...s},a)=>e.jsx("tr",{ref:a,className:c("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...s}));Q.displayName="TableRow";const Fe=n.forwardRef(({className:t,...s},a)=>e.jsx("th",{ref:a,className:c("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...s}));Fe.displayName="TableHead";const vs=t=>{const s=new Uint8Array(t.match(/.{1,2}/g).map(r=>parseInt(r,16))),a=new Blob([s],{type:"image/jpeg"});return URL.createObjectURL(a)},Ae=n.forwardRef(({className:t,children:s,dataType:a,...r},o)=>{const l=(a==null?void 0:a.toUpperCase())==="BLOB",i=n.useMemo(()=>typeof s=="string"&&s.length>40?s.slice(0,40)+"...":s,[s]);return e.jsx("td",{ref:o,className:c("max-w-[200px] overflow-hidden truncate text-ellipsis whitespace-nowrap p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...r,children:e.jsxs(Te,{children:[e.jsx(Ee,{asChild:!0,children:e.jsx("span",{className:"cursor-pointer hover:underline",children:l?e.jsx("span",{className:"italic opacity-40",children:"BLOB"}):i})}),e.jsx(_,{side:"bottom",align:"start",children:e.jsxs("div",{className:"flex flex-col justify-center gap-2",children:[l&&typeof s=="string"?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:vs(s),alt:"BLOB content",className:"flex max-h-40 flex-col items-center justify-center gap-2 rounded object-contain",onError:d=>{d.currentTarget.style.display="none"}}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["Blob length: ",s.length]})]}):e.jsx("span",{className:"max-w-full break-words",children:s}),a&&e.jsx(De,{className:"w-full self-start text-xs font-semibold",children:a})]})})]})})});Ae.displayName="TableCell";const Cs=n.forwardRef(({className:t,...s},a)=>e.jsx("caption",{ref:a,className:c("mt-4 text-sm text-muted-foreground",t),...s}));Cs.displayName="TableCaption";const Rs=L.memo(({columnSchema:t})=>{var s;return t!=null&&t.isPrimaryKey?e.jsx(At,{className:"h-4 w-4"}):t!=null&&t.isForeignKey?e.jsx(Mt,{className:"h-4 w-4"}):(t==null?void 0:t.type)==="BLOB"?e.jsx(It,{className:"h-4 w-4"}):(s=t==null?void 0:t.type)!=null&&s.includes("DATE")?e.jsx(Ht,{className:"h-4 w-4"}):null}),Ss=L.memo(({col:t,columnSchema:s})=>e.jsx(Fe,{children:e.jsxs(Te,{children:[e.jsx(Ee,{asChild:!0,children:e.jsx("span",{className:"cursor-pointer hover:underline",children:e.jsxs("div",{className:"flex gap-1",children:[t,e.jsx(Rs,{columnSchema:s})]})})}),e.jsx(_,{side:"bottom",align:"start",children:(s==null?void 0:s.type)||"Unknown"})]})})),Ds=L.memo(({value:t,dataType:s})=>{const{dateFormatValue:a}=R(),r=s==="DATE"||s==="DATETIME",o=()=>t?r&&A[a]?A[a].func(t):t:e.jsx("span",{className:"italic opacity-40",children:"NULL"});return e.jsx(Ae,{dataType:s,children:o()})});function Ts({data:t,columns:s,tableName:a,tableSchemas:r}){const o=n.useMemo(()=>e.jsx(Le,{children:e.jsx(Q,{children:s.map((i,d)=>e.jsx(Ss,{col:i,columnSchema:r[a][i]},d))})}),[s,r,a]),l=n.useMemo(()=>e.jsx(ke,{children:t.map((i,d)=>e.jsx(Q,{children:s.map((u,m)=>{var p;return e.jsx(Ds,{value:i[u],dataType:(p=r[a][u])==null?void 0:p.type},m)})},d))}),[t,s,r,a]);return e.jsxs(Pe,{children:[o,l]})}function $({children:t}){return e.jsxs("div",{className:"flex items-center justify-center gap-4 rounded border p-4",children:[e.jsx(Ot,{className:"h-6 w-6"}),e.jsx("span",{className:"font-semibold",children:t})]})}function Me({children:t}){return e.jsxs("div",{className:"flex items-center justify-center gap-4 rounded border p-4",children:[e.jsx(Qt,{className:"h-6 w-6 animate-spin"}),e.jsx("span",{className:"font-semibold",children:t})]})}const Es=Nt,Ps=vt,Ie=n.forwardRef(({className:t,align:s="center",sideOffset:a=4,...r},o)=>e.jsx(wt,{children:e.jsx(le,{ref:o,align:s,sideOffset:a,className:c("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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",t),...r})}));Ie.displayName=le.displayName;function Ls(){const{selectedTable:t,tables:s,customQuery:a,db:r}=R(),o=n.useCallback((i,d,u,m)=>e.jsx(y,{className:m,onClick:i,title:u,children:e.jsx("span",{className:"ml-2",children:d})}),[]),l=n.useMemo(()=>{var i;return r&&e.jsxs("div",{className:"flex flex-col gap-1",children:[o(()=>as(r),"Export as SQLite","Download database as SQLite"),o(()=>os(r,parseInt(t)),`Export ${((i=s[parseInt(t)])==null?void 0:i.name)||"selected"} table as CSV`,"Export selected table as CSV"),o(()=>ns(r),"Export all tables as CSV","Export all tables as CSV"),o(()=>ls(r,a),"Export custom query as CSV","Export the result of the custom query as CSV")]})},[r,o,t,s,a]);return e.jsxs(Es,{children:[e.jsx(Ps,{asChild:!0,children:e.jsx(y,{title:"Open export options",children:e.jsx($t,{className:"h-5 w-5"})})}),e.jsx(Ie,{align:"end",className:"w-80",children:l})]})}function ks(){const{tables:t,selectedTable:s,tableSchemas:a,queryError:r,setQueryError:o,rowPerPageOrAuto:l,isCustomQuery:i,setIsCustomQuery:d,customQuery:u,setCustomQuery:m,expandPage:p,setExpandPage:x}=R(),{page:b,setPage:f,rowsPerPage:h}=cs(l),j=n.useMemo(()=>{var C;return(C=t[parseInt(s)])==null?void 0:C.name},[t,s]),S=n.useMemo(()=>{var C;return((C=t[parseInt(s)])==null?void 0:C.count)||0},[t,s]),{data:w,columns:g,isQueryLoading:P,handleCustomQuery:N}=is(j,h,b,i),D=n.useCallback(()=>{o(null),m(""),d(!1)},[d,o,m]),T=n.useCallback(()=>{f(0),D()},[D,f]);n.useEffect(()=>{f(0)},[s]);const k=n.useMemo(()=>e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row",children:[e.jsx(U,{type:"text",value:u,onChange:C=>m(C.target.value),placeholder:"Enter your custom query",className:"w-full"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(y,{className:"w-full",onClick:N,title:"Run custom query",children:e.jsx(qt,{className:"h-5 w-5"})}),e.jsx(y,{className:"w-full",onClick:D,title:"Reset query",children:e.jsx(Bt,{className:"h-5 w-5"})}),e.jsx(y,{className:"w-full",onClick:T,title:"Reset to first page",disabled:b===0,children:e.jsx(zt,{className:"h-5 w-5"})})]})]}),[u,N,D,T,b]),I=n.useMemo(()=>P?e.jsxs(Me,{children:["Loading ",j]}):w.length>0?e.jsx("div",{className:"rounded border",children:e.jsx(Ts,{data:w,columns:g,tableName:j,tableSchemas:a})}):e.jsx($,{children:`Table ${j} is empty`}),[P,w,g,j,a]);return e.jsxs("div",{className:"flex flex-col gap-3 pb-8",children:[e.jsxs("section",{className:"flex flex-col gap-2 rounded border p-3 pb-2",children:[e.jsxs("div",{className:"flex h-full gap-1",children:[e.jsx(hs,{}),e.jsxs("div",{className:"ml-1 flex gap-1",children:[e.jsx(Ls,{}),e.jsx(y,{className:"hidden expand:block",onClick:()=>x(!p),title:"Toggle page size",children:p?e.jsx(Ut,{className:"h-5 w-5"}):e.jsx(Vt,{className:"h-5 w-5"})})]})]}),k,r&&e.jsx("p",{className:"text-center text-xs capitalize text-red-500",children:r})]}),I,!i&&e.jsx(ds,{page:b,setPage:f,rowsPerPage:h,rowCount:S})]})}const He=({shouldScaleBackground:t=!0,...s})=>e.jsx(v.Root,{shouldScaleBackground:t,...s});He.displayName="Drawer";const Fs=v.Trigger,As=v.Portal,Ms=v.Close,Oe=n.forwardRef(({className:t,...s},a)=>e.jsx(v.Overlay,{ref:a,className:c("fixed inset-0 z-50 bg-black/80",t),...s}));Oe.displayName=v.Overlay.displayName;const Qe=n.forwardRef(({className:t,children:s,...a},r)=>e.jsxs(As,{children:[e.jsx(Oe,{}),e.jsxs(v.Content,{ref:r,className:c("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",t),...a,children:[e.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),s]})]}));Qe.displayName="DrawerContent";const $e=({className:t,...s})=>e.jsx("div",{className:c("grid gap-1.5 p-4 text-center sm:text-left",t),...s});$e.displayName="DrawerHeader";const qe=({className:t,...s})=>e.jsx("div",{className:c("mt-auto flex flex-col gap-2 p-4",t),...s});qe.displayName="DrawerFooter";const Be=n.forwardRef(({className:t,...s},a)=>e.jsx(v.Title,{ref:a,className:c("text-lg font-semibold leading-none tracking-tight",t),...s}));Be.displayName=v.Title.displayName;const ze=n.forwardRef(({className:t,...s},a)=>e.jsx(v.Description,{ref:a,className:c("text-sm text-muted-foreground",t),...s}));ze.displayName=v.Description.displayName;const Ue=n.forwardRef(({className:t,children:s,...a},r)=>e.jsxs(ie,{ref:r,className:c("relative overflow-hidden",t),...a,children:[e.jsx(Ct,{className:"h-full w-full rounded-[inherit]",children:s}),e.jsx(Ve,{}),e.jsx(Rt,{})]}));Ue.displayName=ie.displayName;const Ve=n.forwardRef(({className:t,orientation:s="vertical",...a},r)=>e.jsx(ce,{ref:r,orientation:s,className:c("flex touch-none select-none transition-colors",s==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...a,children:e.jsx(St,{className:"relative flex-1 rounded-full bg-border"})}));Ve.displayName=ce.displayName;const _e=n.forwardRef(({className:t,orientation:s="horizontal",decorative:a=!0,...r},o)=>e.jsx(de,{ref:o,decorative:a,orientation:s,className:c("shrink-0 bg-border",s==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));_e.displayName=de.displayName;const Is=q("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ge=n.forwardRef(({className:t,...s},a)=>e.jsx(ue,{ref:a,className:c(Is(),t),...s}));Ge.displayName=ue.displayName;const Ke=n.forwardRef(({className:t,...s},a)=>e.jsx(me,{className:c("grid gap-2",t),...s,ref:a}));Ke.displayName=me.displayName;const Je=n.forwardRef(({className:t,...s},a)=>e.jsx(fe,{ref:a,className:c("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...s,children:e.jsx(Dt,{className:"flex items-center justify-center",children:e.jsx(_t,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Je.displayName=fe.displayName;const G="rowsPerPage",K="dateFormat";function Hs(){const{setRowPerPageOrAuto:t,setIsCustomQuery:s,queryHestory:a,dateFormatValue:r,setDateFormatValue:o}=R(),[l,i]=n.useState(null),[d,u]=n.useState(!1);n.useEffect(()=>{const f=localStorage.getItem(G),h=localStorage.getItem(K);if(f)if(f==="auto")u(!0);else{const j=Number(f);i(j),t(j)}h&&o(h)},[t,o]);const m=n.useCallback(f=>{const h=Number(f.target.value);isNaN(h)||(i(h),u(!1))},[]),p=n.useCallback(()=>{u(f=>!f)},[]),x=n.useCallback(()=>{if(s(!1),l===null){H.error("Please provide a number of rows per page or set it to auto.");return}if(l<1){H.error("Please provide a positive number of rows per page.");return}const f=d?"auto":l.toString();localStorage.setItem(G,f),t(d?"auto":l)},[l,d,s,t]),b=f=>{o(f),localStorage.setItem(K,f)};return e.jsxs(He,{children:[e.jsx(Fs,{asChild:!0,children:e.jsx(y,{className:"grow",title:"Open settings drawer",children:e.jsx(Gt,{className:"h-5 w-5"})})}),e.jsx(Qe,{children:e.jsxs("div",{className:"mx-auto w-full max-w-md",children:[e.jsxs($e,{children:[e.jsx(Be,{children:"Settings"}),e.jsx(ze,{children:"Personalize your site experience here."})]}),e.jsxs("div",{className:"flex flex-col gap-4 p-4 pb-0",children:[e.jsx(Os,{selectedRowsPerPage:l,isAutoRowsPerPage:d,handleInputChange:m,toggleAutoRowsPerPage:p,handleRowsPerPageSave:x}),e.jsx(Qs,{dateFormatValue:r,handleDateFormatChange:b}),e.jsx($s,{queryHestory:a})]}),e.jsx(qe,{children:e.jsx(Ms,{asChild:!0,children:e.jsx(y,{title:"Close settings drawer",variant:"outline",children:"Close"})})})]})})]})}function Os({selectedRowsPerPage:t,isAutoRowsPerPage:s,handleInputChange:a,toggleAutoRowsPerPage:r,handleRowsPerPageSave:o}){return e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-sm text-muted-foreground",children:"Rows Per Page"}),e.jsxs("div",{className:"flex items-center justify-center gap-1 rounded border p-2",children:[e.jsx(U,{value:t||"",onChange:a,disabled:s,placeholder:"Number of rows",type:"number",name:"rowsPerPage"}),e.jsx("span",{className:"h-full text-center text-sm text-muted-foreground",children:"OR"}),e.jsx(y,{className:s?"border border-primary":"",onClick:r,title:"Toggle auto rows per page",variant:"outline",children:"Auto Calculate"})]}),e.jsx(y,{className:"mt-2 w-full",onClick:o,title:"Save rows per page settings",variant:"outline",children:e.jsx("span",{children:"Save"})})]})}function Qs({dateFormatValue:t,handleDateFormatChange:s}){return e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-sm text-muted-foreground",children:"Date type format"}),e.jsxs(Ke,{className:"flex flex-col gap-2",name:"dateType",value:t,onValueChange:s,children:[e.jsx(J,{value:"default",label:"Default"}),Object.keys(A).map(a=>e.jsx(J,{value:a,label:A[a].label},a))]})]})}function J({value:t,label:s}){return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Je,{value:t,id:`r-${t}`}),e.jsx(Ge,{htmlFor:`r-${t}`,children:s})]})}function $s({queryHestory:t}){return e.jsxs("div",{children:[e.jsxs("p",{className:"mb-1 text-sm text-muted-foreground",children:["Query History (",t.length,")"]}),e.jsx(Ue,{className:"h-48 rounded-md border",children:e.jsx("div",{className:"p-4",children:t.map((s,a)=>e.jsxs("div",{children:[e.jsx("div",{className:"text-xs",children:s}),e.jsx(_e,{className:"my-2"})]},a))})})]})}const W="darkMode",Y="animate-circular-reveal";function We(){const[t,s]=n.useState(!1),a=n.useCallback(o=>{s(o),document.body.classList.toggle("dark",o),localStorage.setItem(W,o.toString()),document.body.classList.add(Y),setTimeout(()=>{document.body.classList.remove(Y)},500)},[]);n.useEffect(()=>{const o=localStorage.getItem(W),l=o!==null?o==="true":window.matchMedia("(prefers-color-scheme: dark)").matches;a(l);const i=u=>{a(u.matches)},d=window.matchMedia("(prefers-color-scheme: dark)");return d.addEventListener("change",i),()=>{d.removeEventListener("change",i)}},[a]);const r=n.useCallback(()=>{a(!t)},[t,a]);return e.jsx(y,{className:"relative grow",onClick:r,title:t?"Enable light mode":"Enable dark mode",children:t?e.jsx(Kt,{className:"h-5 w-5"}):e.jsx(Jt,{className:"h-5 w-5"})})}const qs={"application/vnd.sqlite3":[".sqlite",".sqlite3"],"application/x-sqlite3":[".sqlite",".sqlite3"],"application/octet-stream":[".db"],"application/sql":[".sql"]},Bs={CHINOOK:"https://github.com/vwh/sqlite-viewer/raw/main/db_examples/chinook.db"};function zs(){const{loadDatabase:t,setTables:s,setSelectedTable:a,db:r}=R(),[o,l]=n.useState([]),i=n.useCallback(async(x,b)=>{if(l([]),s([]),a("0"),x.length>0&&await t(x[0]),b.length>0){const f=b.flatMap(h=>h.errors);l(f)}},[t,s,a]),{getRootProps:d,getInputProps:u}=Zt({onDrop:i,multiple:!1,accept:qs}),m=n.useCallback(x=>e.jsxs("div",{className:`flex h-full items-center justify-center gap-2 ${x?"px-[10px]":"px-0"}`,children:[e.jsxs("div",{...d(),className:`flex h-full grow cursor-pointer flex-col items-center justify-center rounded border p-6 text-center ${x?"py-0":"py-32"}`,children:[e.jsx("input",{id:"file-upload",...u()}),e.jsx("label",{htmlFor:"file-upload",className:"sr-only",children:"Upload SQLite File"}),e.jsx("p",{className:"hidden sm:block",children:"Drag and drop a SQLite file here, or click to select one"}),e.jsx("p",{className:"block sm:hidden",children:x?"Click to select a file":"Click to select a SQLite file"}),!x&&e.jsx("a",{href:Bs.CHINOOK,className:"text-sm text-link hover:underline",title:"Download sample file",children:"Or download & try this sample file"})]}),x&&e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(We,{}),e.jsx(Hs,{})]})]}),[d,u]),p=n.useMemo(()=>m(!!r),[m,r]);return e.jsxs("section",{children:[p,e.jsx(Us,{errors:o})]})}const Us=L.memo(({errors:t})=>(L.useEffect(()=>{t==null||t.forEach(s=>H(s.message,{position:"bottom-right"}))},[t]),null));function Vs(){const[t,s]=n.useState(()=>document.body.classList.contains("dark"));return n.useEffect(()=>{const a=new MutationObserver(()=>{s(document.body.classList.contains("dark"))});return a.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>a.disconnect()},[]),t}function _s(){const s=Vs()?"/sqlite-dark.webp":"/sqlite-light.webp";return e.jsx("section",{className:"flex justify-center rounded border py-3",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("img",{id:"logo",title:"SQLite Logo",src:s,alt:"SQLite Logo",width:"170",height:"80",draggable:"false"}),e.jsx("p",{className:"text-sm",children:"View SQLite files in the browser"})]})})}const Gs=Et,Ks=Tt,Ye=n.forwardRef(({className:t,...s},a)=>e.jsx(pe,{className:c("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...s,ref:a}));Ye.displayName=pe.displayName;const Ze=n.forwardRef(({className:t,...s},a)=>e.jsxs(Ks,{children:[e.jsx(Ye,{}),e.jsx(xe,{ref:a,className:c("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...s})]}));Ze.displayName=xe.displayName;const Xe=({className:t,...s})=>e.jsx("div",{className:c("flex flex-col space-y-2 text-left",t),...s});Xe.displayName="AlertDialogHeader";const et=({className:t,...s})=>e.jsx("div",{className:c("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s});et.displayName="AlertDialogFooter";const tt=n.forwardRef(({className:t,...s},a)=>e.jsx(he,{ref:a,className:c("text-lg font-semibold",t),...s}));tt.displayName=he.displayName;const st=n.forwardRef(({className:t,...s},a)=>e.jsx(ge,{ref:a,className:c("text-sm",t),...s}));st.displayName=ge.displayName;const at=n.forwardRef(({className:t,...s},a)=>e.jsx(be,{ref:a,className:c(V(),t),...s}));at.displayName=be.displayName;const rt=n.forwardRef(({className:t,...s},a)=>e.jsx(ye,{ref:a,className:c(V({variant:"outline"}),"mt-2 sm:mt-0",t),...s}));rt.displayName=ye.displayName;function Js({showDialog:t,setShowDialog:s,fn:a}){return e.jsx(Gs,{open:t,onOpenChange:s,children:e.jsxs(Ze,{children:[e.jsxs(Xe,{children:[e.jsx(tt,{children:"Retry using a proxy?"}),e.jsx(st,{children:"Failed to load the database from the provided URL due to possible CORS restrictions."})]}),e.jsx("div",{className:"text-sm font-semibold",children:"Using the proxy may expose your database to corsproxy.io services."}),e.jsxs(et,{children:[e.jsx(rt,{onClick:()=>s(!1),children:"Cancel"}),e.jsx(at,{onClick:a,children:"Confirm"})]})]})})}const Ws="https://github.com/vwh/sqlite-viewer";function Ys(){return e.jsxs("footer",{className:"flex items-center justify-between rounded border p-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"hidden text-xs sm:block",children:"No file will be uploaded to server. using JavaScript, sql.js"}),e.jsx("p",{className:"block text-xs sm:hidden",children:"No file uploads to server."}),e.jsxs("a",{href:Ws,target:"_blank",className:"flex items-center gap-1 text-sm text-link hover:underline",title:"Star on GitHub",children:[e.jsx(Wt,{className:"h-4 w-4"}),e.jsx("span",{children:"Star us on GitHub"})]})]}),e.jsx("div",{className:"flex gap-1",children:e.jsx(We,{})})]})}function Zs(){const{db:t,tables:s,isLoading:a,loadDatabase:r,expandPage:o}=R(),[l,i]=n.useState(null),[d,u]=n.useState(!1),[m,p]=n.useState(null),[x,b]=n.useState(!1),f=n.useRef(!1),h=n.useCallback(async(w,g=!1)=>{if(!/^(https?:\/\/(?:www\.)?[a-zA-Z0-9-]{1,256}\.[a-zA-Z]{2,6}(?:\/[^\s]*)?)$/i.test(w)){i("Invalid URL");return}try{b(!0);const N=g?`https://corsproxy.io/?${encodeURIComponent(w)}`:w,D=await fetch(N);if(!D.ok)throw new Error("URL not found or invalid");const T=await D.blob(),k=new File([T],"database.sqlite");await r(k),i(null)}catch(N){g?i(`Error whilefetching, ${N instanceof Error?N.message:String(N)}`):(p(w),u(!0))}finally{b(!1)}},[r]);n.useEffect(()=>{if(f.current)return;const g=new URLSearchParams(window.location.search).get("url");g&&(h(decodeURIComponent(g)),f.current=!0)},[h]);const j=n.useCallback(()=>{m&&(h(m,!0),u(!1))},[m,h]),S=()=>a||x?e.jsxs(Me,{children:[x?"Fetching":"Loading"," SQLite file"]}):l&&!t?e.jsx($,{children:l}):t?s.length>0?e.jsx(ks,{}):e.jsx($,{children:"Your database is empty, no tables found"}):null;return e.jsxs("main",{className:`mx-auto flex h-screen flex-col gap-3 p-4 ${o?"w-full":"container"}`,children:[!t&&e.jsx(_s,{}),e.jsx(zs,{}),S(),e.jsx(Js,{showDialog:d,setShowDialog:u,fn:j}),!t&&e.jsx(Ys,{})]})}const Xs=({...t})=>e.jsx(Xt,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-primary group-[.toaster]:text-background group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t});ot.createRoot(document.getElementById("root")).render(e.jsxs(L.StrictMode,{children:[e.jsx(Zs,{}),e.jsx(Xs,{})]})); diff --git a/assets/index-D1aL-xAe.js.gz b/assets/index-D1aL-xAe.js.gz deleted file mode 100644 index 74c9f1be2542c4a9619c367d67087ff2688fa8d4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 11378 zcmV-&EREA2iwFP!000021MPizciTFW@Bi~D6rMac)eXtZ%_@(sCti{`@fI)H)S8%* zD2X;HDgV~#5}4vyfR`}^x?8o z`Z!qhqcE`QtC8z;MQt}2?;lQg59?Rl+VoVdE|m*KwqP#|YGQx3zx`?Qy-;|R6uz5q z;f#8<@c7NMm**GH%%UC@^^>Cfr;oQa|IQz6bUHn=DI zuql0>3O17y;Ido#JQM6r4$oz8#`#WuggA3I9+x@pXY*oq0hZ!!v8CBdfu!y@oKx`y7qnjFe->Jb8Cvcc7_`_dmr~R2rJ?HrpI*{SL->#t@TH|*8dqCyN} zM{aGmw!eKm+&?pG$VGjx#{M;>&2TgVxov-Vx5mE?L$iXMm7BQWjWh8+h z7+yI-L^Y?|b;qK%{bhgMIr7773EmyLy@`*GcJAKpo}N#>W#3OY=>B%pt+_MdMkB|s zaS=wK)!T2b+k1JM>kr6M8+yH-JF4w|dVaC9u{X$;P}32)L3o3PyHV%^_T$^5A73sm zvLyxgy-sas^8I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01a|9-)BT+=7{hinqPB5?<`k)i%EH-q=|Hk08GH3)w;o;>F5$L_0n_EV zeJOy$DCH@*tQdrI-PUfsL+6zty+$hgWErzt=k1bf%{Ntr2$yc+5=!&>$s=4px#iiH zvTr)83vwQT2&`Z*0v;8vrrbJ;jUNr|w>iQHalXwMLuE32EWNO@qb{sOhH#k!h9b}6 zL!I`cPa0^9>j>8;Y1@y8#t@_akk|K93ZgtbCb z8GHm8Qy(Sb;oP4mv2VjnjPvQJqAi|J)4P`TvXVqP>sw~ijC1K2-QBLU!Taj)Zgpx< z-i{W?QS3{for(const l of o)if(l.type==="childList")for(const i of l.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function a(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=a(o);fetch(o.href,l)}})();const es="https://sql.js.org/dist/sql-wasm.wasm",ts=async t=>{try{const[s,a]=await Promise.all([t.arrayBuffer(),lt({locateFile:()=>es})]);return new a.Database(new Uint8Array(s))}catch(s){throw console.error("Failed to load database:",s),s}},B=t=>{var s;try{return((s=t.exec("SELECT name FROM sqlite_master WHERE type='table';")[0])==null?void 0:s.values.flat())||[]}catch(a){return console.error("Failed to get table names:",a),[]}},ss=async(t,s)=>{try{const[a,r]=t.exec(` + PRAGMA table_info("${s}"); + PRAGMA foreign_key_list("${s}"); + `),o=a.values.reduce((l,i)=>(l[i[1]]={type:i[2],isPrimaryKey:i[5]===1,isForeignKey:!1},l),{});return r==null||r.values.forEach(l=>{const i=l[3];o[i]&&(o[i].isForeignKey=!0)}),o}catch(a){throw console.error(`Failed to get schema for table "${s}":`,a),a}},Q=t=>{if(t.length===0)return{data:[],columns:[]};const{columns:s,values:a}=t[0];return{data:a.map(o=>Object.fromEntries(s.map((l,i)=>[l,o[i]]))),columns:s}},as=t=>{try{const s=t.export(),a=new Blob([s],{type:"application/x-sqlite3"});Z.saveAs(a,"database.sqlite")}catch(s){throw console.error("Failed to export database:",s),s}},rs=(t,s)=>{const a=t.map(o=>`"${o}"`).join(","),r=s.map(o=>t.map(l=>`"${o[l]??""}"`).join(","));return[a,...r].join(` +`)},z=(t,s,a)=>{try{const r=s.exec(t);if(r.length===0)throw new Error(`Query "${t}" returned no results.`);const{data:o,columns:l}=Q(r),i=rs(l,o),c=new Blob([i],{type:"text/csv;charset=utf-8;"});Z.saveAs(c,`${a}.csv`)}catch(r){throw console.error(`Failed to get CSV for query "${t}":`,r),r}},os=(t,s)=>{const r=B(t)[s],o=`SELECT * FROM "${r}"`;z(o,t,r)},ns=t=>{B(t).forEach(s=>{const a=`SELECT * FROM "${s}"`;z(a,t,s)})},ls=(t,s)=>{z(s,t,"custom_query")},R=nt((t,s)=>({db:null,isLoading:!1,queryError:null,tables:[],selectedTable:"0",tableSchemas:{},rowPerPageOrAuto:"auto",isCustomQuery:!1,loadDatabase:async a=>{t({isLoading:!0,queryError:null});try{const r=await ts(a),o=B(r),l=await Promise.all(o.map(async u=>{const m=r.exec(`SELECT COUNT(*) FROM "${u}"`),p=parseInt(m[0].values[0][0],10),x=await ss(r,u);return{name:u,count:p,schema:x}})),i=l.map(({name:u,count:m})=>({name:u,count:m})),c=l.reduce((u,{name:m,schema:p})=>(u[m]=p,u),{});t({db:r,tables:i,tableSchemas:c,isLoading:!1})}catch(r){console.error("Failed to load database:",r),t({isLoading:!1,queryError:"Failed to load database"})}},query:a=>{const{db:r}=s();return r?r.exec(a):(console.warn("Database is not loaded."),[])},setQueryError:a=>t({queryError:a}),setTables:a=>t({tables:a}),setSelectedTable:a=>t({selectedTable:a}),setTableSchemas:a=>t({tableSchemas:a}),setRowPerPageOrAuto:a=>t({rowPerPageOrAuto:a}),customQuery:"",setIsCustomQuery:a=>t({isCustomQuery:a}),setCustomQuery:a=>t({customQuery:a}),queryHestory:[],setQueryHestory:a=>t({queryHestory:a}),unShiftToQueryHestory:a=>t(r=>({queryHestory:[a,...r.queryHestory]})),expandPage:!1,setExpandPage:a=>t({expandPage:a}),dateFormatValue:"formatDateFormatted",setDateFormatValue:a=>t({dateFormatValue:a})}));function is(t,s,a,r){const{db:o,setQueryError:l,setIsCustomQuery:i,query:c,unShiftToQueryHestory:u,customQuery:m,setCustomQuery:p}=R(),[x,b]=n.useState([]),[f,h]=n.useState([]),[j,S]=n.useState(!0);n.useEffect(()=>{o&&t&&!r&&(S(!0),(async()=>{try{const g=`PRAGMA table_info("${t}");`,D=`SELECT ${c(g)[0].values.map(E=>({name:E[1],type:E[2]})).map(E=>E.type.toUpperCase()==="BLOB"?`hex(${E.name}) as ${E.name}`:E.name).join(", ")} FROM "${t}" LIMIT ${s} OFFSET ${a};`,k=c(D),{data:I,columns:C}=Q(k);h(C),b(I),l(null),p(D),u(D)}catch(g){g instanceof Error&&l(g.message)}finally{S(!1)}})())},[o,t,a,s,r,l,c,p,u]);const w=n.useCallback(()=>{if(m.trim()===""){l(null);return}S(!0),(async()=>{try{const g=c(m),{data:P,columns:N}=Q(g);h(N),b(P),i(!0),l(null)}catch(g){g instanceof Error&&l(g.message)}finally{S(!1)}})()},[m,c,l,i]);return{data:x,columns:f,customQuery:m,setCustomQuery:p,isQueryLoading:j,handleCustomQuery:w}}function cs(t){const{setIsCustomQuery:s}=R(),[a,r]=n.useState(0);n.useEffect(()=>{r(0),s(!1)},[s]);let o=30;if(t==="auto"){const l=window.innerHeight,i=[{height:1700,rowHeight:65},{height:1300,rowHeight:70},{height:1200,rowHeight:75},{height:1100,rowHeight:75},{height:1e3,rowHeight:80},{height:950,rowHeight:85},{height:900,rowHeight:90},{height:850,rowHeight:95},{height:800,rowHeight:100},{height:750,rowHeight:105},{height:700,rowHeight:110},{height:600,rowHeight:120},{height:550,rowHeight:150},{height:500,rowHeight:190},{height:0,rowHeight:280}];let u=120;for(const m of i)if(l>m.height){u=m.rowHeight;break}o=Math.max(1,Math.floor(l/u))}else o=t;return{page:a,setPage:r,rowsPerPage:o}}function d(...t){return ct(it(t))}const U=n.forwardRef(({className:t,type:s,...a},r)=>e.jsx("input",{type:s,className:d("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),ref:r,...a}));U.displayName="Input";const V=q("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),y=n.forwardRef(({className:t,variant:s,size:a,asChild:r=!1,...o},l)=>{const i=r?dt:"button";return e.jsx(i,{className:d(V({variant:s,size:a,className:t})),ref:l,...o})});y.displayName="Button";function ds({page:t,setPage:s,rowsPerPage:a,rowCount:r}){const o=Math.ceil(r/a),l=Math.floor(t/a)+1,i=()=>{l{l>1&&s(t-a)};return e.jsx("section",{className:"fixed bottom-[8px] left-0 right-0 z-10 mx-auto w-[270px]",children:e.jsxs("div",{className:"flex justify-between gap-2 rounded border bg-secondary p-[6px]",children:[e.jsx(y,{onClick:c,title:"Previous page",disabled:l===1,children:e.jsx(Pt,{className:"h-4 w-4"})}),e.jsxs("span",{className:"flex items-center justify-center text-sm",children:["Page ",l," of ",o]}),e.jsx(y,{onClick:i,title:"Next page",disabled:l>=o,children:e.jsx(Lt,{className:"h-4 w-4"})})]})})}const us=ht,ms=gt,fs=bt,we=n.forwardRef(({className:t,children:s,...a},r)=>e.jsxs(X,{ref:r,className:d("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",t),...a,children:[s,e.jsx(ut,{asChild:!0,children:e.jsx(je,{className:"h-4 w-4 opacity-50"})})]}));we.displayName=X.displayName;const Ne=n.forwardRef(({className:t,...s},a)=>e.jsx(ee,{ref:a,className:d("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(kt,{className:"h-4 w-4"})}));Ne.displayName=ee.displayName;const ve=n.forwardRef(({className:t,...s},a)=>e.jsx(te,{ref:a,className:d("flex cursor-default items-center justify-center py-1",t),...s,children:e.jsx(je,{className:"h-4 w-4"})}));ve.displayName=te.displayName;const Ce=n.forwardRef(({className:t,children:s,position:a="popper",...r},o)=>e.jsx(mt,{children:e.jsxs(se,{ref:o,className:d("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:a,...r,children:[e.jsx(Ne,{}),e.jsx(ft,{className:d("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),e.jsx(ve,{})]})}));Ce.displayName=se.displayName;const Re=n.forwardRef(({className:t,...s},a)=>e.jsx(ae,{ref:a,className:d("py-1.5 pl-8 pr-2 text-sm font-semibold",t),...s}));Re.displayName=ae.displayName;const Se=n.forwardRef(({className:t,children:s,...a},r)=>e.jsxs(re,{ref:r,className:d("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...a,children:[e.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:e.jsx(pt,{children:e.jsx(Ft,{className:"h-4 w-4"})})}),e.jsx(xt,{children:s})]}));Se.displayName=re.displayName;const ps=n.forwardRef(({className:t,...s},a)=>e.jsx(oe,{ref:a,className:d("-mx-1 my-1 h-px bg-muted",t),...s}));ps.displayName=oe.displayName;const xs=q("inline-flex items-center rounded border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Te({className:t,variant:s,...a}){return e.jsx("div",{className:d(xs({variant:s}),t),...a})}function hs(){const{tables:t,selectedTable:s,setSelectedTable:a,setIsCustomQuery:r}=R(),o=n.useMemo(()=>{var u;const c=parseInt(s);return isNaN(c)?0:((u=t[c])==null?void 0:u.count)||0},[t,s]),l=n.useMemo(()=>t.map((c,u)=>e.jsx(Se,{value:`${u}`,children:c.name},c.name)),[t]);function i(c){r(!1),a(c)}return e.jsxs("section",{className:"flex grow items-center justify-center gap-1",children:[e.jsxs(us,{value:s,onValueChange:i,children:[e.jsx(we,{className:"grow",children:e.jsx(fs,{placeholder:"Select a table"})}),e.jsx(Ce,{children:e.jsxs(ms,{children:[e.jsx(Re,{children:"Tables"}),l]})})]}),e.jsx(Te,{title:"Rows",className:"min-w-[100px] grow py-2 text-sm md:min-w-[200px]",variant:"outline",children:e.jsx("span",{className:"w-full text-center",children:o})})]})}const F=t=>t instanceof Date&&!isNaN(t.getTime()),gs=t=>{const s=new Date(t);return F(s)?Yt(s,{addSuffix:!0}):t},bs=t=>{const s=new Date(t);return F(s)?M(s,"MMMM do, yyyy"):t},ys=t=>{const s=new Date(t);return F(s)?M(s,"hh:mm a"):t},js=t=>{const s=new Date(t);return F(s)?M(s,"MM/dd/yyyy"):t},ws=t=>{const s=new Date(t);return F(s)?M(s,"EEEE, MMMM do, yyyy"):t},A={formatDateRelative:{label:"over 56 years ago",func:gs},formatDateFormatted:{label:"January 9th, 1968",func:bs},formatTime:{label:"12:00 am",func:ys},formatDateShort:{label:"01/09/1968",func:js},formatDateLong:{label:"Monday, January 9th, 1968",func:ws}},De=yt,Ee=jt,_=n.forwardRef(({className:t,align:s="start",side:a="bottom",sideOffset:r=4,...o},l)=>e.jsx(ne,{ref:l,align:s,side:a,sideOffset:r,className:d("z-50 w-64 text-balance break-words rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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",t),...o}));_.displayName=ne.displayName;const Pe=n.forwardRef(({className:t,...s},a)=>e.jsx("div",{className:"relative w-full overflow-auto",children:e.jsx("table",{ref:a,className:d("w-full caption-bottom text-sm",t),...s})}));Pe.displayName="Table";const Le=n.forwardRef(({className:t,...s},a)=>e.jsx("thead",{ref:a,className:d("[&_tr]:border-b",t),...s}));Le.displayName="TableHeader";const ke=n.forwardRef(({className:t,...s},a)=>e.jsx("tbody",{ref:a,className:d("[&_tr:last-child]:border-0",t),...s}));ke.displayName="TableBody";const Ns=n.forwardRef(({className:t,...s},a)=>e.jsx("tfoot",{ref:a,className:d("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",t),...s}));Ns.displayName="TableFooter";const O=n.forwardRef(({className:t,...s},a)=>e.jsx("tr",{ref:a,className:d("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",t),...s}));O.displayName="TableRow";const Fe=n.forwardRef(({className:t,...s},a)=>e.jsx("th",{ref:a,className:d("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",t),...s}));Fe.displayName="TableHead";const vs=t=>{const s=new Uint8Array(t.match(/.{1,2}/g).map(r=>parseInt(r,16))),a=new Blob([s],{type:"image/jpeg"});return URL.createObjectURL(a)},Ae=n.forwardRef(({className:t,children:s,dataType:a,...r},o)=>{const l=(a==null?void 0:a.toUpperCase())==="BLOB",i=n.useMemo(()=>typeof s=="string"&&s.length>40?s.slice(0,40)+"...":s,[s]);return e.jsx("td",{ref:o,className:d("max-w-[200px] overflow-hidden truncate text-ellipsis whitespace-nowrap p-4 align-middle [&:has([role=checkbox])]:pr-0",t),...r,children:e.jsxs(De,{children:[e.jsx(Ee,{asChild:!0,children:e.jsx("span",{className:"cursor-pointer hover:underline",children:l?e.jsx("span",{className:"italic opacity-40",children:"BLOB"}):i})}),e.jsx(_,{side:"bottom",align:"start",children:e.jsxs("div",{className:"flex flex-col justify-center gap-2",children:[l&&typeof s=="string"?e.jsxs(e.Fragment,{children:[e.jsx("img",{src:vs(s),alt:"BLOB content",className:"flex max-h-40 flex-col items-center justify-center gap-2 rounded object-contain",onError:c=>{c.currentTarget.style.display="none"}}),e.jsxs("span",{className:"text-sm text-muted-foreground",children:["Blob length: ",s.length]})]}):e.jsx("span",{className:"max-w-full break-words",children:s}),a&&e.jsx(Te,{className:"w-full self-start text-xs font-semibold",children:a})]})})]})})});Ae.displayName="TableCell";const Cs=n.forwardRef(({className:t,...s},a)=>e.jsx("caption",{ref:a,className:d("mt-4 text-sm text-muted-foreground",t),...s}));Cs.displayName="TableCaption";const Rs=L.memo(({columnSchema:t})=>{var s;return t!=null&&t.isPrimaryKey?e.jsx(At,{className:"h-4 w-4"}):t!=null&&t.isForeignKey?e.jsx(Mt,{className:"h-4 w-4"}):(t==null?void 0:t.type)==="BLOB"?e.jsx(It,{className:"h-4 w-4"}):(s=t==null?void 0:t.type)!=null&&s.includes("DATE")?e.jsx(Ht,{className:"h-4 w-4"}):null}),Ss=L.memo(({col:t,columnSchema:s})=>e.jsx(Fe,{children:e.jsxs(De,{children:[e.jsx(Ee,{asChild:!0,children:e.jsx("span",{className:"cursor-pointer hover:underline",children:e.jsxs("div",{className:"flex gap-1",children:[t,e.jsx(Rs,{columnSchema:s})]})})}),e.jsx(_,{side:"bottom",align:"start",children:(s==null?void 0:s.type)||"Unknown"})]})})),Ts=L.memo(({value:t,dataType:s})=>{const{dateFormatValue:a}=R(),r=s==="DATE"||s==="DATETIME",o=()=>t?r&&A[a]?A[a].func(t):t:e.jsx("span",{className:"italic opacity-40",children:"NULL"});return e.jsx(Ae,{dataType:s,children:o()})});function Ds({data:t,columns:s,tableName:a,tableSchemas:r}){const o=n.useMemo(()=>e.jsx(Le,{children:e.jsx(O,{children:s.map((i,c)=>e.jsx(Ss,{col:i,columnSchema:r[a][i]},c))})}),[s,r,a]),l=n.useMemo(()=>e.jsx(ke,{children:t.map((i,c)=>e.jsx(O,{children:s.map((u,m)=>{var p;return e.jsx(Ts,{value:i[u],dataType:(p=r[a][u])==null?void 0:p.type},m)})},c))}),[t,s,r,a]);return e.jsxs(Pe,{children:[o,l]})}function $({children:t}){return e.jsxs("div",{className:"flex items-center justify-center gap-4 rounded border p-4",children:[e.jsx(Qt,{className:"h-6 w-6"}),e.jsx("span",{className:"font-semibold",children:t})]})}function Me({children:t}){return e.jsxs("div",{className:"flex items-center justify-center gap-4 rounded border p-4",children:[e.jsx(Ot,{className:"h-6 w-6 animate-spin"}),e.jsx("span",{className:"font-semibold",children:t})]})}const Es=Nt,Ps=vt,Ie=n.forwardRef(({className:t,align:s="center",sideOffset:a=4,...r},o)=>e.jsx(wt,{children:e.jsx(le,{ref:o,align:s,sideOffset:a,className:d("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=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",t),...r})}));Ie.displayName=le.displayName;function Ls(){const{selectedTable:t,tables:s,customQuery:a,db:r}=R(),o=n.useCallback((i,c,u,m)=>e.jsx(y,{className:m,onClick:i,title:u,children:e.jsx("span",{className:"ml-2",children:c})}),[]),l=n.useMemo(()=>{var i;return r&&e.jsxs("div",{className:"flex flex-col gap-1",children:[o(()=>as(r),"Export as SQLite","Download database as SQLite"),o(()=>os(r,parseInt(t)),`Export ${((i=s[parseInt(t)])==null?void 0:i.name)||"selected"} table as CSV`,"Export selected table as CSV"),o(()=>ns(r),"Export all tables as CSV","Export all tables as CSV"),o(()=>ls(r,a),"Export custom query as CSV","Export the result of the custom query as CSV")]})},[r,o,t,s,a]);return e.jsxs(Es,{children:[e.jsx(Ps,{asChild:!0,children:e.jsx(y,{title:"Open export options",children:e.jsx($t,{className:"h-5 w-5"})})}),e.jsx(Ie,{align:"end",className:"w-80",children:l})]})}function ks(){const{tables:t,selectedTable:s,tableSchemas:a,queryError:r,setQueryError:o,rowPerPageOrAuto:l,isCustomQuery:i,setIsCustomQuery:c,customQuery:u,setCustomQuery:m,expandPage:p,setExpandPage:x}=R(),{page:b,setPage:f,rowsPerPage:h}=cs(l),j=n.useMemo(()=>{var C;return(C=t[parseInt(s)])==null?void 0:C.name},[t,s]),S=n.useMemo(()=>{var C;return((C=t[parseInt(s)])==null?void 0:C.count)||0},[t,s]),{data:w,columns:g,isQueryLoading:P,handleCustomQuery:N}=is(j,h,b,i),T=n.useCallback(()=>{o(null),m(""),c(!1)},[c,o,m]),D=n.useCallback(()=>{f(0),T()},[T,f]);n.useEffect(()=>{f(0)},[s]);const k=n.useMemo(()=>e.jsxs("div",{className:"flex flex-col gap-2 md:flex-row",children:[e.jsx(U,{type:"text",value:u,onChange:C=>m(C.target.value),placeholder:"Enter your custom query",className:"w-full"}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(y,{className:"w-full",onClick:N,title:"Run custom query",children:e.jsx(qt,{className:"h-5 w-5"})}),e.jsx(y,{className:"w-full",onClick:T,title:"Reset query",children:e.jsx(Bt,{className:"h-5 w-5"})}),e.jsx(y,{className:"w-full",onClick:D,title:"Reset to first page",disabled:b===0,children:e.jsx(zt,{className:"h-5 w-5"})})]})]}),[u,N,T,D,b]),I=n.useMemo(()=>P?e.jsxs(Me,{children:["Loading ",j]}):w.length>0?e.jsx("div",{className:"rounded border",children:e.jsx(Ds,{data:w,columns:g,tableName:j,tableSchemas:a})}):e.jsx($,{children:`Table ${j} is empty`}),[P,w,g,j,a]);return e.jsxs("div",{className:"flex flex-col gap-3 pb-8",children:[e.jsxs("section",{className:"flex flex-col gap-2 rounded border p-3 pb-2",children:[e.jsxs("div",{className:"flex h-full gap-1",children:[e.jsx(hs,{}),e.jsxs("div",{className:"ml-1 flex gap-1",children:[e.jsx(Ls,{}),e.jsx(y,{className:"hidden expand:block",onClick:()=>x(!p),title:"Toggle page size",children:p?e.jsx(Ut,{className:"h-5 w-5"}):e.jsx(Vt,{className:"h-5 w-5"})})]})]}),k,r&&e.jsx("p",{className:"text-center text-xs capitalize text-red-500",children:r})]}),I,!i&&e.jsx(ds,{page:b,setPage:f,rowsPerPage:h,rowCount:S})]})}const He=({shouldScaleBackground:t=!0,...s})=>e.jsx(v.Root,{shouldScaleBackground:t,...s});He.displayName="Drawer";const Fs=v.Trigger,As=v.Portal,Ms=v.Close,Qe=n.forwardRef(({className:t,...s},a)=>e.jsx(v.Overlay,{ref:a,className:d("fixed inset-0 z-50 bg-black/80",t),...s}));Qe.displayName=v.Overlay.displayName;const Oe=n.forwardRef(({className:t,children:s,...a},r)=>e.jsxs(As,{children:[e.jsx(Qe,{}),e.jsxs(v.Content,{ref:r,className:d("fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-[10px] border bg-background",t),...a,children:[e.jsx("div",{className:"mx-auto mt-4 h-2 w-[100px] rounded-full bg-muted"}),s]})]}));Oe.displayName="DrawerContent";const $e=({className:t,...s})=>e.jsx("div",{className:d("grid gap-1.5 p-4 text-center sm:text-left",t),...s});$e.displayName="DrawerHeader";const qe=({className:t,...s})=>e.jsx("div",{className:d("mt-auto flex flex-col gap-2 p-4",t),...s});qe.displayName="DrawerFooter";const Be=n.forwardRef(({className:t,...s},a)=>e.jsx(v.Title,{ref:a,className:d("text-lg font-semibold leading-none tracking-tight",t),...s}));Be.displayName=v.Title.displayName;const ze=n.forwardRef(({className:t,...s},a)=>e.jsx(v.Description,{ref:a,className:d("text-sm text-muted-foreground",t),...s}));ze.displayName=v.Description.displayName;const Ue=n.forwardRef(({className:t,children:s,...a},r)=>e.jsxs(ie,{ref:r,className:d("relative overflow-hidden",t),...a,children:[e.jsx(Ct,{className:"h-full w-full rounded-[inherit]",children:s}),e.jsx(Ve,{}),e.jsx(Rt,{})]}));Ue.displayName=ie.displayName;const Ve=n.forwardRef(({className:t,orientation:s="vertical",...a},r)=>e.jsx(ce,{ref:r,orientation:s,className:d("flex touch-none select-none transition-colors",s==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...a,children:e.jsx(St,{className:"relative flex-1 rounded-full bg-border"})}));Ve.displayName=ce.displayName;const _e=n.forwardRef(({className:t,orientation:s="horizontal",decorative:a=!0,...r},o)=>e.jsx(de,{ref:o,decorative:a,orientation:s,className:d("shrink-0 bg-border",s==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",t),...r}));_e.displayName=de.displayName;const Is=q("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Ge=n.forwardRef(({className:t,...s},a)=>e.jsx(ue,{ref:a,className:d(Is(),t),...s}));Ge.displayName=ue.displayName;const Ke=n.forwardRef(({className:t,...s},a)=>e.jsx(me,{className:d("grid gap-2",t),...s,ref:a}));Ke.displayName=me.displayName;const Je=n.forwardRef(({className:t,...s},a)=>e.jsx(fe,{ref:a,className:d("aspect-square h-4 w-4 rounded-full border border-primary text-primary ring-offset-background focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",t),...s,children:e.jsx(Tt,{className:"flex items-center justify-center",children:e.jsx(_t,{className:"h-2.5 w-2.5 fill-current text-current"})})}));Je.displayName=fe.displayName;const G="rowsPerPage",K="dateFormat";function Hs(){const{setRowPerPageOrAuto:t,setIsCustomQuery:s,queryHestory:a,dateFormatValue:r,setDateFormatValue:o}=R(),[l,i]=n.useState(null),[c,u]=n.useState(!1);n.useEffect(()=>{const f=localStorage.getItem(G),h=localStorage.getItem(K);if(f)if(f==="auto")u(!0);else{const j=Number(f);i(j),t(j)}h&&o(h)},[t,o]);const m=n.useCallback(f=>{const h=Number(f.target.value);isNaN(h)||(i(h),u(!1))},[]),p=n.useCallback(()=>{u(f=>!f)},[]),x=n.useCallback(()=>{if(s(!1),l===null){H.error("Please provide a number of rows per page or set it to auto.");return}if(l<1){H.error("Please provide a positive number of rows per page.");return}const f=c?"auto":l.toString();localStorage.setItem(G,f),t(c?"auto":l)},[l,c,s,t]),b=f=>{o(f),localStorage.setItem(K,f)};return e.jsxs(He,{children:[e.jsx(Fs,{asChild:!0,children:e.jsx(y,{className:"grow",title:"Open settings drawer",children:e.jsx(Gt,{className:"h-5 w-5"})})}),e.jsx(Oe,{children:e.jsxs("div",{className:"mx-auto w-full max-w-md",children:[e.jsxs($e,{children:[e.jsx(Be,{children:"Settings"}),e.jsx(ze,{children:"Personalize your site experience here."})]}),e.jsxs("div",{className:"flex flex-col gap-4 p-4 pb-0",children:[e.jsx(Qs,{selectedRowsPerPage:l,isAutoRowsPerPage:c,handleInputChange:m,toggleAutoRowsPerPage:p,handleRowsPerPageSave:x}),e.jsx(Os,{dateFormatValue:r,handleDateFormatChange:b}),e.jsx($s,{queryHestory:a})]}),e.jsx(qe,{children:e.jsx(Ms,{asChild:!0,children:e.jsx(y,{title:"Close settings drawer",variant:"outline",children:"Close"})})})]})})]})}function Qs({selectedRowsPerPage:t,isAutoRowsPerPage:s,handleInputChange:a,toggleAutoRowsPerPage:r,handleRowsPerPageSave:o}){return e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-sm text-muted-foreground",children:"Rows Per Page"}),e.jsxs("div",{className:"flex items-center justify-center gap-1 rounded border p-2",children:[e.jsx(U,{value:t||"",onChange:a,disabled:s,placeholder:"Number of rows",type:"number",name:"rowsPerPage"}),e.jsx("span",{className:"h-full text-center text-sm text-muted-foreground",children:"OR"}),e.jsx(y,{className:s?"border border-primary":"",onClick:r,title:"Toggle auto rows per page",variant:"outline",children:"Auto Calculate"})]}),e.jsx(y,{className:"mt-2 w-full",onClick:o,title:"Save rows per page settings",variant:"outline",children:e.jsx("span",{children:"Save"})})]})}function Os({dateFormatValue:t,handleDateFormatChange:s}){return e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-sm text-muted-foreground",children:"Date type format"}),e.jsxs(Ke,{className:"flex flex-col gap-2",name:"dateType",value:t,onValueChange:s,children:[e.jsx(J,{value:"default",label:"Default"}),Object.keys(A).map(a=>e.jsx(J,{value:a,label:A[a].label},a))]})]})}function J({value:t,label:s}){return e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Je,{value:t,id:`r-${t}`}),e.jsx(Ge,{htmlFor:`r-${t}`,children:s})]})}function $s({queryHestory:t}){return e.jsxs("div",{children:[e.jsxs("p",{className:"mb-1 text-sm text-muted-foreground",children:["Query History (",t.length,")"]}),e.jsx(Ue,{className:"h-48 rounded-md border",children:e.jsx("div",{className:"p-4",children:t.map((s,a)=>e.jsxs("div",{children:[e.jsx("div",{className:"text-xs",children:s}),e.jsx(_e,{className:"my-2"})]},a))})})]})}const W="darkMode",Y="animate-circular-reveal";function We(){const[t,s]=n.useState(!1),a=n.useCallback(o=>{s(o),document.body.classList.toggle("dark",o),localStorage.setItem(W,o.toString()),document.body.classList.add(Y),setTimeout(()=>{document.body.classList.remove(Y)},500)},[]);n.useEffect(()=>{const o=localStorage.getItem(W),l=o!==null?o==="true":window.matchMedia("(prefers-color-scheme: dark)").matches;a(l);const i=u=>{a(u.matches)},c=window.matchMedia("(prefers-color-scheme: dark)");return c.addEventListener("change",i),()=>{c.removeEventListener("change",i)}},[a]);const r=n.useCallback(()=>{a(!t)},[t,a]);return e.jsx(y,{className:"relative grow",onClick:r,title:t?"Enable light mode":"Enable dark mode",children:t?e.jsx(Kt,{className:"h-5 w-5"}):e.jsx(Jt,{className:"h-5 w-5"})})}const qs={"application/vnd.sqlite3":[".sqlite",".sqlite3"],"application/x-sqlite3":[".sqlite",".sqlite3"],"application/octet-stream":[".db"],"application/sql":[".sql"]},Bs={CHINOOK:"https://github.com/vwh/sqlite-viewer/raw/main/db_examples/chinook.db"};function zs(){const{loadDatabase:t,setTables:s,setSelectedTable:a,db:r}=R(),[o,l]=n.useState([]),i=n.useCallback(async(x,b)=>{if(l([]),s([]),a("0"),x.length>0&&await t(x[0]),b.length>0){const f=b.flatMap(h=>h.errors);l(f)}},[t,s,a]),{getRootProps:c,getInputProps:u}=Zt({onDrop:i,multiple:!1,accept:qs}),m=n.useCallback(x=>e.jsxs("div",{className:`flex h-full items-center justify-center gap-2 ${x?"px-[10px]":"px-0"}`,children:[e.jsxs("div",{...c(),className:`flex h-full grow cursor-pointer flex-col items-center justify-center rounded border p-6 text-center ${x?"py-0":"py-32"}`,children:[e.jsx("input",{id:"file-upload",...u()}),e.jsx("label",{htmlFor:"file-upload",className:"sr-only",children:"Upload SQLite File"}),e.jsx("p",{className:"hidden sm:block",children:"Drag and drop a SQLite file here, or click to select one"}),e.jsx("p",{className:"block sm:hidden",children:x?"Click to select a file":"Click to select a SQLite file"}),!x&&e.jsx("a",{href:Bs.CHINOOK,className:"text-sm text-link hover:underline",title:"Download sample file",children:"Or download & try this sample file"})]}),x&&e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsx(We,{}),e.jsx(Hs,{})]})]}),[c,u]),p=n.useMemo(()=>m(!!r),[m,r]);return e.jsxs("section",{children:[p,e.jsx(Us,{errors:o})]})}const Us=L.memo(({errors:t})=>(L.useEffect(()=>{t==null||t.forEach(s=>H(s.message,{position:"bottom-right"}))},[t]),null));function Vs(){const[t,s]=n.useState(()=>document.body.classList.contains("dark"));return n.useEffect(()=>{const a=new MutationObserver(()=>{s(document.body.classList.contains("dark"))});return a.observe(document.body,{attributes:!0,attributeFilter:["class"]}),()=>a.disconnect()},[]),t}function _s(){const s=Vs()?"/sqlite-dark.webp":"/sqlite-light.webp";return e.jsx("section",{className:"flex justify-center rounded border py-3",children:e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsx("img",{id:"logo",title:"SQLite Logo",src:s,alt:"SQLite Logo",width:"170",height:"80",draggable:"false"}),e.jsx("p",{className:"text-sm",children:"View SQLite files in the browser"})]})})}const Gs=Et,Ks=Dt,Ye=n.forwardRef(({className:t,...s},a)=>e.jsx(pe,{className:d("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...s,ref:a}));Ye.displayName=pe.displayName;const Ze=n.forwardRef(({className:t,...s},a)=>e.jsxs(Ks,{children:[e.jsx(Ye,{}),e.jsx(xe,{ref:a,className:d("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...s})]}));Ze.displayName=xe.displayName;const Xe=({className:t,...s})=>e.jsx("div",{className:d("flex flex-col space-y-2 text-left",t),...s});Xe.displayName="AlertDialogHeader";const et=({className:t,...s})=>e.jsx("div",{className:d("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...s});et.displayName="AlertDialogFooter";const tt=n.forwardRef(({className:t,...s},a)=>e.jsx(he,{ref:a,className:d("text-lg font-semibold",t),...s}));tt.displayName=he.displayName;const st=n.forwardRef(({className:t,...s},a)=>e.jsx(ge,{ref:a,className:d("text-sm",t),...s}));st.displayName=ge.displayName;const at=n.forwardRef(({className:t,...s},a)=>e.jsx(be,{ref:a,className:d(V(),t),...s}));at.displayName=be.displayName;const rt=n.forwardRef(({className:t,...s},a)=>e.jsx(ye,{ref:a,className:d(V({variant:"outline"}),"mt-2 sm:mt-0",t),...s}));rt.displayName=ye.displayName;function Js({showDialog:t,setShowDialog:s,fn:a}){return e.jsx(Gs,{open:t,onOpenChange:s,children:e.jsxs(Ze,{children:[e.jsxs(Xe,{children:[e.jsx(tt,{children:"Retry using a proxy?"}),e.jsx(st,{children:"Failed to load the database from the provided URL due to possible CORS restrictions."})]}),e.jsx("div",{className:"text-sm font-semibold",children:"Using the proxy may expose your database to corsproxy.io services."}),e.jsxs(et,{children:[e.jsx(rt,{onClick:()=>s(!1),children:"Cancel"}),e.jsx(at,{onClick:a,children:"Confirm"})]})]})})}const Ws="https://github.com/vwh/sqlite-viewer";function Ys(){return e.jsxs("footer",{className:"flex items-center justify-between rounded border p-4",children:[e.jsxs("div",{children:[e.jsx("p",{className:"hidden text-xs sm:block",children:"No file will be uploaded to server. using JavaScript, sql.js"}),e.jsx("p",{className:"block text-xs sm:hidden",children:"No file uploads to server."}),e.jsxs("a",{href:Ws,target:"_blank",className:"flex items-center gap-1 text-sm text-link hover:underline",title:"Star on GitHub",children:[e.jsx(Wt,{className:"h-4 w-4"}),e.jsx("span",{children:"Star us on GitHub"})]})]}),e.jsx("div",{className:"flex gap-1",children:e.jsx(We,{})})]})}function Zs(){const{db:t,tables:s,isLoading:a,loadDatabase:r,expandPage:o}=R(),[l,i]=n.useState(null),[c,u]=n.useState(!1),[m,p]=n.useState(null),[x,b]=n.useState(!1),f=n.useRef(!1),h=n.useCallback(async(w,g=!1)=>{if(!/^(https?:\/\/(?:www\.)?[a-zA-Z0-9-]{1,256}\.[a-zA-Z]{2,6}(?:\/[^\s]*)?)$/i.test(w)){i("Invalid URL");return}try{b(!0);const N=g?`https://corsproxy.io/?${encodeURIComponent(w)}`:w,T=await fetch(N);if(!T.ok)throw new Error("URL not found or invalid");const D=await T.blob(),k=new File([D],"database.sqlite");await r(k),i(null)}catch(N){g?i(`Error whilefetching, ${N instanceof Error?N.message:String(N)}`):(p(w),u(!0))}finally{b(!1)}},[r]);n.useEffect(()=>{if(f.current)return;const g=new URLSearchParams(window.location.search).get("url");g&&(h(decodeURIComponent(g)),f.current=!0)},[h]);const j=n.useCallback(()=>{m&&(h(m,!0),u(!1))},[m,h]),S=()=>a||x?e.jsxs(Me,{children:[x?"Fetching":"Loading"," SQLite file"]}):l&&!t?e.jsx($,{children:l}):t?s.length>0?e.jsx(ks,{}):e.jsx($,{children:"Your database is empty, no tables found"}):null;return e.jsxs("main",{className:`mx-auto flex h-screen flex-col gap-3 p-4 ${o?"w-full":"container"}`,children:[!t&&e.jsx(_s,{}),e.jsx(zs,{}),S(),e.jsx(Js,{showDialog:c,setShowDialog:u,fn:j}),!t&&e.jsx(Ys,{})]})}const Xs=({...t})=>e.jsx(Xt,{className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-primary group-[.toaster]:text-background group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t});ot.createRoot(document.getElementById("root")).render(e.jsxs(L.StrictMode,{children:[e.jsx(Zs,{}),e.jsx(Xs,{})]})); diff --git a/assets/index-DKPTwSyp.js.gz b/assets/index-DKPTwSyp.js.gz new file mode 100644 index 0000000000000000000000000000000000000000..6136c22dfd046556ae04cab57a44649589b25fa4 GIT binary patch literal 11399 zcmV;2EO^r&iwFP!000021MPizciTFW@Bi~D6rMac)eXtZ%_@(sCti{`@fI)H)S8%* zD2X;HDgV~#5}4vyfR`}^x?8o z`Z!qhqcE`QtC8z;MQt}2?;lQg59?Rl+VoVdE|m*KwqP#|YGQx3zx`?Qy-;|R6uz5q z;f#8<@c7NMm**GH%%UC@^^>Cfr;oQa|IQz6bUHn=DI zuql0>3O17y;Ido#JQM6r4$oz8#`#WuggA3I9+x@pSyy6q0hZ!!v8CBdfu!y@oKx`y7qnjFe->Jb8Cvcc7_`_dmr~R2rJ?HrpI*{SL->#t@TH|*8dqCyN} zM{aGmw!eKm+&?pG$VGjx#{M;>&2TgVxov-Vx5mE?L$iXMm7BQWjWh8+h z7+yI-L^Y?|b;qK%{bhgMIr7773EmyLy@`*GcJAKpo}N#>W#3OY=>B%pt+_MdMkB|s zaS=wK)!T2b+k1JM>kr6M8+yH-JF4w|dVaC9u{X$;P}32)L3o3PyHV%^_T$^5A73sm zvLyxgy-sas^8I$hJH7jLD;)>C>HF32WOnhntTY$5#KXMNz;{JBs_l$t+td9oXW6m? zSJXx!A^cA5`|ID{49-gC131&A-d_C}9(FI@6-#s--|slxYk=6V?VjF!e0KHaI9u$$ z`hMsLKqIN~-Sys!-o(uo83So*;&$xv+L#9~FOJt=WD6*+?D}pOYf{_Ue*f8@{I(&> z*!{_TVn&3!=ezXFwtR1NZB^@$>mPVrY4YH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BY})QdnFynsPdPe|z*MOra*EW+7i>c=ncF`KP*Ww&Q@#TvEB9%{yjp zm$X0Ly&EaNT@PNQ0fqq0T|9_7v!kC+Y8DkdQ~;ewLnn9fhrRZ1H}&A$p^UnH-_XRw zdlzSTpYs9*83Y8l0ntJK$Il|gJExb}Em75bC4mm3Ha_l`&)z zk-By@nX`QjQ*N+Lpa!p4^UkiE8eML-bKO>Xjoo$abzxP=XBn_o%86>>@2AcpjxPi)3Uxu)lEmvRjuiu5Z)$$CuiM(LFXg06GdOXCzfRy-Mz%AGa( zC_^!%f@~F;q%v^tD_8-dV33Msll+Qj9=wqP$;JYzoVY$qmFn`~o*nV?U~uR83Rr@D hb#twBYo&G7IUDDiZYy^vnw$L#;V(QiM72{G002X!TYdll diff --git a/sw.js b/sw.js index d822501..5b7cccb 100644 --- a/sw.js +++ b/sw.js @@ -1 +1 @@ -if(!self.define){let s,e={};const l=(l,r)=>(l=new URL(l+".js",r).href,e[l]||new Promise((e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()})).then((()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s})));self.define=(r,i)=>{const n=s||("document"in self?document.currentScript.src:"")||location.href;if(e[n])return;let u={};const t=s=>l(s,n),o={module:{uri:n},exports:u,require:t};e[n]=Promise.all(r.map((s=>o[s]||t(s)))).then((s=>(i(...s),u)))}}define(["./workbox-7cfec069"],(function(s){"use strict";self.addEventListener("message",(s=>{s.data&&"SKIP_WAITING"===s.data.type&&self.skipWaiting()})),s.precacheAndRoute([{url:"assets/@floating-ui-DGkE6due.js",revision:null},{url:"assets/@radix-ui-Dtk-Z1Mr.js",revision:null},{url:"assets/aria-hidden-DQ5UC2Eg.js",revision:null},{url:"assets/attr-accept-BWI1aNlo.js",revision:null},{url:"assets/class-variance-authority-Bb4qSo10.js",revision:null},{url:"assets/clsx-B-dksMZM.js",revision:null},{url:"assets/date-fns-fqmN70Xj.js",revision:null},{url:"assets/detect-node-es-l0sNRNKZ.js",revision:null},{url:"assets/file-saver-DhbZvGod.js",revision:null},{url:"assets/file-selector-CBHVlu32.js",revision:null},{url:"assets/get-nonce-C-Z93AgS.js",revision:null},{url:"assets/index-D1aL-xAe.js",revision:null},{url:"assets/index-DFpduaB_.css",revision:null},{url:"assets/lucide-react-Ch2vEKIM.js",revision:null},{url:"assets/prop-types-psm7UO16.js",revision:null},{url:"assets/react-DmpIMwDM.js",revision:null},{url:"assets/react-dom-tIxIBQuZ.js",revision:null},{url:"assets/react-dropzone-D-IBOhIS.js",revision:null},{url:"assets/react-remove-scroll-bar-DZjhPxUV.js",revision:null},{url:"assets/react-remove-scroll-BOyN_WUU.js",revision:null},{url:"assets/react-style-singleton-CpxBwIWS.js",revision:null},{url:"assets/scheduler-CzFDRTuY.js",revision:null},{url:"assets/sonner-BJG0sXho.js",revision:null},{url:"assets/sql.js-lzln2bbd.js",revision:null},{url:"assets/tailwind-merge-BkWO730n.js",revision:null},{url:"assets/tslib-CuZy2iRz.js",revision:null},{url:"assets/use-callback-ref-DRzK4jWO.js",revision:null},{url:"assets/use-sidecar-D8_hMcUG.js",revision:null},{url:"assets/use-sync-external-store-ByYeed7R.js",revision:null},{url:"assets/vaul-Bkmv171v.js",revision:null},{url:"assets/zustand-oOA47TU4.js",revision:null},{url:"index.html",revision:"790fe2b5dd425f60d9b867deb7819370"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"manifest.webmanifest",revision:"662c9ac5fe5300a257a596b0ad6130ea"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html")))})); +if(!self.define){let s,e={};const l=(l,r)=>(l=new URL(l+".js",r).href,e[l]||new Promise((e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()})).then((()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s})));self.define=(r,i)=>{const n=s||("document"in self?document.currentScript.src:"")||location.href;if(e[n])return;let u={};const t=s=>l(s,n),o={module:{uri:n},exports:u,require:t};e[n]=Promise.all(r.map((s=>o[s]||t(s)))).then((s=>(i(...s),u)))}}define(["./workbox-7cfec069"],(function(s){"use strict";self.addEventListener("message",(s=>{s.data&&"SKIP_WAITING"===s.data.type&&self.skipWaiting()})),s.precacheAndRoute([{url:"assets/@floating-ui-DGkE6due.js",revision:null},{url:"assets/@radix-ui-Dtk-Z1Mr.js",revision:null},{url:"assets/aria-hidden-DQ5UC2Eg.js",revision:null},{url:"assets/attr-accept-BWI1aNlo.js",revision:null},{url:"assets/class-variance-authority-Bb4qSo10.js",revision:null},{url:"assets/clsx-B-dksMZM.js",revision:null},{url:"assets/date-fns-fqmN70Xj.js",revision:null},{url:"assets/detect-node-es-l0sNRNKZ.js",revision:null},{url:"assets/file-saver-DhbZvGod.js",revision:null},{url:"assets/file-selector-CBHVlu32.js",revision:null},{url:"assets/get-nonce-C-Z93AgS.js",revision:null},{url:"assets/index-DFpduaB_.css",revision:null},{url:"assets/index-DKPTwSyp.js",revision:null},{url:"assets/lucide-react-Ch2vEKIM.js",revision:null},{url:"assets/prop-types-psm7UO16.js",revision:null},{url:"assets/react-DmpIMwDM.js",revision:null},{url:"assets/react-dom-tIxIBQuZ.js",revision:null},{url:"assets/react-dropzone-D-IBOhIS.js",revision:null},{url:"assets/react-remove-scroll-bar-DZjhPxUV.js",revision:null},{url:"assets/react-remove-scroll-BOyN_WUU.js",revision:null},{url:"assets/react-style-singleton-CpxBwIWS.js",revision:null},{url:"assets/scheduler-CzFDRTuY.js",revision:null},{url:"assets/sonner-BJG0sXho.js",revision:null},{url:"assets/sql.js-lzln2bbd.js",revision:null},{url:"assets/tailwind-merge-BkWO730n.js",revision:null},{url:"assets/tslib-CuZy2iRz.js",revision:null},{url:"assets/use-callback-ref-DRzK4jWO.js",revision:null},{url:"assets/use-sidecar-D8_hMcUG.js",revision:null},{url:"assets/use-sync-external-store-ByYeed7R.js",revision:null},{url:"assets/vaul-Bkmv171v.js",revision:null},{url:"assets/zustand-oOA47TU4.js",revision:null},{url:"index.html",revision:"0bef841db9b30127268e8d17f112eaca"},{url:"registerSW.js",revision:"1872c500de691dce40960bb85481de07"},{url:"manifest.webmanifest",revision:"662c9ac5fe5300a257a596b0ad6130ea"}],{}),s.cleanupOutdatedCaches(),s.registerRoute(new s.NavigationRoute(s.createHandlerBoundToURL("index.html")))}));