@marimo-team/frontend 0.24.1-dev95 → 0.24.1-dev97
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{CellStatus-BAfpiaJr.js → CellStatus-wvvZkEPY.js} +1 -1
- package/dist/assets/{JsonOutput-Bu92ihyf.js → JsonOutput-CRLQQVKf.js} +1 -1
- package/dist/assets/{MarimoErrorOutput-B6VFcCOD.js → MarimoErrorOutput-CeUo5oka.js} +1 -1
- package/dist/assets/{RenderHTML-Cqn8OKqJ.js → RenderHTML-YkwVPe9V.js} +1 -1
- package/dist/assets/{RunButton-CjlJVYRU.js → RunButton-BaV8A-z4.js} +1 -1
- package/dist/assets/{add-cell-with-ai-CoNAy8Wk.js → add-cell-with-ai-DoLkfzYn.js} +1 -1
- package/dist/assets/add-connection-dialog-C1IF1nR0.js +166 -0
- package/dist/assets/{agent-panel-BsUX99c5.js → agent-panel-CG154QrU.js} +1 -1
- package/dist/assets/{ai-model-dropdown-jajg9hms.js → ai-model-dropdown-CrSrb8Zz.js} +1 -1
- package/dist/assets/{app-config-button-CHcCBh-B.js → app-config-button-ktBH1pEB.js} +1 -1
- package/dist/assets/{blob-kift6pGB.js → blob-DVtvZmWH.js} +1 -1
- package/dist/assets/{cell-editor-ByVa98Tu.js → cell-editor-BJfeuqKX.js} +1 -1
- package/dist/assets/{cell-link-CnfnwA6v.js → cell-link-Dqqt6Rgs.js} +1 -1
- package/dist/assets/{cells-BEcungGa.js → cells-D4RwofRx.js} +1 -1
- package/dist/assets/{chat-display-CL_JFB9v.js → chat-display-COmzHgx5.js} +1 -1
- package/dist/assets/{chat-panel-CSzekzAv.js → chat-panel-B2tyEfGW.js} +1 -1
- package/dist/assets/{chat-ui-C1eAy9FG.js → chat-ui-B5bsr-7V.js} +1 -1
- package/dist/assets/{column-preview-BZX77DV6.js → column-preview-CW5DPFvy.js} +1 -1
- package/dist/assets/{command-palette-56SvxMFF.js → command-palette-BcOasAqL.js} +1 -1
- package/dist/assets/{common-fL5LEOMt.js → common-CC3tuCpi.js} +1 -1
- package/dist/assets/{components-BtTyGydI.js → components-D02ZZZMP.js} +1 -1
- package/dist/assets/{datasource-uyI476er.js → datasource-Do8f2hFf.js} +1 -1
- package/dist/assets/{dependency-graph-panel-DQ6IwmNu.js → dependency-graph-panel-Dg-tUB9T.js} +1 -1
- package/dist/assets/{documentation-panel-ChxeMQDj.js → documentation-panel-DvHjxlli.js} +1 -1
- package/dist/assets/{download-Dv0iO8M_.js → download-BP8MrprC.js} +1 -1
- package/dist/assets/{edit-page-B1Vy-UvZ.js → edit-page-CdZC5ONw.js} +4 -4
- package/dist/assets/{error-entries-B5GaQ2cq.js → error-entries-DOZ1u97X.js} +1 -1
- package/dist/assets/{error-panel-D_YO8QtX.js → error-panel-CINcf76Z.js} +1 -1
- package/dist/assets/{file-explorer-panel-1JRkBA_A.js → file-explorer-panel-cflxW8a7.js} +1 -1
- package/dist/assets/{file-icons-D18ZIT8U.js → file-icons-DgKj9mrV.js} +1 -1
- package/dist/assets/{file-name-input-Dp8aYmEH.js → file-name-input-CQF4Ovwx.js} +1 -1
- package/dist/assets/{floating-outline-B14J6Uv7.js → floating-outline-CRXIsrPm.js} +1 -1
- package/dist/assets/{home-page-CoMZwM0i.js → home-page-DPRHPAQM.js} +1 -1
- package/dist/assets/{index-B6Nvcqin.js → index-DN1JMd0-.js} +4 -4
- package/dist/assets/{layout-FSOVn_sw.js → layout-CoCSL4MU.js} +3 -3
- package/dist/assets/{logs-panel-BwA2j1LD.js → logs-panel-DFibPeCT.js} +1 -1
- package/dist/assets/{markdown-renderer-IN72oVfj.js → markdown-renderer-CdZX2MvM.js} +1 -1
- package/dist/assets/{name-cell-input-BOFMaTa1.js → name-cell-input-B-d5Jwh4.js} +1 -1
- package/dist/assets/{outline-panel-xZQU-sfs.js → outline-panel-D2Wk10hY.js} +1 -1
- package/dist/assets/{packages-panel-gfl3Dnuj.js → packages-panel-CQsbxIlG.js} +1 -1
- package/dist/assets/{panel-accordion-state-BBB6Kqr-.js → panel-accordion-state-D6-FMXE2.js} +1 -1
- package/dist/assets/{panels-mouc5Y1Z.js → panels--lkNflNC.js} +1 -1
- package/dist/assets/{process-output-C-rOBNl7.js → process-output-DvTtgoMs.js} +1 -1
- package/dist/assets/{readonly-code-display-fUSnJEhE.js → readonly-code-display-BvqLeUsJ.js} +1 -1
- package/dist/assets/{readonly-python-code-C2BktOKY.js → readonly-python-code-GSN4D4sb.js} +1 -1
- package/dist/assets/{reveal-component-CsovRN4m.js → reveal-component-BuGlRY79.js} +1 -1
- package/dist/assets/{run-page-CRcnkzFj.js → run-page-DaS9kH4f.js} +1 -1
- package/dist/assets/{scratchpad-panel-BkqXEAfy.js → scratchpad-panel-C2QyAZqH.js} +1 -1
- package/dist/assets/{session-panel-CnIUsX9O.js → session-panel-C_N3WGWQ.js} +1 -1
- package/dist/assets/{skeleton-7uu6KXmn.js → skeleton-12JqAMmp.js} +1 -1
- package/dist/assets/{snippets-panel-BoziU8SV.js → snippets-panel-BxwHsPmW.js} +1 -1
- package/dist/assets/{state-DNIOp9vd.js → state-BqrF--O0.js} +1 -1
- package/dist/assets/{state-DaMe_1Uy.js → state-CHplO0zn.js} +1 -1
- package/dist/assets/{tracing-COpxb-Up.js → tracing-Dhq121dR.js} +1 -1
- package/dist/assets/{tracing-panel-DnNQLsh8.js → tracing-panel-IKt1933_.js} +2 -2
- package/dist/assets/{tree-actions-CjTwlxy1.js → tree-actions-DIfWonCA.js} +1 -1
- package/dist/assets/{useAddCell-ZP7MPBcM.js → useAddCell-BYrVaYfZ.js} +1 -1
- package/dist/assets/{useCellActionButton-va5-Bjgq.js → useCellActionButton-DbXDs0MA.js} +1 -1
- package/dist/assets/{useDeleteCell-CuEKdiht.js → useDeleteCell-Wgcl3CRG.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-DDQx4yD6.js → useDependencyPanelTab-C5AU8GKL.js} +1 -1
- package/dist/assets/useNotebookActions-DQQplV7z.js +10 -0
- package/dist/assets/{useRunCells-DccIcaY0.js → useRunCells-DTdMRbkE.js} +1 -1
- package/dist/assets/{useSplitCell-CoAAhbPs.js → useSplitCell-2z0zEB8X.js} +1 -1
- package/dist/assets/vega-component-BSXJcTJb.js +1 -0
- package/dist/index.html +19 -19
- package/package.json +1 -1
- package/src/components/editor/actions/__tests__/types.test.ts +44 -0
- package/src/components/editor/actions/useNotebookActions.tsx +16 -0
- package/src/components/editor/chrome/types.ts +1 -1
- package/src/components/editor/connections/database/add-database-form.tsx +4 -0
- package/src/components/editor/connections/storage/add-storage-form.tsx +6 -0
- package/src/plugins/impl/vega/__tests__/__snapshots__/make-selectable.test.ts.snap +185 -185
- package/src/plugins/impl/vega/__tests__/make-selectable.test.ts +78 -2
- package/src/plugins/impl/vega/params.ts +26 -10
- package/src/plugins/impl/vega/vega-component.tsx +7 -2
- package/dist/assets/add-connection-dialog-D28GcLwH.js +0 -166
- package/dist/assets/useNotebookActions-DEBmnVAR.js +0 -10
- package/dist/assets/vega-component-Bel2PDO-.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e,t}from"./rolldown-runtime-B0Z9INg1.js";import{a as n,c as r,d as i,f as a,l as o,r as s,t as c}from"./useEvent-xfs0Sn4r.js";import{t as l}from"./react-CBDbhulC.js";import{Co as u,D as d,Ga as f,Hi as p,Hn as m,Kt as h,Mo as g,No as _,Qi as v,Za as y,b,da as x,do as ee,ea as te,f as ne,ha as re,ho as ie,ii as ae,ji as oe,ma as se,rr as ce,rt as S,si as le,ur as ue,vt as de,wo as fe,xo as pe}from"./cells-
|
|
1
|
+
import{a as e,t}from"./rolldown-runtime-B0Z9INg1.js";import{a as n,c as r,d as i,f as a,l as o,r as s,t as c}from"./useEvent-xfs0Sn4r.js";import{t as l}from"./react-CBDbhulC.js";import{Co as u,D as d,Ga as f,Hi as p,Hn as m,Kt as h,Mo as g,No as _,Qi as v,Za as y,b,da as x,do as ee,ea as te,f as ne,ha as re,ho as ie,ii as ae,ji as oe,ma as se,rr as ce,rt as S,si as le,ur as ue,vt as de,wo as fe,xo as pe}from"./cells-D4RwofRx.js";import{Cn as C,Cr as me,In as w,It as he,Jn as T,Sn as ge,Tt as E,Yn as D,bt as _e,cn as ve,jn as O,kt as k,lc as ye,ln as A,mr as be,un as j,vn as M,vt as xe,xt as Se,zt as Ce}from"./schemas-aTUejmFi.js";import{t as we}from"./compiler-runtime-CYIjoINj.js";import{n as Te}from"./utils-CWSZQEjr.js";import{k as Ee,t as De}from"./ai-model-dropdown-CrSrb8Zz.js";import{f as Oe,g as N}from"./useEventListener-D27Dii_l.js";import{o as ke}from"./config-D4frVGQ4.js";import{t as Ae}from"./cn-ldLVeaqm.js";import{t as je}from"./jsx-runtime-B74pBk57.js";import{a as Me,c as Ne,p as Pe,r as Fe,t as Ie}from"./dropdown-menu-CqNabM1f.js";import{t as Le}from"./tooltip-D7dq6bnc.js";import{t as Re}from"./button-Btj6GXNy.js";import{Gt as ze,Qt as Be,Tt as Ve,Wt as He,Zt as Ue,at as We,dt as Ge,en as Ke,qt as qe,st as Je,ut as Ye,wt as Xe}from"./dist-PIe1xcZo.js";import{t as Ze}from"./createReducer-Bq-nQJiK.js";import{h as Qe,n as $e,o as et,r as tt}from"./dist-Dz_04liz.js";import{t as nt}from"./requests-C6_IaFh7.js";import{t as rt}from"./createLucideIcon-B7HeEoG2.js";import{r as it,t as at}from"./fileToBase64-NhpNrK5l.js";import{r as ot}from"./useNumberFormatter-DHJ9s6Vk.js";import{f as st,n as ct}from"./markdown-renderer-CdZX2MvM.js";import{t as lt}from"./file-DF8n85RA.js";import{t as ut}from"./image-ab13yGv4.js";import{t as dt}from"./spinner-Ck-Hgfvj.js";import{i as ft,t as pt}from"./useDeleteCell-Wgcl3CRG.js";import{r as mt}from"./input-Daz6sk8l.js";import{a as ht,c as gt,i as _t,n as vt,o as yt,s as bt,t as xt}from"./datasource-Do8f2hFf.js";import{a as St}from"./dist-DCc0VfiO.js";import{t as Ct}from"./uuid-k9DpjH68.js";import{t as wt}from"./use-toast-DpWHUGuF.js";import{a as Tt}from"./session-CEdta5_Q.js";import{r as Et}from"./useTheme-CF-zG9YH.js";import{n as Dt}from"./useRunCells-DTdMRbkE.js";import{n as Ot}from"./blob-DVtvZmWH.js";import{a as kt}from"./errors-DzO-nXy-.js";import{r as At,t as jt}from"./esm-Dw0vvSg2.js";import{i as Mt}from"./cell-link-Dqqt6Rgs.js";import{t as Nt}from"./html-to-image-DMn_7CCA.js";import{n as Pt}from"./renderShortcut-DK_OucLT.js";import{n as Ft}from"./icons-CjLa9BiH.js";import{t as It}from"./process-output-DvTtgoMs.js";import{i as Lt,r as Rt,t as zt}from"./error-entries-DOZ1u97X.js";var Bt=rt(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),Vt=rt(`paperclip`,[[`path`,{d:`m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551`,key:`1miecu`}]]),Ht=rt(`send-horizontal`,[[`path`,{d:`M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z`,key:`117uat`}],[`path`,{d:`M6 12h16`,key:`s4cdu5`}]]),P=we(),Ut=`vercel.ai.error`,Wt=Symbol.for(Ut),Gt,Kt,qt=class e extends (Kt=Error,Gt=Wt,Kt){constructor({name:e,message:t,cause:n}){super(t),this[Gt]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,Ut)}static hasMarker(e,t){let n=Symbol.for(t);return typeof e==`object`&&!!e&&n in e&&typeof e[n]==`boolean`&&e[n]===!0}};function Jt(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.toString():JSON.stringify(e)}var Yt=`AI_InvalidArgumentError`,Xt=`vercel.ai.error.${Yt}`,Zt=Symbol.for(Xt),Qt,$t,en=class extends ($t=qt,Qt=Zt,$t){constructor({message:e,cause:t,argument:n}){super({name:Yt,message:e,cause:t}),this[Qt]=!0,this.argument=n}static isInstance(e){return qt.hasMarker(e,Xt)}},tn=`AI_JSONParseError`,nn=`vercel.ai.error.${tn}`,rn=Symbol.for(nn),an,on,sn=class extends (on=qt,an=rn,on){constructor({text:e,cause:t}){super({name:tn,message:`JSON parsing failed: Text: ${e}.
|
|
2
2
|
Error message: ${Jt(t)}`,cause:t}),this[an]=!0,this.text=e}static isInstance(e){return qt.hasMarker(e,nn)}},cn=`AI_TypeValidationError`,ln=`vercel.ai.error.${cn}`,un=Symbol.for(ln),dn,fn,pn=class e extends (fn=qt,dn=un,fn){constructor({value:e,cause:t,context:n}){let r=`Type validation failed`;if(n?.field&&(r+=` for ${n.field}`),n?.entityName||n?.entityId){r+=` (`;let e=[];n.entityName&&e.push(n.entityName),n.entityId&&e.push(`id: "${n.entityId}"`),r+=e.join(`, `),r+=`)`}super({name:cn,message:`${r}: Value: ${JSON.stringify(e)}.
|
|
3
3
|
Error message: ${Jt(t)}`,cause:t}),this[dn]=!0,this.value=e,this.context=n}static isInstance(e){return qt.hasMarker(e,ln)}static wrap({value:t,cause:n,context:r}){return e.isInstance(n)&&n.value===t&&n.context?.field===r?.field&&n.context?.entityName===r?.entityName&&n.context?.entityId===r?.entityId?n:new e({value:t,cause:n,context:r})}},F;(function(e){e.assertEqual=e=>{};function t(e){}e.assertIs=t;function n(e){throw Error()}e.assertNever=n,e.arrayToEnum=e=>{let t={};for(let n of e)t[n]=n;return t},e.getValidEnumValues=t=>{let n=e.objectKeys(t).filter(e=>typeof t[t[e]]!=`number`),r={};for(let e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys=typeof Object.keys==`function`?e=>Object.keys(e):e=>{let t=[];for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(let n of e)if(t(n))return n},e.isInteger=typeof Number.isInteger==`function`?e=>Number.isInteger(e):e=>typeof e==`number`&&Number.isFinite(e)&&Math.floor(e)===e;function r(e,t=` | `){return e.map(e=>typeof e==`string`?`'${e}'`:e).join(t)}e.joinValues=r,e.jsonStringifyReplacer=(e,t)=>typeof t==`bigint`?t.toString():t})(F||={});var mn;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(mn||={});var I=F.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),hn=e=>{switch(typeof e){case`undefined`:return I.undefined;case`string`:return I.string;case`number`:return Number.isNaN(e)?I.nan:I.number;case`boolean`:return I.boolean;case`function`:return I.function;case`bigint`:return I.bigint;case`symbol`:return I.symbol;case`object`:return Array.isArray(e)?I.array:e===null?I.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?I.promise:typeof Map<`u`&&e instanceof Map?I.map:typeof Set<`u`&&e instanceof Set?I.set:typeof Date<`u`&&e instanceof Date?I.date:I.object;default:return I.unknown}},L=F.arrayToEnum([`invalid_type`,`invalid_literal`,`custom`,`invalid_union`,`invalid_union_discriminator`,`invalid_enum_value`,`unrecognized_keys`,`invalid_arguments`,`invalid_return_type`,`invalid_date`,`invalid_string`,`too_small`,`too_big`,`invalid_intersection_types`,`not_multiple_of`,`not_finite`]),gn=class e extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name=`ZodError`,this.issues=e}format(e){let t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(let i of e.issues)if(i.code===`invalid_union`)i.unionErrors.map(r);else if(i.code===`invalid_return_type`)r(i.returnTypeError);else if(i.code===`invalid_arguments`)r(i.argumentsError);else if(i.path.length===0)n._errors.push(t(i));else{let e=n,r=0;for(;r<i.path.length;){let n=i.path[r];r===i.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(i))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}static assert(t){if(!(t instanceof e))throw Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,F.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=e=>e.message){let t=Object.create(null),n=[];for(let r of this.issues)if(r.path.length>0){let n=r.path[0];t[n]=t[n]||[],t[n].push(e(r))}else n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}};gn.create=e=>new gn(e);var _n=(e,t)=>{let n;switch(e.code){case L.invalid_type:n=e.received===I.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case L.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,F.jsonStringifyReplacer)}`;break;case L.unrecognized_keys:n=`Unrecognized key(s) in object: ${F.joinValues(e.keys,`, `)}`;break;case L.invalid_union:n=`Invalid input`;break;case L.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${F.joinValues(e.options)}`;break;case L.invalid_enum_value:n=`Invalid enum value. Expected ${F.joinValues(e.options)}, received '${e.received}'`;break;case L.invalid_arguments:n=`Invalid function arguments`;break;case L.invalid_return_type:n=`Invalid function return type`;break;case L.invalid_date:n=`Invalid date`;break;case L.invalid_string:typeof e.validation==`object`?`includes`in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position==`number`&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):`startsWith`in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:`endsWith`in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:F.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case L.too_small:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at least`:`more than`} ${e.minimum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at least`:`over`} ${e.minimum} character(s)`:e.type===`number`||e.type===`bigint`?`Number must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${e.minimum}`:e.type===`date`?`Date must be ${e.exact?`exactly equal to `:e.inclusive?`greater than or equal to `:`greater than `}${new Date(Number(e.minimum))}`:`Invalid input`;break;case L.too_big:n=e.type===`array`?`Array must contain ${e.exact?`exactly`:e.inclusive?`at most`:`less than`} ${e.maximum} element(s)`:e.type===`string`?`String must contain ${e.exact?`exactly`:e.inclusive?`at most`:`under`} ${e.maximum} character(s)`:e.type===`number`?`Number must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`bigint`?`BigInt must be ${e.exact?`exactly`:e.inclusive?`less than or equal to`:`less than`} ${e.maximum}`:e.type===`date`?`Date must be ${e.exact?`exactly`:e.inclusive?`smaller than or equal to`:`smaller than`} ${new Date(Number(e.maximum))}`:`Invalid input`;break;case L.custom:n=`Invalid input`;break;case L.invalid_intersection_types:n=`Intersection results could not be merged`;break;case L.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case L.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,F.assertNever(e)}return{message:n}},vn=_n;function yn(){return vn}var bn=e=>{let{data:t,path:n,errorMaps:r,issueData:i}=e,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s=``,c=r.filter(e=>!!e).slice().reverse();for(let e of c)s=e(o,{data:t,defaultError:s}).message;return{...i,path:a,message:s}};function R(e,t){let n=yn(),r=bn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===_n?void 0:_n].filter(e=>!!e)});e.common.issues.push(r)}var z=class e{constructor(){this.value=`valid`}dirty(){this.value===`valid`&&(this.value=`dirty`)}abort(){this.value!==`aborted`&&(this.value=`aborted`)}static mergeArray(e,t){let n=[];for(let r of t){if(r.status===`aborted`)return B;r.status===`dirty`&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(t,n){let r=[];for(let e of n){let t=await e.key,n=await e.value;r.push({key:t,value:n})}return e.mergeObjectSync(t,r)}static mergeObjectSync(e,t){let n={};for(let r of t){let{key:t,value:i}=r;if(t.status===`aborted`||i.status===`aborted`)return B;t.status===`dirty`&&e.dirty(),i.status===`dirty`&&e.dirty(),t.value!==`__proto__`&&(i.value!==void 0||r.alwaysSet)&&(n[t.value]=i.value)}return{status:e.value,value:n}}},B=Object.freeze({status:`aborted`}),xn=e=>({status:`dirty`,value:e}),V=e=>({status:`valid`,value:e}),Sn=e=>e.status===`aborted`,Cn=e=>e.status===`dirty`,wn=e=>e.status===`valid`,Tn=e=>typeof Promise<`u`&&e instanceof Promise,H;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(H||={});var En=class{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Dn=(e,t)=>{if(wn(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error(`Validation failed but no issues detected.`);return{success:!1,get error(){if(this._error)return this._error;let t=new gn(e.common.issues);return this._error=t,this._error}}};function U(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:i}=e;if(t&&(n||r))throw Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:i}:{errorMap:(t,i)=>{let{message:a}=e;return t.code===`invalid_enum_value`?{message:a??i.defaultError}:i.data===void 0?{message:a??r??i.defaultError}:t.code===`invalid_type`?{message:a??n??i.defaultError}:{message:i.defaultError}},description:i}}var W=class{get description(){return this._def.description}_getType(e){return hn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:hn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new z,ctx:{common:e.parent.common,data:e.data,parsedType:hn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(Tn(t))throw Error(`Synchronous parse encountered promise.`);return t}_parseAsync(e){let t=this._parse(e);return Promise.resolve(t)}parse(e,t){let n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){let n={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hn(e)};return Dn(n,this._parseSync({data:e,path:n.path,parent:n}))}"~validate"(e){let t={common:{issues:[],async:!!this[`~standard`].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hn(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return wn(n)?{value:n.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes(`encountered`)&&(this[`~standard`].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>wn(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){let n={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:hn(e)},r=this._parse({data:e,path:n.path,parent:n});return Dn(n,await(Tn(r)?r:Promise.resolve(r)))}refine(e,t){let n=e=>typeof t==`string`||t===void 0?{message:t}:typeof t==`function`?t(e):t;return this._refinement((t,r)=>{let i=e(t),a=()=>r.addIssue({code:L.custom,...n(t)});return typeof Promise<`u`&&i instanceof Promise?i.then(e=>e?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,t){return this._refinement((n,r)=>e(n)?!0:(r.addIssue(typeof t==`function`?t(n,r):t),!1))}_refinement(e){return new Ar({schema:this,typeName:G.ZodEffects,effect:{type:`refinement`,refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this[`~standard`]={version:1,vendor:`zod`,validate:e=>this[`~validate`](e)}}optional(){return jr.create(this,this._def)}nullable(){return Mr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return dr.create(this)}promise(){return kr.create(this,this._def)}or(e){return mr.create([this,e],this._def)}and(e){return vr.create(this,e,this._def)}transform(e){return new Ar({...U(this._def),schema:this,typeName:G.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new Nr({...U(this._def),innerType:this,defaultValue:t,typeName:G.ZodDefault})}brand(){return new Ir({typeName:G.ZodBranded,type:this,...U(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Pr({...U(this._def),innerType:this,catchValue:t,typeName:G.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Lr.create(this,e)}readonly(){return Rr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},On=/^c[^\s-]{8,}$/i,kn=/^[0-9a-z]+$/,An=/^[0-9A-HJKMNP-TV-Z]{26}$/i,jn=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Mn=/^[a-z0-9_-]{21}$/i,Nn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Pn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Fn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,In=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Ln,Rn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,zn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Bn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Vn=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Hn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Un=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Wn=`((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`,Gn=RegExp(`^${Wn}$`);function Kn(e){let t=`[0-5]\\d`;e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision??(t=`${t}(\\.\\d+)?`);let n=e.precision?`+`:`?`;return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${n}`}function qn(e){return RegExp(`^${Kn(e)}$`)}function Jn(e){let t=`${Wn}T${Kn(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Yn(e,t){return!!((t===`v4`||!t)&&Rn.test(e)||(t===`v6`||!t)&&Bn.test(e))}function Xn(e,t){if(!Nn.test(e))return!1;try{let[n]=e.split(`.`);if(!n)return!1;let r=n.replace(/-/g,`+`).replace(/_/g,`/`).padEnd(n.length+(4-n.length%4)%4,`=`),i=JSON.parse(atob(r));return!(typeof i!=`object`||!i||`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&i.alg!==t)}catch{return!1}}function Zn(e,t){return!!((t===`v4`||!t)&&zn.test(e)||(t===`v6`||!t)&&Vn.test(e))}var Qn=class e extends W{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==I.string){let t=this._getOrReturnCtx(e);return R(t,{code:L.invalid_type,expected:I.string,received:t.parsedType}),B}let t=new z,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),R(n,{code:L.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`max`)e.data.length>r.value&&(n=this._getOrReturnCtx(e,n),R(n,{code:L.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!1,message:r.message}),t.dirty());else if(r.kind===`length`){let i=e.data.length>r.value,a=e.data.length<r.value;(i||a)&&(n=this._getOrReturnCtx(e,n),i?R(n,{code:L.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&R(n,{code:L.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)Fn.test(e.data)||(n=this._getOrReturnCtx(e,n),R(n,{validation:`email`,code:L.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)Ln||=new RegExp(In,`u`),Ln.test(e.data)||(n=this._getOrReturnCtx(e,n),R(n,{validation:`emoji`,code:L.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)jn.test(e.data)||(n=this._getOrReturnCtx(e,n),R(n,{validation:`uuid`,code:L.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)Mn.test(e.data)||(n=this._getOrReturnCtx(e,n),R(n,{validation:`nanoid`,code:L.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)On.test(e.data)||(n=this._getOrReturnCtx(e,n),R(n,{validation:`cuid`,code:L.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)kn.test(e.data)||(n=this._getOrReturnCtx(e,n),R(n,{validation:`cuid2`,code:L.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)An.test(e.data)||(n=this._getOrReturnCtx(e,n),R(n,{validation:`ulid`,code:L.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),R(n,{validation:`url`,code:L.invalid_string,message:r.message}),t.dirty()}else r.kind===`regex`?(r.regex.lastIndex=0,r.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),R(n,{validation:`regex`,code:L.invalid_string,message:r.message}),t.dirty())):r.kind===`trim`?e.data=e.data.trim():r.kind===`includes`?e.data.includes(r.value,r.position)||(n=this._getOrReturnCtx(e,n),R(n,{code:L.invalid_string,validation:{includes:r.value,position:r.position},message:r.message}),t.dirty()):r.kind===`toLowerCase`?e.data=e.data.toLowerCase():r.kind===`toUpperCase`?e.data=e.data.toUpperCase():r.kind===`startsWith`?e.data.startsWith(r.value)||(n=this._getOrReturnCtx(e,n),R(n,{code:L.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),R(n,{code:L.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?Jn(r).test(e.data)||(n=this._getOrReturnCtx(e,n),R(n,{code:L.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?Gn.test(e.data)||(n=this._getOrReturnCtx(e,n),R(n,{code:L.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?qn(r).test(e.data)||(n=this._getOrReturnCtx(e,n),R(n,{code:L.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Pn.test(e.data)||(n=this._getOrReturnCtx(e,n),R(n,{validation:`duration`,code:L.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Yn(e.data,r.version)||(n=this._getOrReturnCtx(e,n),R(n,{validation:`ip`,code:L.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?Xn(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),R(n,{validation:`jwt`,code:L.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?Zn(e.data,r.version)||(n=this._getOrReturnCtx(e,n),R(n,{validation:`cidr`,code:L.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Hn.test(e.data)||(n=this._getOrReturnCtx(e,n),R(n,{validation:`base64`,code:L.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Un.test(e.data)||(n=this._getOrReturnCtx(e,n),R(n,{validation:`base64url`,code:L.invalid_string,message:r.message}),t.dirty()):F.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:L.invalid_string,...H.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...H.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...H.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...H.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...H.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...H.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...H.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...H.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...H.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...H.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...H.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...H.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...H.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...H.errToObj(e)})}datetime(e){return typeof e==`string`?this._addCheck({kind:`datetime`,precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:`datetime`,precision:e?.precision===void 0?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...H.errToObj(e?.message)})}date(e){return this._addCheck({kind:`date`,message:e})}time(e){return typeof e==`string`?this._addCheck({kind:`time`,precision:null,message:e}):this._addCheck({kind:`time`,precision:e?.precision===void 0?null:e?.precision,...H.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...H.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...H.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...H.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...H.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...H.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...H.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...H.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...H.errToObj(t)})}nonempty(e){return this.min(1,H.errToObj(e))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:`trim`}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toLowerCase`}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:`toUpperCase`}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind===`datetime`)}get isDate(){return!!this._def.checks.find(e=>e.kind===`date`)}get isTime(){return!!this._def.checks.find(e=>e.kind===`time`)}get isDuration(){return!!this._def.checks.find(e=>e.kind===`duration`)}get isEmail(){return!!this._def.checks.find(e=>e.kind===`email`)}get isURL(){return!!this._def.checks.find(e=>e.kind===`url`)}get isEmoji(){return!!this._def.checks.find(e=>e.kind===`emoji`)}get isUUID(){return!!this._def.checks.find(e=>e.kind===`uuid`)}get isNANOID(){return!!this._def.checks.find(e=>e.kind===`nanoid`)}get isCUID(){return!!this._def.checks.find(e=>e.kind===`cuid`)}get isCUID2(){return!!this._def.checks.find(e=>e.kind===`cuid2`)}get isULID(){return!!this._def.checks.find(e=>e.kind===`ulid`)}get isIP(){return!!this._def.checks.find(e=>e.kind===`ip`)}get isCIDR(){return!!this._def.checks.find(e=>e.kind===`cidr`)}get isBase64(){return!!this._def.checks.find(e=>e.kind===`base64`)}get isBase64url(){return!!this._def.checks.find(e=>e.kind===`base64url`)}get minLength(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};Qn.create=e=>new Qn({checks:[],typeName:G.ZodString,coerce:e?.coerce??!1,...U(e)});function $n(e,t){let n=(e.toString().split(`.`)[1]||``).length,r=(t.toString().split(`.`)[1]||``).length,i=n>r?n:r;return Number.parseInt(e.toFixed(i).replace(`.`,``))%Number.parseInt(t.toFixed(i).replace(`.`,``))/10**i}var er=class e extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==I.number){let t=this._getOrReturnCtx(e);return R(t,{code:L.invalid_type,expected:I.number,received:t.parsedType}),B}let t,n=new z;for(let r of this._def.checks)r.kind===`int`?F.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),R(t,{code:L.invalid_type,expected:`integer`,received:`float`,message:r.message}),n.dirty()):r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),R(t,{code:L.too_small,minimum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),R(t,{code:L.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?$n(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),R(t,{code:L.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),R(t,{code:L.not_finite,message:r.message}),n.dirty()):F.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,H.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,H.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,H.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,H.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:H.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:H.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:H.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:H.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:H.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:H.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:H.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind===`int`||e.kind===`multipleOf`&&F.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let n of this._def.checks)if(n.kind===`finite`||n.kind===`int`||n.kind===`multipleOf`)return!0;else n.kind===`min`?(t===null||n.value>t)&&(t=n.value):n.kind===`max`&&(e===null||n.value<e)&&(e=n.value);return Number.isFinite(t)&&Number.isFinite(e)}};er.create=e=>new er({checks:[],typeName:G.ZodNumber,coerce:e?.coerce||!1,...U(e)});var tr=class e extends W{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==I.bigint)return this._getInvalidInput(e);let t,n=new z;for(let r of this._def.checks)r.kind===`min`?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),R(t,{code:L.too_small,type:`bigint`,minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`max`?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),R(t,{code:L.too_big,type:`bigint`,maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):r.kind===`multipleOf`?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),R(t,{code:L.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):F.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return R(t,{code:L.invalid_type,expected:I.bigint,received:t.parsedType}),B}gte(e,t){return this.setLimit(`min`,e,!0,H.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,H.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,H.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,H.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:H.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!1,message:H.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:H.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:H.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:H.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:H.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e}};tr.create=e=>new tr({checks:[],typeName:G.ZodBigInt,coerce:e?.coerce??!1,...U(e)});var nr=class extends W{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==I.boolean){let t=this._getOrReturnCtx(e);return R(t,{code:L.invalid_type,expected:I.boolean,received:t.parsedType}),B}return V(e.data)}};nr.create=e=>new nr({typeName:G.ZodBoolean,coerce:e?.coerce||!1,...U(e)});var rr=class e extends W{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==I.date){let t=this._getOrReturnCtx(e);return R(t,{code:L.invalid_type,expected:I.date,received:t.parsedType}),B}if(Number.isNaN(e.data.getTime()))return R(this._getOrReturnCtx(e),{code:L.invalid_date}),B;let t=new z,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),R(n,{code:L.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:`date`}),t.dirty()):r.kind===`max`?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),R(n,{code:L.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):F.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(e,t){return this._addCheck({kind:`min`,value:e.getTime(),message:H.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:H.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)t.kind===`min`&&(e===null||t.value>e)&&(e=t.value);return e==null?null:new Date(e)}get maxDate(){let e=null;for(let t of this._def.checks)t.kind===`max`&&(e===null||t.value<e)&&(e=t.value);return e==null?null:new Date(e)}};rr.create=e=>new rr({checks:[],coerce:e?.coerce||!1,typeName:G.ZodDate,...U(e)});var ir=class extends W{_parse(e){if(this._getType(e)!==I.symbol){let t=this._getOrReturnCtx(e);return R(t,{code:L.invalid_type,expected:I.symbol,received:t.parsedType}),B}return V(e.data)}};ir.create=e=>new ir({typeName:G.ZodSymbol,...U(e)});var ar=class extends W{_parse(e){if(this._getType(e)!==I.undefined){let t=this._getOrReturnCtx(e);return R(t,{code:L.invalid_type,expected:I.undefined,received:t.parsedType}),B}return V(e.data)}};ar.create=e=>new ar({typeName:G.ZodUndefined,...U(e)});var or=class extends W{_parse(e){if(this._getType(e)!==I.null){let t=this._getOrReturnCtx(e);return R(t,{code:L.invalid_type,expected:I.null,received:t.parsedType}),B}return V(e.data)}};or.create=e=>new or({typeName:G.ZodNull,...U(e)});var sr=class extends W{constructor(){super(...arguments),this._any=!0}_parse(e){return V(e.data)}};sr.create=e=>new sr({typeName:G.ZodAny,...U(e)});var cr=class extends W{constructor(){super(...arguments),this._unknown=!0}_parse(e){return V(e.data)}};cr.create=e=>new cr({typeName:G.ZodUnknown,...U(e)});var lr=class extends W{_parse(e){let t=this._getOrReturnCtx(e);return R(t,{code:L.invalid_type,expected:I.never,received:t.parsedType}),B}};lr.create=e=>new lr({typeName:G.ZodNever,...U(e)});var ur=class extends W{_parse(e){if(this._getType(e)!==I.undefined){let t=this._getOrReturnCtx(e);return R(t,{code:L.invalid_type,expected:I.void,received:t.parsedType}),B}return V(e.data)}};ur.create=e=>new ur({typeName:G.ZodVoid,...U(e)});var dr=class e extends W{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==I.array)return R(t,{code:L.invalid_type,expected:I.array,received:t.parsedType}),B;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(R(t,{code:e?L.too_big:L.too_small,minimum:i?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:`array`,inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(r.minLength!==null&&t.data.length<r.minLength.value&&(R(t,{code:L.too_small,minimum:r.minLength.value,type:`array`,inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),r.maxLength!==null&&t.data.length>r.maxLength.value&&(R(t,{code:L.too_big,maximum:r.maxLength.value,type:`array`,inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map((e,n)=>r.type._parseAsync(new En(t,e,t.path,n)))).then(e=>z.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new En(t,e,t.path,n)));return z.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:H.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:H.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:H.toString(n)}})}nonempty(e){return this.min(1,e)}};dr.create=(e,t)=>new dr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:G.ZodArray,...U(t)});function fr(e){if(e instanceof pr){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=jr.create(fr(r))}return new pr({...e._def,shape:()=>t})}return e instanceof dr?new dr({...e._def,type:fr(e.element)}):e instanceof jr?jr.create(fr(e.unwrap())):e instanceof Mr?Mr.create(fr(e.unwrap())):e instanceof yr?yr.create(e.items.map(e=>fr(e))):e}var pr=class e extends W{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),t=F.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==I.object){let t=this._getOrReturnCtx(e);return R(t,{code:L.invalid_type,expected:I.object,received:t.parsedType}),B}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof lr&&this._def.unknownKeys===`strip`))for(let e in n.data)i.includes(e)||a.push(e);let o=[];for(let e of i){let t=r[e],i=n.data[e];o.push({key:{status:`valid`,value:e},value:t._parse(new En(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof lr){let e=this._def.unknownKeys;if(e===`passthrough`)for(let e of a)o.push({key:{status:`valid`,value:e},value:{status:`valid`,value:n.data[e]}});else if(e===`strict`)a.length>0&&(R(n,{code:L.unrecognized_keys,keys:a}),t.dirty());else if(e!==`strip`)throw Error(`Internal ZodObject error: invalid unknownKeys value.`)}else{let e=this._def.catchall;for(let t of a){let r=n.data[t];o.push({key:{status:`valid`,value:t},value:e._parse(new En(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of o){let n=await t.key,r=await t.value;e.push({key:n,value:r,alwaysSet:t.alwaysSet})}return e}).then(e=>z.mergeObjectSync(t,e)):z.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return H.errToObj,new e({...this._def,unknownKeys:`strict`,...t===void 0?{}:{errorMap:(e,n)=>{let r=this._def.errorMap?.(e,n).message??n.defaultError;return e.code===`unrecognized_keys`?{message:H.errToObj(t).message??r}:{message:r}}}})}strip(){return new e({...this._def,unknownKeys:`strip`})}passthrough(){return new e({...this._def,unknownKeys:`passthrough`})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:G.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};for(let e of F.objectKeys(t))t[e]&&this.shape[e]&&(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}omit(t){let n={};for(let e of F.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return fr(this)}partial(t){let n={};for(let e of F.objectKeys(this.shape)){let r=this.shape[e];n[e]=t&&!t[e]?r:r.optional()}return new e({...this._def,shape:()=>n})}required(t){let n={};for(let e of F.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof jr;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Er(F.objectKeys(this.shape))}};pr.create=(e,t)=>new pr({shape:()=>e,unknownKeys:`strip`,catchall:lr.create(),typeName:G.ZodObject,...U(t)}),pr.strictCreate=(e,t)=>new pr({shape:()=>e,unknownKeys:`strict`,catchall:lr.create(),typeName:G.ZodObject,...U(t)}),pr.lazycreate=(e,t)=>new pr({shape:e,unknownKeys:`strip`,catchall:lr.create(),typeName:G.ZodObject,...U(t)});var mr=class extends W{_parse(e){let{ctx:t}=this._processInputParams(e),n=this._def.options;function r(e){for(let t of e)if(t.result.status===`valid`)return t.result;for(let n of e)if(n.result.status===`dirty`)return t.common.issues.push(...n.ctx.common.issues),n.result;let n=e.map(e=>new gn(e.ctx.common.issues));return R(t,{code:L.invalid_union,unionErrors:n}),B}if(t.common.async)return Promise.all(n.map(async e=>{let n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}})).then(r);{let e,r=[];for(let i of n){let n={...t,common:{...t.common,issues:[]},parent:null},a=i._parseSync({data:t.data,path:t.path,parent:n});if(a.status===`valid`)return a;a.status===`dirty`&&!e&&(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let i=r.map(e=>new gn(e));return R(t,{code:L.invalid_union,unionErrors:i}),B}}get options(){return this._def.options}};mr.create=(e,t)=>new mr({options:e,typeName:G.ZodUnion,...U(t)});var hr=e=>e instanceof wr?hr(e.schema):e instanceof Ar?hr(e.innerType()):e instanceof Tr?[e.value]:e instanceof Dr?e.options:e instanceof Or?F.objectValues(e.enum):e instanceof Nr?hr(e._def.innerType):e instanceof ar?[void 0]:e instanceof or?[null]:e instanceof jr?[void 0,...hr(e.unwrap())]:e instanceof Mr?[null,...hr(e.unwrap())]:e instanceof Ir||e instanceof Rr?hr(e.unwrap()):e instanceof Pr?hr(e._def.innerType):[],gr=class e extends W{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.object)return R(t,{code:L.invalid_type,expected:I.object,received:t.parsedType}),B;let n=this.discriminator,r=t.data[n],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(R(t,{code:L.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),B)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let i=new Map;for(let e of n){let n=hr(e.shape[t]);if(!n.length)throw Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let r of n){if(i.has(r))throw Error(`Discriminator property ${String(t)} has duplicate value ${String(r)}`);i.set(r,e)}}return new e({typeName:G.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...U(r)})}};function _r(e,t){let n=hn(e),r=hn(t);if(e===t)return{valid:!0,data:e};if(n===I.object&&r===I.object){let n=F.objectKeys(t),r=F.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=_r(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===I.array&&r===I.array){if(e.length!==t.length)return{valid:!1};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=_r(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}return n===I.date&&r===I.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var vr=class extends W{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Sn(e)||Sn(r))return B;let i=_r(e.value,r.value);return i.valid?((Cn(e)||Cn(r))&&t.dirty(),{status:t.value,value:i.data}):(R(n,{code:L.invalid_intersection_types}),B)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([e,t])=>r(e,t)):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};vr.create=(e,t,n)=>new vr({left:e,right:t,typeName:G.ZodIntersection,...U(n)});var yr=class e extends W{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==I.array)return R(n,{code:L.invalid_type,expected:I.array,received:n.parsedType}),B;if(n.data.length<this._def.items.length)return R(n,{code:L.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),B;!this._def.rest&&n.data.length>this._def.items.length&&(R(n,{code:L.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),t.dirty());let r=[...n.data].map((e,t)=>{let r=this._def.items[t]||this._def.rest;return r?r._parse(new En(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>z.mergeArray(t,e)):z.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};yr.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new yr({items:e,typeName:G.ZodTuple,rest:null,...U(t)})};var br=class e extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==I.object)return R(n,{code:L.invalid_type,expected:I.object,received:n.parsedType}),B;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new En(n,e,n.path,e)),value:a._parse(new En(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?z.mergeObjectAsync(t,r):z.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof W?new e({keyType:t,valueType:n,typeName:G.ZodRecord,...U(r)}):new e({keyType:Qn.create(),valueType:t,typeName:G.ZodRecord,...U(n)})}},xr=class extends W{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==I.map)return R(n,{code:L.invalid_type,expected:I.map,received:n.parsedType}),B;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new En(n,e,n.path,[a,`key`])),value:i._parse(new En(n,t,n.path,[a,`value`]))}));if(n.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let n of a){let r=await n.key,i=await n.value;if(r.status===`aborted`||i.status===`aborted`)return B;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}})}{let e=new Map;for(let n of a){let r=n.key,i=n.value;if(r.status===`aborted`||i.status===`aborted`)return B;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};xr.create=(e,t,n)=>new xr({valueType:t,keyType:e,typeName:G.ZodMap,...U(n)});var Sr=class e extends W{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==I.set)return R(n,{code:L.invalid_type,expected:I.set,received:n.parsedType}),B;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(R(n,{code:L.too_small,minimum:r.minSize.value,type:`set`,inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),r.maxSize!==null&&n.data.size>r.maxSize.value&&(R(n,{code:L.too_big,maximum:r.maxSize.value,type:`set`,inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());let i=this._def.valueType;function a(e){let n=new Set;for(let r of e){if(r.status===`aborted`)return B;r.status===`dirty`&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}let o=[...n.data.values()].map((e,t)=>i._parse(new En(n,e,n.path,t)));return n.common.async?Promise.all(o).then(e=>a(e)):a(o)}min(t,n){return new e({...this._def,minSize:{value:t,message:H.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:H.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Sr.create=(e,t)=>new Sr({valueType:e,minSize:null,maxSize:null,typeName:G.ZodSet,...U(t)});var Cr=class e extends W{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==I.function)return R(t,{code:L.invalid_type,expected:I.function,received:t.parsedType}),B;function n(e,n){return bn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,yn(),_n].filter(e=>!!e),issueData:{code:L.invalid_arguments,argumentsError:n}})}function r(e,n){return bn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,yn(),_n].filter(e=>!!e),issueData:{code:L.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof kr){let e=this;return V(async function(...t){let o=new gn([]),s=await e._def.args.parseAsync(t,i).catch(e=>{throw o.addIssue(n(t,e)),o}),c=await Reflect.apply(a,this,s);return await e._def.returns._def.type.parseAsync(c,i).catch(e=>{throw o.addIssue(r(c,e)),o})})}{let e=this;return V(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new gn([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new gn([r(s,c.error)]);return c.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:yr.create(t).rest(cr.create())})}returns(t){return new e({...this._def,returns:t})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(t,n,r){return new e({args:t||yr.create([]).rest(cr.create()),returns:n||cr.create(),typeName:G.ZodFunction,...U(r)})}},wr=class extends W{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}};wr.create=(e,t)=>new wr({getter:e,typeName:G.ZodLazy,...U(t)});var Tr=class extends W{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return R(t,{received:t.data,code:L.invalid_literal,expected:this._def.value}),B}return{status:`valid`,value:e.data}}get value(){return this._def.value}};Tr.create=(e,t)=>new Tr({value:e,typeName:G.ZodLiteral,...U(t)});function Er(e,t){return new Dr({values:e,typeName:G.ZodEnum,...U(t)})}var Dr=class e extends W{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return R(t,{expected:F.joinValues(n),received:t.parsedType,code:L.invalid_type}),B}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return R(t,{received:t.data,code:L.invalid_enum_value,options:n}),B}return V(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(t,n=this._def){return e.create(t,{...this._def,...n})}exclude(t,n=this._def){return e.create(this.options.filter(e=>!t.includes(e)),{...this._def,...n})}};Dr.create=Er;var Or=class extends W{_parse(e){let t=F.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==I.string&&n.parsedType!==I.number){let e=F.objectValues(t);return R(n,{expected:F.joinValues(e),received:n.parsedType,code:L.invalid_type}),B}if(this._cache||=new Set(F.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=F.objectValues(t);return R(n,{received:n.data,code:L.invalid_enum_value,options:e}),B}return V(e.data)}get enum(){return this._def.values}};Or.create=(e,t)=>new Or({values:e,typeName:G.ZodNativeEnum,...U(t)});var kr=class extends W{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==I.promise&&t.common.async===!1?(R(t,{code:L.invalid_type,expected:I.promise,received:t.parsedType}),B):V((t.parsedType===I.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};kr.create=(e,t)=>new kr({type:e,typeName:G.ZodPromise,...U(t)});var Ar=class extends W{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===G.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,i={addIssue:e=>{R(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),r.type===`preprocess`){let e=r.transform(n.data,i);if(n.common.async)return Promise.resolve(e).then(async e=>{if(t.value===`aborted`)return B;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?B:r.status===`dirty`||t.value===`dirty`?xn(r.value):r});{if(t.value===`aborted`)return B;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?B:r.status===`dirty`||t.value===`dirty`?xn(r.value):r}}if(r.type===`refinement`){let e=e=>{let t=r.refinement(e,i);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error(`Async refinement encountered during synchronous parse operation. Use .parseAsync instead.`);return e};if(n.common.async===!1){let r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return r.status===`aborted`?B:(r.status===`dirty`&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(n=>n.status===`aborted`?B:(n.status===`dirty`&&t.dirty(),e(n.value).then(()=>({status:t.value,value:n.value}))))}if(r.type===`transform`){if(n.common.async===!1){let e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!wn(e))return B;let a=r.transform(e.value,i);if(a instanceof Promise)throw Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);return{status:t.value,value:a}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(e=>wn(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):B)}F.assertNever(r)}};Ar.create=(e,t,n)=>new Ar({schema:e,typeName:G.ZodEffects,effect:t,...U(n)}),Ar.createWithPreprocess=(e,t,n)=>new Ar({schema:t,effect:{type:`preprocess`,transform:e},typeName:G.ZodEffects,...U(n)});var jr=class extends W{_parse(e){return this._getType(e)===I.undefined?V(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};jr.create=(e,t)=>new jr({innerType:e,typeName:G.ZodOptional,...U(t)});var Mr=class extends W{_parse(e){return this._getType(e)===I.null?V(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Mr.create=(e,t)=>new Mr({innerType:e,typeName:G.ZodNullable,...U(t)});var Nr=class extends W{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===I.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Nr.create=(e,t)=>new Nr({innerType:e,typeName:G.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...U(t)});var Pr=class extends W{_parse(e){let{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Tn(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new gn(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new gn(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Pr.create=(e,t)=>new Pr({innerType:e,typeName:G.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...U(t)});var Fr=class extends W{_parse(e){if(this._getType(e)!==I.nan){let t=this._getOrReturnCtx(e);return R(t,{code:L.invalid_type,expected:I.nan,received:t.parsedType}),B}return{status:`valid`,value:e.data}}};Fr.create=e=>new Fr({typeName:G.ZodNaN,...U(e)});var Ir=class extends W{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}},Lr=class e extends W{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?B:e.status===`dirty`?(t.dirty(),xn(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{let e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return e.status===`aborted`?B:e.status===`dirty`?(t.dirty(),{status:`dirty`,value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(t,n){return new e({in:t,out:n,typeName:G.ZodPipeline})}},Rr=class extends W{_parse(e){let t=this._def.innerType._parse(e),n=e=>(wn(e)&&(e.value=Object.freeze(e.value)),e);return Tn(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};Rr.create=(e,t)=>new Rr({innerType:e,typeName:G.ZodReadonly,...U(t)}),pr.lazycreate;var G;(function(e){e.ZodString=`ZodString`,e.ZodNumber=`ZodNumber`,e.ZodNaN=`ZodNaN`,e.ZodBigInt=`ZodBigInt`,e.ZodBoolean=`ZodBoolean`,e.ZodDate=`ZodDate`,e.ZodSymbol=`ZodSymbol`,e.ZodUndefined=`ZodUndefined`,e.ZodNull=`ZodNull`,e.ZodAny=`ZodAny`,e.ZodUnknown=`ZodUnknown`,e.ZodNever=`ZodNever`,e.ZodVoid=`ZodVoid`,e.ZodArray=`ZodArray`,e.ZodObject=`ZodObject`,e.ZodUnion=`ZodUnion`,e.ZodDiscriminatedUnion=`ZodDiscriminatedUnion`,e.ZodIntersection=`ZodIntersection`,e.ZodTuple=`ZodTuple`,e.ZodRecord=`ZodRecord`,e.ZodMap=`ZodMap`,e.ZodSet=`ZodSet`,e.ZodFunction=`ZodFunction`,e.ZodLazy=`ZodLazy`,e.ZodLiteral=`ZodLiteral`,e.ZodEnum=`ZodEnum`,e.ZodEffects=`ZodEffects`,e.ZodNativeEnum=`ZodNativeEnum`,e.ZodOptional=`ZodOptional`,e.ZodNullable=`ZodNullable`,e.ZodDefault=`ZodDefault`,e.ZodCatch=`ZodCatch`,e.ZodPromise=`ZodPromise`,e.ZodBranded=`ZodBranded`,e.ZodPipeline=`ZodPipeline`,e.ZodReadonly=`ZodReadonly`})(G||={}),Qn.create,er.create,Fr.create,tr.create,nr.create,rr.create,ir.create,ar.create,or.create,sr.create,cr.create,lr.create,ur.create,dr.create,pr.create,pr.strictCreate,mr.create,gr.create,vr.create,yr.create,br.create,xr.create,Sr.create,Cr.create,wr.create,Tr.create,Dr.create,Or.create,kr.create,Ar.create,jr.create,Mr.create,Ar.createWithPreprocess,Lr.create;var zr=class extends Error{constructor(e,t){super(e),this.name=`ParseError`,this.type=t.type,this.field=t.field,this.value=t.value,this.line=t.line}},Br=10,Vr=13,Hr=32;function Ur(e){}function Wr(e){if(typeof e==`function`)throw TypeError("`config` must be an object, got a function instead. Did you mean `createParser({onEvent: fn})`?");let{onEvent:t=Ur,onError:n=Ur,onRetry:r=Ur,onComment:i,maxBufferSize:a}=e,o=[],s=0,c=!0,l,u=``,d=0,f,p=!1;function m(e){if(p)throw Error("Cannot feed parser: it was terminated after exceeding the configured max buffer size. Call `reset()` to resume parsing.");if(c&&(c=!1,e.charCodeAt(0)===239&&e.charCodeAt(1)===187&&e.charCodeAt(2)===191&&(e=e.slice(3))),o.length===0){let t=g(e);t!==``&&(o.push(t),s=t.length),h();return}if(e.indexOf(`
|
|
4
4
|
`)===-1&&e.indexOf(`\r`)===-1){o.push(e),s+=e.length,h();return}o.push(e);let t=o.join(``);o.length=0,s=0;let n=g(t);n!==``&&(o.push(n),s=n.length),h()}function h(){a!==void 0&&(s+u.length<=a||(p=!0,o.length=0,s=0,l=void 0,u=``,d=0,f=void 0,n(new zr(`Buffered data exceeded max buffer size of ${a} characters`,{type:`max-buffer-size-exceeded`}))))}function g(e){let n=0;if(e.indexOf(`\r`)===-1){let r=e.indexOf(`
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{An as n,Ft as r,Hi as i,It as a,Ln as o,Lt as s,Rt as c,Si as l,Tt as u,qo as d}from"./cells-D4RwofRx.js";import{Cn as f,In as p,kt as m,ln as h,zt as g}from"./schemas-aTUejmFi.js";import{t as _}from"./compiler-runtime-CYIjoINj.js";import{t as v}from"./cn-ldLVeaqm.js";import{t as y}from"./jsx-runtime-B74pBk57.js";import{i as ee,n as te,r as ne,t as re}from"./tabs-c6mpccpH.js";import{i as b,t as ie}from"./tooltip-D7dq6bnc.js";import{r as x}from"./strings-CpYReX2Q.js";import{t as ae}from"./components-CBlGIIAX.js";import{E as oe,M as se,O as ce,T as le,a as S,j as ue,l as de,p as C,r as w,s as T,w as fe}from"./write-secret-modal-lNU_7c2x.js";import{t as pe}from"./plus-C4J9gIE1.js";import{t as me}from"./useIframeCapabilities-DEpTCh1Q.js";var E=e(t(),1),D=_();function O(){return p().optional().describe(n.of({label:`Password`,inputType:`password`,optionRegex:`(password|passwd|pgpassword|db.?pass(word)?)`}))}function k(e,t){let r=p();return r=t?r.nonempty():r.optional(),r=r.describe(n.of({label:e||`Token`,inputType:`password`,optionRegex:`(token|api.?key|access.?token|auth.?token|(^|_)pat(_|$))`})),r}function A(){return p().optional().describe(n.of({label:`Warehouse Name`,optionRegex:`(warehouse|snowflake.?warehouse)`}))}function j(e,t){let r=p();return r=t?r.nonempty():r.optional(),r.describe(n.of({label:e||`URI`,optionRegex:`(uri|url|connection.?string|database.?url|jdbc)`}))}function M(e){return p().nonempty().describe(n.of({label:e||`Host`,optionRegex:`^(?!.*(kubernetes|gpg)).*(host(name)?|pghost|db.?host|database.?host|mysql.?host|postgres.?host|server.?host)`}))}function N(){return p().describe(n.of({label:`Database`,optionRegex:`(database|db.?name|pgdatabase|^DB$|^DATABASE$)`}))}function he(){return p().describe(n.of({label:`Schema`,optionRegex:`(^SCHEMA$|db.?schema|postgres.?schema|pg.?schema|_SCHEMA$)`}))}function P(){return p().nonempty().describe(n.of({label:`Username`,optionRegex:`(username|pguser|db.?user|^USER$|_USER$)`}))}function F(e){let t=d().describe(n.of({label:`Port`,inputType:`number`,placeholder:e?.toString()})).transform(Number).refine(e=>e>=0&&e<=65535,{message:`Port must be between 0 and 65535`});return e===void 0?t:t.default(e)}function ge(){return m().default(!1).describe(n.of({label:`Read Only`}))}var _e=f({type:h(`postgres`),host:M(),port:F(5432).optional(),database:N(),username:P(),password:O(),ssl:m().default(!1).describe(n.of({label:`Use SSL`}))}).describe(n.of({direction:`two-columns`})),ve=f({type:h(`mysql`),host:M(),port:F(3306),database:N(),username:P(),password:O(),ssl:m().default(!1).describe(n.of({label:`Use SSL`}))}).describe(n.of({direction:`two-columns`})),ye=f({type:h(`sqlite`),database:N().describe(n.of({label:`Database Path`}))}).describe(n.of({direction:`two-columns`})),be=f({type:h(`duckdb`),database:N().describe(n.of({label:`Database Path`})),read_only:ge()}).describe(n.of({direction:`two-columns`})),I=f({type:h(`motherduck`),database:N().default(`my_db`).describe(n.of({label:`Database Name`})),token:k()}).describe(n.of({direction:`two-columns`})),L=f({type:h(`snowflake`),account:p().nonempty().describe(n.of({label:`Account`,optionRegex:`(snowflake.?account|^SNOWFLAKE_ACCOUNT$|account.?id)`})),warehouse:p().optional().describe(n.of({label:`Warehouse`,optionRegex:`(snowflake.?warehouse|warehouse)`})),database:N(),schema:p().optional().describe(n.of({label:`Schema`,optionRegex:`(snowflake.?schema|^SCHEMA$|_SCHEMA$)`})),role:p().optional().describe(n.of({label:`Role`})),authType:g(`type`,[f({type:h(`Password`),username:P(),password:O(),enable_mfa:m().default(!1).describe(n.of({label:`Enable MFA (Duo Push)`}))}),f({type:h(`SSO (Browser)`),username:P()}),f({type:h(`Key Pair`),username:P(),private_key_path:p().nonempty().describe(n.of({label:`Private Key Path`,placeholder:`/path/to/rsa_key.p8`})),private_key_passphrase:p().optional().describe(n.of({label:`Private Key Passphrase`,inputType:`password`,optionRegex:`(passphrase|private.?key.?passphrase|key.?passphrase)`}))}),f({type:h(`OAuth / PAT`),token:k(`Token`,!0)})]).default({type:`Password`,username:`username`,enable_mfa:!1}).describe(n.of({special:`tabs`}))}).describe(n.of({direction:`two-columns`})),R=f({type:h(`bigquery`),project:p().nonempty().describe(n.of({label:`Project ID`,optionRegex:`(bigquery.?project|gcp.?project|google.?cloud.?project|project.?id)`})),dataset:p().nonempty().describe(n.of({label:`Dataset`,optionRegex:`(bigquery.?dataset|dataset)`})),credentials_json:p().describe(n.of({label:`Credentials JSON`,special:`secret_textarea`}))}).describe(n.of({direction:`two-columns`})),z=f({type:h(`clickhouse_connect`),host:M(),port:F(8123).optional(),username:P(),password:O(),secure:m().default(!1).describe(n.of({label:`Use HTTPs`})),proxy_path:p().optional().describe(n.of({label:`Proxy Path`,placeholder:`/clickhouse`}))}).describe(n.of({direction:`two-columns`})),B=f({type:h(`timeplus`),host:M().default(`localhost`),port:F(8123).optional(),username:P().default(`default`),password:O().default(``)}).describe(n.of({direction:`two-columns`})),V=f({type:h(`chdb`),database:N().describe(n.of({label:`Database Path`})),read_only:ge()}).describe(n.of({direction:`two-columns`})),H=f({type:h(`trino`),host:M(),port:F(8080),database:N(),schema:he().optional(),username:P(),password:O(),async_support:m().default(!1).describe(n.of({label:`Async Support`}))}).describe(n.of({direction:`two-columns`})),U=f({type:h(`iceberg`),name:p().describe(n.of({label:`Catalog Name`})),catalog:g(`type`,[f({type:h(`REST`),warehouse:A(),uri:p().optional().describe(n.of({label:`URI`,placeholder:`https://`,optionRegex:`(uri|url|connection.?string|database.?url|jdbc)`})),token:k()}),f({type:h(`SQL`),warehouse:A(),uri:p().optional().describe(n.of({label:`URI`,placeholder:`jdbc:iceberg://host:port/database`,optionRegex:`(uri|url|connection.?string|database.?url|jdbc)`}))}),f({type:h(`Hive`),warehouse:A(),uri:j()}),f({type:h(`Glue`),warehouse:A(),uri:j()}),f({type:h(`DynamoDB`),"dynamodb.profile-name":p().optional().describe(n.of({label:`Profile Name`})),"dynamodb.region":p().optional().describe(n.of({label:`Region`})),"dynamodb.access-key-id":p().optional().describe(n.of({label:`Access Key ID`,inputType:`password`,optionRegex:`(access.?key.?id|aws.?access.?key)`})),"dynamodb.secret-access-key":p().optional().describe(n.of({label:`Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|aws.?secret)`})),"dynamodb.session-token":p().optional().describe(n.of({label:`Session Token`,inputType:`password`,optionRegex:`(session.?token|aws.?session)`}))})]).default({type:`REST`,token:void 0}).describe(n.of({special:`tabs`}))}),W=f({type:h(`datafusion`),sessionContext:m().optional().describe(n.of({label:`Use Session Context`}))}),G=f({type:h(`pyspark`),host:M().optional(),port:F().optional()}),K=f({type:h(`redshift`),host:M(),port:F(5439),connectionType:g(`type`,[f({type:h(`IAM credentials`),region:p().describe(n.of({label:`Region`})),aws_access_key_id:p().nonempty().describe(n.of({label:`AWS Access Key ID`,inputType:`password`,optionRegex:`(access.?key.?id|aws.?access.?key)`})),aws_secret_access_key:p().nonempty().describe(n.of({label:`AWS Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|aws.?secret)`})),aws_session_token:p().optional().describe(n.of({label:`AWS Session Token`,inputType:`password`,optionRegex:`(session.?token|aws.?session)`}))}),f({type:h(`DB credentials`),user:P(),password:O()})]).default({type:`IAM credentials`,aws_access_key_id:``,aws_secret_access_key:``,region:``}),database:N()}).describe(n.of({direction:`two-columns`})),q=f({type:h(`databricks`),access_token:k(`Access Token`,!0),server_hostname:M(`Server Hostname`),http_path:j(`HTTP Path`,!0),catalog:p().optional().describe(n.of({label:`Catalog`})),schema:p().optional().describe(n.of({label:`Schema`}))}).describe(n.of({direction:`two-columns`})),xe=f({type:h(`supabase`),host:M(),port:F(5432).optional(),database:N(),username:P(),password:O(),disable_client_pooling:m().default(!1).describe(n.of({label:`Disable Client-Side Pooling`}))}).describe(n.of({direction:`two-columns`})),Se=g(`type`,[_e,ve,ye,be,I,L,R,z,B,V,H,U,W,G,K,q,xe]),Ce={sqlmodel:`SQLModel`,sqlalchemy:`SQLAlchemy`,duckdb:`DuckDB`,clickhouse_connect:`ClickHouse Connect`,chdb:`chDB`,pyiceberg:`PyIceberg`,ibis:`Ibis`,motherduck:`MotherDuck`,redshift:`Redshift`,databricks:`Databricks`},J=class{connection;orm;secrets;constructor(e,t,n){this.connection=e,this.orm=t,this.secrets=n}get imports(){let e=new Set(this.generateImports());switch(this.orm){case`sqlalchemy`:e.add(`import sqlalchemy`);break;case`sqlmodel`:e.add(`import sqlmodel`);break;case`duckdb`:e.add(`import duckdb`);break;case`ibis`:e.add(`import ibis`)}return e}},we=e=>`_${e}`,Te=class{secrets={};get imports(){return Object.keys(this.secrets).length===0?new Set:new Set([`import os`])}print(e,t,n){if(e=we(e),T(t)){let r=de(t),i=n?`os.environ.get("${r}", "${n}")`:`os.environ.get("${r}")`;return this.secrets[e]=i,e}if(n!=null){let r=`os.environ.get("${t}", "${n}")`;return this.secrets[e]=r,e}return typeof t==`number`||typeof t==`number`?`${t}`:typeof t==`boolean`?Y(t):t?`"${t}"`:``}printInFString(e,t,n){if(t===void 0)return``;if(typeof t==`number`)return`${t}`;if(typeof t==`boolean`)return Y(t);let r=this.print(e,t,n);return r.startsWith(`"`)&&r.endsWith(`"`)?r.slice(1,-1):`{${r}}`}printPassword(e,t,n,r){let i=n?this.printInFString.bind(this):this.print.bind(this);return T(e)?i(r||`password`,e):i(r||`password`,t,e)}getSecrets(){return this.secrets}formatSecrets(){return Object.keys(this.secrets).length===0?``:Object.entries(this.secrets).map(([e,t])=>`${e} = ${t}`).join(`
|
|
2
|
+
`)}},Ee=class extends J{generateImports(){return[]}generateConnectionCode(){let e=this.connection.ssl?`, connect_args={'sslmode': 'require'}`:``,t=this.secrets.printPassword(this.connection.password,`POSTGRES_PASSWORD`,!0),n=this.secrets.printInFString(`username`,this.connection.username),r=this.secrets.printInFString(`host`,this.connection.host),i=this.secrets.printInFString(`port`,this.connection.port),a=this.secrets.printInFString(`database`,this.connection.database);return l(`
|
|
3
|
+
DATABASE_URL = f"postgresql://${n}:${t}@${r}:${i}/${a}"
|
|
4
|
+
engine = ${this.orm}.create_engine(DATABASE_URL${e})
|
|
5
|
+
`)}},De=class extends J{generateImports(){return[]}generateConnectionCode(){let e=this.connection.ssl?`, connect_args={'ssl': {'ssl-mode': 'preferred'}}`:``,t=this.secrets.printPassword(this.connection.password,`MYSQL_PASSWORD`,!0),n=this.secrets.printInFString(`database`,this.connection.database),r=this.secrets.printInFString(`username`,this.connection.username),i=this.secrets.printInFString(`host`,this.connection.host),a=this.secrets.printInFString(`port`,this.connection.port);return l(`
|
|
6
|
+
DATABASE_URL = f"mysql+pymysql://${r}:${t}@${i}:${a}/${n}"
|
|
7
|
+
engine = ${this.orm}.create_engine(DATABASE_URL${e})
|
|
8
|
+
`)}},Oe=class extends J{generateImports(){return[]}generateConnectionCode(){let e=this.connection.database?this.secrets.printInFString(`database`,this.connection.database):``,t=e.startsWith(`{`)&&e.endsWith(`}`)?`DATABASE_URL = f"sqlite:///${e}"`:`DATABASE_URL = "sqlite:///${e}"`;return l(`
|
|
9
|
+
${t}
|
|
10
|
+
engine = ${this.orm}.create_engine(DATABASE_URL)
|
|
11
|
+
`)}},ke=class extends J{generateImports(){return[`from snowflake.sqlalchemy import URL`]}generateConnectionCode(){let{authType:e,account:t,database:n,warehouse:r,schema:i,role:a}=this.connection,o={account:this.secrets.print(`account`,t),database:this.secrets.print(`database`,n),warehouse:r?this.secrets.print(`warehouse`,r):void 0,schema:i?this.secrets.print(`schema`,i):void 0,role:a?this.secrets.print(`role`,a):void 0};switch(e.type){case`Password`:{let t=this.secrets.printPassword(e.password,`SNOWFLAKE_PASSWORD`,!1),n={...o,user:this.secrets.print(`user`,e.username),password:t};return e.enable_mfa?l(`
|
|
12
|
+
engine = ${this.orm}.create_engine(
|
|
13
|
+
URL(
|
|
14
|
+
${X(n,e=>` ${e}`)},
|
|
15
|
+
),
|
|
16
|
+
connect_args={"authenticator": "username_password_mfa"},
|
|
17
|
+
)
|
|
18
|
+
`):l(`
|
|
19
|
+
engine = ${this.orm}.create_engine(
|
|
20
|
+
URL(
|
|
21
|
+
${X(n,e=>` ${e}`)},
|
|
22
|
+
)
|
|
23
|
+
)
|
|
24
|
+
`)}case`SSO (Browser)`:{let t={...o,user:this.secrets.print(`user`,e.username),authenticator:`"externalbrowser"`};return l(`
|
|
25
|
+
engine = ${this.orm}.create_engine(
|
|
26
|
+
URL(
|
|
27
|
+
${X(t,e=>` ${e}`)},
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
`)}case`Key Pair`:{let t={...o,user:this.secrets.print(`user`,e.username)},n=this.secrets.print(`private_key_path`,e.private_key_path),r=e.private_key_passphrase?this.secrets.printPassword(e.private_key_passphrase,`SNOWFLAKE_PRIVATE_KEY_PASSPHRASE`,!1):void 0,i=[` "authenticator": "SNOWFLAKE_JWT"`,` "private_key_file": ${n}`];return r&&i.push(` "private_key_file_pwd": ${r}`),l(`
|
|
31
|
+
engine = ${this.orm}.create_engine(
|
|
32
|
+
URL(
|
|
33
|
+
${X(t,e=>` ${e}`)},
|
|
34
|
+
),
|
|
35
|
+
connect_args={
|
|
36
|
+
${i.join(`,
|
|
37
|
+
`)},
|
|
38
|
+
},
|
|
39
|
+
)
|
|
40
|
+
`)}case`OAuth / PAT`:{let t=this.secrets.printPassword(e.token,`SNOWFLAKE_TOKEN`,!1),n={...o,authenticator:`"oauth"`,token:t};return l(`
|
|
41
|
+
engine = ${this.orm}.create_engine(
|
|
42
|
+
URL(
|
|
43
|
+
${X(n,e=>` ${e}`)},
|
|
44
|
+
)
|
|
45
|
+
)
|
|
46
|
+
`)}default:x(e)}}},Ae=class extends J{get credential(){return S(this.connection.credentials_json,e=>this.secrets.print(`credentials_json`,e))}generateImports(){return this.credential.kind===`path`?[]:[`import json`]}generateConnectionCode(){let e=this.secrets.printInFString(`project`,this.connection.project),t=this.secrets.printInFString(`dataset`,this.connection.dataset),n=this.credential;return n.kind===`path`?l(`
|
|
47
|
+
engine = ${this.orm}.create_engine(f"bigquery://${e}/${t}", credentials_path="${w(n.path)}")
|
|
48
|
+
`):l(`
|
|
49
|
+
credentials = ${n.expr}
|
|
50
|
+
engine = ${this.orm}.create_engine(f"bigquery://${e}/${t}", credentials_info=credentials)
|
|
51
|
+
`)}},je=class extends J{generateImports(){return[]}generateConnectionCode(){let e=this.secrets.printInFString(`database`,this.connection.database||`:memory:`);return l(`
|
|
52
|
+
DATABASE_URL = "${e}"
|
|
53
|
+
engine = ${this.orm}.connect(DATABASE_URL, read_only=${Y(this.connection.read_only)})
|
|
54
|
+
`)}},Me=class extends J{generateImports(){return[]}generateConnectionCode(){let e=this.secrets.printInFString(`database`,this.connection.database);if(!this.connection.token)return l(`
|
|
55
|
+
conn = duckdb.connect("md:${e}")
|
|
56
|
+
`);let t=this.secrets.printPassword(this.connection.token,`MOTHERDUCK_TOKEN`,!1);return l(`
|
|
57
|
+
conn = duckdb.connect("md:${e}", config={"motherduck_token": ${t}})
|
|
58
|
+
`)}},Ne=class extends J{generateImports(){return[`import clickhouse_connect`]}generateConnectionCode(){let e=this.secrets.printPassword(this.connection.password,`CLICKHOUSE_PASSWORD`,!1),t={host:this.secrets.print(`host`,this.connection.host),user:this.secrets.print(`user`,this.connection.username),secure:this.secrets.print(`secure`,this.connection.secure),port:this.connection.port?this.secrets.print(`port`,this.connection.port):void 0,password:this.connection.password?e:void 0,proxy_path:this.connection.proxy_path?this.secrets.print(`proxy_path`,this.connection.proxy_path):void 0};return l(`
|
|
59
|
+
engine = ${this.orm}.get_client(
|
|
60
|
+
${X(t,e=>` ${e}`)},
|
|
61
|
+
)
|
|
62
|
+
`)}},Pe=class extends J{generateImports(){return[]}generateConnectionCode(){let e=this.secrets.printPassword(this.connection.password,`TIMEPLUS_PASSWORD`,!0),t=this.secrets.printInFString(`username`,this.connection.username),n=this.secrets.printInFString(`host`,this.connection.host),r=this.secrets.printInFString(`port`,this.connection.port);return l(`
|
|
63
|
+
DATABASE_URL = f"timeplus://${t}:${e}@${n}:${r}"
|
|
64
|
+
engine = ${this.orm}.create_engine(DATABASE_URL)
|
|
65
|
+
`)}},Fe=class extends J{generateImports(){return[`import chdb`]}generateConnectionCode(){let e=this.secrets.print(`database`,this.connection.database)||`""`;return l(`
|
|
66
|
+
engine = ${this.orm}.connect(${e}, read_only=${Y(this.connection.read_only)})
|
|
67
|
+
`)}},Ie=class extends J{generateImports(){return this.connection.async_support?[`import aiotrino`]:[`import trino.sqlalchemy`]}generateConnectionCode(){let e=this.connection.async_support?`aiotrino`:`trino`,t=this.connection.schema?`/${this.connection.schema}`:``,n=this.secrets.printInFString(`username`,this.connection.username),r=this.secrets.printInFString(`host`,this.connection.host),i=this.secrets.printInFString(`port`,this.connection.port),a=this.secrets.printInFString(`database`,this.connection.database),o=this.secrets.printPassword(this.connection.password,`TRINO_PASSWORD`,!0);return l(`
|
|
68
|
+
engine = ${this.orm}.create_engine(f"${e}://${n}:${o}@${r}:${i}/${a}${t}")
|
|
69
|
+
`)}},Le=class extends J{getCatalogOptions(){return Object.fromEntries(Object.entries(this.connection.catalog).filter(([e,t])=>t!=null&&t!==``&&e!==`type`))}generateImports(){if(Object.keys(this.getCatalogOptions()).length===0)return[`from pyiceberg.catalog import load_catalog`];switch(this.connection.catalog.type){case`REST`:return[`from pyiceberg.catalog.rest import RestCatalog`];case`SQL`:return[`from pyiceberg.catalog.sql import SqlCatalog`];case`Hive`:return[`from pyiceberg.catalog.hive import HiveCatalog`];case`Glue`:return[`from pyiceberg.catalog.glue import GlueCatalog`];case`DynamoDB`:return[`from pyiceberg.catalog.dynamodb import DynamoDBCatalog`];default:x(this.connection.catalog)}}generateConnectionCode(){let e=`"${this.connection.name}"`,t=this.getCatalogOptions();if(Object.keys(t).length===0)return`catalog = load_catalog(${e})`;for(let[e,n]of Object.entries(t))T(n)?t[e]=this.secrets.print(e,n):typeof n==`string`&&(t[e]=`"${n}"`);let n=Ge(t,e=>` ${e}`);switch(this.connection.catalog.type){case`REST`:return l(`
|
|
70
|
+
catalog = RestCatalog(
|
|
71
|
+
${e},
|
|
72
|
+
**{\n${n}
|
|
73
|
+
},
|
|
74
|
+
)
|
|
75
|
+
`);case`SQL`:return l(`
|
|
76
|
+
catalog = SqlCatalog(
|
|
77
|
+
${e},
|
|
78
|
+
**{\n${n}
|
|
79
|
+
},
|
|
80
|
+
)
|
|
81
|
+
`);case`Hive`:return l(`
|
|
82
|
+
catalog = HiveCatalog(
|
|
83
|
+
${e},
|
|
84
|
+
**{\n${n}
|
|
85
|
+
},
|
|
86
|
+
)
|
|
87
|
+
`);case`Glue`:return l(`
|
|
88
|
+
catalog = GlueCatalog(
|
|
89
|
+
${e},
|
|
90
|
+
**{\n${n}
|
|
91
|
+
},
|
|
92
|
+
)
|
|
93
|
+
`);case`DynamoDB`:return l(`
|
|
94
|
+
catalog = DynamoDBCatalog(
|
|
95
|
+
${e},
|
|
96
|
+
**{\n${n}
|
|
97
|
+
},
|
|
98
|
+
)
|
|
99
|
+
`);default:x(this.connection.catalog)}}},Re=class extends J{generateImports(){return[`from datafusion import SessionContext`]}generateConnectionCode(){return this.connection.sessionContext?l(`
|
|
100
|
+
ctx = SessionContext()
|
|
101
|
+
# Sample table
|
|
102
|
+
_ = ctx.from_pydict({"a": [1, 2, 3]}, "my_table")
|
|
103
|
+
|
|
104
|
+
con = ibis.datafusion.connect(ctx)
|
|
105
|
+
`):l(`
|
|
106
|
+
con = ibis.datafusion.connect()
|
|
107
|
+
`)}},ze=class extends J{generateImports(){return[`from pyspark.sql import SparkSession`]}generateConnectionCode(){if(this.connection.host||this.connection.port){let e=this.secrets.printInFString(`host`,this.connection.host),t=this.secrets.printInFString(`port`,this.connection.port);return l(`
|
|
108
|
+
session = SparkSession.builder.remote(f"sc://${e}:${t}").getOrCreate()
|
|
109
|
+
con = ibis.pyspark.connect(session)
|
|
110
|
+
`)}return l(`
|
|
111
|
+
con = ibis.pyspark.connect()
|
|
112
|
+
`)}},Be=class extends J{generateImports(){return[`import redshift_connector`]}generateConnectionCode(){let e=this.secrets.print(`host`,this.connection.host),t=this.secrets.print(`port`,this.connection.port),n=this.secrets.print(`database`,this.connection.database);if(this.connection.connectionType.type===`IAM credentials`){let r=this.secrets.print(`aws_access_key_id`,this.connection.connectionType.aws_access_key_id),i=this.secrets.print(`aws_secret_access_key`,this.connection.connectionType.aws_secret_access_key),a=this.connection.connectionType.aws_session_token?this.secrets.print(`aws_session_token`,this.connection.connectionType.aws_session_token):void 0,o={iam:!0,host:e,port:t,region:`"${this.connection.connectionType.region}"`,database:n,access_key_id:r,secret_access_key:i,...a&&{session_token:a}};return l(`
|
|
113
|
+
con = redshift_connector.connect(
|
|
114
|
+
${X(o,e=>` ${e}`)},
|
|
115
|
+
)
|
|
116
|
+
`)}let r=this.connection.connectionType.user?this.secrets.print(`user`,this.connection.connectionType.user):void 0,i=this.connection.connectionType.password?this.secrets.printPassword(this.connection.connectionType.password,`REDSHIFT_PASSWORD`,!1):void 0,a={host:e,port:t,database:n,...r&&{user:r},...i&&{password:i}};return l(`
|
|
117
|
+
con = redshift_connector.connect(
|
|
118
|
+
${X(a,e=>` ${e}`)},
|
|
119
|
+
)
|
|
120
|
+
`)}},Ve=class extends J{generateImports(){return[]}generateConnectionCode(){let e=this.orm!==`ibis`,t=this.secrets.printPassword(this.connection.access_token,`DATABRICKS_ACCESS_TOKEN`,e,`access_token`),n=this.secrets.printPassword(this.connection.server_hostname,`DATABRICKS_SERVER_HOSTNAME`,e,`server_hostname`),r=this.secrets.printPassword(this.connection.http_path,`DATABRICKS_HTTP_PATH`,e,`http_path`),i=this.connection.catalog?this.secrets.printInFString(`catalog`,this.connection.catalog):void 0,a=this.connection.schema?this.secrets.printInFString(`schema`,this.connection.schema):void 0,o=`databricks://token:${t}@${n}?http_path=${r}`;if(i&&(o+=`&catalog=${i}`),a&&(o+=`&schema=${a}`),this.orm===`ibis`){let e=i?`\n catalog=${i},`:``,o=a?`\n schema=${a},`:``;return l(`
|
|
121
|
+
engine = ibis.databricks.connect(
|
|
122
|
+
server_hostname=${n},
|
|
123
|
+
http_path=${r},${e}${o}
|
|
124
|
+
access_token=${t}
|
|
125
|
+
)
|
|
126
|
+
`)}return l(`
|
|
127
|
+
DATABASE_URL = f"${o}"
|
|
128
|
+
engine = ${this.orm}.create_engine(DATABASE_URL)
|
|
129
|
+
`)}},He=class extends J{generateImports(){return this.connection.disable_client_pooling?[`from sqlalchemy.pool import NullPool`]:[]}generateConnectionCode(){let e=this.secrets.printPassword(this.connection.password,`SUPABASE_PASSWORD`,!0),t=this.secrets.printInFString(`username`,this.connection.username),n=this.secrets.printInFString(`host`,this.connection.host),r=this.secrets.printInFString(`port`,this.connection.port),i=this.secrets.printInFString(`database`,this.connection.database),a=this.connection.disable_client_pooling?`, poolclass=NullPool`:``;return l(`
|
|
130
|
+
DATABASE_URL = f"postgresql+psycopg2://${t}:${e}@${n}:${r}/${i}?sslmode=require"
|
|
131
|
+
engine = ${this.orm}.create_engine(DATABASE_URL${a})
|
|
132
|
+
`)}},Ue=class{secrets=new Te;createGenerator(e,t){switch(e.type){case`postgres`:return new Ee(e,t,this.secrets);case`mysql`:return new De(e,t,this.secrets);case`sqlite`:return new Oe(e,t,this.secrets);case`snowflake`:return new ke(e,t,this.secrets);case`bigquery`:return new Ae(e,t,this.secrets);case`duckdb`:return new je(e,t,this.secrets);case`motherduck`:return new Me(e,t,this.secrets);case`clickhouse_connect`:return new Ne(e,t,this.secrets);case`timeplus`:return new Pe(e,t,this.secrets);case`chdb`:return new Fe(e,t,this.secrets);case`trino`:return new Ie(e,t,this.secrets);case`iceberg`:return new Le(e,t,this.secrets);case`datafusion`:return new Re(e,t,this.secrets);case`pyspark`:return new ze(e,t,this.secrets);case`redshift`:return new Be(e,t,this.secrets);case`databricks`:return new Ve(e,t,this.secrets);case`supabase`:return new He(e,t,this.secrets);default:x(e)}}};function We(e,t){if(!(t in Ce))throw Error(`Unsupported library: ${t}`);Se.parse(e);let n=new Ue,r=n.createGenerator(e,t),i=r.generateConnectionCode(),a=n.secrets,o=[...new Set([...a.imports,...r.imports])].toSorted();o.push(``);let s=a.formatSecrets();return s&&o.push(s),o.push(i.trim()),o.join(`
|
|
133
|
+
`)}function Y(e){return e.toString().charAt(0).toUpperCase()+e.toString().slice(1)}function X(e,t){return Object.entries(e).filter(([,e])=>e!=null&&e!==``).map(([e,n])=>t(typeof n==`boolean`?`${e}=${Y(n)}`:`${e}=${n}`)).join(`,
|
|
134
|
+
`)}function Ge(e,t){return Object.entries(e).filter(([,e])=>e!=null&&e!==``).map(([e,n])=>{let r=`"${e}"`;return t(typeof n==`boolean`?`${r}: ${Y(n)}`:`${r}: ${n}`)}).join(`,
|
|
135
|
+
`)}var Z=y(),Ke=[{name:`PostgreSQL`,schema:_e,color:`#336791`,logo:`postgres`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`MySQL`,schema:ve,color:`#00758F`,logo:`mysql`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`SQLite`,schema:ye,color:`#003B57`,logo:`sqlite`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`DuckDB`,schema:be,color:`#FFD700`,logo:`duckdb`,connectionLibraries:{libraries:[`duckdb`],preferred:`duckdb`}},{name:`MotherDuck`,schema:I,color:`#ff9538`,logo:`motherduck`,connectionLibraries:{libraries:[`duckdb`],preferred:`duckdb`}},{name:`Snowflake`,schema:L,color:`#29B5E8`,logo:`snowflake`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`ClickHouse`,schema:z,color:`#2C2C1D`,logo:`clickhouse`,connectionLibraries:{libraries:[`clickhouse_connect`],preferred:`clickhouse_connect`}},{name:`Timeplus`,schema:B,color:`#B83280`,logo:`timeplus`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`BigQuery`,schema:R,color:`#4285F4`,logo:`bigquery`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`ClickHouse Embedded`,schema:V,color:`#f2b611`,logo:`clickhouse`,connectionLibraries:{libraries:[`chdb`],preferred:`chdb`}},{name:`Trino`,schema:H,color:`#d466b6`,logo:`trino`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}},{name:`DataFusion`,schema:W,color:`#202A37`,logo:`datafusion`,connectionLibraries:{libraries:[`ibis`],preferred:`ibis`}},{name:`PySpark`,schema:G,color:`#1C5162`,logo:`pyspark`,connectionLibraries:{libraries:[`ibis`],preferred:`ibis`}},{name:`Redshift`,schema:K,color:`#522BAE`,logo:`redshift`,connectionLibraries:{libraries:[`redshift`],preferred:`redshift`}},{name:`Databricks`,schema:q,color:`#c41e0c`,logo:`databricks`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`,`ibis`],preferred:`sqlalchemy`}},{name:`Supabase`,schema:xe,color:`#238F5F`,logo:`supabase`,connectionLibraries:{libraries:[`sqlalchemy`,`sqlmodel`],preferred:`sqlalchemy`}}],qe=[{name:`Iceberg`,schema:U,color:`#000000`,logo:`iceberg`,connectionLibraries:{libraries:[`pyiceberg`],preferred:`pyiceberg`}}],Je=[...Ke,...qe],Ye=[...new Set(Je.flatMap(({name:e,logo:t})=>[e,t]))],Xe=e=>{let t=(0,D.c)(12),{onSelect:n}=e,r;t[0]===n?r=t[1]:(r=Ke.map(e=>{let{name:t,schema:r,color:i,logo:s}=e;return(0,Z.jsx)(a,{name:t,color:i,icon:(0,Z.jsx)(o,{name:s,className:`w-8 h-8 text-white brightness-0 invert dark:invert`}),onSelect:()=>n(r)},t)}),t[0]=n,t[1]=r);let i;t[2]===r?i=t[3]:(i=(0,Z.jsx)(s,{children:r}),t[2]=r,t[3]=i);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsxs)(`h4`,{className:`font-semibold text-muted-foreground text-lg flex items-center gap-4 my-2`,children:[`Data Catalogs`,(0,Z.jsx)(`hr`,{className:`flex-1`})]}),t[4]=c):c=t[4];let l;t[5]===n?l=t[6]:(l=qe.map(e=>{let{name:t,schema:r,color:i,logo:s}=e;return(0,Z.jsx)(a,{name:t,color:i,icon:(0,Z.jsx)(o,{name:s,className:`w-8 h-8 text-white brightness-0 invert dark:invert`}),onSelect:()=>n(r)},t)}),t[5]=n,t[6]=l);let u;t[7]===l?u=t[8]:(u=(0,Z.jsx)(s,{children:l}),t[7]=l,t[8]=u);let d;return t[9]!==i||t[10]!==u?(d=(0,Z.jsxs)(Z.Fragment,{children:[i,c,u]}),t[9]=i,t[10]=u,t[11]=d):d=t[11],d},Ze=e=>{let t=(0,D.c)(13),{onSubmit:n,header:i}=e,[a,o]=(0,E.useState)(null);if(!a){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`div`,{children:(0,Z.jsx)(Xe,{onSelect:o})}),t[0]=e):e=t[0];let n;return t[1]===i?n=t[2]:(n=(0,Z.jsxs)(Z.Fragment,{children:[i,e]}),t[1]=i,t[2]=n),n}let s;t[3]===a?s=t[4]:(s=Je.find(e=>e.schema===a),t[3]=a,t[4]=s);let c=s?.connectionLibraries,l;t[5]===c?.libraries?l=t[6]:(l=c?.libraries??[],t[5]=c?.libraries,t[6]=l);let u=c?.preferred??`sqlalchemy`,d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>o(null),t[7]=d):d=t[7];let f;return t[8]!==n||t[9]!==a||t[10]!==l||t[11]!==u?(f=(0,Z.jsx)(r,{schema:a,libraries:l,preferredLibrary:u,displayNames:Ce,libraryLabel:`Preferred connection library`,generateCode:Qe,onSubmit:n,onBack:d}),t[8]=n,t[9]=a,t[10]=l,t[11]=u,t[12]=f):f=t[12],f};function Qe(e,t){return We(e,t)}var $e=e=>{let t=(0,D.c)(19),{className:n,sources:r,onAdd:a}=e,o=(0,E.useId)();if(r.length===0)return null;let s;t[0]===n?s=t[1]:(s=v(`rounded-full bg-[linear-gradient(135deg,var(--blue-2),var(--purple-3))] px-3 py-2 dark:bg-[linear-gradient(135deg,var(--blue-2),var(--purple-2))]`,n),t[0]=n,t[1]=s);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(i,{className:`h-3.5 w-3.5 text-(--blue-9) dark:text-(--blue-10)`}),t[2]=c):c=t[2];let l;t[3]===o?l=t[4]:(l=(0,Z.jsxs)(`div`,{className:`mr-1 flex items-center gap-1.5`,children:[c,(0,Z.jsx)(`h3`,{id:o,className:`text-sm`,children:`Quick add`})]}),t[3]=o,t[4]=l);let u;if(t[5]!==a||t[6]!==r){let e;t[8]===a?e=t[9]:(e=e=>(0,Z.jsx)(ie,{side:`bottom`,content:(0,Z.jsx)(et,{source:e}),children:(0,Z.jsxs)(`button`,{type:`button`,"aria-label":`Add ${e.displayName} connection`,className:`inline-flex items-center gap-1 rounded-full border border-border/60 bg-background px-2.5 py-1 text-xs font-medium text-foreground/90 transition-colors hover:border-(--blue-7) focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 dark:border-border dark:bg-background/60 dark:hover:bg-accent/80`,onClick:()=>a(e),children:[(0,Z.jsx)(pe,{className:`h-3 w-3 text-muted-foreground`}),e.displayName]})},e.id),t[8]=a,t[9]=e),u=r.map(e),t[5]=a,t[6]=r,t[7]=u}else u=t[7];let d;t[10]===u?d=t[11]:(d=(0,Z.jsx)(b,{delayDuration:200,children:u}),t[10]=u,t[11]=d);let f;t[12]!==l||t[13]!==d?(f=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[l,d]}),t[12]=l,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==s||t[16]!==f||t[17]!==o?(p=(0,Z.jsx)(`section`,{"aria-labelledby":o,className:s,children:f}),t[15]=s,t[16]=f,t[17]=o,t[18]=p):p=t[18],p},et=e=>{let t=(0,D.c)(17),{source:n}=e,r;t[0]===n.displayName?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`font-medium`,children:n.displayName}),t[0]=n.displayName,t[1]=r);let i;t[2]===n.origins?i=t[3]:(i=n.origins.map(nt).join(` and `),t[2]=n.origins,t[3]=i);let a;t[4]===i?a=t[5]:(a=(0,Z.jsxs)(`div`,{className:`text-xs text-muted-foreground`,children:[`Detected from`,` `,i]}),t[4]=i,t[5]=a);let o;t[6]!==r||t[7]!==a?(o=(0,Z.jsxs)(`div`,{children:[r,a]}),t[6]=r,t[7]=a,t[8]=o):o=t[8];let s;t[9]===n.configuration?s=t[10]:(s=n.configuration.map(rt),t[9]=n.configuration,t[10]=s);let c;t[11]===s?c=t[12]:(c=(0,Z.jsx)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-xs`,children:s}),t[11]=s,t[12]=c);let l;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`div`,{className:`text-xs text-muted-foreground`,children:`Click to add a configured cell.`}),t[13]=l):l=t[13];let u;return t[14]!==o||t[15]!==c?(u=(0,Z.jsxs)(`div`,{className:`min-w-64 space-y-2 py-1`,children:[o,c,l]}),t[14]=o,t[15]=c,t[16]=u):u=t[16],u},tt=e=>{let t=(0,D.c)(4),{onSubmit:n,className:r,group:i}=e,a=c(n),o=u(i),s;return t[0]!==a||t[1]!==r||t[2]!==o?(s=(0,Z.jsx)($e,{className:r,sources:o,onAdd:a}),t[0]=a,t[1]=r,t[2]=o,t[3]=s):s=t[3],s};function nt(e){return e.label}function rt(e){return(0,Z.jsxs)(`div`,{className:`contents`,children:[(0,Z.jsx)(`dt`,{className:`text-muted-foreground`,children:e.field}),(0,Z.jsx)(`dd`,{children:(0,Z.jsx)(`code`,{children:e.value.kind===`environment-variable`?`os.environ["${e.value.name}"]`:e.value.value})})]},e.value.kind===`environment-variable`?e.value.name:`${e.field}:${e.value.value}`)}var it=()=>g(`type`,[f({type:h(`Access keys`),access_key_id:p().optional().describe(n.of({label:`Access Key ID`,description:`Leave empty to use the default credential chain`,inputType:`password`,optionRegex:`(access.?key.?id|object.?storage.?key|aws.?access.?key)`})),secret_access_key:p().optional().describe(n.of({label:`Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|object.?storage.?secret|aws.?secret)`}))}),f({type:h(`Container credentials`),container_credentials_full_uri:p().nonempty().describe(n.of({label:`Credentials URI`,description:`Endpoint that vends credentials to the container`,placeholder:`http://169.254.170.23/v1/credentials`,optionRegex:`container.?credentials`})),container_authorization_token_file:p().nonempty().describe(n.of({label:`Authorization Token File`,description:`File holding the token sent to the credentials URI`,placeholder:`/var/run/secrets/token`,optionRegex:`(container.?authorization.?token.?file|container.?auth.?token)`}))})]).default({type:`Access keys`}).describe(n.of({label:`Credentials`,special:`tabs`})),at=f({type:h(`s3`),bucket:p().nonempty().describe(n.of({label:`Bucket`,placeholder:`my-bucket`,optionRegex:`(bucket|s3.?bucket)`})),region:p().optional().describe(n.of({label:`Region`,placeholder:`us-east-1`,optionRegex:`(region|aws.?region)`})),endpoint_url:p().optional().describe(n.of({label:`Endpoint URL`,description:`Ignored if the AWS_ENDPOINT_URL_S3 environment variable is set`,placeholder:`https://s3.amazonaws.com`,optionRegex:`(endpoint|s3.?url|s3.?endpoint)`})),allow_http:m().default(!1).describe(n.of({label:`Allow HTTP`,description:`Required for plain-http (non-TLS) endpoints`})),auth:it()}).describe(n.of({direction:`two-columns`})),ot=f({type:h(`gcs`),bucket:p().nonempty().describe(n.of({label:`Bucket`,placeholder:`my-bucket`,optionRegex:`(bucket|gcs.?bucket|google.?bucket)`})),service_account_key:p().optional().describe(n.of({label:`Service Account Key (JSON)`,special:`secret_textarea`}))}).describe(n.of({direction:`two-columns`})),Q=f({type:h(`azure`),container:p().nonempty().describe(n.of({label:`Container`,placeholder:`my-container`})),account_name:p().nonempty().describe(n.of({label:`Account Name`,placeholder:`storageaccount`,optionRegex:`(azure.?account|account.?name|storage.?account)`})),account_key:p().optional().describe(n.of({label:`Account Key`,inputType:`password`,optionRegex:`(azure.?key|account.?key|storage.?key)`}))}).describe(n.of({direction:`two-columns`})),st=f({type:h(`coreweave`),bucket:p().nonempty().describe(n.of({label:`Bucket`,placeholder:`bucket-name`})),region:p().nonempty().describe(n.of({label:`Region`,placeholder:`US-EAST-04A`})),auth:it()}).describe(n.of({direction:`two-columns`})),ct=f({type:h(`gdrive`),credentials_json:p().optional().describe(n.of({label:`Service Account JSON`,description:`Leave empty to use browser-based authentication`,special:`secret_textarea`}))}).describe(n.of({direction:`two-columns`})),lt=f({type:h(`huggingface`),token:p().optional().describe(n.of({label:`Access Token`,description:`Leave empty to use the HF_TOKEN environment variable or cached login`,inputType:`password`,optionRegex:`(hf.?token|hugging.?face.?token|hub.?token)`}))}).describe(n.of({direction:`two-columns`}));function ut(e){return e!=null&&e!==``}var dt=f({type:h(`github`),org:p().nonempty().describe(n.of({label:`Organization or user`})),repo:p().nonempty().describe(n.of({label:`Repository`})),sha:p().optional().describe(n.of({label:`Branch, tag, or commit`,placeholder:`main`,description:`Leave empty to use the default branch`})),username:p().optional().describe(n.of({label:`Username`,description:`Set this together with access token`,optionRegex:`(github.?username|github.?user)`})),token:p().optional().describe(n.of({label:`Access Token`,description:`Set this together with username. Required for private repos and to avoid GitHub's rate limits.`,inputType:`password`,optionRegex:`(github.?token|gh.?token|github.?pat)`}))}).refine(e=>ut(e.username)===ut(e.token),{message:`Username and access token are required together`,path:[`token`]}).describe(n.of({direction:`two-columns`})),ft=g(`type`,[at,ot,Q,st,ct,lt,dt]),pt={obstore:`obstore`,fsspec:`fsspec`,huggingface_hub:`huggingface_hub`},mt=class{secrets={};get imports(){return Object.keys(this.secrets).length===0?new Set:new Set([`import os`])}print(e,t){if(t===void 0||t===``)return``;let n=`_${e}`;if(T(t)){let e=de(t);return this.secrets[n]=`os.environ.get("${e}")`,n}return`"${w(t)}"`}formatSecrets(){return Object.keys(this.secrets).length===0?``:Object.entries(this.secrets).map(([e,t])=>`${e} = ${t}`).join(`
|
|
136
|
+
`)}};function ht(e,t){if(e?.type===`Container credentials`)return[` container_credentials_full_uri=${t.print(`container_credentials_full_uri`,e.container_credentials_full_uri)},`,` container_authorization_token_file=${t.print(`container_authorization_token_file`,e.container_authorization_token_file)},`];let n=[];return e?.access_key_id&&n.push(` access_key_id=${t.print(`access_key_id`,e.access_key_id)},`),e?.secret_access_key&&n.push(` secret_access_key=${t.print(`secret_access_key`,e.secret_access_key)},`),n}function gt(e,t){let n=t.print(`bucket`,e.bucket),r=new Set([`from obstore.store import S3Store`]),i=[];e.region&&i.push(` region=${t.print(`region`,e.region)},`),i.push(...ht(e.auth,t)),e.endpoint_url&&i.push(` endpoint_url=${t.print(`endpoint_url`,e.endpoint_url)},`),e.allow_http&&i.push(` allow_http=True,`);let a=i.length>0?`\n${i.join(`
|
|
137
|
+
`)}\n`:``;return{imports:r,code:l(`
|
|
138
|
+
store = S3Store(${n},${a})
|
|
139
|
+
`)}}function _t(e,t){let n=t.print(`bucket`,e.bucket),r=new Set([`from obstore.store import GCSStore`]);if(!e.service_account_key)return{imports:r,code:l(`
|
|
140
|
+
store = GCSStore(${n})
|
|
141
|
+
`)};let i=S(e.service_account_key,e=>t.print(`service_account_key`,e));return i.kind===`path`?{imports:r,code:l(`
|
|
142
|
+
store = GCSStore(${n},
|
|
143
|
+
service_account_path="${w(i.path)}",
|
|
144
|
+
)
|
|
145
|
+
`)}:(r.add(`import json`),{imports:r,code:l(`
|
|
146
|
+
_credentials = ${i.expr}
|
|
147
|
+
store = GCSStore(${n},
|
|
148
|
+
service_account_key=_credentials,
|
|
149
|
+
)
|
|
150
|
+
`)})}function vt(e,t){let n=t.print(`container`,e.container),r=t.print(`account_name`,e.account_name),i=new Set([`from obstore.store import AzureStore`]),a=[`account_name=${r},`];return e.account_key&&a.push(`account_key=${t.print(`account_key`,e.account_key)},`),{imports:i,code:`store = AzureStore(${n},\n${a.map(e=>` ${e}`).join(`
|
|
151
|
+
`)}\n)`}}function yt(e,t){let n=t.print(`bucket`,e.bucket),r=new Set([`from obstore.store import S3Store`]),i=[` region=${t.print(`region`,e.region)},`];i.push(...ht(e.auth,t)),i.push(` endpoint="https://${e.bucket}.cwobject.com",`,` virtual_hosted_style_request=True,`);let a=`\n${i.join(`
|
|
152
|
+
`)}\n`;return{imports:r,code:l(`
|
|
153
|
+
store = S3Store(${n},${a})
|
|
154
|
+
`)}}function bt(e,t){let{secrets:n,isEmbedded:r=!1}=t,i=new Set([`from gdrive_fsspec import GoogleDriveFileSystem`]);if(e.credentials_json){let t=S(e.credentials_json,e=>n.print(`credentials_json`,e));return t.kind===`path`?{imports:i,code:l(`
|
|
155
|
+
fs = GoogleDriveFileSystem(creds="${w(t.path)}", token="service_account", use_listings_cache=False, skip_instance_cache=True)
|
|
156
|
+
`)}:(i.add(`import json`),{imports:i,code:l(`
|
|
157
|
+
_creds = ${t.expr}
|
|
158
|
+
fs = GoogleDriveFileSystem(creds=_creds, token="service_account", use_listings_cache=False, skip_instance_cache=True)
|
|
159
|
+
`)})}return{imports:i,code:l(r?`
|
|
160
|
+
fs = GoogleDriveFileSystem(use_listings_cache=False, skip_instance_cache=True, auth_kwargs={"use_local_webserver": False})
|
|
161
|
+
mo.output.clear_console()
|
|
162
|
+
`:`
|
|
163
|
+
fs = GoogleDriveFileSystem(use_listings_cache=False, skip_instance_cache=True)
|
|
164
|
+
`)}}function xt(e,t){let n=new Set([`from huggingface_hub import HfApi`]);return e.token?{imports:n,code:`hf = HfApi(token=${t.print(`token`,e.token)})`}:{imports:n,code:`hf = HfApi()`}}function St(e,t){let n=new Set([`from fsspec.implementations.github import GithubFileSystem`]),r=[`org=${t.print(`org`,e.org)},`,`repo=${t.print(`repo`,e.repo)},`];return e.sha&&r.push(`sha=${t.print(`sha`,e.sha)},`),e.username&&e.token&&r.push(`username=${t.print(`username`,e.username)},`,`token=${t.print(`token`,e.token)},`),{imports:n,code:`fs = GithubFileSystem(\n${r.map(e=>` ${e}`).join(`
|
|
165
|
+
`)}\n)`}}function Ct(e,t){ft.parse(e);let n=new mt,r;switch(e.type){case`s3`:r=gt(e,n);break;case`gcs`:r=_t(e,n);break;case`azure`:r=vt(e,n);break;case`coreweave`:r=yt(e,n);break;case`gdrive`:r=bt(e,{secrets:n,isEmbedded:t.isEmbedded});break;case`huggingface`:r=xt(e,n);break;case`github`:r=St(e,n);break;default:x(e)}let i=[...new Set([...n.imports,...r.imports])].toSorted();i.push(``);let a=n.formatSecrets();return a&&i.push(a),i.push(r.code.trim()),i.join(`
|
|
166
|
+
`)}var wt=`#232F3E`,$=[{name:`Amazon S3`,schema:at,protocol:`s3`,storageLibraries:{libraries:[`obstore`],preferred:`obstore`}},{name:`Google Cloud Storage`,schema:ot,protocol:`gcs`,storageLibraries:{libraries:[`obstore`],preferred:`obstore`}},{name:`Azure Blob Storage`,schema:Q,protocol:`azure`,storageLibraries:{libraries:[`obstore`],preferred:`obstore`}},{name:`CoreWeave`,schema:st,protocol:`coreweave`,storageLibraries:{libraries:[`obstore`],preferred:`obstore`}},{name:`Google Drive`,schema:ct,protocol:`gdrive`,storageLibraries:{libraries:[`fsspec`],preferred:`fsspec`}},{name:`Hugging Face Hub`,schema:lt,protocol:`hf`,storageLibraries:{libraries:[`huggingface_hub`],preferred:`huggingface_hub`}},{name:`GitHub`,schema:dt,protocol:`github`,storageLibraries:{libraries:[`fsspec`],preferred:`fsspec`}}],Tt=[...new Set($.flatMap(({name:e,protocol:t})=>[e,t]))],Et=e=>{let t=(0,D.c)(4),{onSelect:n}=e,r;t[0]===n?r=t[1]:(r=$.map(e=>{let{name:t,schema:r,protocol:i}=e;return(0,Z.jsx)(a,{name:t,color:wt,icon:(0,Z.jsx)(ae,{protocol:i,forceDark:!0,className:`w-7.5 h-7.5 text-white`}),onSelect:()=>n(r)},t)}),t[0]=n,t[1]=r);let i;return t[2]===r?i=t[3]:(i=(0,Z.jsx)(s,{children:r}),t[2]=r,t[3]=i),i},Dt=e=>{let t=(0,D.c)(16),{onSubmit:n,header:i}=e,{isEmbedded:a}=me(),[o,s]=(0,E.useState)(null);if(!o){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`div`,{children:(0,Z.jsx)(Et,{onSelect:s})}),t[0]=e):e=t[0];let n;return t[1]===i?n=t[2]:(n=(0,Z.jsxs)(Z.Fragment,{children:[i,e]}),t[1]=i,t[2]=n),n}let c;t[3]===o?c=t[4]:(c=$.find(e=>e.schema===o),t[3]=o,t[4]=c);let l=c?.storageLibraries,u;t[5]===l?.libraries?u=t[6]:(u=l?.libraries??[],t[5]=l?.libraries,t[6]=u);let d=l?.preferred??`obstore`,f;t[7]===a?f=t[8]:(f=(e,t)=>Ct(e,{library:t,isEmbedded:a}),t[7]=a,t[8]=f);let p;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>s(null),t[9]=p):p=t[9];let m;return t[10]!==n||t[11]!==o||t[12]!==u||t[13]!==d||t[14]!==f?(m=(0,Z.jsx)(r,{schema:o,libraries:u,preferredLibrary:d,displayNames:pt,libraryLabel:`Preferred storage library`,generateCode:f,onSubmit:n,onBack:p}),t[10]=n,t[11]=o,t[12]=u,t[13]=d,t[14]=f,t[15]=m):m=t[15],m},Ot=e=>{let t=(0,D.c)(9),{children:n,defaultTab:r}=e,i=r===void 0?`databases`:r,[a,o]=(0,E.useState)(!1),s;t[0]===n?s=t[1]:(s=(0,Z.jsx)(se,{asChild:!0,children:n}),t[0]=n,t[1]=s);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>o(!1),t[2]=c):c=t[2];let l;t[3]===i?l=t[4]:(l=(0,Z.jsx)(kt,{defaultTab:i,onClose:c}),t[3]=i,t[4]=l);let u;return t[5]!==a||t[6]!==s||t[7]!==l?(u=(0,Z.jsxs)(fe,{open:a,onOpenChange:o,children:[s,l]}),t[5]=a,t[6]=s,t[7]=l,t[8]=u):u=t[8],u},kt=e=>{let t=(0,D.c)(24),{defaultTab:n,onClose:r}=e,[i,a]=(0,E.useState)(n===void 0?`databases`:n),o;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsxs)(ne,{className:`w-full mb-4`,children:[(0,Z.jsx)(ee,{value:`databases`,className:`flex-1`,children:`Databases & Catalogs`}),(0,Z.jsx)(ee,{value:`storage`,className:`flex-1`,children:`Remote Storages`})]}),t[0]=o):o=t[0];let s=o,c;t[1]===i?c=t[2]:(c=i===`databases`?(0,Z.jsxs)(Z.Fragment,{children:[`Don't see your database or connection method? A`,` `,(0,Z.jsx)(C,{href:`https://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database`,children:`code snippet`}),` `,`is all you need.`]}):(0,Z.jsxs)(Z.Fragment,{children:[`Don't see your storage or connection method? A`,` `,(0,Z.jsx)(C,{href:`https://docs.marimo.io/guides/working_with_data/remote_storage/#creating-a-storage-connection`,children:`code snippet`}),` `,`is all you need.`]}),t[1]=i,t[2]=c);let l=c,u;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(ue,{children:`Add Connection`}),t[3]=u):u=t[3];let d;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(C,{href:`https://docs.marimo.io/guides/working_with_data/sql/#connecting-to-a-custom-database`,children:`database, data catalog`}),t[4]=d):d=t[4];let f;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(C,{href:`https://docs.marimo.io/guides/working_with_data/remote_storage/`,children:`remote storage`}),t[5]=f):f=t[5];let p;t[6]===l?p=t[7]:(p=(0,Z.jsxs)(ce,{children:[u,(0,Z.jsxs)(oe,{children:[`Connect to a`,` `,d,` `,`or`,` `,f,` `,`directly from your notebook.`,(0,Z.jsx)(`span`,{className:`block`,children:l})]})]}),t[6]=l,t[7]=p);let m=i===`storage`?`storage`:`database`,h;t[8]!==r||t[9]!==m?(h=(0,Z.jsx)(tt,{onSubmit:r,className:`-mt-2`,group:m}),t[8]=r,t[9]=m,t[10]=h):h=t[10];let g;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(g=e=>a(e),t[11]=g):g=t[11];let _;t[12]===r?_=t[13]:(_=(0,Z.jsx)(te,{value:`databases`,className:`mt-0 focus-visible:ring-0 focus-visible:ring-offset-0`,children:(0,Z.jsx)(Ze,{onSubmit:r,header:s})}),t[12]=r,t[13]=_);let v;t[14]===r?v=t[15]:(v=(0,Z.jsx)(te,{value:`storage`,className:`mt-0 focus-visible:ring-0 focus-visible:ring-offset-0`,children:(0,Z.jsx)(Dt,{onSubmit:r,header:s})}),t[14]=r,t[15]=v);let y;t[16]!==i||t[17]!==_||t[18]!==v?(y=(0,Z.jsxs)(re,{value:i,onValueChange:g,children:[_,v]}),t[16]=i,t[17]=_,t[18]=v,t[19]=y):y=t[19];let b;return t[20]!==y||t[21]!==p||t[22]!==h?(b=(0,Z.jsxs)(le,{className:`max-h-[75vh] overflow-y-auto`,children:[p,h,y]}),t[20]=y,t[21]=p,t[22]=h,t[23]=b):b=t[23],b};export{Ye as i,kt as n,Tt as r,Ot as t};
|