@marimo-team/frontend 0.24.1-dev60 → 0.24.1-dev62
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-DeTZJKkI.js → CellStatus-ByrqmRbF.js} +1 -1
- package/dist/assets/{JsonOutput-CucHb-Xd.js → JsonOutput-DbjqR1zZ.js} +1 -1
- package/dist/assets/{MarimoErrorOutput-9BDdSrft.js → MarimoErrorOutput-CidvW8yi.js} +1 -1
- package/dist/assets/{RenderHTML-9AmE10az.js → RenderHTML-DyTQ_aJR.js} +1 -1
- package/dist/assets/{RunButton-B1OO4yPE.js → RunButton-Cv_ckYEH.js} +1 -1
- package/dist/assets/{add-cell-with-ai-B382kx-8.js → add-cell-with-ai-DKAX5Wkq.js} +1 -1
- package/dist/assets/{add-connection-dialog-CCgzVaXE.js → add-connection-dialog-k-xbLWdR.js} +1 -1
- package/dist/assets/{agent-panel-tC3KSuFA.js → agent-panel-BJEEx6sL.js} +1 -1
- package/dist/assets/{ai-model-dropdown-BwTphSMd.js → ai-model-dropdown-Cwwyj9FR.js} +1 -1
- package/dist/assets/{app-config-button-C3LicTtk.js → app-config-button-DOupOPfE.js} +1 -1
- package/dist/assets/{blob-EfjbJ__b.js → blob-D2x71aTK.js} +1 -1
- package/dist/assets/{cell-editor-CR6poe2J.js → cell-editor-CA-TDKsV.js} +1 -1
- package/dist/assets/{cell-link-q2lv7md_.js → cell-link-c74wFaiz.js} +1 -1
- package/dist/assets/{cells-v0dAmt79.js → cells-DNoi9Edm.js} +3 -3
- package/dist/assets/{chat-display-C-KzQ4Sl.js → chat-display-1WcDqz9D.js} +1 -1
- package/dist/assets/{chat-panel-BM8a5kkg.js → chat-panel-BwFn9Fqv.js} +1 -1
- package/dist/assets/{chat-ui-B10QUDuE.js → chat-ui-Dh1Yvmb2.js} +1 -1
- package/dist/assets/{column-preview-DahZx7i3.js → column-preview-BrO557-t.js} +1 -1
- package/dist/assets/{command-palette-DLDqpso1.js → command-palette-09UTreJu.js} +1 -1
- package/dist/assets/{common-C-hdr6As.js → common-CAMZMCwq.js} +1 -1
- package/dist/assets/{components-Cnt-rCdC.js → components-DJLtV_Mj.js} +1 -1
- package/dist/assets/{datasource-Bq9EwG3Q.js → datasource-DVv7qUFu.js} +1 -1
- package/dist/assets/{dependency-graph-panel-DLgUYv2G.js → dependency-graph-panel-IgEoFXFw.js} +1 -1
- package/dist/assets/{documentation-panel-BIqV8dCY.js → documentation-panel-CpJX3LTt.js} +1 -1
- package/dist/assets/{download-D-WORhyV.js → download-CCPBCjzu.js} +1 -1
- package/dist/assets/{edit-page-rjLWDywQ.js → edit-page-acN1qybv.js} +4 -4
- package/dist/assets/{error-entries-DOcZqCs5.js → error-entries-DOS37j7f.js} +1 -1
- package/dist/assets/{error-panel-xPtHRph4.js → error-panel-B3q6q2Gs.js} +1 -1
- package/dist/assets/{file-explorer-panel-YhKO1Kb8.js → file-explorer-panel-uum_XPfd.js} +1 -1
- package/dist/assets/{file-icons-BI3Xijjz.js → file-icons-CLGmPKoJ.js} +1 -1
- package/dist/assets/{file-name-input-B0v9VVzS.js → file-name-input-DC441YXk.js} +1 -1
- package/dist/assets/{floating-outline-fI7KiW7l.js → floating-outline-W5HJSoBY.js} +1 -1
- package/dist/assets/{home-page-BMzFHuuq.js → home-page-ChhDXfUJ.js} +1 -1
- package/dist/assets/{index-B2a_xizI.js → index-CTgrlfah.js} +3 -3
- package/dist/assets/{layout-Dqce0OL2.js → layout-D6bpFA5-.js} +3 -3
- package/dist/assets/{logs-panel-BlKmgk9O.js → logs-panel-DmbccYWJ.js} +1 -1
- package/dist/assets/{markdown-renderer-BHFj8yJ6.js → markdown-renderer-CB2UurmB.js} +1 -1
- package/dist/assets/{name-cell-input-9y9cdffD.js → name-cell-input-CX4R8mJV.js} +1 -1
- package/dist/assets/{outline-panel-BkyU6F0r.js → outline-panel-LEx0BFUs.js} +1 -1
- package/dist/assets/{packages-panel-DGuBWpad.js → packages-panel-C1GVBEEm.js} +1 -1
- package/dist/assets/{panel-accordion-state-C2vAFKpP.js → panel-accordion-state-HNISBQa4.js} +1 -1
- package/dist/assets/{panels-ZCSZ8vcg.js → panels-DHzJd4RF.js} +1 -1
- package/dist/assets/{process-output-DmEilKB6.js → process-output-DIhqtgs6.js} +1 -1
- package/dist/assets/{readonly-code-display-2N0THiJK.js → readonly-code-display-Cee30pk_.js} +1 -1
- package/dist/assets/{readonly-python-code-DyB_sdtx.js → readonly-python-code-m_9bVgtt.js} +1 -1
- package/dist/assets/{reveal-component-DmwU8_uO.js → reveal-component-UsIugcdk.js} +1 -1
- package/dist/assets/{run-page-C-fKIihG.js → run-page-BBlp0Qjt.js} +1 -1
- package/dist/assets/{scratchpad-panel-D_0HEFCV.js → scratchpad-panel-H9rBgtaS.js} +1 -1
- package/dist/assets/{session-panel-BAqFjL9-.js → session-panel-F_IDPTWG.js} +1 -1
- package/dist/assets/{skeleton-BUOlBrWg.js → skeleton-HSX1nQ-v.js} +1 -1
- package/dist/assets/{snippets-panel-C4dcsNOG.js → snippets-panel-DpCuVkpq.js} +1 -1
- package/dist/assets/{state-Du63Xg9M.js → state-CHqSZb7R.js} +1 -1
- package/dist/assets/{state-C8pDImyF.js → state-DGgHgBN9.js} +1 -1
- package/dist/assets/{tracing-DPTkPFxO.js → tracing-BEJAq4zg.js} +1 -1
- package/dist/assets/{tracing-panel-3SQN2w-o.js → tracing-panel-D8QL7Nar.js} +2 -2
- package/dist/assets/{tree-actions-Bn9POqng.js → tree-actions-CxkW_mv4.js} +1 -1
- package/dist/assets/{useAddCell-DtdPi8nq.js → useAddCell-CAX4gqgE.js} +1 -1
- package/dist/assets/{useCellActionButton-BS300A54.js → useCellActionButton-Cje0V_da.js} +1 -1
- package/dist/assets/{useDeleteCell-Ha8ut0yy.js → useDeleteCell-CL_90v2g.js} +1 -1
- package/dist/assets/{useDependencyPanelTab-DsrUeu8t.js → useDependencyPanelTab-BEA9Hqzv.js} +1 -1
- package/dist/assets/{useNotebookActions-DdgIE9oe.js → useNotebookActions-Rn6aXLN2.js} +1 -1
- package/dist/assets/{useRunCells-CIALOcRX.js → useRunCells-DttzF-pt.js} +1 -1
- package/dist/assets/{useSplitCell-dEuZjk85.js → useSplitCell-BD2q-Clc.js} +1 -1
- package/dist/index.html +19 -19
- package/package.json +1 -1
- package/src/core/codemirror/copilot/__tests__/getCodes.test.ts +66 -1
- package/src/core/codemirror/copilot/getCodes.ts +22 -25
- package/src/core/codemirror/lsp/__tests__/notebook-lsp.test.ts +25 -0
|
@@ -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{Ao as u,Bi as d,Bn as f,E as p,Qi as m,Ua as h,Wt as g,Xi as _,Ya as v,ai as y,bo as b,co as x,cr as S,d as ee,fa as te,fo as ne,gt as re,ki as ie,ko as ae,la as oe,ni as se,pa as C,rt as ce,tr as le,vo as ue,xo as de,y as fe}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{Ao as u,Bi as d,Bn as f,E as p,Qi as m,Ua as h,Wt as g,Xi as _,Ya as v,ai as y,bo as b,co as x,cr as S,d as ee,fa as te,fo as ne,gt as re,ki as ie,ko as ae,la as oe,ni as se,pa as C,rt as ce,tr as le,vo as ue,xo as de,y as fe}from"./cells-DNoi9Edm.js";import{Cn as w,Cr as pe,In as T,It as me,Jn as E,Sn as he,Tt as D,Yn as O,bt as ge,cn as _e,jn as k,kt as A,lc as ve,ln as j,mr as ye,un as M,vn as N,vt as be,xt as xe,zt as Se}from"./schemas-aTUejmFi.js";import{t as Ce}from"./compiler-runtime-CYIjoINj.js";import{n as we}from"./utils-CUZQNAWJ.js";import{k as Te,t as Ee}from"./ai-model-dropdown-Cwwyj9FR.js";import{f as De,g as Oe}from"./useEventListener-D27Dii_l.js";import{o as ke}from"./config-DaNyNpZL.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-BMBznEru.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-CB2UurmB.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-CL_90v2g.js";import{r as mt}from"./input-DeyycFtq.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-DVv7qUFu.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-D3zvxdF3.js";import{n as Dt}from"./useRunCells-DttzF-pt.js";import{n as Ot}from"./blob-D2x71aTK.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-c74wFaiz.js";import{t as Nt}from"./html-to-image-DMn_7CCA.js";import{n as Pt}from"./renderShortcut-CS4ccH3x.js";import{n as Ft}from"./icons-CjLa9BiH.js";import{t as It}from"./process-output-DIhqtgs6.js";import{i as Lt,r as Rt,t as zt}from"./error-entries-DOS37j7f.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=Ce(),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(`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{Bi as n,Ct as r,Fn as i,Ft as a,It as o,Nt as s,On as c,Pt as l,Wo as u,bi as d}from"./cells-
|
|
1
|
+
import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{Bi as n,Ct as r,Fn as i,Ft as a,It as o,Nt as s,On as c,Pt as l,Wo as u,bi as d}from"./cells-DNoi9Edm.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-ib4asSo7.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-BG_B6y1P.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(c.of({label:`Password`,inputType:`password`,optionRegex:`(password|passwd|pgpassword|db.?pass(word)?)`}))}function k(e,t){let n=p();return n=t?n.nonempty():n.optional(),n=n.describe(c.of({label:e||`Token`,inputType:`password`,optionRegex:`(token|api.?key|access.?token|auth.?token|(^|_)pat(_|$))`})),n}function A(){return p().optional().describe(c.of({label:`Warehouse Name`,optionRegex:`(warehouse|snowflake.?warehouse)`}))}function j(e,t){let n=p();return n=t?n.nonempty():n.optional(),n.describe(c.of({label:e||`URI`,optionRegex:`(uri|url|connection.?string|database.?url|jdbc)`}))}function M(e){return p().nonempty().describe(c.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(c.of({label:`Database`,optionRegex:`(database|db.?name|pgdatabase|^DB$|^DATABASE$)`}))}function he(){return p().describe(c.of({label:`Schema`,optionRegex:`(^SCHEMA$|db.?schema|postgres.?schema|pg.?schema|_SCHEMA$)`}))}function P(){return p().nonempty().describe(c.of({label:`Username`,optionRegex:`(username|pguser|db.?user|^USER$|_USER$)`}))}function F(e){let t=u().describe(c.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(c.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(c.of({label:`Use SSL`}))}).describe(c.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(c.of({label:`Use SSL`}))}).describe(c.of({direction:`two-columns`})),ye=f({type:h(`sqlite`),database:N().describe(c.of({label:`Database Path`}))}).describe(c.of({direction:`two-columns`})),I=f({type:h(`duckdb`),database:N().describe(c.of({label:`Database Path`})),read_only:ge()}).describe(c.of({direction:`two-columns`})),L=f({type:h(`motherduck`),database:N().default(`my_db`).describe(c.of({label:`Database Name`})),token:k()}).describe(c.of({direction:`two-columns`})),R=f({type:h(`snowflake`),account:p().nonempty().describe(c.of({label:`Account`,optionRegex:`(snowflake.?account|^SNOWFLAKE_ACCOUNT$|account.?id)`})),warehouse:p().optional().describe(c.of({label:`Warehouse`,optionRegex:`(snowflake.?warehouse|warehouse)`})),database:N(),schema:p().optional().describe(c.of({label:`Schema`,optionRegex:`(snowflake.?schema|^SCHEMA$|_SCHEMA$)`})),role:p().optional().describe(c.of({label:`Role`})),authType:g(`type`,[f({type:h(`Password`),username:P(),password:O(),enable_mfa:m().default(!1).describe(c.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(c.of({label:`Private Key Path`,placeholder:`/path/to/rsa_key.p8`})),private_key_passphrase:p().optional().describe(c.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(c.of({special:`tabs`}))}).describe(c.of({direction:`two-columns`})),z=f({type:h(`bigquery`),project:p().nonempty().describe(c.of({label:`Project ID`,optionRegex:`(bigquery.?project|gcp.?project|google.?cloud.?project|project.?id)`})),dataset:p().nonempty().describe(c.of({label:`Dataset`,optionRegex:`(bigquery.?dataset|dataset)`})),credentials_json:p().describe(c.of({label:`Credentials JSON`,special:`secret_textarea`}))}).describe(c.of({direction:`two-columns`})),B=f({type:h(`clickhouse_connect`),host:M(),port:F(8123).optional(),username:P(),password:O(),secure:m().default(!1).describe(c.of({label:`Use HTTPs`})),proxy_path:p().optional().describe(c.of({label:`Proxy Path`,placeholder:`/clickhouse`}))}).describe(c.of({direction:`two-columns`})),V=f({type:h(`timeplus`),host:M().default(`localhost`),port:F(8123).optional(),username:P().default(`default`),password:O().default(``)}).describe(c.of({direction:`two-columns`})),H=f({type:h(`chdb`),database:N().describe(c.of({label:`Database Path`})),read_only:ge()}).describe(c.of({direction:`two-columns`})),U=f({type:h(`trino`),host:M(),port:F(8080),database:N(),schema:he().optional(),username:P(),password:O(),async_support:m().default(!1).describe(c.of({label:`Async Support`}))}).describe(c.of({direction:`two-columns`})),W=f({type:h(`iceberg`),name:p().describe(c.of({label:`Catalog Name`})),catalog:g(`type`,[f({type:h(`REST`),warehouse:A(),uri:p().optional().describe(c.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(c.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(c.of({label:`Profile Name`})),"dynamodb.region":p().optional().describe(c.of({label:`Region`})),"dynamodb.access-key-id":p().optional().describe(c.of({label:`Access Key ID`,inputType:`password`,optionRegex:`(access.?key.?id|aws.?access.?key)`})),"dynamodb.secret-access-key":p().optional().describe(c.of({label:`Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|aws.?secret)`})),"dynamodb.session-token":p().optional().describe(c.of({label:`Session Token`,inputType:`password`,optionRegex:`(session.?token|aws.?session)`}))})]).default({type:`REST`,token:void 0}).describe(c.of({special:`tabs`}))}),G=f({type:h(`datafusion`),sessionContext:m().optional().describe(c.of({label:`Use Session Context`}))}),K=f({type:h(`pyspark`),host:M().optional(),port:F().optional()}),q=f({type:h(`redshift`),host:M(),port:F(5439),connectionType:g(`type`,[f({type:h(`IAM credentials`),region:p().describe(c.of({label:`Region`})),aws_access_key_id:p().nonempty().describe(c.of({label:`AWS Access Key ID`,inputType:`password`,optionRegex:`(access.?key.?id|aws.?access.?key)`})),aws_secret_access_key:p().nonempty().describe(c.of({label:`AWS Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|aws.?secret)`})),aws_session_token:p().optional().describe(c.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(c.of({direction:`two-columns`})),J=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(c.of({label:`Catalog`})),schema:p().optional().describe(c.of({label:`Schema`}))}).describe(c.of({direction:`two-columns`})),be=f({type:h(`supabase`),host:M(),port:F(5432).optional(),database:N(),username:P(),password:O(),disable_client_pooling:m().default(!1).describe(c.of({label:`Disable Client-Side Pooling`}))}).describe(c.of({direction:`two-columns`})),xe=g(`type`,[_e,ve,ye,I,L,R,z,B,V,H,U,W,G,K,q,J,be]),Se={sqlmodel:`SQLModel`,sqlalchemy:`SQLAlchemy`,duckdb:`DuckDB`,clickhouse_connect:`ClickHouse Connect`,chdb:`chDB`,pyiceberg:`PyIceberg`,ibis:`Ibis`,motherduck:`MotherDuck`,redshift:`Redshift`,databricks:`Databricks`},Y=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}},Ce=e=>`_${e}`,we=class{secrets={};get imports(){return Object.keys(this.secrets).length===0?new Set:new Set([`import os`])}print(e,t,n){if(e=Ce(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`?X(t):t?`"${t}"`:``}printInFString(e,t,n){if(t===void 0)return``;if(typeof t==`number`)return`${t}`;if(typeof t==`boolean`)return X(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
2
|
`)}},Te=class extends Y{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 d(`
|
|
3
3
|
DATABASE_URL = f"postgresql://${n}:${t}@${r}:${i}/${a}"
|
|
4
4
|
engine = ${this.orm}.create_engine(DATABASE_URL${e})
|