@marimo-team/frontend 0.24.3-dev10 → 0.24.3-dev14

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.
Files changed (80) hide show
  1. package/dist/assets/{CellStatus-DXkwkuL9.js → CellStatus-LChlPuPv.js} +1 -1
  2. package/dist/assets/{JsonOutput-izmGhjov.js → JsonOutput-DCgOfk7t.js} +1 -1
  3. package/dist/assets/{MarimoErrorOutput-CdmP3ZHL.js → MarimoErrorOutput-DwGwWsxV.js} +1 -1
  4. package/dist/assets/{RenderHTML-DlYXvh8D.js → RenderHTML-B73ExmWb.js} +1 -1
  5. package/dist/assets/{RunButton-Bieadi9w.js → RunButton-iPopny2V.js} +1 -1
  6. package/dist/assets/{add-cell-with-ai-ZpV9L4qe.js → add-cell-with-ai-Zmna5Pnz.js} +1 -1
  7. package/dist/assets/{add-connection-dialog-a8mkIeXa.js → add-connection-dialog-1fPdJRRj.js} +1 -1
  8. package/dist/assets/{agent-panel-rVtDSi07.js → agent-panel-5XpCdNT3.js} +1 -1
  9. package/dist/assets/{ai-model-dropdown-C8IztRe2.js → ai-model-dropdown-DyZHVnJV.js} +1 -1
  10. package/dist/assets/{app-config-button-DLr-6jwI.js → app-config-button-hAuVQs8P.js} +1 -1
  11. package/dist/assets/{blob-B2Qs47Zi.js → blob-B6ayJpoQ.js} +1 -1
  12. package/dist/assets/{cell-editor-3VpJI5EQ.js → cell-editor-BF03RXUX.js} +6 -6
  13. package/dist/assets/{cell-link-DEXHmwy1.js → cell-link-B7ZVGcSl.js} +1 -1
  14. package/dist/assets/{cells--Hh9voS5.js → cells-CMLP1Dld.js} +2 -2
  15. package/dist/assets/{chat-display-DtQ0tOGK.js → chat-display-DITGvVMs.js} +1 -1
  16. package/dist/assets/{chat-panel-DLgUUTdo.js → chat-panel-DkD3HUqU.js} +1 -1
  17. package/dist/assets/{chat-ui-DIXDoCsM.js → chat-ui-Dbm1pCa-.js} +1 -1
  18. package/dist/assets/{column-preview-H8rmRiii.js → column-preview-oex3TMfq.js} +1 -1
  19. package/dist/assets/{command-palette-Pmg3QxZ0.js → command-palette-Bur8AlZ8.js} +1 -1
  20. package/dist/assets/{common-CrhvbKbI.js → common-BN-k-WsU.js} +1 -1
  21. package/dist/assets/{components-rCVlCccf.js → components-BPyy3wXe.js} +1 -1
  22. package/dist/assets/{datasource-DgkQfSw3.js → datasource-DDYaCFxh.js} +1 -1
  23. package/dist/assets/{dependency-graph-panel-D1BZdQJH.js → dependency-graph-panel-XotpvJGU.js} +1 -1
  24. package/dist/assets/{documentation-panel-DzNGB1Zx.js → documentation-panel-pxfRAT4P.js} +1 -1
  25. package/dist/assets/{download-DtQweFN1.js → download-BRrPmrl5.js} +1 -1
  26. package/dist/assets/{edit-page-fb5fV9UA.js → edit-page-C7Rr28Uh.js} +4 -4
  27. package/dist/assets/{error-entries-CMsalXvZ.js → error-entries-Bc5lubx5.js} +1 -1
  28. package/dist/assets/{error-panel-D6kqFA9f.js → error-panel-n7jAw6zx.js} +1 -1
  29. package/dist/assets/{file-explorer-panel-D3APtOiy.js → file-explorer-panel-BOBUXkRd.js} +1 -1
  30. package/dist/assets/{file-name-input-CdDGwb85.js → file-name-input-Brf4MYj_.js} +1 -1
  31. package/dist/assets/{floating-outline-D2WpILR-.js → floating-outline-CG-zTB22.js} +1 -1
  32. package/dist/assets/{home-page-BXgJYrZ5.js → home-page-CiNzhCq5.js} +1 -1
  33. package/dist/assets/{index-B4Fq20-p.js → index-DTkztl_B.js} +6 -6
  34. package/dist/assets/{layout-VgriO3Ll.js → layout-DUWWt2Qy.js} +3 -3
  35. package/dist/assets/{logs-panel-DsbX3K3h.js → logs-panel-Dpw-vNvJ.js} +1 -1
  36. package/dist/assets/{markdown-renderer-DD7ui8RW.js → markdown-renderer-C_dn-F0h.js} +1 -1
  37. package/dist/assets/{name-cell-input-EjA-eGvA.js → name-cell-input-DQ1AN_b1.js} +1 -1
  38. package/dist/assets/{outline-panel-DeDFCw9s.js → outline-panel-CANEwLJ7.js} +1 -1
  39. package/dist/assets/{packages-panel-B__MaP9u.js → packages-panel-Brdj0VxX.js} +1 -1
  40. package/dist/assets/{panel-accordion-state-CwLKISCL.js → panel-accordion-state-CJxJh72n.js} +1 -1
  41. package/dist/assets/{panels-c3iYYVuV.js → panels-viysxgE7.js} +1 -1
  42. package/dist/assets/{process-output-DQoLxPra.js → process-output-DTlZ_jDn.js} +1 -1
  43. package/dist/assets/{readonly-code-display-DuFy8860.js → readonly-code-display-DWORkymT.js} +1 -1
  44. package/dist/assets/{readonly-python-code-yR65TOiM.js → readonly-python-code-Cvz_-5Jh.js} +1 -1
  45. package/dist/assets/{reveal-component-CgskYNVn.js → reveal-component-sEYLer4J.js} +1 -1
  46. package/dist/assets/{run-page-C_mciAdT.js → run-page-grpBV-DF.js} +1 -1
  47. package/dist/assets/{scratchpad-panel-Bj4yxnuS.js → scratchpad-panel-CBxmZReo.js} +1 -1
  48. package/dist/assets/{session-panel-NQyDQouJ.js → session-panel-2w7efICk.js} +1 -1
  49. package/dist/assets/{skeleton-CUFHwpIk.js → skeleton-SCiqCq0i.js} +1 -1
  50. package/dist/assets/{snippets-panel-Bx2wFck8.js → snippets-panel-CvdCemOl.js} +1 -1
  51. package/dist/assets/{state-CdjswcRf.js → state-CJnYkzhz.js} +1 -1
  52. package/dist/assets/{state-CiPrV156.js → state-DuyHh3Fk.js} +1 -1
  53. package/dist/assets/{tracing-Qjfb3Qm1.js → tracing-CnQSHm2x.js} +1 -1
  54. package/dist/assets/{tracing-panel-Cj_-LD2X.js → tracing-panel-BZHx8nXa.js} +2 -2
  55. package/dist/assets/tree-actions-5rg4Zqxe.js +1 -0
  56. package/dist/assets/{useAddCell-Bvb-C_H5.js → useAddCell-4vmbxGw5.js} +1 -1
  57. package/dist/assets/{useCellActionButton-Df4qSnWR.js → useCellActionButton-BQY2nyr_.js} +1 -1
  58. package/dist/assets/{useDeleteCell-eNMTvg8D.js → useDeleteCell-CM1QzkEs.js} +1 -1
  59. package/dist/assets/{useDependencyPanelTab-BusYWoB8.js → useDependencyPanelTab-BsALWNfv.js} +1 -1
  60. package/dist/assets/{useInstallPackage-ClaR_nYb.js → useInstallPackage-Cr0TevQm.js} +1 -1
  61. package/dist/assets/useNotebookActions-BzEheQzj.js +10 -0
  62. package/dist/assets/{useRunCells-D8B7UNsg.js → useRunCells-C2e26LhV.js} +1 -1
  63. package/dist/assets/{useSplitCell-Cy7fCcQW.js → useSplitCell-CJ8nGq_h.js} +1 -1
  64. package/dist/index.html +19 -19
  65. package/package.json +1 -1
  66. package/src/components/data-table/column-explorer-panel/column-explorer.tsx +2 -6
  67. package/src/components/editor/chrome/components/feedback-button.tsx +10 -9
  68. package/src/components/editor/code/__tests__/readonly-diff.test.tsx +65 -0
  69. package/src/components/editor/code/readonly-diff.tsx +1 -1
  70. package/src/components/editor/file-tree/__tests__/tree-actions.test.tsx +54 -0
  71. package/src/components/editor/file-tree/tree-actions.tsx +11 -14
  72. package/src/core/cells/pending-delete-service.ts +12 -16
  73. package/src/core/codemirror/language/__tests__/sql.test.ts +70 -2
  74. package/src/core/codemirror/language/languages/sql/sql.ts +16 -1
  75. package/src/core/datasets/__tests__/data-source.test.ts +2 -0
  76. package/src/core/datasets/data-source-connections.ts +15 -10
  77. package/src/plugins/layout/AccordionPlugin.tsx +7 -2
  78. package/src/plugins/layout/__test__/AccordionPlugin.test.tsx +66 -0
  79. package/dist/assets/tree-actions-CmY9PFuu.js +0 -1
  80. package/dist/assets/useNotebookActions-bWJW4dS_.js +0 -10
@@ -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,D as d,Ha as f,Ja as p,Mi as m,Ui as h,Un as g,ai as _,b as v,bo as y,ca as b,ci as x,co as ee,da as te,dr as ne,f as re,fa as ie,fo as ae,ir as oe,it as se,ko as ce,qt as le,vo as ue,xo as de,yt as fe}from"./cells--Hh9voS5.js";import{Cn as S,Cr as pe,In as C,It as me,Jn as w,Sn as he,Tt as T,Yn as E,bt as ge,cn as _e,jn as D,kt as O,lc as ve,ln as k,mr as ye,un as A,vn as j,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-D5Ywm7-q.js";import{k as Te,t as Ee}from"./ai-model-dropdown-C8IztRe2.js";import{f as De,g as M}from"./useEventListener-92uWqz-P.js";import{o as Oe}from"./config-BuGkUPaK.js";import{t as ke}from"./cn-ldLVeaqm.js";import{t as Ae}from"./jsx-runtime-B74pBk57.js";import{a as je,c as Me,p as Ne,r as Pe,t as Fe}from"./dropdown-menu-DnvwbPho.js";import{t as Ie}from"./tooltip-BvU0ko_d.js";import{t as Le}from"./button-Dh8EwhsF.js";import{Gt as Re,Qt as ze,Tt as Be,Wt as Ve,Zt as He,at as Ue,dt as We,en as Ge,qt as Ke,st as qe,ut as Je,wt as Ye}from"./dist-BtC9ym6k.js";import{t as Xe}from"./createReducer-B_XmHROl.js";import{h as Ze,n as Qe,o as $e,r as et}from"./dist-DiYjQAhI.js";import{t as tt}from"./requests-C6_IaFh7.js";import{t as nt}from"./createLucideIcon-B7HeEoG2.js";import{i as rt,r as it}from"./paths-ClYq6Exe.js";import{r as at,t as ot}from"./fileToBase64-NhpNrK5l.js";import{r as st}from"./useNumberFormatter-DHJ9s6Vk.js";import{f as ct,n as lt}from"./markdown-renderer-DD7ui8RW.js";import{t as ut}from"./file-DF8n85RA.js";import{t as dt}from"./image-ab13yGv4.js";import{t as ft}from"./spinner-Ck-Hgfvj.js";import{i as pt,t as mt}from"./useDeleteCell-eNMTvg8D.js";import{r as ht}from"./input-DEbY281O.js";import{a as gt,c as _t,i as vt,n as yt,o as bt,s as xt,t as St}from"./datasource-DgkQfSw3.js";import{a as Ct}from"./dist-Cx4BE7jC.js";import{t as wt}from"./uuid-k9DpjH68.js";import{t as Tt}from"./use-toast-DpWHUGuF.js";import{a as Et}from"./session-Sz5nSFku.js";import{r as Dt}from"./useTheme-C-ri8BtY.js";import{n as Ot}from"./useRunCells-D8B7UNsg.js";import{n as kt}from"./blob-B2Qs47Zi.js";import{a as At}from"./errors-DzO-nXy-.js";import{r as jt,t as Mt}from"./esm-BHMOvJzM.js";import{i as Nt}from"./cell-link-DEXHmwy1.js";import{t as Pt}from"./html-to-image-D6GUC5q6.js";import{n as Ft}from"./renderShortcut-BE8QI9Yi.js";import{n as It}from"./icons-CjLa9BiH.js";import{t as Lt}from"./process-output-DQoLxPra.js";import{i as Rt,r as zt,t as Bt}from"./error-entries-CMsalXvZ.js";var Vt=nt(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),Ht=nt(`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`}]]),Ut=nt(`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`}]]),N=Ce(),Wt=`vercel.ai.error`,Gt=Symbol.for(Wt),Kt,qt,Jt=class e extends (qt=Error,Kt=Gt,qt){constructor({name:e,message:t,cause:n}){super(t),this[Kt]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,Wt)}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 Yt(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.toString():JSON.stringify(e)}var Xt=`AI_InvalidArgumentError`,Zt=`vercel.ai.error.${Xt}`,Qt=Symbol.for(Zt),$t,en,tn=class extends (en=Jt,$t=Qt,en){constructor({message:e,cause:t,argument:n}){super({name:Xt,message:e,cause:t}),this[$t]=!0,this.argument=n}static isInstance(e){return Jt.hasMarker(e,Zt)}},nn=`AI_JSONParseError`,rn=`vercel.ai.error.${nn}`,an=Symbol.for(rn),on,sn,cn=class extends (sn=Jt,on=an,sn){constructor({text:e,cause:t}){super({name:nn,message:`JSON parsing failed: Text: ${e}.
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,D as d,Ha as f,Ja as p,Mi as m,Ui as h,Un as g,ai as _,b as v,bo as y,ca as b,ci as x,co as ee,da as te,dr as ne,f as re,fa as ie,fo as ae,ir as oe,it as se,ko as ce,qt as le,vo as ue,xo as de,yt as fe}from"./cells-CMLP1Dld.js";import{Cn as S,Cr as pe,In as C,It as me,Jn as w,Sn as he,Tt as T,Yn as E,bt as ge,cn as _e,jn as D,kt as O,lc as ve,ln as k,mr as ye,un as A,vn as j,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-D5Ywm7-q.js";import{k as Te,t as Ee}from"./ai-model-dropdown-DyZHVnJV.js";import{f as De,g as M}from"./useEventListener-92uWqz-P.js";import{o as Oe}from"./config-BuGkUPaK.js";import{t as ke}from"./cn-ldLVeaqm.js";import{t as Ae}from"./jsx-runtime-B74pBk57.js";import{a as je,c as Me,p as Ne,r as Pe,t as Fe}from"./dropdown-menu-DnvwbPho.js";import{t as Ie}from"./tooltip-BvU0ko_d.js";import{t as Le}from"./button-Dh8EwhsF.js";import{Gt as Re,Qt as ze,Tt as Be,Wt as Ve,Zt as He,at as Ue,dt as We,en as Ge,qt as Ke,st as qe,ut as Je,wt as Ye}from"./dist-BtC9ym6k.js";import{t as Xe}from"./createReducer-B_XmHROl.js";import{h as Ze,n as Qe,o as $e,r as et}from"./dist-DiYjQAhI.js";import{t as tt}from"./requests-C6_IaFh7.js";import{t as nt}from"./createLucideIcon-B7HeEoG2.js";import{i as rt,r as it}from"./paths-ClYq6Exe.js";import{r as at,t as ot}from"./fileToBase64-NhpNrK5l.js";import{r as st}from"./useNumberFormatter-DHJ9s6Vk.js";import{f as ct,n as lt}from"./markdown-renderer-C_dn-F0h.js";import{t as ut}from"./file-DF8n85RA.js";import{t as dt}from"./image-ab13yGv4.js";import{t as ft}from"./spinner-Ck-Hgfvj.js";import{i as pt,t as mt}from"./useDeleteCell-CM1QzkEs.js";import{r as ht}from"./input-DEbY281O.js";import{a as gt,c as _t,i as vt,n as yt,o as bt,s as xt,t as St}from"./datasource-DDYaCFxh.js";import{a as Ct}from"./dist-Cx4BE7jC.js";import{t as wt}from"./uuid-k9DpjH68.js";import{t as Tt}from"./use-toast-DpWHUGuF.js";import{a as Et}from"./session-Sz5nSFku.js";import{r as Dt}from"./useTheme-C-ri8BtY.js";import{n as Ot}from"./useRunCells-C2e26LhV.js";import{n as kt}from"./blob-B6ayJpoQ.js";import{a as At}from"./errors-DzO-nXy-.js";import{r as jt,t as Mt}from"./esm-BHMOvJzM.js";import{i as Nt}from"./cell-link-B7ZVGcSl.js";import{t as Pt}from"./html-to-image-D6GUC5q6.js";import{n as Ft}from"./renderShortcut-BE8QI9Yi.js";import{n as It}from"./icons-CjLa9BiH.js";import{t as Lt}from"./process-output-DTlZ_jDn.js";import{i as Rt,r as zt,t as Bt}from"./error-entries-Bc5lubx5.js";var Vt=nt(`circle-stop`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`rect`,{x:`9`,y:`9`,width:`6`,height:`6`,rx:`1`,key:`1ssd4o`}]]),Ht=nt(`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`}]]),Ut=nt(`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`}]]),N=Ce(),Wt=`vercel.ai.error`,Gt=Symbol.for(Wt),Kt,qt,Jt=class e extends (qt=Error,Kt=Gt,qt){constructor({name:e,message:t,cause:n}){super(t),this[Kt]=!0,this.name=e,this.cause=n}static isInstance(t){return e.hasMarker(t,Wt)}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 Yt(e){return e==null?`unknown error`:typeof e==`string`?e:e instanceof Error?e.toString():JSON.stringify(e)}var Xt=`AI_InvalidArgumentError`,Zt=`vercel.ai.error.${Xt}`,Qt=Symbol.for(Zt),$t,en,tn=class extends (en=Jt,$t=Qt,en){constructor({message:e,cause:t,argument:n}){super({name:Xt,message:e,cause:t}),this[$t]=!0,this.argument=n}static isInstance(e){return Jt.hasMarker(e,Zt)}},nn=`AI_JSONParseError`,rn=`vercel.ai.error.${nn}`,an=Symbol.for(rn),on,sn,cn=class extends (sn=Jt,on=an,sn){constructor({text:e,cause:t}){super({name:nn,message:`JSON parsing failed: Text: ${e}.
2
2
  Error message: ${Yt(t)}`,cause:t}),this[on]=!0,this.text=e}static isInstance(e){return Jt.hasMarker(e,rn)}},ln=`AI_TypeValidationError`,un=`vercel.ai.error.${ln}`,dn=Symbol.for(un),fn,pn,mn=class e extends (pn=Jt,fn=dn,pn){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:ln,message:`${r}: Value: ${JSON.stringify(e)}.
3
3
  Error message: ${Yt(t)}`,cause:t}),this[fn]=!0,this.value=e,this.context=n}static isInstance(e){return Jt.hasMarker(e,un)}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})}},P;(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})(P||={});var hn;(function(e){e.mergeShapes=(e,t)=>({...e,...t})})(hn||={});var F=P.arrayToEnum([`string`,`nan`,`number`,`integer`,`float`,`boolean`,`date`,`bigint`,`symbol`,`function`,`undefined`,`null`,`array`,`object`,`unknown`,`promise`,`void`,`never`,`map`,`set`]),gn=e=>{switch(typeof e){case`undefined`:return F.undefined;case`string`:return F.string;case`number`:return Number.isNaN(e)?F.nan:F.number;case`boolean`:return F.boolean;case`function`:return F.function;case`bigint`:return F.bigint;case`symbol`:return F.symbol;case`object`:return Array.isArray(e)?F.array:e===null?F.null:e.then&&typeof e.then==`function`&&e.catch&&typeof e.catch==`function`?F.promise:typeof Map<`u`&&e instanceof Map?F.map:typeof Set<`u`&&e instanceof Set?F.set:typeof Date<`u`&&e instanceof Date?F.date:F.object;default:return F.unknown}},I=P.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`]),_n=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,P.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()}};_n.create=e=>new _n(e);var vn=(e,t)=>{let n;switch(e.code){case I.invalid_type:n=e.received===F.undefined?`Required`:`Expected ${e.expected}, received ${e.received}`;break;case I.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,P.jsonStringifyReplacer)}`;break;case I.unrecognized_keys:n=`Unrecognized key(s) in object: ${P.joinValues(e.keys,`, `)}`;break;case I.invalid_union:n=`Invalid input`;break;case I.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${P.joinValues(e.options)}`;break;case I.invalid_enum_value:n=`Invalid enum value. Expected ${P.joinValues(e.options)}, received '${e.received}'`;break;case I.invalid_arguments:n=`Invalid function arguments`;break;case I.invalid_return_type:n=`Invalid function return type`;break;case I.invalid_date:n=`Invalid date`;break;case I.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}"`:P.assertNever(e.validation):n=e.validation===`regex`?`Invalid`:`Invalid ${e.validation}`;break;case I.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 I.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 I.custom:n=`Invalid input`;break;case I.invalid_intersection_types:n=`Intersection results could not be merged`;break;case I.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case I.not_finite:n=`Number must be finite`;break;default:n=t.defaultError,P.assertNever(e)}return{message:n}},yn=vn;function bn(){return yn}var xn=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 L(e,t){let n=bn(),r=xn({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===vn?void 0:vn].filter(e=>!!e)});e.common.issues.push(r)}var R=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 z;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 z;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}}},z=Object.freeze({status:`aborted`}),Sn=e=>({status:`dirty`,value:e}),B=e=>({status:`valid`,value:e}),Cn=e=>e.status===`aborted`,wn=e=>e.status===`dirty`,Tn=e=>e.status===`valid`,En=e=>typeof Promise<`u`&&e instanceof Promise,V;(function(e){e.errToObj=e=>typeof e==`string`?{message:e}:e||{},e.toString=e=>typeof e==`string`?e:e?.message})(V||={});var Dn=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}},On=(e,t)=>{if(Tn(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 _n(e.common.issues);return this._error=t,this._error}}};function H(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 U=class{get description(){return this._def.description}_getType(e){return gn(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:gn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new R,ctx:{common:e.parent.common,data:e.data,parsedType:gn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(En(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:gn(e)};return On(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:gn(e)};if(!this[`~standard`].async)try{let n=this._parseSync({data:e,path:[],parent:t});return Tn(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=>Tn(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:gn(e)},r=this._parse({data:e,path:n.path,parent:n});return On(n,await(En(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:I.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 jr({schema:this,typeName:W.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 Mr.create(this,this._def)}nullable(){return Nr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return fr.create(this)}promise(){return Ar.create(this,this._def)}or(e){return hr.create([this,e],this._def)}and(e){return yr.create(this,e,this._def)}transform(e){return new jr({...H(this._def),schema:this,typeName:W.ZodEffects,effect:{type:`transform`,transform:e}})}default(e){let t=typeof e==`function`?e:()=>e;return new Pr({...H(this._def),innerType:this,defaultValue:t,typeName:W.ZodDefault})}brand(){return new Lr({typeName:W.ZodBranded,type:this,...H(this._def)})}catch(e){let t=typeof e==`function`?e:()=>e;return new Fr({...H(this._def),innerType:this,catchValue:t,typeName:W.ZodCatch})}describe(e){let t=this.constructor;return new t({...this._def,description:e})}pipe(e){return Rr.create(this,e)}readonly(){return zr.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},kn=/^c[^\s-]{8,}$/i,An=/^[0-9a-z]+$/,jn=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Mn=/^[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,Nn=/^[a-z0-9_-]{21}$/i,Pn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Fn=/^[-+]?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)?)??$/,In=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Ln=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`,Rn,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])$/,Bn=/^(?:(?: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])$/,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]))$/,Hn=/^(([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])$/,Un=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Wn=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Gn=`((\\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])))`,Kn=RegExp(`^${Gn}$`);function qn(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 Jn(e){return RegExp(`^${qn(e)}$`)}function Yn(e){let t=`${Gn}T${qn(e)}`,n=[];return n.push(e.local?`Z?`:`Z`),e.offset&&n.push(`([+-]\\d{2}:?\\d{2})`),t=`${t}(${n.join(`|`)})`,RegExp(`^${t}$`)}function Xn(e,t){return!!((t===`v4`||!t)&&zn.test(e)||(t===`v6`||!t)&&Vn.test(e))}function Zn(e,t){if(!Pn.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 Qn(e,t){return!!((t===`v4`||!t)&&Bn.test(e)||(t===`v6`||!t)&&Hn.test(e))}var $n=class e extends U{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==F.string){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.string,received:t.parsedType}),z}let t=new R,n;for(let r of this._def.checks)if(r.kind===`min`)e.data.length<r.value&&(n=this._getOrReturnCtx(e,n),L(n,{code:I.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),L(n,{code:I.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?L(n,{code:I.too_big,maximum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}):a&&L(n,{code:I.too_small,minimum:r.value,type:`string`,inclusive:!0,exact:!0,message:r.message}),t.dirty())}else if(r.kind===`email`)In.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`email`,code:I.invalid_string,message:r.message}),t.dirty());else if(r.kind===`emoji`)Rn||=new RegExp(Ln,`u`),Rn.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`emoji`,code:I.invalid_string,message:r.message}),t.dirty());else if(r.kind===`uuid`)Mn.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`uuid`,code:I.invalid_string,message:r.message}),t.dirty());else if(r.kind===`nanoid`)Nn.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`nanoid`,code:I.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid`)kn.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`cuid`,code:I.invalid_string,message:r.message}),t.dirty());else if(r.kind===`cuid2`)An.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`cuid2`,code:I.invalid_string,message:r.message}),t.dirty());else if(r.kind===`ulid`)jn.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`ulid`,code:I.invalid_string,message:r.message}),t.dirty());else if(r.kind===`url`)try{new URL(e.data)}catch{n=this._getOrReturnCtx(e,n),L(n,{validation:`url`,code:I.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),L(n,{validation:`regex`,code:I.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),L(n,{code:I.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),L(n,{code:I.invalid_string,validation:{startsWith:r.value},message:r.message}),t.dirty()):r.kind===`endsWith`?e.data.endsWith(r.value)||(n=this._getOrReturnCtx(e,n),L(n,{code:I.invalid_string,validation:{endsWith:r.value},message:r.message}),t.dirty()):r.kind===`datetime`?Yn(r).test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{code:I.invalid_string,validation:`datetime`,message:r.message}),t.dirty()):r.kind===`date`?Kn.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{code:I.invalid_string,validation:`date`,message:r.message}),t.dirty()):r.kind===`time`?Jn(r).test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{code:I.invalid_string,validation:`time`,message:r.message}),t.dirty()):r.kind===`duration`?Fn.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`duration`,code:I.invalid_string,message:r.message}),t.dirty()):r.kind===`ip`?Xn(e.data,r.version)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`ip`,code:I.invalid_string,message:r.message}),t.dirty()):r.kind===`jwt`?Zn(e.data,r.alg)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`jwt`,code:I.invalid_string,message:r.message}),t.dirty()):r.kind===`cidr`?Qn(e.data,r.version)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`cidr`,code:I.invalid_string,message:r.message}),t.dirty()):r.kind===`base64`?Un.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`base64`,code:I.invalid_string,message:r.message}),t.dirty()):r.kind===`base64url`?Wn.test(e.data)||(n=this._getOrReturnCtx(e,n),L(n,{validation:`base64url`,code:I.invalid_string,message:r.message}),t.dirty()):P.assertNever(r);return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement(t=>e.test(t),{validation:t,code:I.invalid_string,...V.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(e){return this._addCheck({kind:`email`,...V.errToObj(e)})}url(e){return this._addCheck({kind:`url`,...V.errToObj(e)})}emoji(e){return this._addCheck({kind:`emoji`,...V.errToObj(e)})}uuid(e){return this._addCheck({kind:`uuid`,...V.errToObj(e)})}nanoid(e){return this._addCheck({kind:`nanoid`,...V.errToObj(e)})}cuid(e){return this._addCheck({kind:`cuid`,...V.errToObj(e)})}cuid2(e){return this._addCheck({kind:`cuid2`,...V.errToObj(e)})}ulid(e){return this._addCheck({kind:`ulid`,...V.errToObj(e)})}base64(e){return this._addCheck({kind:`base64`,...V.errToObj(e)})}base64url(e){return this._addCheck({kind:`base64url`,...V.errToObj(e)})}jwt(e){return this._addCheck({kind:`jwt`,...V.errToObj(e)})}ip(e){return this._addCheck({kind:`ip`,...V.errToObj(e)})}cidr(e){return this._addCheck({kind:`cidr`,...V.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,...V.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,...V.errToObj(e?.message)})}duration(e){return this._addCheck({kind:`duration`,...V.errToObj(e)})}regex(e,t){return this._addCheck({kind:`regex`,regex:e,...V.errToObj(t)})}includes(e,t){return this._addCheck({kind:`includes`,value:e,position:t?.position,...V.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:`startsWith`,value:e,...V.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:`endsWith`,value:e,...V.errToObj(t)})}min(e,t){return this._addCheck({kind:`min`,value:e,...V.errToObj(t)})}max(e,t){return this._addCheck({kind:`max`,value:e,...V.errToObj(t)})}length(e,t){return this._addCheck({kind:`length`,value:e,...V.errToObj(t)})}nonempty(e){return this.min(1,V.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}};$n.create=e=>new $n({checks:[],typeName:W.ZodString,coerce:e?.coerce??!1,...H(e)});function er(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 tr=class e extends U{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)!==F.number){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.number,received:t.parsedType}),z}let t,n=new R;for(let r of this._def.checks)r.kind===`int`?P.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),L(t,{code:I.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),L(t,{code:I.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),L(t,{code:I.too_big,maximum:r.value,type:`number`,inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):r.kind===`multipleOf`?er(e.data,r.value)!==0&&(t=this._getOrReturnCtx(e,t),L(t,{code:I.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):r.kind===`finite`?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),L(t,{code:I.not_finite,message:r.message}),n.dirty()):P.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit(`min`,e,!0,V.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,V.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,V.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,V.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:V.toString(i)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(e){return this._addCheck({kind:`int`,message:V.toString(e)})}positive(e){return this._addCheck({kind:`min`,value:0,inclusive:!1,message:V.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:0,inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:0,inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:0,inclusive:!0,message:V.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:V.toString(t)})}finite(e){return this._addCheck({kind:`finite`,message:V.toString(e)})}safe(e){return this._addCheck({kind:`min`,inclusive:!0,value:-(2**53-1),message:V.toString(e)})._addCheck({kind:`max`,inclusive:!0,value:2**53-1,message:V.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`&&P.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)}};tr.create=e=>new tr({checks:[],typeName:W.ZodNumber,coerce:e?.coerce||!1,...H(e)});var nr=class e extends U{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)!==F.bigint)return this._getInvalidInput(e);let t,n=new R;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),L(t,{code:I.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),L(t,{code:I.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),L(t,{code:I.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):P.assertNever(r);return{status:n.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.bigint,received:t.parsedType}),z}gte(e,t){return this.setLimit(`min`,e,!0,V.toString(t))}gt(e,t){return this.setLimit(`min`,e,!1,V.toString(t))}lte(e,t){return this.setLimit(`max`,e,!0,V.toString(t))}lt(e,t){return this.setLimit(`max`,e,!1,V.toString(t))}setLimit(t,n,r,i){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:V.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:V.toString(e)})}negative(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!1,message:V.toString(e)})}nonpositive(e){return this._addCheck({kind:`max`,value:BigInt(0),inclusive:!0,message:V.toString(e)})}nonnegative(e){return this._addCheck({kind:`min`,value:BigInt(0),inclusive:!0,message:V.toString(e)})}multipleOf(e,t){return this._addCheck({kind:`multipleOf`,value:e,message:V.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}};nr.create=e=>new nr({checks:[],typeName:W.ZodBigInt,coerce:e?.coerce??!1,...H(e)});var rr=class extends U{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==F.boolean){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.boolean,received:t.parsedType}),z}return B(e.data)}};rr.create=e=>new rr({typeName:W.ZodBoolean,coerce:e?.coerce||!1,...H(e)});var ir=class e extends U{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==F.date){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.date,received:t.parsedType}),z}if(Number.isNaN(e.data.getTime()))return L(this._getOrReturnCtx(e),{code:I.invalid_date}),z;let t=new R,n;for(let r of this._def.checks)r.kind===`min`?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),L(n,{code:I.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),L(n,{code:I.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:`date`}),t.dirty()):P.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:V.toString(t)})}max(e,t){return this._addCheck({kind:`max`,value:e.getTime(),message:V.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)}};ir.create=e=>new ir({checks:[],coerce:e?.coerce||!1,typeName:W.ZodDate,...H(e)});var ar=class extends U{_parse(e){if(this._getType(e)!==F.symbol){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.symbol,received:t.parsedType}),z}return B(e.data)}};ar.create=e=>new ar({typeName:W.ZodSymbol,...H(e)});var or=class extends U{_parse(e){if(this._getType(e)!==F.undefined){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.undefined,received:t.parsedType}),z}return B(e.data)}};or.create=e=>new or({typeName:W.ZodUndefined,...H(e)});var sr=class extends U{_parse(e){if(this._getType(e)!==F.null){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.null,received:t.parsedType}),z}return B(e.data)}};sr.create=e=>new sr({typeName:W.ZodNull,...H(e)});var cr=class extends U{constructor(){super(...arguments),this._any=!0}_parse(e){return B(e.data)}};cr.create=e=>new cr({typeName:W.ZodAny,...H(e)});var lr=class extends U{constructor(){super(...arguments),this._unknown=!0}_parse(e){return B(e.data)}};lr.create=e=>new lr({typeName:W.ZodUnknown,...H(e)});var ur=class extends U{_parse(e){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.never,received:t.parsedType}),z}};ur.create=e=>new ur({typeName:W.ZodNever,...H(e)});var dr=class extends U{_parse(e){if(this._getType(e)!==F.undefined){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.void,received:t.parsedType}),z}return B(e.data)}};dr.create=e=>new dr({typeName:W.ZodVoid,...H(e)});var fr=class e extends U{_parse(e){let{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==F.array)return L(t,{code:I.invalid_type,expected:F.array,received:t.parsedType}),z;if(r.exactLength!==null){let e=t.data.length>r.exactLength.value,i=t.data.length<r.exactLength.value;(e||i)&&(L(t,{code:e?I.too_big:I.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&&(L(t,{code:I.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&&(L(t,{code:I.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 Dn(t,e,t.path,n)))).then(e=>R.mergeArray(n,e));let i=[...t.data].map((e,n)=>r.type._parseSync(new Dn(t,e,t.path,n)));return R.mergeArray(n,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:V.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:V.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:V.toString(n)}})}nonempty(e){return this.min(1,e)}};fr.create=(e,t)=>new fr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:W.ZodArray,...H(t)});function pr(e){if(e instanceof mr){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=Mr.create(pr(r))}return new mr({...e._def,shape:()=>t})}return e instanceof fr?new fr({...e._def,type:pr(e.element)}):e instanceof Mr?Mr.create(pr(e.unwrap())):e instanceof Nr?Nr.create(pr(e.unwrap())):e instanceof br?br.create(e.items.map(e=>pr(e))):e}var mr=class e extends U{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=P.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==F.object){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.object,received:t.parsedType}),z}let{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof ur&&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 Dn(n,i,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof ur){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&&(L(n,{code:I.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 Dn(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=>R.mergeObjectSync(t,e)):R.mergeObjectSync(t,o)}get shape(){return this._def.shape()}strict(t){return V.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:V.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:W.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 P.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 P.objectKeys(this.shape))t[e]||(n[e]=this.shape[e]);return new e({...this._def,shape:()=>n})}deepPartial(){return pr(this)}partial(t){let n={};for(let e of P.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 P.objectKeys(this.shape))if(t&&!t[e])n[e]=this.shape[e];else{let t=this.shape[e];for(;t instanceof Mr;)t=t._def.innerType;n[e]=t}return new e({...this._def,shape:()=>n})}keyof(){return Dr(P.objectKeys(this.shape))}};mr.create=(e,t)=>new mr({shape:()=>e,unknownKeys:`strip`,catchall:ur.create(),typeName:W.ZodObject,...H(t)}),mr.strictCreate=(e,t)=>new mr({shape:()=>e,unknownKeys:`strict`,catchall:ur.create(),typeName:W.ZodObject,...H(t)}),mr.lazycreate=(e,t)=>new mr({shape:e,unknownKeys:`strip`,catchall:ur.create(),typeName:W.ZodObject,...H(t)});var hr=class extends U{_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 _n(e.ctx.common.issues));return L(t,{code:I.invalid_union,unionErrors:n}),z}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 _n(e));return L(t,{code:I.invalid_union,unionErrors:i}),z}}get options(){return this._def.options}};hr.create=(e,t)=>new hr({options:e,typeName:W.ZodUnion,...H(t)});var gr=e=>e instanceof Tr?gr(e.schema):e instanceof jr?gr(e.innerType()):e instanceof Er?[e.value]:e instanceof Or?e.options:e instanceof kr?P.objectValues(e.enum):e instanceof Pr?gr(e._def.innerType):e instanceof or?[void 0]:e instanceof sr?[null]:e instanceof Mr?[void 0,...gr(e.unwrap())]:e instanceof Nr?[null,...gr(e.unwrap())]:e instanceof Lr||e instanceof zr?gr(e.unwrap()):e instanceof Fr?gr(e._def.innerType):[],_r=class e extends U{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==F.object)return L(t,{code:I.invalid_type,expected:F.object,received:t.parsedType}),z;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}):(L(t,{code:I.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),z)}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=gr(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:W.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:i,...H(r)})}};function vr(e,t){let n=gn(e),r=gn(t);if(e===t)return{valid:!0,data:e};if(n===F.object&&r===F.object){let n=P.objectKeys(t),r=P.objectKeys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=vr(e[n],t[n]);if(!r.valid)return{valid:!1};i[n]=r.data}return{valid:!0,data:i}}if(n===F.array&&r===F.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=vr(i,a);if(!o.valid)return{valid:!1};n.push(o.data)}return{valid:!0,data:n}}return n===F.date&&r===F.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var yr=class extends U{_parse(e){let{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(Cn(e)||Cn(r))return z;let i=vr(e.value,r.value);return i.valid?((wn(e)||wn(r))&&t.dirty(),{status:t.value,value:i.data}):(L(n,{code:I.invalid_intersection_types}),z)};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}))}};yr.create=(e,t,n)=>new yr({left:e,right:t,typeName:W.ZodIntersection,...H(n)});var br=class e extends U{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.array)return L(n,{code:I.invalid_type,expected:F.array,received:n.parsedType}),z;if(n.data.length<this._def.items.length)return L(n,{code:I.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:`array`}),z;!this._def.rest&&n.data.length>this._def.items.length&&(L(n,{code:I.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 Dn(n,e,n.path,t)):null}).filter(e=>!!e);return n.common.async?Promise.all(r).then(e=>R.mergeArray(t,e)):R.mergeArray(t,r)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};br.create=(e,t)=>{if(!Array.isArray(e))throw Error(`You must pass an array of schemas to z.tuple([ ... ])`);return new br({items:e,typeName:W.ZodTuple,rest:null,...H(t)})};var xr=class e extends U{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!==F.object)return L(n,{code:I.invalid_type,expected:F.object,received:n.parsedType}),z;let r=[],i=this._def.keyType,a=this._def.valueType;for(let e in n.data)r.push({key:i._parse(new Dn(n,e,n.path,e)),value:a._parse(new Dn(n,n.data[e],n.path,e)),alwaysSet:e in n.data});return n.common.async?R.mergeObjectAsync(t,r):R.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof U?new e({keyType:t,valueType:n,typeName:W.ZodRecord,...H(r)}):new e({keyType:$n.create(),valueType:t,typeName:W.ZodRecord,...H(n)})}},Sr=class extends U{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!==F.map)return L(n,{code:I.invalid_type,expected:F.map,received:n.parsedType}),z;let r=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([e,t],a)=>({key:r._parse(new Dn(n,e,n.path,[a,`key`])),value:i._parse(new Dn(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 z;(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 z;(r.status===`dirty`||i.status===`dirty`)&&t.dirty(),e.set(r.value,i.value)}return{status:t.value,value:e}}}};Sr.create=(e,t,n)=>new Sr({valueType:t,keyType:e,typeName:W.ZodMap,...H(n)});var Cr=class e extends U{_parse(e){let{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==F.set)return L(n,{code:I.invalid_type,expected:F.set,received:n.parsedType}),z;let r=this._def;r.minSize!==null&&n.data.size<r.minSize.value&&(L(n,{code:I.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&&(L(n,{code:I.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 z;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 Dn(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:V.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:V.toString(n)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}};Cr.create=(e,t)=>new Cr({valueType:e,minSize:null,maxSize:null,typeName:W.ZodSet,...H(t)});var wr=class e extends U{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==F.function)return L(t,{code:I.invalid_type,expected:F.function,received:t.parsedType}),z;function n(e,n){return xn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,bn(),vn].filter(e=>!!e),issueData:{code:I.invalid_arguments,argumentsError:n}})}function r(e,n){return xn({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,bn(),vn].filter(e=>!!e),issueData:{code:I.invalid_return_type,returnTypeError:n}})}let i={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof Ar){let e=this;return B(async function(...t){let o=new _n([]),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 B(function(...t){let o=e._def.args.safeParse(t,i);if(!o.success)throw new _n([n(t,o.error)]);let s=Reflect.apply(a,this,o.data),c=e._def.returns.safeParse(s,i);if(!c.success)throw new _n([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:br.create(t).rest(lr.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||br.create([]).rest(lr.create()),returns:n||lr.create(),typeName:W.ZodFunction,...H(r)})}},Tr=class extends U{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})}};Tr.create=(e,t)=>new Tr({getter:e,typeName:W.ZodLazy,...H(t)});var Er=class extends U{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return L(t,{received:t.data,code:I.invalid_literal,expected:this._def.value}),z}return{status:`valid`,value:e.data}}get value(){return this._def.value}};Er.create=(e,t)=>new Er({value:e,typeName:W.ZodLiteral,...H(t)});function Dr(e,t){return new Or({values:e,typeName:W.ZodEnum,...H(t)})}var Or=class e extends U{_parse(e){if(typeof e.data!=`string`){let t=this._getOrReturnCtx(e),n=this._def.values;return L(t,{expected:P.joinValues(n),received:t.parsedType,code:I.invalid_type}),z}if(this._cache||=new Set(this._def.values),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),n=this._def.values;return L(t,{received:t.data,code:I.invalid_enum_value,options:n}),z}return B(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})}};Or.create=Dr;var kr=class extends U{_parse(e){let t=P.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==F.string&&n.parsedType!==F.number){let e=P.objectValues(t);return L(n,{expected:P.joinValues(e),received:n.parsedType,code:I.invalid_type}),z}if(this._cache||=new Set(P.getValidEnumValues(this._def.values)),!this._cache.has(e.data)){let e=P.objectValues(t);return L(n,{received:n.data,code:I.invalid_enum_value,options:e}),z}return B(e.data)}get enum(){return this._def.values}};kr.create=(e,t)=>new kr({values:e,typeName:W.ZodNativeEnum,...H(t)});var Ar=class extends U{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==F.promise&&t.common.async===!1?(L(t,{code:I.invalid_type,expected:F.promise,received:t.parsedType}),z):B((t.parsedType===F.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}};Ar.create=(e,t)=>new Ar({type:e,typeName:W.ZodPromise,...H(t)});var jr=class extends U{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===W.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=>{L(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 z;let r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return r.status===`aborted`?z:r.status===`dirty`||t.value===`dirty`?Sn(r.value):r});{if(t.value===`aborted`)return z;let r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return r.status===`aborted`?z:r.status===`dirty`||t.value===`dirty`?Sn(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`?z:(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`?z:(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(!Tn(e))return z;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=>Tn(e)?Promise.resolve(r.transform(e.value,i)).then(e=>({status:t.value,value:e})):z)}P.assertNever(r)}};jr.create=(e,t,n)=>new jr({schema:e,typeName:W.ZodEffects,effect:t,...H(n)}),jr.createWithPreprocess=(e,t,n)=>new jr({schema:t,effect:{type:`preprocess`,transform:e},typeName:W.ZodEffects,...H(n)});var Mr=class extends U{_parse(e){return this._getType(e)===F.undefined?B(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Mr.create=(e,t)=>new Mr({innerType:e,typeName:W.ZodOptional,...H(t)});var Nr=class extends U{_parse(e){return this._getType(e)===F.null?B(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Nr.create=(e,t)=>new Nr({innerType:e,typeName:W.ZodNullable,...H(t)});var Pr=class extends U{_parse(e){let{ctx:t}=this._processInputParams(e),n=t.data;return t.parsedType===F.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}};Pr.create=(e,t)=>new Pr({innerType:e,typeName:W.ZodDefault,defaultValue:typeof t.default==`function`?t.default:()=>t.default,...H(t)});var Fr=class extends U{_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 En(r)?r.then(e=>({status:`valid`,value:e.status===`valid`?e.value:this._def.catchValue({get error(){return new _n(n.common.issues)},input:n.data})})):{status:`valid`,value:r.status===`valid`?r.value:this._def.catchValue({get error(){return new _n(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Fr.create=(e,t)=>new Fr({innerType:e,typeName:W.ZodCatch,catchValue:typeof t.catch==`function`?t.catch:()=>t.catch,...H(t)});var Ir=class extends U{_parse(e){if(this._getType(e)!==F.nan){let t=this._getOrReturnCtx(e);return L(t,{code:I.invalid_type,expected:F.nan,received:t.parsedType}),z}return{status:`valid`,value:e.data}}};Ir.create=e=>new Ir({typeName:W.ZodNaN,...H(e)});var Lr=class extends U{_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}},Rr=class e extends U{_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`?z:e.status===`dirty`?(t.dirty(),Sn(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`?z: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:W.ZodPipeline})}},zr=class extends U{_parse(e){let t=this._def.innerType._parse(e),n=e=>(Tn(e)&&(e.value=Object.freeze(e.value)),e);return En(t)?t.then(e=>n(e)):n(t)}unwrap(){return this._def.innerType}};zr.create=(e,t)=>new zr({innerType:e,typeName:W.ZodReadonly,...H(t)}),mr.lazycreate;var W;(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`})(W||={}),$n.create,tr.create,Ir.create,nr.create,rr.create,ir.create,ar.create,or.create,sr.create,cr.create,lr.create,ur.create,dr.create,fr.create,mr.create,mr.strictCreate,hr.create,_r.create,yr.create,br.create,xr.create,Sr.create,Cr.create,wr.create,Tr.create,Er.create,Or.create,kr.create,Ar.create,jr.create,Mr.create,Nr.create,jr.createWithPreprocess,Rr.create;var Br=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}},Vr=10,Hr=13,Ur=32;function Wr(e){}function Gr(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=Wr,onError:n=Wr,onRetry:r=Wr,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 Br(`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{Ci as n,Et as r,It as i,Lt as a,Rn as o,Rt as s,Ui as c,Wo as l,jn as u,zt as d}from"./cells--Hh9voS5.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-Cy1qXLzH.js";import{i as b,t as ie}from"./tooltip-BvU0ko_d.js";import{r as x}from"./strings-CReV1AYG.js";import{t as ae}from"./components-DUYCXngU.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-CSWlDX_Z.js";import{t as pe}from"./plus-C4J9gIE1.js";import{t as me}from"./useIframeCapabilities-C7Di8f2y.js";var E=e(t(),1),D=_();function O(){return p().optional().describe(u.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(u.of({label:e||`Token`,inputType:`password`,optionRegex:`(token|api.?key|access.?token|auth.?token|(^|_)pat(_|$))`})),n}function A(){return p().optional().describe(u.of({label:`Warehouse Name`,optionRegex:`(warehouse|snowflake.?warehouse)`}))}function j(e,t){let n=p();return n=t?n.nonempty():n.optional(),n.describe(u.of({label:e||`URI`,optionRegex:`(uri|url|connection.?string|database.?url|jdbc)`}))}function M(e){return p().nonempty().describe(u.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(u.of({label:`Database`,optionRegex:`(database|db.?name|pgdatabase|^DB$|^DATABASE$)`}))}function he(){return p().describe(u.of({label:`Schema`,optionRegex:`(^SCHEMA$|db.?schema|postgres.?schema|pg.?schema|_SCHEMA$)`}))}function P(){return p().nonempty().describe(u.of({label:`Username`,optionRegex:`(username|pguser|db.?user|^USER$|_USER$)`}))}function F(e){let t=l().describe(u.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(u.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(u.of({label:`Use SSL`}))}).describe(u.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(u.of({label:`Use SSL`}))}).describe(u.of({direction:`two-columns`})),ye=f({type:h(`sqlite`),database:N().describe(u.of({label:`Database Path`}))}).describe(u.of({direction:`two-columns`})),be=f({type:h(`duckdb`),database:N().describe(u.of({label:`Database Path`})),read_only:ge()}).describe(u.of({direction:`two-columns`})),I=f({type:h(`motherduck`),database:N().default(`my_db`).describe(u.of({label:`Database Name`})),token:k()}).describe(u.of({direction:`two-columns`})),L=f({type:h(`snowflake`),account:p().nonempty().describe(u.of({label:`Account`,optionRegex:`(snowflake.?account|^SNOWFLAKE_ACCOUNT$|account.?id)`})),warehouse:p().optional().describe(u.of({label:`Warehouse`,optionRegex:`(snowflake.?warehouse|warehouse)`})),database:N(),schema:p().optional().describe(u.of({label:`Schema`,optionRegex:`(snowflake.?schema|^SCHEMA$|_SCHEMA$)`})),role:p().optional().describe(u.of({label:`Role`})),authType:g(`type`,[f({type:h(`Password`),username:P(),password:O(),enable_mfa:m().default(!1).describe(u.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(u.of({label:`Private Key Path`,placeholder:`/path/to/rsa_key.p8`})),private_key_passphrase:p().optional().describe(u.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(u.of({special:`tabs`}))}).describe(u.of({direction:`two-columns`})),R=f({type:h(`bigquery`),project:p().nonempty().describe(u.of({label:`Project ID`,optionRegex:`(bigquery.?project|gcp.?project|google.?cloud.?project|project.?id)`})),dataset:p().nonempty().describe(u.of({label:`Dataset`,optionRegex:`(bigquery.?dataset|dataset)`})),credentials_json:p().describe(u.of({label:`Credentials JSON`,special:`secret_textarea`}))}).describe(u.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(u.of({label:`Use HTTPs`})),proxy_path:p().optional().describe(u.of({label:`Proxy Path`,placeholder:`/clickhouse`}))}).describe(u.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(u.of({direction:`two-columns`})),V=f({type:h(`chdb`),database:N().describe(u.of({label:`Database Path`})),read_only:ge()}).describe(u.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(u.of({label:`Async Support`}))}).describe(u.of({direction:`two-columns`})),U=f({type:h(`iceberg`),name:p().describe(u.of({label:`Catalog Name`})),catalog:g(`type`,[f({type:h(`REST`),warehouse:A(),uri:p().optional().describe(u.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(u.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(u.of({label:`Profile Name`})),"dynamodb.region":p().optional().describe(u.of({label:`Region`})),"dynamodb.access-key-id":p().optional().describe(u.of({label:`Access Key ID`,inputType:`password`,optionRegex:`(access.?key.?id|aws.?access.?key)`})),"dynamodb.secret-access-key":p().optional().describe(u.of({label:`Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|aws.?secret)`})),"dynamodb.session-token":p().optional().describe(u.of({label:`Session Token`,inputType:`password`,optionRegex:`(session.?token|aws.?session)`}))})]).default({type:`REST`,token:void 0}).describe(u.of({special:`tabs`}))}),W=f({type:h(`datafusion`),sessionContext:m().optional().describe(u.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(u.of({label:`Region`})),aws_access_key_id:p().nonempty().describe(u.of({label:`AWS Access Key ID`,inputType:`password`,optionRegex:`(access.?key.?id|aws.?access.?key)`})),aws_secret_access_key:p().nonempty().describe(u.of({label:`AWS Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|aws.?secret)`})),aws_session_token:p().optional().describe(u.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(u.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(u.of({label:`Catalog`})),schema:p().optional().describe(u.of({label:`Schema`}))}).describe(u.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(u.of({label:`Disable Client-Side Pooling`}))}).describe(u.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(`
1
+ import{a as e}from"./rolldown-runtime-B0Z9INg1.js";import{t}from"./react-CBDbhulC.js";import{Ci as n,Et as r,It as i,Lt as a,Rn as o,Rt as s,Ui as c,Wo as l,jn as u,zt as d}from"./cells-CMLP1Dld.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-Cy1qXLzH.js";import{i as b,t as ie}from"./tooltip-BvU0ko_d.js";import{r as x}from"./strings-CReV1AYG.js";import{t as ae}from"./components-DUYCXngU.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-CSWlDX_Z.js";import{t as pe}from"./plus-C4J9gIE1.js";import{t as me}from"./useIframeCapabilities-C7Di8f2y.js";var E=e(t(),1),D=_();function O(){return p().optional().describe(u.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(u.of({label:e||`Token`,inputType:`password`,optionRegex:`(token|api.?key|access.?token|auth.?token|(^|_)pat(_|$))`})),n}function A(){return p().optional().describe(u.of({label:`Warehouse Name`,optionRegex:`(warehouse|snowflake.?warehouse)`}))}function j(e,t){let n=p();return n=t?n.nonempty():n.optional(),n.describe(u.of({label:e||`URI`,optionRegex:`(uri|url|connection.?string|database.?url|jdbc)`}))}function M(e){return p().nonempty().describe(u.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(u.of({label:`Database`,optionRegex:`(database|db.?name|pgdatabase|^DB$|^DATABASE$)`}))}function he(){return p().describe(u.of({label:`Schema`,optionRegex:`(^SCHEMA$|db.?schema|postgres.?schema|pg.?schema|_SCHEMA$)`}))}function P(){return p().nonempty().describe(u.of({label:`Username`,optionRegex:`(username|pguser|db.?user|^USER$|_USER$)`}))}function F(e){let t=l().describe(u.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(u.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(u.of({label:`Use SSL`}))}).describe(u.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(u.of({label:`Use SSL`}))}).describe(u.of({direction:`two-columns`})),ye=f({type:h(`sqlite`),database:N().describe(u.of({label:`Database Path`}))}).describe(u.of({direction:`two-columns`})),be=f({type:h(`duckdb`),database:N().describe(u.of({label:`Database Path`})),read_only:ge()}).describe(u.of({direction:`two-columns`})),I=f({type:h(`motherduck`),database:N().default(`my_db`).describe(u.of({label:`Database Name`})),token:k()}).describe(u.of({direction:`two-columns`})),L=f({type:h(`snowflake`),account:p().nonempty().describe(u.of({label:`Account`,optionRegex:`(snowflake.?account|^SNOWFLAKE_ACCOUNT$|account.?id)`})),warehouse:p().optional().describe(u.of({label:`Warehouse`,optionRegex:`(snowflake.?warehouse|warehouse)`})),database:N(),schema:p().optional().describe(u.of({label:`Schema`,optionRegex:`(snowflake.?schema|^SCHEMA$|_SCHEMA$)`})),role:p().optional().describe(u.of({label:`Role`})),authType:g(`type`,[f({type:h(`Password`),username:P(),password:O(),enable_mfa:m().default(!1).describe(u.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(u.of({label:`Private Key Path`,placeholder:`/path/to/rsa_key.p8`})),private_key_passphrase:p().optional().describe(u.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(u.of({special:`tabs`}))}).describe(u.of({direction:`two-columns`})),R=f({type:h(`bigquery`),project:p().nonempty().describe(u.of({label:`Project ID`,optionRegex:`(bigquery.?project|gcp.?project|google.?cloud.?project|project.?id)`})),dataset:p().nonempty().describe(u.of({label:`Dataset`,optionRegex:`(bigquery.?dataset|dataset)`})),credentials_json:p().describe(u.of({label:`Credentials JSON`,special:`secret_textarea`}))}).describe(u.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(u.of({label:`Use HTTPs`})),proxy_path:p().optional().describe(u.of({label:`Proxy Path`,placeholder:`/clickhouse`}))}).describe(u.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(u.of({direction:`two-columns`})),V=f({type:h(`chdb`),database:N().describe(u.of({label:`Database Path`})),read_only:ge()}).describe(u.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(u.of({label:`Async Support`}))}).describe(u.of({direction:`two-columns`})),U=f({type:h(`iceberg`),name:p().describe(u.of({label:`Catalog Name`})),catalog:g(`type`,[f({type:h(`REST`),warehouse:A(),uri:p().optional().describe(u.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(u.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(u.of({label:`Profile Name`})),"dynamodb.region":p().optional().describe(u.of({label:`Region`})),"dynamodb.access-key-id":p().optional().describe(u.of({label:`Access Key ID`,inputType:`password`,optionRegex:`(access.?key.?id|aws.?access.?key)`})),"dynamodb.secret-access-key":p().optional().describe(u.of({label:`Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|aws.?secret)`})),"dynamodb.session-token":p().optional().describe(u.of({label:`Session Token`,inputType:`password`,optionRegex:`(session.?token|aws.?session)`}))})]).default({type:`REST`,token:void 0}).describe(u.of({special:`tabs`}))}),W=f({type:h(`datafusion`),sessionContext:m().optional().describe(u.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(u.of({label:`Region`})),aws_access_key_id:p().nonempty().describe(u.of({label:`AWS Access Key ID`,inputType:`password`,optionRegex:`(access.?key.?id|aws.?access.?key)`})),aws_secret_access_key:p().nonempty().describe(u.of({label:`AWS Secret Access Key`,inputType:`password`,optionRegex:`(secret.?access.?key|aws.?secret)`})),aws_session_token:p().optional().describe(u.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(u.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(u.of({label:`Catalog`})),schema:p().optional().describe(u.of({label:`Schema`}))}).describe(u.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(u.of({label:`Disable Client-Side Pooling`}))}).describe(u.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
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),r=this.secrets.printInFString(`username`,this.connection.username),i=this.secrets.printInFString(`host`,this.connection.host),a=this.secrets.printInFString(`port`,this.connection.port),o=this.secrets.printInFString(`database`,this.connection.database);return n(`
3
3
  DATABASE_URL = f"postgresql://${r}:${t}@${i}:${a}/${o}"
4
4
  engine = ${this.orm}.create_engine(DATABASE_URL${e})