@prisma/studio-core 0.0.0 → 0.2.0
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/CPIOZS5X-V4BHP4CI.js +1 -0
- package/dist/OKF6E45R-XYOIK2NY.js +1 -0
- package/dist/adapter-CKFCHq71.d.cts +201 -0
- package/dist/adapter-CKFCHq71.d.ts +201 -0
- package/dist/chunk-2ZJZX5I7.js +0 -0
- package/dist/chunk-5MNS4IJC.js +1332 -0
- package/dist/chunk-BMVJYUJW.js +1 -0
- package/dist/chunk-N2MLAUEV.js +1 -0
- package/dist/chunk-P72NBTYE.js +1 -0
- package/dist/chunk-XS52QRY2.js +1 -0
- package/dist/data/accelerate/index.cjs +1 -0
- package/dist/data/accelerate/index.d.cts +47 -0
- package/dist/data/accelerate/index.d.ts +47 -0
- package/dist/data/accelerate/index.js +1 -0
- package/dist/data/bff/index.cjs +1 -0
- package/dist/data/bff/index.d.cts +55 -0
- package/dist/data/bff/index.d.ts +55 -0
- package/dist/data/bff/index.js +1 -0
- package/dist/data/index.cjs +1 -1
- package/dist/data/index.d.cts +3 -2
- package/dist/data/index.d.ts +3 -2
- package/dist/data/index.js +1 -0
- package/dist/data/pglite/index.cjs +1 -0
- package/dist/data/pglite/index.d.cts +26 -0
- package/dist/data/pglite/index.d.ts +26 -0
- package/dist/data/pglite/index.js +1 -0
- package/dist/data/postgres-core/index.cjs +1 -0
- package/dist/data/postgres-core/index.d.cts +154 -0
- package/dist/data/postgres-core/index.d.ts +154 -0
- package/dist/data/postgres-core/index.js +1 -0
- package/dist/index-BDPv5Gnt.d.ts +48 -0
- package/dist/index-BNAA6jKD.d.cts +48 -0
- package/dist/ui/index.cjs +1523 -1
- package/dist/ui/index.css +1967 -0
- package/dist/ui/index.d.cts +10 -2
- package/dist/ui/index.d.ts +10 -2
- package/dist/ui/index.js +194 -1
- package/package.json +124 -21
- package/data/index.ts +0 -1
- package/tsconfig.json +0 -6
- package/tsup.config.ts +0 -11
- package/ui/index.tsx +0 -1
package/dist/ui/index.d.cts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { A as Adapter } from '../adapter-CKFCHq71.cjs';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
interface StudioProps {
|
|
5
|
+
adapter: Adapter;
|
|
6
|
+
onError?: (error: Error) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Main Studio component that provides database visualization and management
|
|
10
|
+
*/
|
|
11
|
+
declare function Studio(props: StudioProps): react_jsx_runtime.JSX.Element;
|
|
4
12
|
|
|
5
|
-
export
|
|
13
|
+
export { Studio, type StudioProps };
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { A as Adapter } from '../adapter-CKFCHq71.js';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
interface StudioProps {
|
|
5
|
+
adapter: Adapter;
|
|
6
|
+
onError?: (error: Error) => void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Main Studio component that provides database visualization and management
|
|
10
|
+
*/
|
|
11
|
+
declare function Studio(props: StudioProps): react_jsx_runtime.JSX.Element;
|
|
4
12
|
|
|
5
|
-
export {
|
|
13
|
+
export { Studio, type StudioProps };
|
package/dist/ui/index.js
CHANGED
|
@@ -1 +1,194 @@
|
|
|
1
|
-
import{Fragment as l,jsx as o}from"react/jsx-runtime";var d=o(l,{children:"Hello World"});export{d as default};
|
|
1
|
+
import"../chunk-2ZJZX5I7.js";import{D as ke}from"../chunk-P72NBTYE.js";import{B as Ma,aa as Aa,c as V,q as va,r as ka,t as Ra}from"../chunk-N2MLAUEV.js";import{a as Jo,b as te}from"../chunk-BMVJYUJW.js";import{useIsMutating as Yl}from"@tanstack/react-query";import{useEffect as eu,useState as au}from"react";import{toast as tu}from"sonner";import{Slot as Dr}from"@radix-ui/react-slot";import{cva as Tr}from"class-variance-authority";import*as vt from"react";import{clsx as Mr}from"clsx";var Ba="-",$o=e=>{let a=Yo(e),{conflictingClassGroups:t,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{let u=l.split(Ba);return u[0]===""&&u.length!==1&&u.shift(),ht(u,a)||jo(l)},getConflictingClassGroupIds:(l,u)=>{let d=t[l]||[];return u&&o[l]?[...d,...o[l]]:d}}},ht=(e,a)=>{if(e.length===0)return a.classGroupId;let t=e[0],o=a.nextPart.get(t),r=o?ht(e.slice(1),o):void 0;if(r)return r;if(a.validators.length===0)return;let s=e.join(Ba);return a.validators.find(({validator:l})=>l(s))?.classGroupId},Lt=/^\[(.+)\]$/,jo=e=>{if(Lt.test(e)){let a=Lt.exec(e)[1],t=a?.substring(0,a.indexOf(":"));if(t)return"arbitrary.."+t}},Yo=e=>{let{theme:a,prefix:t}=e,o={nextPart:new Map,validators:[]};return ar(Object.entries(e.classGroups),t).forEach(([s,l])=>{Ta(l,o,s,a)}),o},Ta=(e,a,t,o)=>{e.forEach(r=>{if(typeof r=="string"){let s=r===""?a:gt(a,r);s.classGroupId=t;return}if(typeof r=="function"){if(er(r)){Ta(r(o),a,t,o);return}a.validators.push({validator:r,classGroupId:t});return}Object.entries(r).forEach(([s,l])=>{Ta(l,gt(a,s),t,o)})})},gt=(e,a)=>{let t=e;return a.split(Ba).forEach(o=>{t.nextPart.has(o)||t.nextPart.set(o,{nextPart:new Map,validators:[]}),t=t.nextPart.get(o)}),t},er=e=>e.isThemeGetter,ar=(e,a)=>a?e.map(([t,o])=>{let r=o.map(s=>typeof s=="string"?a+s:typeof s=="object"?Object.fromEntries(Object.entries(s).map(([l,u])=>[a+l,u])):s);return[t,r]}):e,tr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let a=0,t=new Map,o=new Map,r=(s,l)=>{t.set(s,l),a++,a>e&&(a=0,o=t,t=new Map)};return{get(s){let l=t.get(s);if(l!==void 0)return l;if((l=o.get(s))!==void 0)return r(s,l),l},set(s,l){t.has(s)?t.set(s,l):r(s,l)}}},St="!",or=e=>{let{separator:a,experimentalParseClassName:t}=e,o=a.length===1,r=a[0],s=a.length,l=u=>{let d=[],n=0,i=0,C;for(let x=0;x<u.length;x++){let I=u[x];if(n===0){if(I===r&&(o||u.slice(x,x+s)===a)){d.push(u.slice(i,x)),i=x+s;continue}if(I==="/"){C=x;continue}}I==="["?n++:I==="]"&&n--}let c=d.length===0?u:u.substring(i),w=c.startsWith(St),y=w?c.substring(1):c,L=C&&C>i?C-i:void 0;return{modifiers:d,hasImportantModifier:w,baseClassName:y,maybePostfixModifierPosition:L}};return t?u=>t({className:u,parseClassName:l}):l},rr=e=>{if(e.length<=1)return e;let a=[],t=[];return e.forEach(o=>{o[0]==="["?(a.push(...t.sort(),o),t=[]):t.push(o)}),a.push(...t.sort()),a},sr=e=>({cache:tr(e.cacheSize),parseClassName:or(e),...$o(e)}),lr=/\s+/,ur=(e,a)=>{let{parseClassName:t,getClassGroupId:o,getConflictingClassGroupIds:r}=a,s=[],l=e.trim().split(lr),u="";for(let d=l.length-1;d>=0;d-=1){let n=l[d],{modifiers:i,hasImportantModifier:C,baseClassName:c,maybePostfixModifierPosition:w}=t(n),y=!!w,L=o(y?c.substring(0,w):c);if(!L){if(!y){u=n+(u.length>0?" "+u:u);continue}if(L=o(c),!L){u=n+(u.length>0?" "+u:u);continue}y=!1}let x=rr(i).join(":"),I=C?x+St:x,M=I+L;if(s.includes(M))continue;s.push(M);let W=r(L,y);for(let K=0;K<W.length;++K){let xe=W[K];s.push(I+xe)}u=n+(u.length>0?" "+u:u)}return u};function dr(){let e=0,a,t,o="";for(;e<arguments.length;)(a=arguments[e++])&&(t=bt(a))&&(o&&(o+=" "),o+=t);return o}var bt=e=>{if(typeof e=="string")return e;let a,t="";for(let o=0;o<e.length;o++)e[o]&&(a=bt(e[o]))&&(t&&(t+=" "),t+=a);return t};function Ct(e,...a){let t,o,r,s=l;function l(d){let n=a.reduce((i,C)=>C(i),e());return t=sr(n),o=t.cache.get,r=t.cache.set,s=u,u(d)}function u(d){let n=o(d);if(n)return n;let i=ur(d,t);return r(d,i),i}return function(){return s(dr.apply(null,arguments))}}var k=e=>{let a=t=>t[e]||[];return a.isThemeGetter=!0,a},wt=/^\[(?:([a-z-]+):)?(.+)\]$/i,nr=/^\d+\/\d+$/,fr=new Set(["px","full","screen"]),ir=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,cr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,pr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,mr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,xr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,oe=e=>Re(e)||fr.has(e)||nr.test(e),ge=e=>Me(e,"length",wr),Re=e=>!!e&&!Number.isNaN(Number(e)),Da=e=>Me(e,"number",Re),Oe=e=>!!e&&Number.isInteger(Number(e)),Lr=e=>e.endsWith("%")&&Re(e.slice(0,-1)),h=e=>wt.test(e),Ce=e=>ir.test(e),gr=new Set(["length","size","percentage"]),Cr=e=>Me(e,gr,yt),Ir=e=>Me(e,"position",yt),hr=new Set(["image","url"]),Sr=e=>Me(e,hr,Pr),br=e=>Me(e,"",yr),qe=()=>!0,Me=(e,a,t)=>{let o=wt.exec(e);return o?o[1]?typeof a=="string"?o[1]===a:a.has(o[1]):t(o[2]):!1},wr=e=>cr.test(e)&&!pr.test(e),yt=()=>!1,yr=e=>mr.test(e),Pr=e=>xr.test(e);var It=()=>{let e=k("colors"),a=k("spacing"),t=k("blur"),o=k("brightness"),r=k("borderColor"),s=k("borderRadius"),l=k("borderSpacing"),u=k("borderWidth"),d=k("contrast"),n=k("grayscale"),i=k("hueRotate"),C=k("invert"),c=k("gap"),w=k("gradientColorStops"),y=k("gradientColorStopPositions"),L=k("inset"),x=k("margin"),I=k("opacity"),M=k("padding"),W=k("saturate"),K=k("scale"),xe=k("sepia"),Pe=k("skew"),ve=k("space"),G=k("translate"),R=()=>["auto","contain","none"],g=()=>["auto","hidden","clip","visible","scroll"],T=()=>["auto",h,a],P=()=>[h,a],Le=()=>["",oe,ge],na=()=>["auto",Re,h],pt=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],fa=()=>["solid","dashed","dotted","double","none"],mt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Pa=()=>["start","end","center","between","around","evenly","stretch"],Fe=()=>["","0",h],xt=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ae=()=>[Re,h];return{cacheSize:500,separator:":",theme:{colors:[qe],spacing:[oe,ge],blur:["none","",Ce,h],brightness:ae(),borderColor:[e],borderRadius:["none","","full",Ce,h],borderSpacing:P(),borderWidth:Le(),contrast:ae(),grayscale:Fe(),hueRotate:ae(),invert:Fe(),gap:P(),gradientColorStops:[e],gradientColorStopPositions:[Lr,ge],inset:T(),margin:T(),opacity:ae(),padding:P(),saturate:ae(),scale:ae(),sepia:Fe(),skew:ae(),space:P(),translate:P()},classGroups:{aspect:[{aspect:["auto","square","video",h]}],container:["container"],columns:[{columns:[Ce]}],"break-after":[{"break-after":xt()}],"break-before":[{"break-before":xt()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...pt(),h]}],overflow:[{overflow:g()}],"overflow-x":[{"overflow-x":g()}],"overflow-y":[{"overflow-y":g()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[L]}],"inset-x":[{"inset-x":[L]}],"inset-y":[{"inset-y":[L]}],start:[{start:[L]}],end:[{end:[L]}],top:[{top:[L]}],right:[{right:[L]}],bottom:[{bottom:[L]}],left:[{left:[L]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Oe,h]}],basis:[{basis:T()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",h]}],grow:[{grow:Fe()}],shrink:[{shrink:Fe()}],order:[{order:["first","last","none",Oe,h]}],"grid-cols":[{"grid-cols":[qe]}],"col-start-end":[{col:["auto",{span:["full",Oe,h]},h]}],"col-start":[{"col-start":na()}],"col-end":[{"col-end":na()}],"grid-rows":[{"grid-rows":[qe]}],"row-start-end":[{row:["auto",{span:[Oe,h]},h]}],"row-start":[{"row-start":na()}],"row-end":[{"row-end":na()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",h]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",h]}],gap:[{gap:[c]}],"gap-x":[{"gap-x":[c]}],"gap-y":[{"gap-y":[c]}],"justify-content":[{justify:["normal",...Pa()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...Pa(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...Pa(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[M]}],px:[{px:[M]}],py:[{py:[M]}],ps:[{ps:[M]}],pe:[{pe:[M]}],pt:[{pt:[M]}],pr:[{pr:[M]}],pb:[{pb:[M]}],pl:[{pl:[M]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[ve]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[ve]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",h,a]}],"min-w":[{"min-w":[h,a,"min","max","fit"]}],"max-w":[{"max-w":[h,a,"none","full","min","max","fit","prose",{screen:[Ce]},Ce]}],h:[{h:[h,a,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[h,a,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[h,a,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[h,a,"auto","min","max","fit"]}],"font-size":[{text:["base",Ce,ge]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Da]}],"font-family":[{font:[qe]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",h]}],"line-clamp":[{"line-clamp":["none",Re,Da]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",oe,h]}],"list-image":[{"list-image":["none",h]}],"list-style-type":[{list:["none","disc","decimal",h]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[I]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[I]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...fa(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",oe,ge]}],"underline-offset":[{"underline-offset":["auto",oe,h]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:P()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",h]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",h]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[I]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...pt(),Ir]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Cr]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Sr]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[w]}],"gradient-via":[{via:[w]}],"gradient-to":[{to:[w]}],rounded:[{rounded:[s]}],"rounded-s":[{"rounded-s":[s]}],"rounded-e":[{"rounded-e":[s]}],"rounded-t":[{"rounded-t":[s]}],"rounded-r":[{"rounded-r":[s]}],"rounded-b":[{"rounded-b":[s]}],"rounded-l":[{"rounded-l":[s]}],"rounded-ss":[{"rounded-ss":[s]}],"rounded-se":[{"rounded-se":[s]}],"rounded-ee":[{"rounded-ee":[s]}],"rounded-es":[{"rounded-es":[s]}],"rounded-tl":[{"rounded-tl":[s]}],"rounded-tr":[{"rounded-tr":[s]}],"rounded-br":[{"rounded-br":[s]}],"rounded-bl":[{"rounded-bl":[s]}],"border-w":[{border:[u]}],"border-w-x":[{"border-x":[u]}],"border-w-y":[{"border-y":[u]}],"border-w-s":[{"border-s":[u]}],"border-w-e":[{"border-e":[u]}],"border-w-t":[{"border-t":[u]}],"border-w-r":[{"border-r":[u]}],"border-w-b":[{"border-b":[u]}],"border-w-l":[{"border-l":[u]}],"border-opacity":[{"border-opacity":[I]}],"border-style":[{border:[...fa(),"hidden"]}],"divide-x":[{"divide-x":[u]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[u]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[I]}],"divide-style":[{divide:fa()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...fa()]}],"outline-offset":[{"outline-offset":[oe,h]}],"outline-w":[{outline:[oe,ge]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:Le()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[I]}],"ring-offset-w":[{"ring-offset":[oe,ge]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ce,br]}],"shadow-color":[{shadow:[qe]}],opacity:[{opacity:[I]}],"mix-blend":[{"mix-blend":[...mt(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":mt()}],filter:[{filter:["","none"]}],blur:[{blur:[t]}],brightness:[{brightness:[o]}],contrast:[{contrast:[d]}],"drop-shadow":[{"drop-shadow":["","none",Ce,h]}],grayscale:[{grayscale:[n]}],"hue-rotate":[{"hue-rotate":[i]}],invert:[{invert:[C]}],saturate:[{saturate:[W]}],sepia:[{sepia:[xe]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[t]}],"backdrop-brightness":[{"backdrop-brightness":[o]}],"backdrop-contrast":[{"backdrop-contrast":[d]}],"backdrop-grayscale":[{"backdrop-grayscale":[n]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[i]}],"backdrop-invert":[{"backdrop-invert":[C]}],"backdrop-opacity":[{"backdrop-opacity":[I]}],"backdrop-saturate":[{"backdrop-saturate":[W]}],"backdrop-sepia":[{"backdrop-sepia":[xe]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[l]}],"border-spacing-x":[{"border-spacing-x":[l]}],"border-spacing-y":[{"border-spacing-y":[l]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",h]}],duration:[{duration:ae()}],ease:[{ease:["linear","in","out","in-out",h]}],delay:[{delay:ae()}],animate:[{animate:["none","spin","ping","pulse","bounce",h]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[K]}],"scale-x":[{"scale-x":[K]}],"scale-y":[{"scale-y":[K]}],rotate:[{rotate:[Oe,h]}],"translate-x":[{"translate-x":[G]}],"translate-y":[{"translate-y":[G]}],"skew-x":[{"skew-x":[Pe]}],"skew-y":[{"skew-y":[Pe]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",h]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",h]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":P()}],"scroll-mx":[{"scroll-mx":P()}],"scroll-my":[{"scroll-my":P()}],"scroll-ms":[{"scroll-ms":P()}],"scroll-me":[{"scroll-me":P()}],"scroll-mt":[{"scroll-mt":P()}],"scroll-mr":[{"scroll-mr":P()}],"scroll-mb":[{"scroll-mb":P()}],"scroll-ml":[{"scroll-ml":P()}],"scroll-p":[{"scroll-p":P()}],"scroll-px":[{"scroll-px":P()}],"scroll-py":[{"scroll-py":P()}],"scroll-ps":[{"scroll-ps":P()}],"scroll-pe":[{"scroll-pe":P()}],"scroll-pt":[{"scroll-pt":P()}],"scroll-pr":[{"scroll-pr":P()}],"scroll-pb":[{"scroll-pb":P()}],"scroll-pl":[{"scroll-pl":P()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",h]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[oe,ge,Da]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},vr=(e,{cacheSize:a,prefix:t,separator:o,experimentalParseClassName:r,extend:s={},override:l={}})=>{Ne(e,"cacheSize",a),Ne(e,"prefix",t),Ne(e,"separator",o),Ne(e,"experimentalParseClassName",r);for(let u in l)kr(e[u],l[u]);for(let u in s)Rr(e[u],s[u]);return e},Ne=(e,a,t)=>{t!==void 0&&(e[a]=t)},kr=(e,a)=>{if(a)for(let t in a)Ne(e,t,a[t])},Rr=(e,a)=>{if(a)for(let t in a){let o=a[t];o!==void 0&&(e[t]=(e[t]||[]).concat(o))}},Pt=(e,...a)=>typeof e=="function"?Ct(It,e,...a):Ct(()=>vr(It(),e),...a);var Ar=Pt({prefix:"ps-"});function m(...e){return Ar(Mr(e))}import{jsx as Fr}from"react/jsx-runtime";var Br=Tr("ps-inline-flex ps-items-center ps-justify-center ps-gap-2 ps-whitespace-nowrap ps-rounded-md ps-text-sm ps-font-medium ps-transition-colors focus-visible:ps-outline-none focus-visible:ps-ring-1 focus-visible:ps-ring-ring disabled:ps-pointer-events-none disabled:ps-opacity-50 [&_svg]:ps-pointer-events-none [&_svg]:ps-size-4 [&_svg]:ps-shrink-0",{variants:{variant:{default:"ps-bg-primary ps-text-primary-foreground ps-shadow hover:ps-bg-primary/90",destructive:"ps-bg-destructive ps-text-destructive-foreground ps-shadow-sm hover:ps-bg-destructive/90",outline:"ps-border ps-border-input ps-bg-background ps-shadow-sm hover:ps-bg-accent hover:ps-text-accent-foreground",secondary:"ps-bg-secondary ps-text-secondary-foreground ps-shadow-sm hover:ps-bg-secondary/80",ghost:"hover:ps-bg-accent hover:ps-text-accent-foreground",link:"ps-text-primary ps-underline-offset-4 hover:ps-underline"},size:{default:"ps-h-9 ps-px-4 ps-py-2",sm:"ps-h-8 ps-rounded-md ps-px-3 ps-text-xs",lg:"ps-h-10 ps-rounded-md ps-px-8",icon:"ps-h-9 ps-w-9"}},defaultVariants:{variant:"default",size:"default"}}),N=vt.forwardRef(({className:e,variant:a,size:t,asChild:o=!1,...r},s)=>Fr(o?Dr:"button",{className:m(Br({variant:a,size:t,className:e})),ref:s,...r}));N.displayName="Button";import*as Ze from"@radix-ui/react-checkbox";import{forwardRef as qr,createElement as Nr}from"react";var kt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ia=(...e)=>e.filter((a,t,o)=>!!a&&o.indexOf(a)===t).join(" ");import{forwardRef as Or,createElement as Mt}from"react";var Rt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};var At=Or(({color:e="currentColor",size:a=24,strokeWidth:t=2,absoluteStrokeWidth:o,className:r="",children:s,iconNode:l,...u},d)=>Mt("svg",{ref:d,...Rt,width:a,height:a,stroke:e,strokeWidth:o?Number(t)*24/Number(a):t,className:ia("lucide",r),...u},[...l.map(([n,i])=>Mt(n,i)),...Array.isArray(s)?s:[s]]));var v=(e,a)=>{let t=qr(({className:o,...r},s)=>Nr(At,{ref:s,iconNode:a,className:ia(`lucide-${kt(e)}`,o),...r}));return t.displayName=`${e}`,t};var Ie=v("ArrowDownWideNarrow",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"M11 4h10",key:"1w87gc"}],["path",{d:"M11 8h7",key:"djye34"}],["path",{d:"M11 12h4",key:"q8tih4"}]]);var Ue=v("ArrowUpWideNarrow",[["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}],["path",{d:"M11 12h10",key:"1438ji"}],["path",{d:"M11 16h7",key:"uosisv"}],["path",{d:"M11 20h4",key:"1krc32"}]]);var re=v("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);var Ee=v("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);var He=v("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);var se=v("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);var ze=v("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);var Ge=v("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);var be=v("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]]);var Ve=v("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);var We=v("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]]);var Ke=v("KeyRound",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);var Xe=v("PinOff",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);var Qe=v("Pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]);var _e=v("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);import*as Dt from"react";import{jsx as Fa}from"react/jsx-runtime";var Je=Dt.forwardRef(({className:e,...a},t)=>Fa(Ze.Root,{ref:t,className:m("ps-peer ps-h-4 ps-w-4 ps-shrink-0 ps-rounded-sm ps-border ps-border-primary ps-shadow focus-visible:ps-outline-none focus-visible:ps-ring-1 focus-visible:ps-ring-ring disabled:ps-cursor-not-allowed disabled:ps-opacity-50 data-[state=checked]:ps-bg-primary data-[state=checked]:ps-text-primary-foreground",e),...a,children:Fa(Ze.Indicator,{className:m("ps-flex ps-items-center ps-justify-center ps-text-current"),children:Fa(re,{className:"ps-h-4 ps-w-4"})})}));Je.displayName=Ze.Root.displayName;import{useMutation as rs,useQueryClient as ss}from"@tanstack/react-query";import{QueryClient as _r,QueryClientProvider as Zr}from"@tanstack/react-query";import*as X from"react";import{onlineManager as Ur,useQueryClient as Er}from"@tanstack/react-query";var Tt=class{#a;#n;#f;#i;#e=!1;#c;#t;#o;#r;#s;#l;#u;#d;constructor(e){let{client:a,queryFlavor:t,version:o,onlineManager:r,buttonPosition:s,position:l,initialIsOpen:u,errorTypes:d,styleNonce:n,shadowDOMTarget:i}=e;this.#a=V(a),this.#f=t,this.#i=o,this.#n=r,this.#c=n,this.#t=i,this.#o=V(s),this.#r=V(l),this.#s=V(u),this.#l=V(d)}setButtonPosition(e){this.#o[1](e)}setPosition(e){this.#r[1](e)}setInitialIsOpen(e){this.#s[1](e)}setErrorTypes(e){this.#l[1](e)}setClient(e){this.#a[1](e)}mount(e){if(this.#e)throw new Error("Devtools is already mounted");let a=Ma(()=>{let t=this,[o]=this.#o,[r]=this.#r,[s]=this.#s,[l]=this.#l,[u]=this.#a,d;return this.#u?d=this.#u:(d=Ra(()=>import("../CPIOZS5X-V4BHP4CI.js")),this.#u=d),Aa(this.#c,this.#t),va(d,ka({get queryFlavor(){return t.#f},get version(){return t.#i},get onlineManager(){return t.#n},get shadowDOMTarget(){return t.#t}},{get client(){return u()},get buttonPosition(){return o()},get position(){return r()},get initialIsOpen(){return s()},get errorTypes(){return l()}}))},e);this.#e=!0,this.#d=a}unmount(){if(!this.#e)throw new Error("Devtools is not mounted");this.#d?.(),this.#e=!1}},Bt=class{#a;#n;#f;#i;#e=!1;#c;#t;#o;#r;#s;#l;#u;#d;#p;constructor(e){let{client:a,queryFlavor:t,version:o,onlineManager:r,buttonPosition:s,position:l,initialIsOpen:u,errorTypes:d,styleNonce:n,shadowDOMTarget:i,onClose:C}=e;this.#a=V(a),this.#f=t,this.#i=o,this.#n=r,this.#c=n,this.#t=i,this.#o=V(s),this.#r=V(l),this.#s=V(u),this.#l=V(d),this.#u=V(C)}setButtonPosition(e){this.#o[1](e)}setPosition(e){this.#r[1](e)}setInitialIsOpen(e){this.#s[1](e)}setErrorTypes(e){this.#l[1](e)}setClient(e){this.#a[1](e)}setOnClose(e){this.#u[1](()=>e)}mount(e){if(this.#e)throw new Error("Devtools is already mounted");let a=Ma(()=>{let t=this,[o]=this.#o,[r]=this.#r,[s]=this.#s,[l]=this.#l,[u]=this.#a,[d]=this.#u,n;return this.#d?n=this.#d:(n=Ra(()=>import("../OKF6E45R-XYOIK2NY.js")),this.#d=n),Aa(this.#c,this.#t),va(n,ka({get queryFlavor(){return t.#f},get version(){return t.#i},get onlineManager(){return t.#n},get shadowDOMTarget(){return t.#t}},{get client(){return u()},get buttonPosition(){return o()},get position(){return r()},get initialIsOpen(){return s()},get errorTypes(){return l()},get onClose(){return d()}}))},e);this.#e=!0,this.#p=a}unmount(){if(!this.#e)throw new Error("Devtools is not mounted");this.#p?.(),this.#e=!1}};import{jsx as Hr}from"react/jsx-runtime";function Ft(e){let a=Er(e.client),t=X.useRef(null),{buttonPosition:o,position:r,initialIsOpen:s,errorTypes:l,styleNonce:u,shadowDOMTarget:d}=e,[n]=X.useState(new Tt({client:a,queryFlavor:"React Query",version:"5",onlineManager:Ur,buttonPosition:o,position:r,initialIsOpen:s,errorTypes:l,styleNonce:u,shadowDOMTarget:d}));return X.useEffect(()=>{n.setClient(a)},[a,n]),X.useEffect(()=>{o&&n.setButtonPosition(o)},[o,n]),X.useEffect(()=>{r&&n.setPosition(r)},[r,n]),X.useEffect(()=>{n.setInitialIsOpen(s||!1)},[s,n]),X.useEffect(()=>{n.setErrorTypes(l||[])},[l,n]),X.useEffect(()=>(t.current&&n.mount(t.current),()=>{n.unmount()}),[n]),Hr("div",{dir:"ltr",className:"tsqd-parent-container",ref:t})}import*as le from"react";import{onlineManager as Gr,useQueryClient as Vr}from"@tanstack/react-query";import{jsx as Wr}from"react/jsx-runtime";function Ot(e){let a=Vr(e.client),t=le.useRef(null),{errorTypes:o,styleNonce:r,shadowDOMTarget:s}=e,[l]=le.useState(new Bt({client:a,queryFlavor:"React Query",version:"5",onlineManager:Gr,buttonPosition:"bottom-left",position:"bottom",initialIsOpen:!0,errorTypes:o,styleNonce:r,shadowDOMTarget:s,onClose:e.onClose}));return le.useEffect(()=>{l.setClient(a)},[a,l]),le.useEffect(()=>{l.setOnClose(e.onClose??(()=>{}))},[e.onClose,l]),le.useEffect(()=>{l.setErrorTypes(o||[])},[o,l]),le.useEffect(()=>(t.current&&l.mount(t.current),()=>{l.unmount()}),[l]),Wr("div",{style:{height:"500px",...e.style},className:"tsqd-parent-container",ref:t})}var qt=process.env.NODE_ENV!=="development"?function(){return null}:Ft,pn=process.env.NODE_ENV!=="development"?function(){return null}:Ot;import{NuqsAdapter as Jr}from"nuqs/adapters/react";import{createContext as $r,useContext as jr,useState as Yr}from"react";import{toast as es}from"sonner";import{Toaster as Xr}from"sonner";import{jsx as Qr}from"react/jsx-runtime";var Nt=({...e})=>Qr(Xr,{className:"ps-toaster ps-group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground 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"}},...e});import{jsx as ca,jsxs as ts}from"react/jsx-runtime";var as=new _r,Ut=$r(void 0);function Et(e){let{children:a,...t}=e,[o,r]=Yr(null),s=e.onError;return s??=l=>es.error(l.message),ts(Zr,{client:as,children:[ca(qt,{}),ca(Nt,{}),ca(Jr,{children:ca(Ut.Provider,{value:{...t,activeTable:o,setActiveTable:r,onError:s},children:a})})]})}function F(){let e=jr(Ut);if(!e)throw new Error("`useStudio` must be used within a `StudioContext.Provider`");return e}function os(e,a){let t={filter:ke(e,a.columns),table:`${a.schema}.${a.name}`};return JSON.stringify(t)}function Ht(e,a){return{...e,__ps_rowid:os(e,a)}}function pa(e,a){let{row:t,rows:o}=e;return t!==void 0?{...e,row:Ht(t,a)}:o!==void 0?{...e,rows:o.map(r=>Ht(r,a))}:e}function zt(){let{activeTable:e,adapter:a}=F(),t=ss(),{schema:o=null,name:r=null}=e??{};return rs({mutationKey:["schema",o,"table",r,"insert"],async mutationFn(s){let[l,u]=await a.insert({rows:s,table:e},{});if(l)throw l;return pa(u,e)},onSuccess(s){t.setQueriesData({exact:!1,queryKey:["schema",o,"table",r,"query"]},l=>l==null?l:{...l,rows:[...s.rows,...l.rows]})},retry:!1})}import{useQuery as ls}from"@tanstack/react-query";function Gt(e){let{pageIndex:a,pageSize:t,sortOrder:o}=e,{activeTable:r,adapter:s}=F();return ls({enabled:!!r,gcTime:0,placeholderData(l,u){let[,d,,n]=u?.queryKey||[];if(!(d!==r?.schema||n!==r?.name))return l},async queryFn({signal:l}){let[u,d]=await s.query({pageIndex:a,pageSize:t,sortOrder:o,table:r},{abortSignal:l});if(u)throw u;return pa(d,r)},queryKey:["schema",r?.schema||null,"table",r?.name||null,"query","sortOrder",o.map(l=>`${l.column}:${l.direction}`).join(",")||"natural","pageIndex",a,"pageSize",t],staleTime:1/0})}import{useMutation as us,useQueryClient as ds}from"@tanstack/react-query";function Vt(){let{activeTable:e,adapter:a,onError:t}=F(),o=ds(),r=["schema",e?.schema??null,"table",e?.name??null];return us({mutationFn:async s=>{let[l,u]=await a.update(s.details,s.options);if(l)throw l;return u},mutationKey:[...r,"update"],onError(s,l){let{changes:u,row:d}=l.details;t(s),Oa({getFinderFn(){let n={...d,...u},i=ke(n,e.columns);return C=>i.every(([c,w])=>C[c]===w)},queryClient:o,table:e,updaterFn:function(i){return{...i,...Object.keys(u).reduce((C,c)=>({...C,[c]:d[c]}),{})}}})},onMutate(s){let{details:l}=s;Oa({getFinderFn(){let{row:u}=l,d=ke(u,e.columns);return n=>d.every(([i,C])=>n[i]===C)},queryClient:o,table:e,updaterFn:function(d){return{...d,...l.changes}}})},onSuccess(s,l){Oa({getFinderFn(){let{changes:u,row:d}=l.details,n={...d,...u},i=ke(n,e.columns);return C=>i.every(([c,w])=>C[c]===w)},queryClient:o,table:e,updaterFn:function(d){let{__ps_updated_at__:n}=d,{row:i}=s;return n!=null&&i.__ps_updated_at__<=n?d:{...d,...i}}})},retry:!1})}function Oa(e){let{getFinderFn:a,queryClient:t,table:o,updaterFn:r}=e,s;t.setQueriesData({exact:!1,queryKey:["schema",o.schema,"table",o.name,"query"]},l=>{let{rows:u=[]}=l||{};if(u.length===0)return l;let d=u.findIndex(s??=a());if(d===-1)return l;let n=r(u[d]);return{...l,rows:[...u.slice(0,d),n,...u.slice(d+1)]}})}import{useIsMutating as ns}from"@tanstack/react-query";function Wt(){return ns({predicate({options:{mutationKey:e}}){return e?.[4]==="insert"}})}import{useCallback as ps}from"react";var B={};Jo(B,{keyMap:()=>qa,urlKeys:()=>cs,useQueryState:()=>Ae,useQueryStates:()=>$e});te(B,af);import{useQueryState as fs,useQueryStates as is}from"nuqs";import*as af from"nuqs";function qa(e){return e}function cs(e){return e}var Yn=Symbol("BRAND_SYMBOL");function Ae(e,a){return fs(e,a)}function $e(e,a){return is(e,a)}var ms=25,xs={pageIndex:B.parseAsIndex.withDefault(0),pageSize:B.parseAsInteger.withDefault(ms)};function ma(){let[{pageIndex:e,pageSize:a},t]=$e(xs),o=ps(r=>{t(typeof r=="function"?s=>{let l=r(s);return{pageIndex:l.pageIndex,pageSize:l.pageSize}}:{pageIndex:r.pageIndex,pageSize:r.pageSize})},[t]);return{paginationState:{pageIndex:e,pageSize:a},setPaginationState:o}}import{useEffect as Cs,useState as Is}from"react";import{useMutation as Ls,useQueryClient as gs}from"@tanstack/react-query";function Kt(){let{activeTable:e,adapter:a}=F(),t=gs(),{schema:o=null,name:r=null}=e??{};return Ls({mutationKey:["schema",o,"table",r,"delete"],async mutationFn(s){let[l,u]=await a.delete({rows:s,table:e},{});if(l)throw l;return u},async onSuccess(){await t.invalidateQueries({exact:!1,queryKey:["schema",o,"table",r,"query"]})},retry:!1})}function Xt(e){let{activeTable:a,onError:t}=F(),{paginationState:o}=ma(),[r,s]=Is({}),l=Object.keys(r).length!==0,{mutate:u}=Kt();Cs(()=>s({}),[a,o.pageIndex]);function d(){let n=e?.rows.filter(i=>r[i.__ps_rowid]);u(n??[],{onSuccess(){s({})},onError:t})}return{deleteSelection:d,setRowSelectionState:s,rowSelectionState:r,isSelecting:l}}import{useEffect as hs,useState as Ss}from"react";function Qt(){let[e,a]=Ae("sort",{defaultValue:""}),t=l=>{if(!l)return[];try{return l.split(",").map(u=>{let[d,n]=u.split(":");return!d||!n||!["asc","desc"].includes(n)?null:{column:d,direction:n}}).filter(Boolean)}catch(u){return console.error("Failed to parse sorting parameter:",u),[]}},[o,r]=Ss(()=>t(e));return hs(()=>{let l=t(e);r(l)},[e]),{sortingState:o,setSortingState:l=>{let u=typeof l=="function"?l(o):l;r(u);let d=u.length>0?u.map(n=>`${n.column}:${n.direction}`).join(","):null;a(d)}}}import{isObjectType as Ks}from"remeda";import{forwardRef as Ts}from"react";import*as de from"react";import{jsx as ue}from"react/jsx-runtime";var Na=de.forwardRef(({className:e,...a},t)=>ue("div",{className:"ps-relative ps-w-full ps-overflow-auto ps-flex ps-items-start ps-h-full",children:ue("table",{ref:t,className:m("ps-w-full ps-caption-bottom ps-text-sm",e),...a})}));Na.displayName="Table";var Ua=de.forwardRef(({className:e,...a},t)=>ue("thead",{ref:t,className:m(e),...a}));Ua.displayName="TableHeader";var Ea=de.forwardRef(({className:e,...a},t)=>ue("tbody",{ref:t,className:m("[&_tr:last-child]:ps-border-0",e),...a}));Ea.displayName="TableBody";var bs=de.forwardRef(({className:e,...a},t)=>ue("tfoot",{ref:t,className:m("ps-border-t ps-bg-muted/50 ps-font-medium [&>tr]:last:ps-border-b-0",e),...a}));bs.displayName="TableFooter";var we=de.forwardRef(({className:e,...a},t)=>ue("tr",{ref:t,className:m("ps-border-b ps-transition-colors hover:ps-bg-muted/50 data-[state=selected]:ps-bg-muted",e),...a}));we.displayName="TableRow";var xa=de.forwardRef(({className:e,...a},t)=>ue("th",{ref:t,className:m("ps-h-10 ps-px-2 ps-text-left ps-align-middle ps-font-medium ps-text-muted-foreground",e),...a}));xa.displayName="TableHead";var De=de.forwardRef(({className:e,...a},t)=>ue("td",{ref:t,className:m("ps-align-middle",e),...a}));De.displayName="TableCell";var ws=de.forwardRef(({className:e,...a},t)=>ue("caption",{ref:t,className:m("ps-mt-4 ps-text-sm ps-text-muted-foreground",e),...a}));ws.displayName="TableCaption";import{isValidElement as Ds}from"react";import*as S from"@radix-ui/react-context-menu";import*as ne from"react";import{jsx as U,jsxs as Ga}from"react/jsx-runtime";var _t=S.Root,Zt=S.Trigger;var ys=ne.forwardRef(({className:e,inset:a,children:t,...o},r)=>Ga(S.SubTrigger,{ref:r,className:m("ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-px-2 ps-py-1.5 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[state=open]:ps-bg-accent data-[state=open]:ps-text-accent-foreground",a&&"ps-pl-8",e),...o,children:[t,U(se,{className:"ps-ml-auto ps-h-4 ps-w-4"})]}));ys.displayName=S.SubTrigger.displayName;var Ps=ne.forwardRef(({className:e,...a},t)=>U(S.SubContent,{ref:t,className:m("ps-z-50 ps-min-w-[8rem] ps-overflow-hidden ps-rounded-md ps-border ps-bg-popover ps-p-1 ps-text-popover-foreground ps-shadow-lg data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-context-menu-content-transform-origin]",e),...a}));Ps.displayName=S.SubContent.displayName;var Ha=ne.forwardRef(({className:e,...a},t)=>U(S.Portal,{children:U(S.Content,{ref:t,className:m("ps-z-50 ps-max-h-[--radix-context-menu-content-available-height] ps-min-w-[8rem] ps-overflow-y-auto ps-overflow-x-hidden ps-rounded-md ps-border ps-bg-popover ps-p-1 ps-text-popover-foreground ps-shadow-md data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-context-menu-content-transform-origin]",e),...a})}));Ha.displayName=S.Content.displayName;var za=ne.forwardRef(({className:e,inset:a,...t},o)=>U(S.Item,{ref:o,className:m("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-px-2 ps-py-1.5 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",a&&"ps-pl-8",e),...t}));za.displayName=S.Item.displayName;var vs=ne.forwardRef(({className:e,children:a,checked:t,...o},r)=>Ga(S.CheckboxItem,{ref:r,className:m("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-8 ps-pr-2 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),checked:t,...o,children:[U("span",{className:"ps-absolute ps-left-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:U(S.ItemIndicator,{children:U(re,{className:"ps-h-4 ps-w-4"})})}),a]}));vs.displayName=S.CheckboxItem.displayName;var ks=ne.forwardRef(({className:e,children:a,...t},o)=>Ga(S.RadioItem,{ref:o,className:m("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-8 ps-pr-2 ps-text-sm ps-outline-none focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),...t,children:[U("span",{className:"ps-absolute ps-left-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:U(S.ItemIndicator,{children:U(be,{className:"ps-h-4 ps-w-4 ps-fill-current"})})}),a]}));ks.displayName=S.RadioItem.displayName;var Rs=ne.forwardRef(({className:e,inset:a,...t},o)=>U(S.Label,{ref:o,className:m("ps-px-2 ps-py-1.5 ps-text-sm ps-font-semibold ps-text-foreground",a&&"ps-pl-8",e),...t}));Rs.displayName=S.Label.displayName;var Ms=ne.forwardRef(({className:e,...a},t)=>U(S.Separator,{ref:t,className:m("ps--mx-1 ps-my-1 ps-h-px ps-bg-border",e),...a}));Ms.displayName=S.Separator.displayName;var As=({className:e,...a})=>U("span",{className:m("ps-ml-auto ps-text-xs ps-tracking-widest ps-text-muted-foreground",e),...a});As.displayName="ContextMenuShortcut";import{jsx as Va,jsxs as Jt}from"react/jsx-runtime";function $t(e){let{children:a}=e;return Jt(_t,{children:[Va(Zt,{className:"ps-block ps-w-full ps-px-[var(--studio-cell-spacing)] ps-leading-[var(--studio-cell-height)] ps-h-[var(--studio-cell-height)] ps-text-xs ps-font-mono ps-whitespace-nowrap ps-overflow-hidden ps-text-ellipsis",children:a}),Va(Ha,{children:Jt(za,{onClick:()=>{let t=Wa(a);navigator.clipboard.writeText(t).catch(o=>{console.error("Failed to copy to clipboard:",o)})},className:"ps-flex ps-items-center ps-gap-2",children:[Va(Ve,{size:12}),"Copy"]})})]})}function Wa(e){if(typeof e=="string"||typeof e=="number"||typeof e=="boolean")return String(e);if(e==null)return"";if(Ds(e)){let a=e.props;return e.type&&typeof e.type=="function"&&e.type.name==="RevealText"?a.text||"":e.type&&typeof e.type=="function"&&e.type.name==="NullValue"?"NULL":a.children?Wa(a.children):""}return Array.isArray(e)?e.map(Wa).join(""):""}import{jsx as jt}from"react/jsx-runtime";function O(e){let{children:a,className:t,ref:o,style:r,...s}=e;return jt(De,{...s,className:m("ps-p-0 ps-border-r ps-border-b ps-border-table-border ps-bg-table-head last:ps-border-r-0","ps-cursor-pointer",t),ref:o,style:r,children:jt($t,{children:a})})}import{jsx as Yt}from"react/jsx-runtime";var Ka=Ts((e,a)=>{let{containerProps:t,value:o,...r}=e;return Yt(O,{...r,...t,ref:a,children:Yt("div",{"data-cell-type":"boolean",children:String(!!o)})})});Ka.displayName="BooleanCell";import{forwardRef as Bs}from"react";import{jsx as Fs}from"react/jsx-runtime";var Xa=Bs((e,a)=>{let{containerProps:t,value:o,...r}=e;return Fs(O,{...r,...t,ref:a,children:String(o)})});Xa.displayName="DateCell";import{forwardRef as Os}from"react";import{jsx as qs}from"react/jsx-runtime";var je=Os((e,a)=>{let{containerProps:t,...o}=e;return qs(O,{...o,...t,ref:a})});je.displayName="EmptyCell";import{forwardRef as Ns}from"react";import{jsx as Us}from"react/jsx-runtime";var Qa=Ns((e,a)=>{let{containerProps:t,value:o,options:r,...s}=e;return Us(O,{...s,...t,ref:a,children:String(o)})});Qa.displayName="EnumCell";import{forwardRef as Es}from"react";import{jsx as Hs}from"react/jsx-runtime";var La=Es((e,a)=>{let{containerProps:t,value:o,...r}=e;return Hs(O,{...r,...t,ref:a,children:JSON.stringify(o,null,2)})});La.displayName="JSONCell";import{forwardRef as zs}from"react";import{jsx as eo}from"react/jsx-runtime";var _a=zs((e,a)=>{let{containerProps:t,...o}=e;return eo(O,{...o,...t,ref:a,children:eo("code",{className:"ps-text-gray-500",children:"NULL"})})});_a.displayName="NullCell";import{forwardRef as Gs}from"react";import{jsx as ao}from"react/jsx-runtime";var Za=Gs((e,a)=>{let{containerProps:t,value:o,...r}=e;return ao(O,{...r,...t,ref:a,children:ao("div",{"data-cell-type":"numeric",children:o===null?"NULL":String(o)})})});Za.displayName="NumericCell";import{forwardRef as Vs}from"react";import{jsx as Ws}from"react/jsx-runtime";var Ye=Vs((e,a)=>{let{containerProps:t,value:o,...r}=e;return Ws(O,{...r,...t,ref:a,children:String(o)})});Ye.displayName="RawCell";import{jsx as Q}from"react/jsx-runtime";function ga(e,a,t){let o=e.getValue();if(o===void 0)return Q(je,{});if(o===null)return Q(_a,{});let{group:r,options:s,isArray:l}=a.datatype;if(r==="json"||l)return Q(La,{containerProps:t,value:o});if(r==="string")return Q(Ye,{containerProps:t,value:o});if(r==="enum")return Q(Qa,{containerProps:t,value:o,options:s});if(r==="boolean")return Q(Ka,{containerProps:t,value:o});if(r==="datetime")return Q(Xa,{containerProps:t,value:o});if(r==="time")return Q(Ye,{containerProps:t,value:o});if(r==="numeric")return Q(Za,{containerProps:t,value:o});if(r==="raw")return Ks(o)?Q(La,{containerProps:t,value:o}):Q(Ye,{containerProps:t,value:o});throw new Error(`Datatype group "${r}" was not handled in '/cell/get-cell.tsx'`)}import{forwardRef as Xs}from"react";import{jsx as to}from"react/jsx-runtime";var Ja=Xs((e,a)=>{let{row:t,className:o,...r}=e;return to("div",{ref:a,className:m("ps-flex ps-justify-center ps-items-center",o),...r,children:to(Je,{checked:t.getIsSelected(),disabled:!t.getCanSelect(),onCheckedChange:t.getToggleSelectedHandler()})})});Ja.displayName="SelectRowCell";import*as fe from"@radix-ui/react-popover";import*as D from"react";import{jsx as ea}from"react/jsx-runtime";var oo=D.createContext(null),$a=({children:e,...a})=>{let[t,o]=D.useState(!1),r=D.useRef(new Set),s=D.useCallback(d=>{r.current.add(d)},[]),l=D.useCallback(d=>{r.current.delete(d)},[]),u=D.useCallback(d=>{!d&&t&&r.current.forEach(n=>{n()}),o(d)},[t]);return ea(oo.Provider,{value:{open:t,setOpen:o,registerOnBeforeClose:s,unregisterOnBeforeClose:l},children:ea(fe.Root,{open:t,onOpenChange:u,...a,children:e})})};$a.displayName="PopoverCell";var ja=D.forwardRef(({children:e,onDoubleClick:a,className:t,...o},r)=>{let s=D.useRef(null);return ea(fe.Trigger,{ref:l=>{typeof r=="function"?r(l):r&&(r.current=l),s.current=l},className:m("w-full h-full cursor-pointer",t),...o,children:e})});ja.displayName="PopoverCellTrigger";var Ya=D.forwardRef(({className:e,align:a="center",sideOffset:t=4,...o},r)=>ea(fe.Portal,{children:ea(fe.Content,{ref:r,align:a,sideOffset:t,className:m("ps-flex ps-flex-col ps-gap-2 ps-z-50 ps-rounded-md ps-border ps-bg-popover ps-text-popover-foreground ps-shadow-md ps-outline-hidden 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",e),onEscapeKeyDown:s=>s.preventDefault(),...o})}));Ya.displayName=fe.Content.displayName;function J(e){let a=D.useContext(oo),t=D.useCallback(()=>{e.onSave&&e.onSave(),a&&a.setOpen(!1)},[e.onSave,a]),o=D.useCallback(()=>{e.onCancel&&e.onCancel(),a&&a.setOpen(!1)},[e.onCancel,a]);return D.useEffect(()=>{if(!a?.registerOnBeforeClose||!e.onSave)return;let r=()=>!!e.onSave?.();return a.registerOnBeforeClose(r),()=>a.unregisterOnBeforeClose?.(r)},[e.onSave,a]),D.useEffect(()=>{let r=s=>{(s.key==="Enter"||s.key==="Return")&&!s.shiftKey?t():s.key==="Escape"&&o()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[t,o]),{handleSave:t,handleCancel:o}}import{jsx as ro,jsxs as Qs}from"react/jsx-runtime";function Ca(e){let{cellComponent:a,inputComponent:t}=e;return Qs($a,{children:[ro(ja,{asChild:!0,children:a}),ro(Ya,{align:"start",alignOffset:-1,className:"ps-min-w-cell ps-rounded-none ps-bg-muted ps-p-0 ps-z-30 ps-gap-0 ps-border-blue-500 ps-min-w-[calc(var(--radix-popover-trigger-width) + 1px)]",sideOffset:-40,children:t})]})}import{DndContext as xl,MouseSensor as Ll,useSensor as gl,useSensors as Cl}from"@dnd-kit/core";import{arrayMove as Il,horizontalListSortingStrategy as hl,SortableContext as Sl,useSortable as bl}from"@dnd-kit/sortable";import{CSS as wl}from"@dnd-kit/utilities";import{flexRender as yl,getCoreRowModel as Pl,useReactTable as vl}from"@tanstack/react-table";import*as ie from"react";import p from"react";function he(){return he=Object.assign?Object.assign.bind():function(e){for(var a=1;a<arguments.length;a++){var t=arguments[a];for(var o in t)({}).hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},he.apply(null,arguments)}var _s=e=>{try{let a=localStorage.getItem(e);return typeof a=="string"?JSON.parse(a):void 0}catch{return}};function Zs(e,a){let[t,o]=p.useState();p.useEffect(()=>{let s=_s(e);o(typeof s>"u"||s===null?typeof a=="function"?a():a:s)},[a,e]);let r=p.useCallback(s=>{o(l=>{let u=s;typeof s=="function"&&(u=s(l));try{localStorage.setItem(e,JSON.stringify(u))}catch{}return u})},[e]);return[t,r]}var $={background:"#0b1521",backgroundAlt:"#132337",foreground:"white",gray:"#3f4e60",grayAlt:"#222e3e",inputBackgroundColor:"#fff",inputTextColor:"#000",success:"#00ab52",danger:"#ff0085",active:"#006bff",warning:"#ffb200"},uo=p.createContext($);function no(e){let{theme:a,...t}=e;return p.createElement(uo.Provider,he({value:a},t))}function Js(){return p.useContext(uo)}function $s(e){let[a,t]=p.useState(()=>{if(typeof window<"u")return window.matchMedia&&window.matchMedia(e).matches});return p.useEffect(()=>{if(typeof window<"u"){if(!window.matchMedia)return;let o=window.matchMedia(e),r=s=>{let{matches:l}=s;return t(l)};return o.addListener(r),()=>{o.removeListener(r)}}},[a,e,t]),a}var js=typeof window>"u";function _(e,a,t){return t===void 0&&(t={}),p.forwardRef((o,r)=>{let{style:s,...l}=o,u=Js(),d=Object.entries(t).reduce((n,i)=>{let[C,c]=i;return $s(C)?{...n,...typeof c=="function"?c(l,u):c}:n},{});return p.createElement(e,{...l,style:{...typeof a=="function"?a(l,u):a,...s,...d},ref:r})})}function Ys(){let e=p.useRef(!1),a=p.useCallback(()=>e.current,[]);return p[js?"useEffect":"useLayoutEffect"](()=>(e.current=!0,()=>{e.current=!1}),[]),a}var el=_("div",(e,a)=>({fontSize:"clamp(12px, 1.5vw, 14px)",fontFamily:"sans-serif",display:"flex",backgroundColor:a.background,color:a.foreground}),{"(max-width: 700px)":{flexDirection:"column"},"(max-width: 600px)":{fontSize:".9em"}});_("div",()=>({flex:"1 1 500px",display:"flex",flexDirection:"column",overflow:"auto",height:"100%"}),{"(max-width: 700px)":(e,a)=>({borderTop:`2px solid ${a.gray}`})});var al=_("button",(e,a)=>({appearance:"none",fontSize:".9em",fontWeight:"bold",background:a.gray,border:"0",borderRadius:".3em",color:"white",padding:".5em",opacity:e.disabled?".5":void 0,cursor:"pointer"}));_("code",{fontSize:".9em"});_("input",(e,a)=>({backgroundColor:a.inputBackgroundColor,border:0,borderRadius:".2em",color:a.inputTextColor,fontSize:".9em",lineHeight:"1.3",padding:".3em .4em"}));_("select",(e,a)=>({display:"inline-block",fontSize:".9em",fontFamily:"sans-serif",fontWeight:"normal",lineHeight:"1.3",padding:".3em 1.5em .3em .5em",height:"auto",border:0,borderRadius:".2em",appearance:"none",WebkitAppearance:"none",backgroundColor:a.inputBackgroundColor,backgroundImage:`url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='100' height='100' fill='%23444444'><polygon points='0,25 100,25 50,75'/></svg>")`,backgroundRepeat:"no-repeat",backgroundPosition:"right .55em center",backgroundSize:".65em auto, 100%",color:a.inputTextColor}),{"(max-width: 500px)":{display:"none"}});var so=_("div",{fontFamily:"Menlo, monospace",fontSize:"0.7rem",lineHeight:"1.7",outline:"none",wordBreak:"break-word"}),Ia=_("span",{cursor:"pointer",color:"white"}),tl=_("span",(e,a)=>({color:a.danger})),et=_("div",{marginLeft:".1rem",paddingLeft:"1rem",borderLeft:"2px solid rgba(0,0,0,.15)"}),ol=_("span",{color:"grey",fontSize:".7rem"}),lo=e=>{let{expanded:a,style:t={},...o}=e;return p.createElement("span",{style:{display:"inline-block",transition:"all .1s ease",transform:`rotate(${a?90:0}deg) ${t.transform||""}`,...t}},"\u25B6")},rl=e=>{let{handleEntry:a,label:t,value:o,subEntries:r,subEntryPages:s,type:l,expanded:u,toggle:d,pageSize:n,renderer:i}=e,[C,c]=p.useState(void 0),[w,y]=p.useState([]),L=()=>{c(o())};return p.createElement(so,{key:t},s!=null&&s.length?p.createElement(p.Fragment,null,p.createElement(Ia,{onClick:()=>d()},p.createElement(lo,{expanded:u})," ",t," ",p.createElement(ol,null,String(l).toLowerCase()==="iterable"?"(Iterable) ":"",r.length," ",r.length>1?"items":"item")),u?s.length===1?p.createElement(et,null,r.map(x=>a(x))):p.createElement(et,null,s.map((x,I)=>p.createElement("div",{key:I},p.createElement(so,null,p.createElement(Ia,{onClick:()=>y(M=>M.includes(I)?M.filter(W=>W!==I):[...M,I])},p.createElement(lo,{expanded:u})," [",I*n," ..."," ",I*n+n-1,"]"),w.includes(I)?p.createElement(et,null,x.map(M=>a(M))):null)))):null):l==="function"?p.createElement(p.Fragment,null,p.createElement(j,{renderer:i,label:p.createElement("button",{onClick:L},p.createElement(Ia,null,t)," \u{1F504}"," "),value:C,defaultExpanded:{}})):p.createElement(p.Fragment,null,p.createElement(Ia,null,t,":")," ",p.createElement(tl,null,JSON.stringify(o,Object.getOwnPropertyNames(Object(o))))))};function j(e){let{value:a,defaultExpanded:t,renderer:o=rl,pageSize:r=100,depth:s=0,...l}=e,[u,d]=p.useState(t),n=L=>{d(x=>typeof L<"u"?L:!x)},i=[],C=typeof a,c,w=[],y=L=>{let x=i.concat(L.label),I=t===!0?{[L.label]:!0}:t?.[L.label];return{...L,subPath:L,path:x,depth:s+1,defaultExpanded:I}};if(Array.isArray(a)?(C="array",c=a.map((L,x)=>y({label:x,value:L}))):a!==null&&typeof a=="object"&&typeof a[Symbol.iterator]=="function"?(C="Iterable",c=Array.from(a,(L,x)=>y({label:x,value:L}))):typeof a=="function"?C="function":typeof a=="object"&&a!==null&&(C="object",c=Object.entries(a).map(L=>{let[x,I]=L;return y({label:x,value:I})})),c){let L=0;for(;L<c.length;)w.push(c.slice(L,L+r)),L=L+r}return o({handleEntry:L=>p.createElement(j,he({key:L.label,renderer:o},l,L)),type:C,subEntries:c,subEntryPages:w,depth:s,value:a,path:i,expanded:u,toggle:n,pageSize:r,...l})}function fo(e){return ie.createElement("svg",he({width:"40px",height:"40px",viewBox:"0 0 190 190",version:"1.1"},e),ie.createElement("g",{stroke:"none",strokeWidth:"1",fill:"none",fillRule:"evenodd"},ie.createElement("g",{id:"og-white",transform:"translate(-28.000000, -21.000000)"},ie.createElement("g",{id:"Group-2",transform:"translate(28.000000, 31.000000)"},ie.createElement("g",{id:"Group",transform:"translate(0.000000, 10.000000)"},ie.createElement("path",{d:"M39.7239712,51.3436237 C36.631224,36.362877 35.9675112,24.8727722 37.9666331,16.5293551 C39.1555965,11.5671678 41.3293088,7.51908462 44.6346064,4.59846305 C48.1241394,1.51504777 52.5360327,0.00201216606 57.493257,0.00201216606 C65.6712013,0.00201216606 74.2682602,3.72732143 83.4557246,10.8044264 C87.2031203,13.6910458 91.0924366,17.170411 95.1316515,21.2444746 C95.4531404,20.8310265 95.8165416,20.4410453 96.2214301,20.0806152 C107.64098,9.91497158 117.255245,3.59892716 125.478408,1.16365068 C130.367899,-0.284364005 134.958526,-0.422317978 139.138936,0.983031021 C143.551631,2.46646844 147.06766,5.53294888 149.548314,9.82810912 C153.642288,16.9166735 154.721918,26.2310983 153.195595,37.7320243 C152.573451,42.4199112 151.50985,47.5263831 150.007094,53.0593153 C150.574045,53.1277086 151.142416,53.2532808 151.705041,53.4395297 C166.193932,58.2358678 176.453582,63.3937462 182.665021,69.2882839 C186.360669,72.7953831 188.773972,76.6998434 189.646365,81.0218204 C190.567176,85.5836746 189.669313,90.1593316 187.191548,94.4512967 C183.105211,101.529614 175.591643,107.11221 164.887587,111.534031 C160.589552,113.309539 155.726579,114.917559 150.293259,116.363748 C150.541176,116.92292 150.733521,117.516759 150.862138,118.139758 C153.954886,133.120505 154.618598,144.61061 152.619477,152.954027 C151.430513,157.916214 149.256801,161.964297 145.951503,164.884919 C142.46197,167.968334 138.050077,169.48137 133.092853,169.48137 C124.914908,169.48137 116.31785,165.756061 107.130385,158.678956 C103.343104,155.761613 99.4108655,152.238839 95.3254337,148.108619 C94.9050753,148.765474 94.3889681,149.376011 93.7785699,149.919385 C82.3590198,160.085028 72.744755,166.401073 64.5215915,168.836349 C59.6321009,170.284364 55.0414736,170.422318 50.8610636,169.016969 C46.4483686,167.533532 42.9323404,164.467051 40.4516862,160.171891 C36.3577116,153.083327 35.2780823,143.768902 36.8044053,132.267976 C37.449038,127.410634 38.56762,122.103898 40.1575891,116.339009 C39.5361041,116.276104 38.9120754,116.144816 38.2949591,115.940529 C23.8060684,111.144191 13.5464184,105.986312 7.33497892,100.091775 C3.63933121,96.5846754 1.22602752,92.6802151 0.353635235,88.3582381 C-0.567176333,83.7963839 0.330686581,79.2207269 2.80845236,74.9287618 C6.89478863,67.8504443 14.4083565,62.2678481 25.1124133,57.8460273 C29.5385143,56.0176154 34.5637208,54.366822 40.1939394,52.8874674 C39.9933393,52.3969171 39.8349374,51.8811235 39.7239712,51.3436237 Z",id:"Path",fill:"#002C4B",fillRule:"nonzero",transform:"translate(95.000000, 85.000000) scale(-1, 1) translate(-95.000000, -85.000000) "}),ie.createElement("path",{d:"M91.735,110 L91.735,116 L80.6322051,116 C78.8411286,116 77.1868614,115.041975 76.2954489,113.488483 L74.294,110 L91.735,110 Z M116.181,110 L114.180256,113.488483 C113.288844,115.041975 111.634576,116 109.8435,116 L98.735,116 L98.735,110 L116.181,110 Z M91.735,96 L91.735,103 L70.277,103 L66.26,96 L91.735,96 Z M124.215,96 L120.198,103 L98.735,103 L98.735,96 L124.215,96 Z M91.735,82 L91.735,89 L62.244,89 L61.6632438,87.9884826 C60.7789187,86.4473417 60.7789187,84.5526583 61.6632438,83.0115174 L62.243,82 L91.735,82 Z M128.232,82 L128.812461,83.0115174 C129.696786,84.5526583 129.696786,86.4473417 128.812461,87.9884826 L128.231,89 L98.735,89 L98.735,82 L128.232,82 Z M91.735,68 L91.735,75 L66.26,75 L70.277,68 L91.735,68 Z M120.198,68 L124.215,75 L98.735,75 L98.735,68 L120.198,68 Z M91.735,55 L91.735,61 L74.293,61 L76.2954489,57.5115174 C77.1868614,55.958025 78.8411286,55 80.6322051,55 L91.735,55 Z M109.8435,55 C111.634576,55 113.288844,55.958025 114.180256,57.5115174 L116.182,61 L98.735,61 L98.735,55 L109.8435,55 Z",id:"Polygon-2",fill:"#FFD94C"}),ie.createElement("path",{d:"M54.8601729,98.3577578 C56.1715224,97.6082856 57.8360246,98.0746014 58.5779424,99.3993034 L58.5779424,99.3993034 L59.0525843,100.24352 C62.8563392,106.982993 66.8190116,113.380176 70.9406016,119.435068 C75.8078808,126.585427 81.28184,133.82411 87.3624792,141.151115 C88.3168778,142.30114 88.1849437,144.011176 87.065686,144.997937 L87.065686,144.997937 L86.4542085,145.534625 C66.3465389,163.103314 53.2778188,166.612552 47.2480482,156.062341 C41.3500652,145.742717 43.4844915,126.982888 53.6513274,99.7828526 C53.876818,99.1795821 54.3045861,98.675291 54.8601729,98.3577578 Z M140.534177,119.041504 C141.986131,118.785177 143.375496,119.742138 143.65963,121.194242 L143.65963,121.194242 L143.812815,121.986376 C148.782365,147.995459 145.283348,161 133.315764,161 C121.609745,161 106.708724,149.909007 88.6127018,127.727022 C88.2113495,127.235047 87.9945723,126.617371 88,125.981509 C88.013158,124.480686 89.2357854,123.274651 90.730918,123.287756 L90.730918,123.287756 L91.6846544,123.294531 C99.3056979,123.335994 106.714387,123.071591 113.910723,122.501323 C122.409039,121.82788 131.283523,120.674607 140.534177,119.041504 Z M147.408726,63.8119663 C147.932139,62.4026903 149.508386,61.6634537 150.954581,62.149012 L150.954581,62.149012 L151.742552,62.4154854 C177.583763,71.217922 187.402356,80.8916805 181.198332,91.4367609 C175.129904,101.751366 157.484347,109.260339 128.26166,113.963678 C127.613529,114.067994 126.948643,113.945969 126.382735,113.618843 C125.047025,112.846729 124.602046,111.158214 125.388848,109.847438 L125.388848,109.847438 L125.889328,109.0105 C129.877183,102.31633 133.481358,95.6542621 136.701854,89.0242957 C140.50501,81.1948179 144.073967,72.7907081 147.408726,63.8119663 Z M61.7383398,56.0363218 C62.3864708,55.9320063 63.0513565,56.0540315 63.6172646,56.3811573 C64.9529754,57.153271 65.3979538,58.8417862 64.6111517,60.1525615 L64.6111517,60.1525615 L64.1106718,60.9895001 C60.1228168,67.6836699 56.5186416,74.3457379 53.2981462,80.9757043 C49.49499,88.8051821 45.9260328,97.2092919 42.5912744,106.188034 C42.0678608,107.59731 40.4916142,108.336546 39.045419,107.850988 L39.045419,107.850988 L38.2574475,107.584515 C12.4162372,98.782078 2.59764398,89.1083195 8.80166786,78.5632391 C14.8700957,68.2486335 32.515653,60.7396611 61.7383398,56.0363218 Z M103.545792,24.4653746 C123.653461,6.89668641 136.722181,3.38744778 142.751952,13.9376587 C148.649935,24.2572826 146.515508,43.0171122 136.348673,70.2171474 C136.123182,70.8204179 135.695414,71.324709 135.139827,71.6422422 C133.828478,72.3917144 132.163975,71.9253986 131.422058,70.6006966 L131.422058,70.6006966 L130.947416,69.7564798 C127.143661,63.0170065 123.180988,56.6198239 119.059398,50.564932 C114.192119,43.4145727 108.71816,36.1758903 102.637521,28.8488847 C101.683122,27.6988602 101.815056,25.9888243 102.934314,25.0020629 L102.934314,25.0020629 Z M57.6842361,8 C69.3902551,8 84.2912758,19.0909926 102.387298,41.2729777 C102.788651,41.7649527 103.005428,42.3826288 103,43.0184911 C102.986842,44.5193144 101.764215,45.7253489 100.269082,45.7122445 L100.269082,45.7122445 L99.3153456,45.7054689 C91.6943021,45.6640063 84.2856126,45.9284091 77.0892772,46.4986773 C68.5909612,47.17212 59.7164767,48.325393 50.4658235,49.9584962 C49.0138691,50.2148231 47.6245044,49.2578618 47.3403697,47.805758 L47.3403697,47.805758 L47.1871846,47.0136235 C42.2176347,21.0045412 45.7166519,8 57.6842361,8 Z",id:"Combined-Shape",fill:"#FF4154"}))))))}function io(e){let{initialIsOpen:a,table:t,panelProps:o={},toggleButtonProps:r={},containerElement:s="footer"}=e,l=p.useRef(null),u=p.useRef(null),[d,n]=Zs("reactTableDevtoolsOpen",a),i=Ys(),{style:C={},...c}=o,{style:w={},onClick:y,...L}=r;return i()?p.createElement(s,{ref:l,className:"ReactTableDevtools"},p.createElement(no,{theme:$},d?p.createElement(sl,he({ref:u},c,{table:t,isOpen:d,setIsOpen:n,style:{maxHeight:"80vh",width:"100%",...C}})):p.createElement("button",he({type:"button"},L,{"aria-label":"Open React Table Devtools",onClick:x=>{n(!0),y&&y(x)},style:{background:"none",border:0,padding:0,margin:".5rem",display:"inline-flex",fontSize:"1.5em",cursor:"pointer",width:"fit-content",...w}}),p.createElement(fo,{"aria-hidden":!0})))):null}var sl=p.forwardRef(function(a,t){let{table:o,isOpen:r=!0,setIsOpen:s,...l}=a;return p.createElement(no,{theme:$},p.createElement(el,he({ref:t,className:"ReactTableDevtoolsPanel"},l),p.createElement("style",{dangerouslySetInnerHTML:{__html:`
|
|
2
|
+
.ReactTableDevtoolsPanel * {
|
|
3
|
+
scrollbar-color: ${$.backgroundAlt} ${$.gray};
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.ReactTableDevtoolsPanel *::-webkit-scrollbar, .ReactTableDevtoolsPanel scrollbar {
|
|
7
|
+
width: 1em;
|
|
8
|
+
height: 1em;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ReactTableDevtoolsPanel *::-webkit-scrollbar-track, .ReactTableDevtoolsPanel scrollbar-track {
|
|
12
|
+
background: ${$.backgroundAlt};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.ReactTableDevtoolsPanel *::-webkit-scrollbar-thumb, .ReactTableDevtoolsPanel scrollbar-thumb {
|
|
16
|
+
background: ${$.gray};
|
|
17
|
+
border-radius: .5em;
|
|
18
|
+
border: 3px solid ${$.backgroundAlt};
|
|
19
|
+
}
|
|
20
|
+
`}}),p.createElement("div",{style:{flex:"1 1 500px",minHeight:"40%",maxHeight:"100%",overflow:"auto",borderRight:`1px solid ${$.grayAlt}`,display:"flex",flexDirection:"column"}},p.createElement("div",{style:{padding:".5em",background:$.backgroundAlt,display:"flex",justifyContent:"space-between",alignItems:"center"}},p.createElement(fo,{"aria-hidden":!0,style:{marginRight:".5em"},onClick:()=>s(!1)}),p.createElement("div",{style:{marginRight:"auto",fontSize:"clamp(.8rem, 2vw, 1.3rem)",fontWeight:"bold"}},"React Table"," ",p.createElement("span",{style:{fontWeight:100}},"Devtools")),p.createElement("div",{style:{display:"flex",flexDirection:"column"}},r?p.createElement(al,{type:"button","aria-label":"Close React Table Devtools",onClick:()=>{s(!1)}},"Close"):null)),p.createElement("div",{style:{display:"flex",flexWrap:"wrap",overflowY:"auto",flex:"1"}},p.createElement("div",{style:{flex:"1 1 auto",padding:".5em"}},p.createElement(j,{label:"Instance",value:o,defaultExpanded:!1}),p.createElement("div",{style:{height:".5rem"}}),p.createElement(j,{label:"State",value:o.getState(),defaultExpanded:!1}),p.createElement("div",{style:{height:".5rem"}}),p.createElement(j,{label:"Columns",value:o.getAllColumns(),defaultExpanded:!1})),p.createElement("div",{style:{flex:"1 1 auto",padding:".5em"}},p.createElement(j,{label:"Core Model",value:o.getCoreRowModel(),defaultExpanded:!1}),p.createElement(j,{label:"Filtered Model",value:o.getFilteredRowModel(),defaultExpanded:!1}),p.createElement(j,{label:"Sorted Model",value:o.getSortedRowModel(),defaultExpanded:!1}),p.createElement(j,{label:"Grouped Model",value:o.getGroupedRowModel(),defaultExpanded:!1}),p.createElement(j,{label:"Expanded Model",value:o.getExpandedRowModel(),defaultExpanded:!1}))))))});import{useEffect as kl,useMemo as Rl,useState as rt}from"react";import{flexRender as pl}from"@tanstack/react-table";import*as b from"@radix-ui/react-dropdown-menu";import*as ce from"react";import{jsx as E,jsxs as tt}from"react/jsx-runtime";var co=b.Root,po=b.Trigger;var ll=ce.forwardRef(({className:e,inset:a,children:t,...o},r)=>tt(b.SubTrigger,{ref:r,className:m("ps-flex ps-cursor-default ps-select-none ps-items-center ps-gap-2 ps-rounded-sm ps-px-2 ps-py-1.5 ps-text-sm ps-outline-none focus:ps-bg-accent data-[state=open]:ps-bg-accent [&_svg]:ps-pointer-events-none [&_svg]:ps-size-4 [&_svg]:ps-shrink-0",a&&"ps-pl-8",e),...o,children:[t,E(se,{className:"ps-ml-auto"})]}));ll.displayName=b.SubTrigger.displayName;var ul=ce.forwardRef(({className:e,...a},t)=>E(b.SubContent,{ref:t,className:m("ps-z-50 ps-min-w-[8rem] ps-overflow-hidden ps-rounded-md ps-border ps-bg-popover ps-p-1 ps-text-popover-foreground ps-shadow-lg data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-dropdown-menu-content-transform-origin]",e),...a}));ul.displayName=b.SubContent.displayName;var at=ce.forwardRef(({className:e,sideOffset:a=4,...t},o)=>E(b.Portal,{children:E(b.Content,{ref:o,sideOffset:a,className:m("ps-z-50 ps-max-h-[var(--radix-dropdown-menu-content-available-height)] ps-min-w-[8rem] ps-overflow-y-auto ps-overflow-x-hidden ps-rounded-md ps-border ps-bg-popover ps-p-1 ps-text-popover-foreground ps-shadow-md","data-[state=open]:ps-animate-in data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=open]:ps-fade-in-0 data-[state=closed]:ps-zoom-out-95 data-[state=open]:ps-zoom-in-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-dropdown-menu-content-transform-origin]",e),...t})}));at.displayName=b.Content.displayName;var ha=ce.forwardRef(({className:e,inset:a,...t},o)=>E(b.Item,{ref:o,className:m("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-gap-2 ps-rounded-sm ps-px-2 ps-py-1.5 ps-text-sm ps-outline-none ps-transition-colors focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50 [&>svg]:ps-size-4 [&>svg]:ps-shrink-0",a&&"ps-pl-8",e),...t}));ha.displayName=b.Item.displayName;var dl=ce.forwardRef(({className:e,children:a,checked:t,...o},r)=>tt(b.CheckboxItem,{ref:r,className:m("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-8 ps-pr-2 ps-text-sm ps-outline-none ps-transition-colors focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),checked:t,...o,children:[E("span",{className:"ps-absolute ps-left-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:E(b.ItemIndicator,{children:E(re,{className:"ps-h-4 ps-w-4"})})}),a]}));dl.displayName=b.CheckboxItem.displayName;var nl=ce.forwardRef(({className:e,children:a,...t},o)=>tt(b.RadioItem,{ref:o,className:m("ps-relative ps-flex ps-cursor-default ps-select-none ps-items-center ps-rounded-sm ps-py-1.5 ps-pl-8 ps-pr-2 ps-text-sm ps-outline-none ps-transition-colors focus:ps-bg-accent focus:ps-text-accent-foreground data-[disabled]:ps-pointer-events-none data-[disabled]:ps-opacity-50",e),...t,children:[E("span",{className:"ps-absolute ps-left-2 ps-flex ps-h-3.5 ps-w-3.5 ps-items-center ps-justify-center",children:E(b.ItemIndicator,{children:E(be,{className:"ps-h-2 ps-w-2 ps-fill-current"})})}),a]}));nl.displayName=b.RadioItem.displayName;var fl=ce.forwardRef(({className:e,inset:a,...t},o)=>E(b.Label,{ref:o,className:m("ps-px-2 ps-py-1.5 ps-text-sm ps-font-semibold",a&&"ps-pl-8",e),...t}));fl.displayName=b.Label.displayName;var il=ce.forwardRef(({className:e,...a},t)=>E(b.Separator,{ref:t,className:m("ps--mx-1 ps-my-1 ps-h-px ps-bg-muted",e),...a}));il.displayName=b.Separator.displayName;var cl=({className:e,...a})=>E("span",{className:m("ps-ml-auto ps-text-xs ps-tracking-widest ps-opacity-60",e),...a});cl.displayName="DropdownMenuShortcut";import{Fragment as ot,jsx as q,jsxs as pe}from"react/jsx-runtime";function mo(e){let{header:a,className:t}=e;return pe("div",{className:m("ps-flex ps-items-center ps-justify-between ps-w-full ps-h-full ps-flex-0",t),children:[pe("div",{className:"ps-flex ps-items-center ps-justify-between ps-w-full",children:[q("div",{className:"ps-flex ps-items-center ps-gap-2 ps-overflow-hidden ps-text-ellipsis ps-font-mono ps-text-xs",children:a.isPlaceholder?null:q("span",{className:"ps-flex ps-min-w-0",children:q("span",{className:"ps-min-w-0 ps-overflow-hidden ps-text-ellipsis ps-text-foreground/90",children:pl(a.column.columnDef.header,a.getContext())})})}),q("span",{className:"ps-relative ps-gap-1",children:a.column.getCanPin()&&a.column.id!=="select"&&pe(co,{children:[q(po,{asChild:!0,children:q(N,{variant:"ghost",size:"sm",className:"ps-px-0 ps-h-6 ps-w-6",children:q(Ee,{size:12})})}),pe(at,{children:[a.column.getCanSort()&&q(ha,{onClick:()=>a.column.toggleSorting(),children:q("span",{className:"ps-flex ps-items-center ps-gap-2",children:a.column.getNextSortingOrder()==="desc"?pe(ot,{children:[q(Ie,{size:16}),"Sort descending"]}):a.column.getNextSortingOrder()==="asc"?pe(ot,{children:[q(Ue,{size:16}),"Sort ascending"]}):pe(ot,{children:[q(_e,{size:16}),"Cancel sorting"]})})}),q(ha,{onClick:()=>a.column.pin(a.column.getIsPinned()?!1:"left"),children:a.column.getIsPinned()?pe("span",{className:"ps-flex ps-items-center ps-gap-2",children:[q(Xe,{size:16}),"Unpin column"]}):pe("span",{className:"ps-flex ps-items-center ps-gap-2",children:[q(Qe,{size:16}),"Pin column"]})})]})]})})]}),a.column.getCanResize()&&q("button",{type:"button",tabIndex:0,onMouseDown:o=>{o.stopPropagation(),a.getResizeHandler()(o)},onTouchStart:o=>{o.stopPropagation(),a.getResizeHandler()(o)},onClick:o=>o.stopPropagation(),onKeyDown:o=>{(o.key==="Enter"||o.key===" ")&&(o.preventDefault(),o.stopPropagation(),a.getResizeHandler()(o))},className:m("ps-absolute ps-right-0 ps-top-0 ps-h-full ps-w-px ps-cursor-col-resize ps-border ps-border-transparent hover:ps-border-table-border"),"aria-label":"Resize column"})]})}import{jsx as xo}from"react/jsx-runtime";function Lo({className:e}){return xo("div",{"data-loading-bar":!0,className:m("ps-h-[2px] ps-w-full ps-overflow-hidden ps-bg-gray-200 ps-z-50",e),children:xo("div",{className:"ps-animate-indeterminate-bar ps-h-full ps-w-1/3 ps-rounded-r-full ps-bg-purple-600"})})}import*as go from"react";import{jsx as ml}from"react/jsx-runtime";var aa=go.forwardRef(({className:e,type:a,...t},o)=>ml("input",{type:a,className:m("ps-flex ps-h-9 ps-w-full ps-rounded-md ps-border ps-border-input ps-bg-transparent ps-px-3 ps-py-1 ps-shadow-sm ps-transition-colors file:ps-border-0 file:ps-bg-transparent file:ps-text-sm file:ps-font-medium file:ps-text-foreground placeholder:ps-text-muted-foreground focus-visible:ps-outline-none focus-visible:ps-ring-1 focus-visible:ps-ring-ring disabled:ps-cursor-not-allowed disabled:ps-opacity-50",e),ref:o,...t}));aa.displayName="Input";import{jsx as H,jsxs as Sa}from"react/jsx-runtime";function Co(e){let{table:a,variant:t="basic"}=e,{pageIndex:o}=a.getState().pagination,r=a.getPageCount();return H("div",{className:"ps-rounded-b-lg ps-overflow-clip ps-sticky ps-bottom-0 ps-left-0 ps-border-t-0 w-full ps-z-20 ps-p-0",children:H("div",{className:"ps-flex ps-items-center ps-justify-between ps-space-x-2 ps-py-2 ps-px-2 ps-border-t ps-border-table-border ps-backdrop-blur-sm ps-bg-table-head/90",children:t==="basic"?Sa("div",{className:"ps-flex ps-items-center ps-space-x-2",children:[H(N,{variant:"outline",size:"sm",className:"ps-h-9",onClick:()=>a.previousPage(),disabled:!a.getCanPreviousPage(),children:"Previous"}),H(N,{variant:"outline",size:"sm",className:"ps-h-9",onClick:()=>a.nextPage(),disabled:!a.getCanNextPage(),children:"Next"})]}):H("div",{className:"ps-flex ps-items-center ps-space-x-2",children:Sa("div",{className:"ps-flex ps-items-center ps-space-x-2",children:[H(N,{variant:"outline",onClick:()=>a.setPageIndex(0),disabled:!a.getCanPreviousPage(),children:H(ze,{className:"ps-w-4 ps-h-4"})}),H(N,{variant:"outline",onClick:()=>a.previousPage(),disabled:!a.getCanPreviousPage(),children:H(He,{className:"ps-w-4 ps-h-4"})}),Sa("div",{className:"ps-flex ps-items-center ps-gap-1 ps-text-xs ps-font-medium",children:["Page",H(aa,{type:"number",min:1,max:r,value:o+1,className:"ps-w-16",onChange:s=>{let l=s.target.value?Number(s.target.value)-1:0;a.setPageIndex(l)}}),Sa("span",{className:"ps-shrink-0 ps-w-max",children:["of ",r]})]}),H(N,{variant:"outline",onClick:()=>a.nextPage(),disabled:!a.getCanNextPage(),children:H(se,{className:"ps-w-4 ps-h-4"})}),H(N,{variant:"outline",onClick:()=>a.setPageIndex(r-1),disabled:!a.getCanNextPage(),children:H(Ge,{className:"ps-w-4 ps-h-4"})})]})})})})}function me(e){let a=e.getIsPinned(),t=a==="right"&&e.getIsFirstColumn("right");return{className:m("ps-group ps-border-r ps-border-b ps-border-table-border last:ps-border-r-0","ps-overflow-hidden ps-whitespace-nowrap ps-text-ellipsis",a&&["ps-sticky ps-bg-background ps-z-20",a==="left"?"ps-left-0":"ps-right-0"],!a&&"ps-relative ps-z-10",a&&t&&"ps-shadow-[-1px_0_0_0_hsl(var(--border))]"),style:{width:e.getSize(),left:a==="left"?`${e.getStart("left")}px`:void 0,right:a==="right"?`${e.getAfter("right")}px`:void 0}}}import{Fragment as Dl,jsx as A,jsxs as ba}from"react/jsx-runtime";var Ml=e=>{let{children:a,className:t,header:o,style:r}=e,{attributes:s,listeners:l,transform:u,transition:d,setNodeRef:n,isDragging:i}=bl({id:o.id});return A(xa,{ref:n,...s,...l,style:{cursor:"grab",touchAction:"none",transform:wl.Transform.toString(u),transition:d,...r,"--dragging-width":`${o.getSize()}px`},className:m(t,"ps-select-none ps-touch-none ps-sticky ps-top-0 ps-z-20 ps-bg-table-head",o.column.getIsPinned()&&"ps-sticky ps-z-30",i&&"!ps-z-50 ps-w-[var(--dragging-width)] ps-border-2 ps-border-violet-500"),children:A("div",{className:"ps-w-full",children:a})})};function ho(e){let{columnDefs:a,getBeforeRows:t,isLoading:o,isProcessing:r,onPaginationChange:s,onRowSelectionChange:l,onSortingChange:u,pageCount:d,paginationState:n,rows:i,rowSelectionState:C,sortingState:c}=e,[w,y]=rt([]),[L,x]=rt({left:["__ps_select"],right:[]}),[I,M]=rt({}),W=Rl(()=>Io(c),[c]),K=o||r;kl(()=>y(a.map(({accessorKey:R})=>R)),[]);function xe({active:R,over:g}){g&&R.id!==g.id&&y(T=>{let P=T.indexOf(R.id),Le=T.indexOf(g.id);return Il(T,P,Le)})}let Pe=gl(Ll,{activationConstraint:{distance:10}}),ve=Cl(Pe),G=vl({columnResizeMode:"onChange",columns:a,data:i,defaultColumn:{size:200,minSize:50,maxSize:500},enableColumnPinning:!0,enableColumnResizing:!0,enableRowSelection:!0,enableSorting:!!(u&&c),getCoreRowModel:Pl(),getRowId:({__ps_rowid:R})=>R,manualPagination:!0,manualSorting:!0,onColumnOrderChange:y,onColumnPinningChange:x,onColumnSizingChange:M,onPaginationChange:s,onRowSelectionChange:l,onSortingChange:R=>u?.(g=>(typeof R=="function"&&(R=R(Io(g))),Al(R))),pageCount:d,state:{columnOrder:w,columnPinning:L,columnSizing:I,pagination:n,rowSelection:C,sorting:W}});return ba(Dl,{children:[process.env.NODE_ENV==="production"?null:A(io,{table:G}),ba("div",{"data-studio":"content",className:"ps-flex-1 ps-w-0 ps-h-0 ps-min-w-full ps-flex ps-flex-col ps-relative ps-bg-slate-100",children:[A("div",{children:K&&A(Lo,{className:"ps-absolute -ps-top-[1px] ps-left-0 ps-right-0"})}),A(xl,{sensors:ve,onDragEnd:xe,children:ba(Na,{className:"ps-table-fixed ps-border-separate ps-border-spacing-0 ps-box-border",children:[A("colgroup",{children:A("col",{style:{width:"40px",minWidth:0,maxWidth:"40px"}})}),A(Ua,{children:G.getHeaderGroups().map(R=>A(we,{children:A(Sl,{items:R.headers.filter(g=>g.id!=="__ps_select").map(g=>g.id),strategy:hl,children:R.headers.map(g=>g.id==="__ps_select"?A(xa,{style:me(g.column).style,className:m(me(g.column).className,"ps-select-none ps-sticky ps-top-0 ps-z-20 ps-bg-table-head ps-p-0 ps-table-cell-select",g.column.getIsPinned()&&"ps-sticky ps-z-30"),children:A("div",{className:"ps-flex ps-items-center ps-justify-center ps-h-full",children:yl(g.column.columnDef.header,g.getContext())})},g.id):A(Ml,{header:g,table:G,...me(g.column),children:A(mo,{header:g})},g.id))})},R.id))}),ba(Ea,{children:[t?.(G),G.getRowModel().rows?.length?G.getRowModel().rows.map(R=>A(we,{className:m("ps-bg-table-row ps-odd:bg-table-row-odd ps-group [&:last-of-type_td]:ps-border-b-0"),children:R.getVisibleCells().map((g,T)=>{if(g.column.id==="__ps_select")return A(De,{style:me(g.column).style,className:m(me(g.column).className,"ps-table-cell-select"),children:typeof g.column.columnDef.cell=="function"&&(P=>{let Le=g.column.columnDef.cell(g.getContext());return A(Le,{className:"ps-w-full ps-h-full"})})({className:""})},g.id);if(typeof g.column.columnDef.cell=="function"){let P=g.column.columnDef.cell(g.getContext());return A(P,{...me(g.column)},T)}return null})},R.id)):A(we,{children:A(De,{colSpan:a.length,className:"ps-h-24 ps-text-center",children:o?"Loading...":"No results."})})]})]})}),!d||d<2?null:A(Co,{table:G,variant:"numeric"})]})]})}function Io(e){return e?.map(a=>({id:a.column,desc:a.direction==="desc"}))||[]}function Al(e){return e.map(a=>({column:a.id,direction:a.desc?"desc":"asc"}))}import*as Z from"@radix-ui/react-tooltip";import*as bo from"react";import{jsx as So}from"react/jsx-runtime";var wo=Z.Provider,yo=Z.Root,Po=Z.Trigger,st=bo.forwardRef(({className:e,sideOffset:a=4,...t},o)=>So(Z.Portal,{children:So(Z.Content,{ref:o,sideOffset:a,className:m("ps-z-50 ps-overflow-hidden ps-rounded-md ps-bg-primary ps-px-3 ps-py-1.5 ps-text-xs ps-text-primary-foreground ps-animate-in ps-fade-in-0 ps-zoom-in-95 data-[state=closed]:ps-animate-out data-[state=closed]:ps-fade-out-0 data-[state=closed]:ps-zoom-out-95 data-[side=bottom]:ps-slide-in-from-top-2 data-[side=left]:ps-slide-in-from-right-2 data-[side=right]:ps-slide-in-from-left-2 data-[side=top]:ps-slide-in-from-bottom-2 ps-origin-[--radix-tooltip-content-transform-origin]",e),...t})}));st.displayName=Z.Content.displayName;import{jsx as ye,jsxs as lt}from"react/jsx-runtime";function vo({column:e}){return e.isInPrimaryKey?lt("span",{className:"ps-flex ps-flex-row ps-font-medium ps-items-center ps-gap-1",children:[ye(wo,{delayDuration:300,children:lt(yo,{children:[ye(Po,{asChild:!0,children:ye(Ke,{size:12})}),ye(st,{children:ye("p",{children:"Primary Key"})})]})}),e.name]}):lt("div",{className:"ps-flex ps-flex-row ps-gap-1 ps-items-center",children:[ye("span",{className:"ps-font-medium ps-truncate",children:e.name}),ye("span",{className:"ps-overflow-hidden ps-text-ellipsis ps-text-muted-foreground/70 ps-lowercase ps-truncate",children:e.datatype.name})]})}import{isObjectType as Zl}from"remeda";import{motion as Ao}from"motion/react";import Ol,{useState as Do}from"react";import*as ut from"@radix-ui/react-label";import{cva as Tl}from"class-variance-authority";import*as ko from"react";import{jsx as Fl}from"react/jsx-runtime";var Bl=Tl("ps-text-sm ps-font-medium ps-leading-none peer-disabled:ps-cursor-not-allowed peer-disabled:ps-opacity-70"),ta=ko.forwardRef(({className:e,...a},t)=>Fl(ut.Root,{ref:t,className:m(Bl(),e),...a}));ta.displayName=ut.Root.displayName;import*as oa from"@radix-ui/react-switch";import*as Mo from"react";import{jsx as Ro}from"react/jsx-runtime";var ra=Mo.forwardRef(({className:e,...a},t)=>Ro(oa.Root,{className:m("ps-peer ps-inline-flex ps-h-5 ps-w-9 ps-shrink-0 ps-cursor-pointer ps-items-center ps-rounded-full ps-border-2 ps-border-transparent ps-shadow-sm ps-transition-colors focus-visible:ps-outline-none focus-visible:ps-ring-2 focus-visible:ps-ring-ring focus-visible:ps-ring-offset-2 focus-visible:ps-ring-offset-background disabled:ps-cursor-not-allowed disabled:ps-opacity-50 data-[state=checked]:ps-bg-primary data-[state=unchecked]:ps-bg-input",e),...a,ref:t,children:Ro(oa.Thumb,{className:m("ps-pointer-events-none ps-block ps-h-4 ps-w-4 ps-rounded-full ps-bg-background ps-shadow-lg ps-ring-0 ps-transition-transform data-[state=checked]:ps-translate-x-4 data-[state=unchecked]:ps-translate-x-0")})}));ra.displayName=oa.Root.displayName;import{jsx as Te,jsxs as sa}from"react/jsx-runtime";var Y=({onSave:e,onCancel:a,onClose:t,onNullChange:o,isNull:r=!1})=>sa("div",{className:"ps-flex ps-flex-row ps-gap-1 ps-border-t ps-border-table-border ps-text-xs",children:[sa("div",{className:"ps-flex ps-flex-col ps-gap-1 ps-p-2 ps-mr-auto",children:[sa("button",{className:"ps-flex ps-flex-row ps-gap-1 ps-items-center ps-cursor-pointer",onClick:()=>{e&&e(),t&&t()},children:[Te("kbd",{className:"ps-inline-flex ps-justify-center ps-items-center ps-h-6 ps-w-6 ps-rounded-md ps-bg-muted ps-text-muted-foreground",children:Te(We,{size:12,strokeWidth:2})})," ","Save changes"]}),sa("button",{className:"ps-flex ps-flex-row ps-gap-1 ps-items-center ps-cursor-pointer",onClick:()=>{a&&a(),t&&t()},children:[Te("kbd",{className:"ps-inline-flex ps-justify-center ps-items-center ps-h-6 ps-w-6 ps-rounded-md ps-bg-muted ps-text-muted-foreground ps-text-[8px] ps-leading-none ps-font-semibold",children:"Esc"})," ","Cancel changes"]})]}),o&&Te("div",{className:"ps-flex ps-flex-col ps-gap-1 ps-p-2",children:sa("label",{className:"ps-flex ps-flex-row ps-gap-1 ps-items-center",htmlFor:"set-nullable",children:[Te(ra,{id:"set-nullable",checked:r,onCheckedChange:d=>{o&&o(d)}}),Te("span",{children:"Set to NULL"})]})})]});import{Fragment as ql,jsx as la,jsxs as To}from"react/jsx-runtime";function Bo(e){let{value:a,onSubmit:t,column:o}=e,r=o.nullable===!0,[s,l]=Do(a===null?!1:a),[u,d]=Do(a===null),n=a===null?!1:a,i=x=>{l(x)},C=x=>{d(x)},c=Ol.useCallback(()=>{let x=u?null:s;return x!==a?(t(x),!0):!1},[s,a,t,u]),w=()=>{l(n),d(a===null)},{handleSave:y,handleCancel:L}=J({onSave:c,onCancel:w});return To(ql,{children:[To("div",{className:"ps-flex ps-flex-row ps-items-center ps-h-[var(--studio-cell-height)] ps-gap-4 ps-py-0 ps-px-2",children:[la(ta,{htmlFor:"boolean-input",className:"ps-sr-only",children:"Boolean"}),la(Ao.div,{className:"ps-flex ps-items-center",initial:{opacity:0},animate:{opacity:1},transition:{duration:.24},children:la(ra,{id:"boolean-input",checked:s,onCheckedChange:i,disabled:u})}),la(Ao.div,{"data-value":!0,className:"ps-inline-flex ps-items-center ps-text-xs ps-text-muted-foreground ps-font-mono",initial:{x:-40,opacity:1},animate:{x:0,opacity:1},transition:{duration:.12,delay:0},children:u?"NULL":String(s)})]}),la(Y,{onSave:y,onCancel:L,onNullChange:r?C:void 0,isNull:u})]})}import{useCallback as Ul,useState as Oo}from"react";import{cva as Nl}from"class-variance-authority";import{jsx as Dp}from"react/jsx-runtime";var Fo=Nl("ps-inline-flex ps-items-center ps-rounded-md ps-border ps-px-2.5 ps-py-0.5 ps-text-xs ps-font-semibold ps-transition-colors focus:ps-outline-none focus:ps-ring-2 focus:ps-ring-ring focus:ps-ring-offset-2",{variants:{variant:{default:"ps-border-transparent ps-bg-primary ps-text-primary-foreground ps-shadow hover:ps-bg-primary/80",secondary:"ps-border-transparent ps-bg-secondary ps-text-secondary-foreground hover:ps-bg-secondary/80",destructive:"ps-border-transparent ps-bg-destructive ps-text-destructive-foreground ps-shadow hover:ps-bg-destructive/80",outline:"ps-text-foreground"}},defaultVariants:{variant:"default"}});import{Fragment as El,jsx as wa,jsxs as Hl}from"react/jsx-runtime";function qo(e){let{onSubmit:a,column:t,value:o,options:r=[]}=e,s=t.nullable===!0,l=String(o),[u,d]=Oo(l),[n,i]=Oo(o===null),C=I=>{d(I)},c=I=>{i(I)},w=Ul(()=>n?o!==null?(a(null),!0):!1:u!==l?(a(u),!0):!1,[u,l,a,n,o]),y=()=>{d(l),i(o===null)},{handleSave:L,handleCancel:x}=J({onSave:w,onCancel:y});return Hl(El,{children:[wa("div",{className:"ps-flex ps-items-center ps-gap-2 ps-font-mono ps-h-[var(--studio-cell-height)] ps-px-2 ps-py-0 ps-w-full ps-text-xs ps-text-muted-foreground",children:u}),wa("div",{className:"ps-flex ps-flex-row ps-gap-2 ps-p-2",children:r.map(I=>wa("button",{onClick:()=>C(I),className:Fo({variant:I===u?"default":"outline"}),disabled:n,children:I},I))}),wa(Y,{onSave:L,onCancel:x,onNullChange:s?c:void 0,isNull:n})]})}import zl,{useState as No}from"react";import{Fragment as Gl,jsx as dt,jsxs as Vl}from"react/jsx-runtime";function Uo(e){let{value:a,onSubmit:t,column:o}=e,r=o.nullable===!0,s=a===null?"":JSON.stringify(a,null,2),[l,u]=No(s),[d,n]=No(a===null),i=x=>{u(x.target.value)},C=x=>{n(x)},c=zl.useCallback(()=>{if(d)return a!==null?(t(null),!0):!1;let x=l===""?null:JSON.parse(l);return x!==a?(t(x),!0):!1},[l,a,t,d]),w=()=>{u(s),n(a===null)},{handleSave:y,handleCancel:L}=J({onSave:c,onCancel:w});return Vl(Gl,{children:[dt("div",{className:"ps-flex ps-flex-row ps-items-center ps-gap-4 ps-py-0",children:dt("textarea",{rows:5,value:l,onChange:i,disabled:d,className:"ps-cell-input-base ps-appearance-none ps-w-full ps-font-mono ps-border-none ps-outline-none ps-shadow-none ps-bg-transparent focus-visible:ps-ring-0 ps-resize ps-px-[var(--studio-cell-spacing)]",lang:"en_EN"})}),dt(Y,{onSave:y,onCancel:L,onNullChange:r?C:void 0,isNull:d})]})}import Wl,{useState as Eo}from"react";import{Fragment as Kl,jsx as nt,jsxs as Ho}from"react/jsx-runtime";function zo(e){let{value:a,onSubmit:t,column:o}=e,r=o.nullable===!0,[s,l]=Eo(a===null?"":String(a)),[u,d]=Eo(a===null),n=a===null?"":String(a),i=x=>{l(x.target.value)},C=x=>{d(x)},c=Wl.useCallback(()=>{if(u)return a!==null?(t(null),!0):!1;let x=s===""?null:Number(s);return s!==a?(t(x),!0):!1},[s,a,t,u]),w=()=>{l(n),d(a===null)},{handleSave:y,handleCancel:L}=J({onSave:c,onCancel:w});return Ho(Kl,{children:[Ho("div",{className:"ps-flex ps-flex-row ps-items-center ps-h-[var(--studio-cell-height)] ps-gap-4 ps-py-0",children:[nt(ta,{htmlFor:"numeric-input",className:"ps-sr-only",children:"Numeric"}),nt("input",{type:"text",inputMode:"numeric",pattern:"\\d*",value:s,onChange:i,disabled:u,className:"ps-cell-input-leading ps-appearance-none ps-w-full ps-font-mono ps-border-none ps-outline-none ps-shadow-none ps-bg-transparent focus-visible:ps-ring-0 ps-resize-none ps-px-[var(--studio-cell-spacing)]",step:"any",lang:"en_EN"})]}),nt(Y,{onSave:y,onCancel:L,onNullChange:r?C:void 0,isNull:u})]})}import Ql from"react";import{useState as Xl}from"react";function Go(e){let{initialValue:a}=e,[t,o]=Xl(a??"");return{handleOnChange:s=>{o(s.target.value)},value:t}}import{Fragment as _l,jsx as ft,jsxs as Vo}from"react/jsx-runtime";function Wo(e){let{onSubmit:a,value:t}=e,o=String(t),{handleOnChange:r,value:s}=Go({initialValue:o});function l(C){C.preventDefault(),s!==o&&a(s)}let u=Ql.useCallback(()=>s!==o?(a(s),!0):!1,[s,o,a]),d=()=>{},{handleSave:n,handleCancel:i}=J({onSave:u,onCancel:d});return Vo(_l,{children:[Vo("form",{onSubmit:l,children:[ft(aa,{className:"ps-cell-input-leading ps-font-mono ps-border-none ps-shadow-none focus-visible:ps-ring-0 ps-resize-none ps-px-[var(--studio-cell-spacing)]",onChange:r,type:"text",value:s}),ft("input",{type:"submit",className:"ps-sr-only"})]}),ft(Y,{onSave:n,onCancel:i})]})}import{jsx as ua}from"react/jsx-runtime";function ya(e,a,t){let{group:o,options:r,isArray:s}=a.datatype,l=e.getValue(),u=l===void 0?"":l;return o==="json"||s?ua(Uo,{onSubmit:t,value:u,column:a}):o==="boolean"?ua(Bo,{onSubmit:t,value:u,column:a}):o==="enum"?ua(qo,{onSubmit:t,value:u,options:r,column:a}):o==="numeric"?ua(zo,{onSubmit:t,value:u,column:a}):ua(Wo,{onSubmit:t,value:Zl(u)?JSON.stringify(u):u})}import{useReactTable as Jl}from"@tanstack/react-table";import{omit as $l}from"remeda";import{Fragment as jl,jsx as da}from"react/jsx-runtime";function Ko(e){let{table:a,stagedRows:t,setStagedRows:o}=e;function r(u,d){o(n=>{let i=[...n];return i[u]={...i[u],...d},i})}let s=Object.values(a.options.columns).map(u=>u.id==="__ps_select"?{...u,cell(){return()=>da(je,{})}}:{...u,cell({cell:d}){return n=>da(Ca,{cellComponent:ga(d,u.meta,n),inputComponent:ya(d,u.meta,i=>{console.log("value",i),r(n.rowIndex,{[u.id]:i})})})}}),l=Jl({...a.options,columns:s,enableSorting:!1,onPaginationChange:void 0,onSortingChange:void 0,data:t,state:$l(a.options.state,["pagination","sorting"])});return da(jl,{children:l.getRowModel().rows.map((u,d)=>da(we,{children:u.getVisibleCells().map((n,i)=>{if(typeof n.column.columnDef.cell=="function"){let C=n.column.columnDef.cell(n.getContext());return da(C,{...me(n.column),rowIndex:d},i)}return null})},d))})}import{Fragment as it,jsx as z,jsxs as ct}from"react/jsx-runtime";function Xo(e){let a=!!Yl(),{activeTable:t,onError:o}=F(),{sortingState:r,setSortingState:s}=Qt(),{paginationState:l,setPaginationState:u}=ma(),[d,n]=au([]),{data:i,isFetching:C}=Gt({...l,sortOrder:r}),{deleteSelection:c,isSelecting:w,rowSelectionState:y,setRowSelectionState:L}=Xt(i),x=Wt(),I=zt(),M=Vt();if(eu(()=>n([]),[t]),!t)return null;function W(){I.mutate(d,{onError:o,onSuccess(){tu.success("Rows inserted successfully"),n([])}})}function K(){n(g=>[...g,{}])}function xe(){n([])}function Pe(g,T,P){M.mutate({details:{changes:{[T.name]:g},row:P,table:t},options:{}})}let ve=Object.values(t?.columns??{}).map(g=>({id:g.name,accessorKey:g.name,meta:g,header(){return vo({column:g})},cell({cell:T}){return P=>z(Ca,{cellComponent:ga(T,g,P),inputComponent:ya(T,g,Le=>Pe(Le,g,T.row.original))})}})),G=[{id:"__ps_select",accessorKey:"__ps_select",enablePinning:!1,meta:{disableDragging:!0},header({table:g}){return z(Je,{checked:g.getIsAllRowsSelected(),onCheckedChange:T=>g.toggleAllRowsSelected(!!T)})},cell({row:g}){return()=>z(Ja,{row:g})}}],R=[...ve,...G].sort(ru);return ct(it,{children:[z("div",{className:"ps-bg-studio-header-background ps-flex ps-w-full ps-p-2 ps-py-3 ps-border-b ps-bg-card ps-rounded-t-lg",children:z("div",{className:"ps-flex ps-items-center ps-justify-between ps-w-full ps-gap-2",children:z("div",{className:"ps-flex ps-flex-grow ps-justify-between ps-items-center",children:ct("div",{className:"ps-flex ps-items-center ps-gap-2",children:[z(N,{variant:"outline",size:"sm",onClick:K,disabled:x>0,children:"Insert row"}),d.length>0&&ct(it,{children:[z(N,{variant:"secondary",size:"sm",onClick:W,children:"Save"}),z(N,{variant:"ghost",size:"sm",onClick:xe,children:"Cancel"})]}),w&&z(it,{children:z(N,{variant:"secondary",size:"sm",onClick:c,children:"Delete"})})]})})})}),z(ho,{columnDefs:R,getBeforeRows:g=>z(Ko,{table:g,stagedRows:d,setStagedRows:n}),isLoading:C,isProcessing:a,onPaginationChange:u,onRowSelectionChange:L,onSortingChange:s,pageCount:ou(i?.filteredRowCount??1/0,l.pageSize),paginationState:l,rows:i?.rows??[],rowSelectionState:y,sortingState:r})]})}function ou(e,a){if(e===1/0)return;let t=Number((BigInt(e)+BigInt(a)-BigInt(1))/BigInt(a));return Number.isSafeInteger(t)?t:Number.MAX_SAFE_INTEGER}function ru(e,a){let t=e.meta,o=a.meta;return e.id==="__ps_select"||a.id==="__ps_select"?1:t===void 0||o===void 0?0:t.isInPrimaryKey&&!o.isInPrimaryKey?-1:!t.isInPrimaryKey&&o.isInPrimaryKey?1:t.name.localeCompare(o.name)}import{Slot as du}from"@radix-ui/react-slot";import{useCallback as lu,useEffect as uu}from"react";import{useQuery as su}from"@tanstack/react-query";var Qo=-1;function _o(){let{adapter:e}=F();return su({initialData:{schemas:{[e.defaultSchema||"db"]:{tables:{}}},timezone:"UTC"},initialDataUpdatedAt:Qo,queryFn:async({signal:a})=>{let[t,o]=await e.introspect({abortSignal:a});if(t)throw t;return o},queryKey:["introspection"],staleTime:a=>a.state.dataUpdatedAt===Qo?0:1/0})}function Zo(){let{activeTable:e,setActiveTable:a,adapter:t}=F(),{data:o,isLoading:r}=_o(),s=Object.values(o.schemas[t.defaultSchema||"db"]?.tables||{}),[l]=s,[u,d]=$e({table:{defaultValue:null,parse:c=>c,serialize:c=>c??""},schema:{defaultValue:"",parse:c=>c,serialize:c=>c??""}}),[,n]=Ae("pageIndex",{parse:c=>c,serialize:c=>c??""}),[,i]=Ae("sort",{parse:c=>c,serialize:c=>c??""});uu(()=>{if(!r){if(u?.table&&s.length>0){let c=s.find(w=>w.name===u.table);if(c){a(c);return}}s.length>0&&!e&&(a(l||null),l&&d({table:l.name,schema:l.schema}))}},[r,u,s,l,e,a,d]);let C=lu(c=>{e!==c&&(a(c),d({table:c.name,schema:c.schema}),n(null),i(null))},[e,a,d,n,i]);return{tables:s,activeTable:e,isLoading:r,handleTableChange:C}}import{jsx as ee,jsxs as iu}from"react/jsx-runtime";function Se(){let{tables:e,activeTable:a,isLoading:t,handleTableChange:o}=Zo();return ee("div",{className:"ps-flex ps-flex-col ps-w-64 ps-gap-4 ps-shrink-0 ps-overflow-y-auto ps-max-h-full ps-min-h-0 ps-rounded-lg ps-border ps-bg-card ps-text-card-foreground ps-shadow-xs",children:ee(Se.Block,{label:"Tables",children:e.length>0?e.map(r=>ee(Se.Item,{isActive:a===r,onClick:()=>{o(r)},className:"ps-capitalize ps-py-1 ps-font-mono ps-text-xs ps-text-foreground/60 hover:ps-text-foreground ps-transition-all ps-cursor-pointer data-[active=true]:ps-bg-primary/5 data-[active=true]:ps-foreground data-[active=true]:ps-text-foreground",children:r.name},`${r.schema}-${r.name}`)):t?ee(Se.Item,{children:"Loading..."}):ee(Se.Item,{children:"No tables found"})})})}var nu=({className:e,label:a,children:t,...o})=>iu("div",{className:e,...o,children:[ee("div",{className:"ps-pt-4 ps-pb-2 ps-px-4",children:ee("h2",{className:"ps-text-sm ps-font-medium",children:a})}),ee("nav",{"aria-label":a,className:"ps-flex ps-flex-col ps-gap-px ps-pb-3",children:t})]}),fu=({className:e,asChild:a=!1,isActive:t,size:o,...r})=>ee(a?du:"button",{"data-sidebar":"menu-button","data-size":o,"data-active":t,className:m("ps-py-1.5 ps-px-4 ps-text-sm ps-font-medium ps-flex ps-gap-2 ps-items-center ps-border ps-border-transparent ps-bg-transparent ps-hover:bg-muted/50",e),...r,children:ee("span",{className:"ps-truncate",children:r.children})});Se.Block=nu;Se.Item=fu;import{jsx as Be,jsxs as pu}from"react/jsx-runtime";function cu(e){let{adapter:a,onError:t}=e;return a?Be(Et,{adapter:a,onError:t,children:Be("div",{className:"ps-flex ps-flex-col ps-w-full ps-min-h-0 ps-max-h-full",children:pu("div",{className:"ps-flex ps-gap-4 ps-w-full ps-bg-background ps-relative ps-max-h-full ps-min-h-full",children:[Be(Se,{}),Be("div",{className:"ps-flex ps-w-full ps-flex-col ps-bg-slate-100 ps-border ps-rounded-lg ps-self-start ps-h-full ps-min-h-full ps-max-h-full ps-overflow-clip",children:Be(Xo,{})})]})})}):(console.error("No adapter provided to Studio component"),Be("div",{children:"Error: No adapter provided"}))}export{cu as Studio};
|
|
21
|
+
/*! Bundled license information:
|
|
22
|
+
|
|
23
|
+
lucide-react/dist/esm/shared/src/utils.js:
|
|
24
|
+
(**
|
|
25
|
+
* @license lucide-react v0.427.0 - ISC
|
|
26
|
+
*
|
|
27
|
+
* This source code is licensed under the ISC license.
|
|
28
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
29
|
+
*)
|
|
30
|
+
|
|
31
|
+
lucide-react/dist/esm/defaultAttributes.js:
|
|
32
|
+
(**
|
|
33
|
+
* @license lucide-react v0.427.0 - ISC
|
|
34
|
+
*
|
|
35
|
+
* This source code is licensed under the ISC license.
|
|
36
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
37
|
+
*)
|
|
38
|
+
|
|
39
|
+
lucide-react/dist/esm/Icon.js:
|
|
40
|
+
(**
|
|
41
|
+
* @license lucide-react v0.427.0 - ISC
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the ISC license.
|
|
44
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
+
*)
|
|
46
|
+
|
|
47
|
+
lucide-react/dist/esm/createLucideIcon.js:
|
|
48
|
+
(**
|
|
49
|
+
* @license lucide-react v0.427.0 - ISC
|
|
50
|
+
*
|
|
51
|
+
* This source code is licensed under the ISC license.
|
|
52
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
53
|
+
*)
|
|
54
|
+
|
|
55
|
+
lucide-react/dist/esm/icons/arrow-down-wide-narrow.js:
|
|
56
|
+
(**
|
|
57
|
+
* @license lucide-react v0.427.0 - ISC
|
|
58
|
+
*
|
|
59
|
+
* This source code is licensed under the ISC license.
|
|
60
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
61
|
+
*)
|
|
62
|
+
|
|
63
|
+
lucide-react/dist/esm/icons/arrow-up-wide-narrow.js:
|
|
64
|
+
(**
|
|
65
|
+
* @license lucide-react v0.427.0 - ISC
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the ISC license.
|
|
68
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
69
|
+
*)
|
|
70
|
+
|
|
71
|
+
lucide-react/dist/esm/icons/check.js:
|
|
72
|
+
(**
|
|
73
|
+
* @license lucide-react v0.427.0 - ISC
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the ISC license.
|
|
76
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
+
*)
|
|
78
|
+
|
|
79
|
+
lucide-react/dist/esm/icons/chevron-down.js:
|
|
80
|
+
(**
|
|
81
|
+
* @license lucide-react v0.427.0 - ISC
|
|
82
|
+
*
|
|
83
|
+
* This source code is licensed under the ISC license.
|
|
84
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
+
*)
|
|
86
|
+
|
|
87
|
+
lucide-react/dist/esm/icons/chevron-left.js:
|
|
88
|
+
(**
|
|
89
|
+
* @license lucide-react v0.427.0 - ISC
|
|
90
|
+
*
|
|
91
|
+
* This source code is licensed under the ISC license.
|
|
92
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
93
|
+
*)
|
|
94
|
+
|
|
95
|
+
lucide-react/dist/esm/icons/chevron-right.js:
|
|
96
|
+
(**
|
|
97
|
+
* @license lucide-react v0.427.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*)
|
|
102
|
+
|
|
103
|
+
lucide-react/dist/esm/icons/chevrons-left.js:
|
|
104
|
+
(**
|
|
105
|
+
* @license lucide-react v0.427.0 - ISC
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the ISC license.
|
|
108
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
+
*)
|
|
110
|
+
|
|
111
|
+
lucide-react/dist/esm/icons/chevrons-right.js:
|
|
112
|
+
(**
|
|
113
|
+
* @license lucide-react v0.427.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*)
|
|
118
|
+
|
|
119
|
+
lucide-react/dist/esm/icons/circle.js:
|
|
120
|
+
(**
|
|
121
|
+
* @license lucide-react v0.427.0 - ISC
|
|
122
|
+
*
|
|
123
|
+
* This source code is licensed under the ISC license.
|
|
124
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
+
*)
|
|
126
|
+
|
|
127
|
+
lucide-react/dist/esm/icons/copy.js:
|
|
128
|
+
(**
|
|
129
|
+
* @license lucide-react v0.427.0 - ISC
|
|
130
|
+
*
|
|
131
|
+
* This source code is licensed under the ISC license.
|
|
132
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
133
|
+
*)
|
|
134
|
+
|
|
135
|
+
lucide-react/dist/esm/icons/corner-down-left.js:
|
|
136
|
+
(**
|
|
137
|
+
* @license lucide-react v0.427.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*)
|
|
142
|
+
|
|
143
|
+
lucide-react/dist/esm/icons/key-round.js:
|
|
144
|
+
(**
|
|
145
|
+
* @license lucide-react v0.427.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*)
|
|
150
|
+
|
|
151
|
+
lucide-react/dist/esm/icons/pin-off.js:
|
|
152
|
+
(**
|
|
153
|
+
* @license lucide-react v0.427.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*)
|
|
158
|
+
|
|
159
|
+
lucide-react/dist/esm/icons/pin.js:
|
|
160
|
+
(**
|
|
161
|
+
* @license lucide-react v0.427.0 - ISC
|
|
162
|
+
*
|
|
163
|
+
* This source code is licensed under the ISC license.
|
|
164
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
+
*)
|
|
166
|
+
|
|
167
|
+
lucide-react/dist/esm/icons/x.js:
|
|
168
|
+
(**
|
|
169
|
+
* @license lucide-react v0.427.0 - ISC
|
|
170
|
+
*
|
|
171
|
+
* This source code is licensed under the ISC license.
|
|
172
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
173
|
+
*)
|
|
174
|
+
|
|
175
|
+
lucide-react/dist/esm/lucide-react.js:
|
|
176
|
+
(**
|
|
177
|
+
* @license lucide-react v0.427.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*)
|
|
182
|
+
|
|
183
|
+
@tanstack/react-table-devtools/build/lib/index.mjs:
|
|
184
|
+
(**
|
|
185
|
+
* react-table-devtools
|
|
186
|
+
*
|
|
187
|
+
* Copyright (c) TanStack
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the MIT license found in the
|
|
190
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
191
|
+
*
|
|
192
|
+
* @license MIT
|
|
193
|
+
*)
|
|
194
|
+
*/
|