@marimo-team/frontend 0.13.15-dev94621 → 0.13.15-dev95169

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 (126) hide show
  1. package/dist/assets/ConnectedDataExplorerComponent-DMbAMOE2.js +19 -0
  2. package/dist/assets/{ImageComparisonComponent-Dbj__lai.js → ImageComparisonComponent-Dt2c0WI0.js} +1 -1
  3. package/dist/assets/VegaLite-BC6OiOdc.js +189 -0
  4. package/dist/assets/{_baseEach-BqAvOD8c.js → _baseEach-xrSKUL6D.js} +1 -1
  5. package/dist/assets/_baseMap-Co5Ctxc-.js +1 -0
  6. package/dist/assets/{_baseUniq-B0Npei9m.js → _baseUniq-tXYh6-hn.js} +1 -1
  7. package/dist/assets/{_createAggregator-BKA_Ss1e.js → _createAggregator-OgVuAWwe.js} +1 -1
  8. package/dist/assets/{any-language-editor-DTaSEcVG.js → any-language-editor-BfurezbZ.js} +2 -2
  9. package/dist/assets/arc-Cuwikxov.js +1 -0
  10. package/dist/assets/architectureDiagram-IEHRJDOE-B0hSM5NU.js +36 -0
  11. package/dist/assets/{blockDiagram-JOT3LUYC-Bnf2UxpD.js → blockDiagram-JOT3LUYC-DgC3NNDI.js} +2 -2
  12. package/dist/assets/{c4Diagram-VJAJSXHY-QxUdLc-K.js → c4Diagram-VJAJSXHY-D683l2ZX.js} +2 -2
  13. package/dist/assets/channel-cHKKjSyd.js +1 -0
  14. package/dist/assets/{chunk-4BMEZGHF-H7EEQl6q.js → chunk-4BMEZGHF-B3HxruSo.js} +1 -1
  15. package/dist/assets/{chunk-A2AXSNBT-D13pJwJM.js → chunk-A2AXSNBT-Ci2DD3Bw.js} +1 -1
  16. package/dist/assets/{chunk-AEK57VVT-BWCVlBB5.js → chunk-AEK57VVT-tVa1eJrk.js} +1 -1
  17. package/dist/assets/{chunk-D6G4REZN-C62AHwHx.js → chunk-D6G4REZN-DOUGMytM.js} +1 -1
  18. package/dist/assets/{chunk-RZ5BOZE2-CmPMfSaj.js → chunk-RZ5BOZE2-CrRBfGxp.js} +1 -1
  19. package/dist/assets/{chunk-XZIHB7SX-GHZeRWxO.js → chunk-XZIHB7SX-D7gtlskS.js} +1 -1
  20. package/dist/assets/{circle-play-BvX3Ulrl.js → circle-play-aLPCmGWb.js} +1 -1
  21. package/dist/assets/classDiagram-GIVACNV2-B701bM1H.js +1 -0
  22. package/dist/assets/classDiagram-v2-COTLJTTW-B701bM1H.js +1 -0
  23. package/dist/assets/clone-DOhAYwvT.js +1 -0
  24. package/dist/assets/compile-Bmr75iPx.js +10 -0
  25. package/dist/assets/{cytoscape.esm-C11VZyMT.js → cytoscape.esm-C5gjFiAL.js} +1 -1
  26. package/dist/assets/{dagre-OKDRZEBW-CtuQChdp.js → dagre-OKDRZEBW-wTmEuHGH.js} +1 -1
  27. package/dist/assets/{data-editor-3Ux39S9C.js → data-editor-BFY1-e4L.js} +3 -3
  28. package/dist/assets/{diagram-SSKATNLV-BqcJFrNF.js → diagram-SSKATNLV-CKu0fGwH.js} +1 -1
  29. package/dist/assets/{diagram-VNBRO52H-Cs8fyIXd.js → diagram-VNBRO52H-DxtPa1lw.js} +1 -1
  30. package/dist/assets/edit-page-OL6bLqPt.js +144 -0
  31. package/dist/assets/edit-page-jDQVLtmt.css +1 -0
  32. package/dist/assets/{erDiagram-Q7BY3M3F-BMgqLKmD.js → erDiagram-Q7BY3M3F-B1g7wlXr.js} +1 -1
  33. package/dist/assets/{flowDiagram-4HSFHLVR-DciiR0rj.js → flowDiagram-4HSFHLVR-CxhoMzRq.js} +1 -1
  34. package/dist/assets/{ganttDiagram-APWFNJXF-BpEW8IYZ.js → ganttDiagram-APWFNJXF-DBTZJFAx.js} +3 -3
  35. package/dist/assets/{gitGraphDiagram-7IBYFJ6S-BaSDKKIa.js → gitGraphDiagram-7IBYFJ6S-C266q9QJ.js} +3 -3
  36. package/dist/assets/{graph-DL39zUTR.js → graph-CyYfFYfg.js} +1 -1
  37. package/dist/assets/home-page-B7cbUfJl.js +9 -0
  38. package/dist/assets/{index-FqMljUBK.js → index-3k9JrDIu.js} +1 -1
  39. package/dist/assets/{index-DB5cKm7z.js → index-3lKcEd4T.js} +1 -1
  40. package/dist/assets/{index-Doh84EGk.js → index-7cpS98VS.js} +1 -1
  41. package/dist/assets/{index-Pi193pwF.js → index-B2hYczV1.js} +1 -1
  42. package/dist/assets/index-BHCV7iZe.js +1 -0
  43. package/dist/assets/{index-CrCsM3ik.js → index-B_dRl7Km.js} +1 -1
  44. package/dist/assets/index-Bs5GWuAv.js +1 -0
  45. package/dist/assets/index-ByFAVbrc.js +498 -0
  46. package/dist/assets/{index-Bm_ScR8y.js → index-CAzz96VI.js} +1 -1
  47. package/dist/assets/{index-q272cbnk.js → index-CD9p0BAM.js} +1 -1
  48. package/dist/assets/{index--agldwX6.js → index-CDEi0MFT.js} +1 -1
  49. package/dist/assets/{index-BKtaZn1Q.js → index-CLi3elum.js} +1 -1
  50. package/dist/assets/{index-Bal79f_9.js → index-CVAd0sqi.js} +1 -1
  51. package/dist/assets/{index-BCFYFtQv.js → index-Czxzx51b.js} +1 -1
  52. package/dist/assets/{index-KDcItMxX.js → index-D_TLJ-v4.js} +1 -1
  53. package/dist/assets/{index-DbDeTxOP.js → index-DtCGXDXQ.js} +1 -1
  54. package/dist/assets/index-N-a4M2pk.css +1 -0
  55. package/dist/assets/{index-gMYKBEpG.js → index-Qr_sLZh_.js} +1 -1
  56. package/dist/assets/{index-Ct_PXOmA.js → index-uZdlLtIL.js} +1 -1
  57. package/dist/assets/{index-CbJeiKW0.js → index-xoF5D1eb.js} +1 -1
  58. package/dist/assets/infoDiagram-PH2N3AL5-CivcoKxu.js +2 -0
  59. package/dist/assets/{journeyDiagram-U35MCT3I-CuqLlejI.js → journeyDiagram-U35MCT3I-CH8869D9.js} +1 -1
  60. package/dist/assets/{kanban-definition-NDS4AKOZ-DgKxUGj4.js → kanban-definition-NDS4AKOZ-Bnb6zVFB.js} +1 -1
  61. package/dist/assets/layout-BIwj_D7w.js +1 -0
  62. package/dist/assets/{linear-pbz19uUF.js → linear-DMCeXg_c.js} +1 -1
  63. package/dist/assets/{mermaid-WxgDr0hv.js → mermaid-B0jSmOfJ.js} +5 -5
  64. package/dist/assets/{min-DdE4sYeY.js → min-CkHnq4VQ.js} +1 -1
  65. package/dist/assets/mindmap-definition-ALO5MXBD-BI9VR8Cf.js +95 -0
  66. package/dist/assets/panels-DcAzAz16.css +1 -0
  67. package/dist/assets/panels-cAXK7Jyh.js +27 -0
  68. package/dist/assets/{pieDiagram-IB7DONF6-DgEbYdHg.js → pieDiagram-IB7DONF6-D8VINHB_.js} +1 -1
  69. package/dist/assets/{quadrantDiagram-7GDLP6J5-BSWFuF0Y.js → quadrantDiagram-7GDLP6J5-BFS28tw4.js} +1 -1
  70. package/dist/assets/{radar-MK3ICKWK-BJDjrXWM.js → radar-MK3ICKWK-DSVT3cXG.js} +1 -1
  71. package/dist/assets/{react-plotly-C5U3mvED.js → react-plotly-BNW3vCgp.js} +20 -20
  72. package/dist/assets/{requirementDiagram-KVF5MWMF-D8uDxIAJ.js → requirementDiagram-KVF5MWMF-CfI13owT.js} +1 -1
  73. package/dist/assets/run-page-DjmUhHLl.js +1 -0
  74. package/dist/assets/{sankeyDiagram-QLVOVGJD-73tcIslD.js → sankeyDiagram-QLVOVGJD-BeJLaDns.js} +3 -3
  75. package/dist/assets/save-worker-CULn6QYm.js +1 -0
  76. package/dist/assets/{sequenceDiagram-X6HHIX6F-r3ic9pyn.js → sequenceDiagram-X6HHIX6F-B1RwH1-2.js} +1 -1
  77. package/dist/assets/slides-component-CVrMbfwN.js +1 -0
  78. package/dist/assets/{sortBy-BpSlonWp.js → sortBy-BiofcvTm.js} +1 -1
  79. package/dist/assets/{stateDiagram-DGXRK772-Mpm66CPm.js → stateDiagram-DGXRK772-CIUlnvCJ.js} +1 -1
  80. package/dist/assets/stateDiagram-v2-YXO3MK2T-kL9s1PVF.js +1 -0
  81. package/dist/assets/{terminal-BQOcln6v.js → terminal-C62pbxD3.js} +4 -4
  82. package/dist/assets/{time-Cn-0oAKv.js → time-B4kWZB7X.js} +1 -1
  83. package/dist/assets/{timeline-definition-BDJGKUSR-CA21Dmu1.js → timeline-definition-BDJGKUSR-DhI3tww5.js} +1 -1
  84. package/dist/assets/timer-DFzT7np-.js +1 -0
  85. package/dist/assets/tracing-DRxcEDwj.js +2 -0
  86. package/dist/assets/{transform-BzDy4yXW.js → transform-Cyp0GDF-.js} +1 -1
  87. package/dist/assets/tree-BeiPW5VN.js +17 -0
  88. package/dist/assets/vega-component-DZaNq-Dj.js +1 -0
  89. package/dist/assets/worker-C9vrNVln.js +1 -0
  90. package/dist/assets/worker-DsmMBHp1.js +1 -0
  91. package/dist/assets/{xychartDiagram-VJFVF3MP-DxgSMkAS.js → xychartDiagram-VJFVF3MP-Dww8gmBA.js} +1 -1
  92. package/dist/index.html +2 -2
  93. package/package.json +21 -20
  94. package/dist/assets/ConnectedDataExplorerComponent-Df1FbiME.js +0 -19
  95. package/dist/assets/VegaLite-CsQpZRnQ.js +0 -189
  96. package/dist/assets/_baseMap-BHbCXxiE.js +0 -1
  97. package/dist/assets/arc-ZB5pDULS.js +0 -1
  98. package/dist/assets/architectureDiagram-IEHRJDOE-epLkXczD.js +0 -36
  99. package/dist/assets/channel-DZbCNlo_.js +0 -1
  100. package/dist/assets/classDiagram-GIVACNV2-BlRHqMM8.js +0 -1
  101. package/dist/assets/classDiagram-v2-COTLJTTW-BlRHqMM8.js +0 -1
  102. package/dist/assets/clone-DVCFP2SD.js +0 -1
  103. package/dist/assets/compile-CH1soqis.js +0 -10
  104. package/dist/assets/edit-page-B7tjWZiy.css +0 -1
  105. package/dist/assets/edit-page-DUsEwG2Y.js +0 -144
  106. package/dist/assets/home-page-DTShNiLM.js +0 -9
  107. package/dist/assets/index-2MzWRy4i.js +0 -1
  108. package/dist/assets/index-BVPr58uH.js +0 -1
  109. package/dist/assets/index-DC0qQbhv.css +0 -1
  110. package/dist/assets/index-DR-WqNxT.js +0 -499
  111. package/dist/assets/infoDiagram-PH2N3AL5-B_fFvotD.js +0 -2
  112. package/dist/assets/layout-CxQYfzbu.js +0 -1
  113. package/dist/assets/mindmap-definition-ALO5MXBD-Da3RK7Bo.js +0 -95
  114. package/dist/assets/run-page-B7ZRDNoo.js +0 -1
  115. package/dist/assets/save-worker-BDcz2hJn.js +0 -1
  116. package/dist/assets/shutdown-button-B8rKQT9U.js +0 -17
  117. package/dist/assets/slides-component-CbtSDUoE.js +0 -1
  118. package/dist/assets/stateDiagram-v2-YXO3MK2T-BqskMlhw.js +0 -1
  119. package/dist/assets/storage-Co1CXoG3.js +0 -27
  120. package/dist/assets/storage-De8XnUVS.css +0 -1
  121. package/dist/assets/timer-B5eI7Tcu.js +0 -1
  122. package/dist/assets/tracing-BdpCs0Te.js +0 -2
  123. package/dist/assets/vega-component-ldxTiMcn.js +0 -1
  124. package/dist/assets/worker-BoGc2ntD.js +0 -1
  125. package/dist/assets/worker-D9uxCaRv.js +0 -1
  126. /package/dist/assets/{shutdown-button-C1rhMrxo.css → tree-C1rhMrxo.css} +0 -0
@@ -1 +0,0 @@
1
- const e=1e3;function t(e,t){const r=e.map((e=>`"${e}"`)).join(", ");return new Error(`This RPC instance cannot ${t} because the transport did not provide one or more of these methods: ${r}`)}function r(r={}){let n={};function a(e){n=e}let s,i={};function o(e){i.unregisterHandler&&i.unregisterHandler(),i=e,i.registerHandler?.(b)}function d(e){s="function"!=typeof e?(t,r)=>{const n=e[t];if(n)return n(r);const a=e._;if(!a)throw new Error(`The requested method has no handler: ${t}`);return a(t,r)}:e}const{maxRequestTime:c=e}=r;r.transport&&o(r.transport),r.requestHandler&&d(r.requestHandler),r._debugHooks&&a(r._debugHooks);let u=0;const l=new Map,p=new Map;function h(e,...r){const a=r[0];return new Promise(((r,s)=>{if(!i.send)throw t(["send"],"make requests");const o=u<=1e10?++u:u=0,d={type:"request",id:o,method:e,params:a};l.set(o,{resolve:r,reject:s}),c!==1/0&&p.set(o,setTimeout((()=>{p.delete(o),s(new Error("RPC request timed out."))}),c)),n.onSend?.(d),i.send(d)}))}const f=new Proxy(h,{get:(e,t,r)=>t in e?Reflect.get(e,t,r):e=>h(t,e)}),m=f;function y(e,...r){const a=r[0];if(!i.send)throw t(["send"],"send messages");const s={type:"message",id:e,payload:a};n.onSend?.(s),i.send(s)}const g=new Proxy(y,{get:(e,t,r)=>t in e?Reflect.get(e,t,r):e=>y(t,e)}),v=g,_=new Map,w=new Set;async function b(e){if(n.onReceive?.(e),!("type"in e))throw new Error("Message does not contain a type.");if("request"===e.type){if(!i.send||!s)throw t(["send","requestHandler"],"handle requests");const{id:a,method:o,params:d}=e;let c;try{c={type:"response",id:a,success:!0,payload:await s(o,d)}}catch(r){if(!(r instanceof Error))throw r;c={type:"response",id:a,success:!1,error:r.message}}return n.onSend?.(c),void i.send(c)}if("response"!==e.type){if("message"!==e.type)throw new Error(`Unexpected RPC message type: ${e.type}`);{for(const r of w)r(e.id,e.payload);const t=_.get(e.id);if(!t)return;for(const r of t)r(e.payload)}}else{const t=p.get(e.id);null!=t&&clearTimeout(t);const{resolve:r,reject:n}=l.get(e.id)??{};e.success?r?.(e.payload):n?.(new Error(e.error))}}return{setTransport:o,setRequestHandler:d,request:f,requestProxy:m,send:g,sendProxy:v,addMessageListener:function(e,r){if(!i.registerHandler)throw t(["registerHandler"],"register message listeners");"*"!==e?(_.has(e)||_.set(e,new Set),_.get(e)?.add(r)):w.add(r)},removeMessageListener:function(e,t){"*"!==e?(_.get(e)?.delete(t),0===_.get(e)?.size&&_.delete(e)):w.delete(t)},proxy:{send:v,request:m},_setDebugHooks:a}}const n="[transport-id]";function a(e,t={}){const{transportId:r,filter:a,remotePort:s}=t,i=e,o=s??e;let d;return{send(e){o.postMessage(function(e,t){const{transportId:r}=t;return null!=r?{[n]:r,data:e}:e}(e,{transportId:r}))},registerHandler(e){d=t=>{const s=t.data,[i,o]=function(e,t){const{transportId:r,filter:a}=t,s=a?.();if(null!=r&&null!=s)throw new Error("Cannot use both `transportId` and `filter` at the same time");let i=e;if(r){if(e[n]!==r)return[!0];i=e.data}return!1===s?[!0]:[!1,i]}(s,{transportId:r,filter:()=>a?.(t)});i||e(o)},i.addEventListener("message",d)},unregisterHandler(){d&&i.removeEventListener("message",d)}}}const s=()=>{},i=(e,t)=>{const r=`[${e}]`;return{debug:(...e)=>t.debug(r,...e),log:(...e)=>t.log(r,...e),warn:(...e)=>t.warn(r,...e),error:(...e)=>t.error(r,...e),trace:(...e)=>t.trace(r,...e),get:r=>i(`${e}.${r}`,t),disabled:(e=!0)=>e?d:t}},o={debug:(...e)=>{},log:(...e)=>{console.log(...e)},warn:(...e)=>{console.warn(...e)},error:(...e)=>{console.error(...e)},trace:(...e)=>{console.trace(...e)},get:e=>i(e,o),disabled:(e=!0)=>e?d:o},d={debug:()=>s,log:()=>s,warn:()=>s,error:()=>s,trace:()=>s,get:()=>d,disabled:()=>d};const c="undefined"!=typeof window&&window.Logger||o,u=e=>(new TextDecoder).decode(e);var l,p;!function(e){e.assertEqual=e=>e,e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(l||(l={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(p||(p={}));const h=l.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),f=e=>{switch(typeof e){case"undefined":return h.undefined;case"string":return h.string;case"number":return isNaN(e)?h.nan:h.number;case"boolean":return h.boolean;case"function":return h.function;case"bigint":return h.bigint;case"symbol":return h.symbol;case"object":return Array.isArray(e)?h.array:null===e?h.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?h.promise:"undefined"!=typeof Map&&e instanceof Map?h.map:"undefined"!=typeof Set&&e instanceof Set?h.set:"undefined"!=typeof Date&&e instanceof Date?h.date:h.object;default:return h.unknown}},m=l.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"]);class y 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]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(n);else if("invalid_return_type"===a.code)n(a.returnTypeError);else if("invalid_arguments"===a.code)n(a.argumentsError);else if(0===a.path.length)r._errors.push(t(a));else{let e=r,n=0;for(;n<a.path.length;){const r=a.path[n];n===a.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(a))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof y))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,l.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const n of this.issues)n.path.length>0?(t[n.path[0]]=t[n.path[0]]||[],t[n.path[0]].push(e(n))):r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}y.create=e=>new y(e);const g=(e,t)=>{let r;switch(e.code){case m.invalid_type:r=e.received===h.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case m.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,l.jsonStringifyReplacer)}`;break;case m.unrecognized_keys:r=`Unrecognized key(s) in object: ${l.joinValues(e.keys,", ")}`;break;case m.invalid_union:r="Invalid input";break;case m.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${l.joinValues(e.options)}`;break;case m.invalid_enum_value:r=`Invalid enum value. Expected ${l.joinValues(e.options)}, received '${e.received}'`;break;case m.invalid_arguments:r="Invalid function arguments";break;case m.invalid_return_type:r="Invalid function return type";break;case m.invalid_date:r="Invalid date";break;case m.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:l.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case m.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`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 m.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case m.custom:r="Invalid input";break;case m.invalid_intersection_types:r="Intersection results could not be merged";break;case m.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case m.not_finite:r="Number must be finite";break;default:r=t.defaultError,l.assertNever(e)}return{message:r}};let v=g;function _(){return v}const w=e=>{const{data:t,path:r,errorMaps:n,issueData:a}=e,s=[...r,...a.path||[]],i={...a,path:s};if(void 0!==a.message)return{...a,path:s,message:a.message};let o="";const d=n.filter((e=>!!e)).slice().reverse();for(const c of d)o=c(i,{data:t,defaultError:o}).message;return{...a,path:s,message:o}};function b(e,t){const r=_(),n=w({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===g?void 0:g].filter((e=>!!e))});e.common.issues.push(n)}class k{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return x;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const n of t){const e=await n.key,t=await n.value;r.push({key:e,value:t})}return k.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:a}=n;if("aborted"===t.status)return x;if("aborted"===a.status)return x;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!n.alwaysSet||(r[t.value]=a.value)}return{status:e.value,value:r}}}const x=Object.freeze({status:"aborted"}),S=e=>({status:"dirty",value:e}),T=e=>({status:"valid",value:e}),E=e=>"aborted"===e.status,O=e=>"dirty"===e.status,Z=e=>"valid"===e.status,N=e=>"undefined"!=typeof Promise&&e instanceof Promise;function j(e,t,r,n){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t.get(e)}function P(e,t,r,n,a){if("function"==typeof t||!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return t.set(e,r),r}var A,C,I;"function"==typeof SuppressedError&&SuppressedError,function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(A||(A={}));class R{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const F=(e,t)=>{if(Z(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new y(e.common.issues);return this._error=t,this._error}}};function $(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:a}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:a};return{errorMap:(t,a)=>{var s,i;const{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:a.defaultError}:void 0===a.data?{message:null!==(s=null!=o?o:n)&&void 0!==s?s:a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:null!==(i=null!=o?o:r)&&void 0!==i?i:a.defaultError}},description:a}}class L{get description(){return this._def.description}_getType(e){return f(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:f(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new k,ctx:{common:e.parent.common,data:e.data,parsedType:f(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(N(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){var r;const n={common:{issues:[],async:null!==(r=null==t?void 0:t.async)&&void 0!==r&&r,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:f(e)},a=this._parseSync({data:e,path:n.path,parent:n});return F(n,a)}"~validate"(e){var t,r;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:f(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:n});return Z(t)?{value:t.value}:{issues:n.common.issues}}catch(a){(null===(r=null===(t=null==a?void 0:a.message)||void 0===t?void 0:t.toLowerCase())||void 0===r?void 0:r.includes("encountered"))&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then((e=>Z(e)?{value:e.value}:{issues:n.common.issues}))}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:f(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(N(n)?n:Promise.resolve(n));return F(r,a)}refine(e,t){const r=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,n)=>{const a=e(t),s=()=>n.addIssue({code:m.custom,...r(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(s(),!1))):!!a||(s(),!1)}))}refinement(e,t){return this._refinement(((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1)))}_refinement(e){return new Le({schema:this,typeName:Ge.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 Me.create(this,this._def)}nullable(){return De.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return _e.create(this)}promise(){return $e.create(this,this._def)}or(e){return ke.create([this,e],this._def)}and(e){return Ee.create(this,e,this._def)}transform(e){return new Le({...$(this._def),schema:this,typeName:Ge.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Ue({...$(this._def),innerType:this,defaultValue:t,typeName:Ge.ZodDefault})}brand(){return new He({typeName:Ge.ZodBranded,type:this,...$(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ze({...$(this._def),innerType:this,catchValue:t,typeName:Ge.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Be.create(this,e)}readonly(){return We.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const M=/^c[^\s-]{8,}$/i,D=/^[0-9a-z]+$/,U=/^[0-9A-HJKMNP-TV-Z]{26}$/i,z=/^[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,q=/^[a-z0-9_-]{21}$/i,V=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,H=/^[-+]?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)?)??$/,B=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let W;const K=/^(?:(?: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])$/,J=/^(?:(?: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])$/,Y=/^(([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]))$/,G=/^(([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])$/,X=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Q=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ee="((\\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])))",te=new RegExp(`^${ee}$`);function re(e){let t="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`),t}function ne(e){let t=`${ee}T${re(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function ae(e,t){if(!V.test(e))return!1;try{const[r]=e.split("."),n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),a=JSON.parse(atob(n));return"object"==typeof a&&null!==a&&(!(!a.typ||!a.alg)&&(!t||a.alg===t))}catch(r){return!1}}function se(e,t){return!("v4"!==t&&t||!J.test(e))||!("v6"!==t&&t||!G.test(e))}class ie extends L{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==h.string){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.string,received:t.parsedType}),x}const t=new k;let r;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(r=this._getOrReturnCtx(e,r),b(r,{code:m.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(r=this._getOrReturnCtx(e,r),b(r,{code:m.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const n=e.data.length>i.value,a=e.data.length<i.value;(n||a)&&(r=this._getOrReturnCtx(e,r),n?b(r,{code:m.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&b(r,{code:m.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)B.test(e.data)||(r=this._getOrReturnCtx(e,r),b(r,{validation:"email",code:m.invalid_string,message:i.message}),t.dirty());else if("emoji"===i.kind)W||(W=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),W.test(e.data)||(r=this._getOrReturnCtx(e,r),b(r,{validation:"emoji",code:m.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)z.test(e.data)||(r=this._getOrReturnCtx(e,r),b(r,{validation:"uuid",code:m.invalid_string,message:i.message}),t.dirty());else if("nanoid"===i.kind)q.test(e.data)||(r=this._getOrReturnCtx(e,r),b(r,{validation:"nanoid",code:m.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)M.test(e.data)||(r=this._getOrReturnCtx(e,r),b(r,{validation:"cuid",code:m.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)D.test(e.data)||(r=this._getOrReturnCtx(e,r),b(r,{validation:"cuid2",code:m.invalid_string,message:i.message}),t.dirty());else if("ulid"===i.kind)U.test(e.data)||(r=this._getOrReturnCtx(e,r),b(r,{validation:"ulid",code:m.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(s){r=this._getOrReturnCtx(e,r),b(r,{validation:"url",code:m.invalid_string,message:i.message}),t.dirty()}else if("regex"===i.kind){i.regex.lastIndex=0;i.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),b(r,{validation:"regex",code:m.invalid_string,message:i.message}),t.dirty())}else if("trim"===i.kind)e.data=e.data.trim();else if("includes"===i.kind)e.data.includes(i.value,i.position)||(r=this._getOrReturnCtx(e,r),b(r,{code:m.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),t.dirty());else if("toLowerCase"===i.kind)e.data=e.data.toLowerCase();else if("toUpperCase"===i.kind)e.data=e.data.toUpperCase();else if("startsWith"===i.kind)e.data.startsWith(i.value)||(r=this._getOrReturnCtx(e,r),b(r,{code:m.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty());else if("endsWith"===i.kind)e.data.endsWith(i.value)||(r=this._getOrReturnCtx(e,r),b(r,{code:m.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty());else if("datetime"===i.kind){ne(i).test(e.data)||(r=this._getOrReturnCtx(e,r),b(r,{code:m.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else if("date"===i.kind){te.test(e.data)||(r=this._getOrReturnCtx(e,r),b(r,{code:m.invalid_string,validation:"date",message:i.message}),t.dirty())}else if("time"===i.kind){new RegExp(`^${re(i)}$`).test(e.data)||(r=this._getOrReturnCtx(e,r),b(r,{code:m.invalid_string,validation:"time",message:i.message}),t.dirty())}else"duration"===i.kind?H.test(e.data)||(r=this._getOrReturnCtx(e,r),b(r,{validation:"duration",code:m.invalid_string,message:i.message}),t.dirty()):"ip"===i.kind?(n=e.data,("v4"!==(a=i.version)&&a||!K.test(n))&&("v6"!==a&&a||!Y.test(n))&&(r=this._getOrReturnCtx(e,r),b(r,{validation:"ip",code:m.invalid_string,message:i.message}),t.dirty())):"jwt"===i.kind?ae(e.data,i.alg)||(r=this._getOrReturnCtx(e,r),b(r,{validation:"jwt",code:m.invalid_string,message:i.message}),t.dirty()):"cidr"===i.kind?se(e.data,i.version)||(r=this._getOrReturnCtx(e,r),b(r,{validation:"cidr",code:m.invalid_string,message:i.message}),t.dirty()):"base64"===i.kind?X.test(e.data)||(r=this._getOrReturnCtx(e,r),b(r,{validation:"base64",code:m.invalid_string,message:i.message}),t.dirty()):"base64url"===i.kind?Q.test(e.data)||(r=this._getOrReturnCtx(e,r),b(r,{validation:"base64url",code:m.invalid_string,message:i.message}),t.dirty()):l.assertNever(i);var n,a;return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement((t=>e.test(t)),{validation:t,code:m.invalid_string,...A.errToObj(r)})}_addCheck(e){return new ie({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...A.errToObj(e)})}url(e){return this._addCheck({kind:"url",...A.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...A.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...A.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...A.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...A.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...A.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...A.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...A.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...A.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...A.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...A.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...A.errToObj(e)})}datetime(e){var t,r;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,local:null!==(r=null==e?void 0:e.local)&&void 0!==r&&r,...A.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,...A.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...A.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...A.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...A.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...A.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...A.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...A.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...A.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...A.errToObj(t)})}nonempty(e){return this.min(1,A.errToObj(e))}trim(){return new ie({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ie({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ie({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isDate(){return!!this._def.checks.find((e=>"date"===e.kind))}get isTime(){return!!this._def.checks.find((e=>"time"===e.kind))}get isDuration(){return!!this._def.checks.find((e=>"duration"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isNANOID(){return!!this._def.checks.find((e=>"nanoid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get isCIDR(){return!!this._def.checks.find((e=>"cidr"===e.kind))}get isBase64(){return!!this._def.checks.find((e=>"base64"===e.kind))}get isBase64url(){return!!this._def.checks.find((e=>"base64url"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function oe(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,a=r>n?r:n;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}ie.create=e=>{var t;return new ie({checks:[],typeName:Ge.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...$(e)})};class de extends L{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){this._def.coerce&&(e.data=Number(e.data));if(this._getType(e)!==h.number){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.number,received:t.parsedType}),x}let t;const r=new k;for(const n of this._def.checks)if("int"===n.kind)l.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),b(t,{code:m.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty());else if("min"===n.kind){(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else if("max"===n.kind){(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else"multipleOf"===n.kind?0!==oe(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),b(t,{code:m.not_finite,message:n.message}),r.dirty()):l.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,A.toString(t))}gt(e,t){return this.setLimit("min",e,!1,A.toString(t))}lte(e,t){return this.setLimit("max",e,!0,A.toString(t))}lt(e,t){return this.setLimit("max",e,!1,A.toString(t))}setLimit(e,t,r,n){return new de({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:A.toString(n)}]})}_addCheck(e){return new de({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:A.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:A.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:A.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:A.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:A.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:A.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:A.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:A.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:A.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&l.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}de.create=e=>new de({checks:[],typeName:Ge.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...$(e)});class ce extends L{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(n){return this._getInvalidInput(e)}if(this._getType(e)!==h.bigint)return this._getInvalidInput(e);let t;const r=new k;for(const a of this._def.checks)if("min"===a.kind){(a.inclusive?e.data<a.value:e.data<=a.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty())}else if("max"===a.kind){(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty())}else"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),b(t,{code:m.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):l.assertNever(a);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.bigint,received:t.parsedType}),x}gte(e,t){return this.setLimit("min",e,!0,A.toString(t))}gt(e,t){return this.setLimit("min",e,!1,A.toString(t))}lte(e,t){return this.setLimit("max",e,!0,A.toString(t))}lt(e,t){return this.setLimit("max",e,!1,A.toString(t))}setLimit(e,t,r,n){return new ce({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:A.toString(n)}]})}_addCheck(e){return new ce({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:A.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:A.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:A.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:A.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:A.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ce.create=e=>{var t;return new ce({checks:[],typeName:Ge.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...$(e)})};class ue extends L{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==h.boolean){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.boolean,received:t.parsedType}),x}return T(e.data)}}ue.create=e=>new ue({typeName:Ge.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...$(e)});class le extends L{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==h.date){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.date,received:t.parsedType}),x}if(isNaN(e.data.getTime())){return b(this._getOrReturnCtx(e),{code:m.invalid_date}),x}const t=new k;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),b(r,{code:m.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),b(r,{code:m.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):l.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new le({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:A.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:A.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}le.create=e=>new le({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Ge.ZodDate,...$(e)});class pe extends L{_parse(e){if(this._getType(e)!==h.symbol){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.symbol,received:t.parsedType}),x}return T(e.data)}}pe.create=e=>new pe({typeName:Ge.ZodSymbol,...$(e)});class he extends L{_parse(e){if(this._getType(e)!==h.undefined){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.undefined,received:t.parsedType}),x}return T(e.data)}}he.create=e=>new he({typeName:Ge.ZodUndefined,...$(e)});class fe extends L{_parse(e){if(this._getType(e)!==h.null){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.null,received:t.parsedType}),x}return T(e.data)}}fe.create=e=>new fe({typeName:Ge.ZodNull,...$(e)});class me extends L{constructor(){super(...arguments),this._any=!0}_parse(e){return T(e.data)}}me.create=e=>new me({typeName:Ge.ZodAny,...$(e)});class ye extends L{constructor(){super(...arguments),this._unknown=!0}_parse(e){return T(e.data)}}ye.create=e=>new ye({typeName:Ge.ZodUnknown,...$(e)});class ge extends L{_parse(e){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.never,received:t.parsedType}),x}}ge.create=e=>new ge({typeName:Ge.ZodNever,...$(e)});class ve extends L{_parse(e){if(this._getType(e)!==h.undefined){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.void,received:t.parsedType}),x}return T(e.data)}}ve.create=e=>new ve({typeName:Ge.ZodVoid,...$(e)});class _e extends L{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==h.array)return b(t,{code:m.invalid_type,expected:h.array,received:t.parsedType}),x;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,a=t.data.length<n.exactLength.value;(e||a)&&(b(t,{code:e?m.too_big:m.too_small,minimum:a?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(b(t,{code:m.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(b(t,{code:m.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map(((e,r)=>n.type._parseAsync(new R(t,e,t.path,r))))).then((e=>k.mergeArray(r,e)));const a=[...t.data].map(((e,r)=>n.type._parseSync(new R(t,e,t.path,r))));return k.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new _e({...this._def,minLength:{value:e,message:A.toString(t)}})}max(e,t){return new _e({...this._def,maxLength:{value:e,message:A.toString(t)}})}length(e,t){return new _e({...this._def,exactLength:{value:e,message:A.toString(t)}})}nonempty(e){return this.min(1,e)}}function we(e){if(e instanceof be){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Me.create(we(n))}return new be({...e._def,shape:()=>t})}return e instanceof _e?new _e({...e._def,type:we(e.element)}):e instanceof Me?Me.create(we(e.unwrap())):e instanceof De?De.create(we(e.unwrap())):e instanceof Oe?Oe.create(e.items.map((e=>we(e)))):e}_e.create=(e,t)=>new _e({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Ge.ZodArray,...$(t)});class be extends L{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=l.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==h.object){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.object,received:t.parsedType}),x}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof ge&&"strip"===this._def.unknownKeys))for(const o in r.data)a.includes(o)||s.push(o);const i=[];for(const o of a){const e=n[o],t=r.data[o];i.push({key:{status:"valid",value:o},value:e._parse(new R(r,t,r.path,o)),alwaysSet:o in r.data})}if(this._def.catchall instanceof ge){const e=this._def.unknownKeys;if("passthrough"===e)for(const t of s)i.push({key:{status:"valid",value:t},value:{status:"valid",value:r.data[t]}});else if("strict"===e)s.length>0&&(b(r,{code:m.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const n=r.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new R(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of i){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e})).then((e=>k.mergeObjectSync(t,e))):k.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return A.errToObj,new be({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,a,s,i;const o=null!==(s=null===(a=(n=this._def).errorMap)||void 0===a?void 0:a.call(n,t,r).message)&&void 0!==s?s:r.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=A.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new be({...this._def,unknownKeys:"strip"})}passthrough(){return new be({...this._def,unknownKeys:"passthrough"})}extend(e){return new be({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new be({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Ge.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new be({...this._def,catchall:e})}pick(e){const t={};return l.objectKeys(e).forEach((r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])})),new be({...this._def,shape:()=>t})}omit(e){const t={};return l.objectKeys(this.shape).forEach((r=>{e[r]||(t[r]=this.shape[r])})),new be({...this._def,shape:()=>t})}deepPartial(){return we(this)}partial(e){const t={};return l.objectKeys(this.shape).forEach((r=>{const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()})),new be({...this._def,shape:()=>t})}required(e){const t={};return l.objectKeys(this.shape).forEach((r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof Me;)e=e._def.innerType;t[r]=e}})),new be({...this._def,shape:()=>t})}keyof(){return Ie(l.objectKeys(this.shape))}}be.create=(e,t)=>new be({shape:()=>e,unknownKeys:"strip",catchall:ge.create(),typeName:Ge.ZodObject,...$(t)}),be.strictCreate=(e,t)=>new be({shape:()=>e,unknownKeys:"strict",catchall:ge.create(),typeName:Ge.ZodObject,...$(t)}),be.lazycreate=(e,t)=>new be({shape:e,unknownKeys:"strip",catchall:ge.create(),typeName:Ge.ZodObject,...$(t)});class ke extends L{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map((async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const r=e.map((e=>new y(e.ctx.common.issues)));return b(t,{code:m.invalid_union,unionErrors:r}),x}));{let e;const n=[];for(const s of r){const r={...t,common:{...t.common,issues:[]},parent:null},a=s._parseSync({data:t.data,path:t.path,parent:r});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=n.map((e=>new y(e)));return b(t,{code:m.invalid_union,unionErrors:a}),x}}get options(){return this._def.options}}ke.create=(e,t)=>new ke({options:e,typeName:Ge.ZodUnion,...$(t)});const xe=e=>e instanceof Ae?xe(e.schema):e instanceof Le?xe(e.innerType()):e instanceof Ce?[e.value]:e instanceof Re?e.options:e instanceof Fe?l.objectValues(e.enum):e instanceof Ue?xe(e._def.innerType):e instanceof he?[void 0]:e instanceof fe?[null]:e instanceof Me?[void 0,...xe(e.unwrap())]:e instanceof De?[null,...xe(e.unwrap())]:e instanceof He||e instanceof We?xe(e.unwrap()):e instanceof ze?xe(e._def.innerType):[];class Se extends L{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.object)return b(t,{code:m.invalid_type,expected:h.object,received:t.parsedType}),x;const r=this.discriminator,n=t.data[r],a=this.optionsMap.get(n);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(b(t,{code:m.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),x)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){const n=new Map;for(const a of t){const t=xe(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const r of t){if(n.has(r))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(r)}`);n.set(r,a)}}return new Se({typeName:Ge.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...$(r)})}}function Te(e,t){const r=f(e),n=f(t);if(e===t)return{valid:!0,data:e};if(r===h.object&&n===h.object){const r=l.objectKeys(t),n=l.objectKeys(e).filter((e=>-1!==r.indexOf(e))),a={...e,...t};for(const s of n){const r=Te(e[s],t[s]);if(!r.valid)return{valid:!1};a[s]=r.data}return{valid:!0,data:a}}if(r===h.array&&n===h.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const a=Te(e[n],t[n]);if(!a.valid)return{valid:!1};r.push(a.data)}return{valid:!0,data:r}}return r===h.date&&n===h.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class Ee extends L{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(E(e)||E(n))return x;const a=Te(e.value,n.value);return a.valid?((O(e)||O(n))&&t.dirty(),{status:t.value,value:a.data}):(b(r,{code:m.invalid_intersection_types}),x)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then((([e,t])=>n(e,t))):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}Ee.create=(e,t,r)=>new Ee({left:e,right:t,typeName:Ge.ZodIntersection,...$(r)});class Oe extends L{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.array)return b(r,{code:m.invalid_type,expected:h.array,received:r.parsedType}),x;if(r.data.length<this._def.items.length)return b(r,{code:m.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&r.data.length>this._def.items.length&&(b(r,{code:m.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map(((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new R(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(n).then((e=>k.mergeArray(t,e))):k.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new Oe({...this._def,rest:e})}}Oe.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Oe({items:e,typeName:Ge.ZodTuple,rest:null,...$(t)})};class Ze extends L{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.object)return b(r,{code:m.invalid_type,expected:h.object,received:r.parsedType}),x;const n=[],a=this._def.keyType,s=this._def.valueType;for(const i in r.data)n.push({key:a._parse(new R(r,i,r.path,i)),value:s._parse(new R(r,r.data[i],r.path,i)),alwaysSet:i in r.data});return r.common.async?k.mergeObjectAsync(t,n):k.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new Ze(t instanceof L?{keyType:e,valueType:t,typeName:Ge.ZodRecord,...$(r)}:{keyType:ie.create(),valueType:e,typeName:Ge.ZodRecord,...$(t)})}}class Ne extends L{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.map)return b(r,{code:m.invalid_type,expected:h.map,received:r.parsedType}),x;const n=this._def.keyType,a=this._def.valueType,s=[...r.data.entries()].map((([e,t],s)=>({key:n._parse(new R(r,e,r.path,[s,"key"])),value:a._parse(new R(r,t,r.path,[s,"value"]))})));if(r.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const r of s){const n=await r.key,a=await r.value;if("aborted"===n.status||"aborted"===a.status)return x;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const r of s){const n=r.key,a=r.value;if("aborted"===n.status||"aborted"===a.status)return x;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}}}Ne.create=(e,t,r)=>new Ne({valueType:t,keyType:e,typeName:Ge.ZodMap,...$(r)});class je extends L{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==h.set)return b(r,{code:m.invalid_type,expected:h.set,received:r.parsedType}),x;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(b(r,{code:m.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(b(r,{code:m.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const a=this._def.valueType;function s(e){const r=new Set;for(const n of e){if("aborted"===n.status)return x;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const i=[...r.data.values()].map(((e,t)=>a._parse(new R(r,e,r.path,t))));return r.common.async?Promise.all(i).then((e=>s(e))):s(i)}min(e,t){return new je({...this._def,minSize:{value:e,message:A.toString(t)}})}max(e,t){return new je({...this._def,maxSize:{value:e,message:A.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}je.create=(e,t)=>new je({valueType:e,minSize:null,maxSize:null,typeName:Ge.ZodSet,...$(t)});class Pe extends L{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.function)return b(t,{code:m.invalid_type,expected:h.function,received:t.parsedType}),x;function r(e,r){return w({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_(),g].filter((e=>!!e)),issueData:{code:m.invalid_arguments,argumentsError:r}})}function n(e,r){return w({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_(),g].filter((e=>!!e)),issueData:{code:m.invalid_return_type,returnTypeError:r}})}const a={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof $e){const e=this;return T((async function(...t){const i=new y([]),o=await e._def.args.parseAsync(t,a).catch((e=>{throw i.addIssue(r(t,e)),i})),d=await Reflect.apply(s,this,o);return await e._def.returns._def.type.parseAsync(d,a).catch((e=>{throw i.addIssue(n(d,e)),i}))}))}{const e=this;return T((function(...t){const i=e._def.args.safeParse(t,a);if(!i.success)throw new y([r(t,i.error)]);const o=Reflect.apply(s,this,i.data),d=e._def.returns.safeParse(o,a);if(!d.success)throw new y([n(o,d.error)]);return d.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Pe({...this._def,args:Oe.create(e).rest(ye.create())})}returns(e){return new Pe({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Pe({args:e||Oe.create([]).rest(ye.create()),returns:t||ye.create(),typeName:Ge.ZodFunction,...$(r)})}}class Ae extends L{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}Ae.create=(e,t)=>new Ae({getter:e,typeName:Ge.ZodLazy,...$(t)});class Ce extends L{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return b(t,{received:t.data,code:m.invalid_literal,expected:this._def.value}),x}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ie(e,t){return new Re({values:e,typeName:Ge.ZodEnum,...$(t)})}Ce.create=(e,t)=>new Ce({value:e,typeName:Ge.ZodLiteral,...$(t)});class Re extends L{constructor(){super(...arguments),C.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return b(t,{expected:l.joinValues(r),received:t.parsedType,code:m.invalid_type}),x}if(j(this,C)||P(this,C,new Set(this._def.values)),!j(this,C).has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return b(t,{received:t.data,code:m.invalid_enum_value,options:r}),x}return T(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return Re.create(e,{...this._def,...t})}exclude(e,t=this._def){return Re.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}C=new WeakMap,Re.create=Ie;class Fe extends L{constructor(){super(...arguments),I.set(this,void 0)}_parse(e){const t=l.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==h.string&&r.parsedType!==h.number){const e=l.objectValues(t);return b(r,{expected:l.joinValues(e),received:r.parsedType,code:m.invalid_type}),x}if(j(this,I)||P(this,I,new Set(l.getValidEnumValues(this._def.values))),!j(this,I).has(e.data)){const e=l.objectValues(t);return b(r,{received:r.data,code:m.invalid_enum_value,options:e}),x}return T(e.data)}get enum(){return this._def.values}}I=new WeakMap,Fe.create=(e,t)=>new Fe({values:e,typeName:Ge.ZodNativeEnum,...$(t)});class $e extends L{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.promise&&!1===t.common.async)return b(t,{code:m.invalid_type,expected:h.promise,received:t.parsedType}),x;const r=t.parsedType===h.promise?t.data:Promise.resolve(t.data);return T(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}$e.create=(e,t)=>new $e({type:e,typeName:Ge.ZodPromise,...$(t)});class Le extends L{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Ge.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,a={addIssue:e=>{b(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===n.type){const e=n.transform(r.data,a);if(r.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return x;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?x:"dirty"===n.status||"dirty"===t.value?S(n.value):n}));{if("aborted"===t.value)return x;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?x:"dirty"===n.status||"dirty"===t.value?S(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,a);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?x:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((r=>"aborted"===r.status?x:("dirty"===r.status&&t.dirty(),e(r.value).then((()=>({status:t.value,value:r.value}))))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Z(e))return e;const s=n.transform(e.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then((e=>Z(e)?Promise.resolve(n.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}l.assertNever(n)}}Le.create=(e,t,r)=>new Le({schema:e,typeName:Ge.ZodEffects,effect:t,...$(r)}),Le.createWithPreprocess=(e,t,r)=>new Le({schema:t,effect:{type:"preprocess",transform:e},typeName:Ge.ZodEffects,...$(r)});class Me extends L{_parse(e){return this._getType(e)===h.undefined?T(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Me.create=(e,t)=>new Me({innerType:e,typeName:Ge.ZodOptional,...$(t)});class De extends L{_parse(e){return this._getType(e)===h.null?T(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}De.create=(e,t)=>new De({innerType:e,typeName:Ge.ZodNullable,...$(t)});class Ue extends L{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===h.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Ue.create=(e,t)=>new Ue({innerType:e,typeName:Ge.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...$(t)});class ze extends L{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return N(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new y(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new y(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}ze.create=(e,t)=>new ze({innerType:e,typeName:Ge.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...$(t)});class qe extends L{_parse(e){if(this._getType(e)!==h.nan){const t=this._getOrReturnCtx(e);return b(t,{code:m.invalid_type,expected:h.nan,received:t.parsedType}),x}return{status:"valid",value:e.data}}}qe.create=e=>new qe({typeName:Ge.ZodNaN,...$(e)});const Ve=Symbol("zod_brand");class He extends L{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class Be extends L{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?x:"dirty"===e.status?(t.dirty(),S(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})()}{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?x:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new Be({in:e,out:t,typeName:Ge.ZodPipeline})}}class We extends L{_parse(e){const t=this._def.innerType._parse(e),r=e=>(Z(e)&&(e.value=Object.freeze(e.value)),e);return N(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}function Ke(e,t){const r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r}function Je(e,t={},r){return e?me.create().superRefine(((n,a)=>{var s,i;const o=e(n);if(o instanceof Promise)return o.then((e=>{var s,i;if(!e){const e=Ke(t,n),o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:r)||void 0===i||i;a.addIssue({code:"custom",...e,fatal:o})}}));if(!o){const e=Ke(t,n),o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:r)||void 0===i||i;a.addIssue({code:"custom",...e,fatal:o})}})):me.create()}We.create=(e,t)=>new We({innerType:e,typeName:Ge.ZodReadonly,...$(t)});const Ye={object:be.lazycreate};var Ge;!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"}(Ge||(Ge={}));const Xe=ie.create,Qe=de.create,et=qe.create,tt=ce.create,rt=ue.create,nt=le.create,at=pe.create,st=he.create,it=fe.create,ot=me.create,dt=ye.create,ct=ge.create,ut=ve.create,lt=_e.create,pt=be.create,ht=be.strictCreate,ft=ke.create,mt=Se.create,yt=Ee.create,gt=Oe.create,vt=Ze.create,_t=Ne.create,wt=je.create,bt=Pe.create,kt=Ae.create,xt=Ce.create,St=Re.create,Tt=Fe.create,Et=$e.create,Ot=Le.create,Zt=Me.create,Nt=De.create,jt=Le.createWithPreprocess,Pt=Be.create,At={string:e=>ie.create({...e,coerce:!0}),number:e=>de.create({...e,coerce:!0}),boolean:e=>ue.create({...e,coerce:!0}),bigint:e=>ce.create({...e,coerce:!0}),date:e=>le.create({...e,coerce:!0})},Ct=x;var It=Object.freeze({__proto__:null,defaultErrorMap:g,setErrorMap:function(e){v=e},getErrorMap:_,makeIssue:w,EMPTY_PATH:[],addIssueToContext:b,ParseStatus:k,INVALID:x,DIRTY:S,OK:T,isAborted:E,isDirty:O,isValid:Z,isAsync:N,get util(){return l},get objectUtil(){return p},ZodParsedType:h,getParsedType:f,ZodType:L,datetimeRegex:ne,ZodString:ie,ZodNumber:de,ZodBigInt:ce,ZodBoolean:ue,ZodDate:le,ZodSymbol:pe,ZodUndefined:he,ZodNull:fe,ZodAny:me,ZodUnknown:ye,ZodNever:ge,ZodVoid:ve,ZodArray:_e,ZodObject:be,ZodUnion:ke,ZodDiscriminatedUnion:Se,ZodIntersection:Ee,ZodTuple:Oe,ZodRecord:Ze,ZodMap:Ne,ZodSet:je,ZodFunction:Pe,ZodLazy:Ae,ZodLiteral:Ce,ZodEnum:Re,ZodNativeEnum:Fe,ZodPromise:$e,ZodEffects:Le,ZodTransformer:Le,ZodOptional:Me,ZodNullable:De,ZodDefault:Ue,ZodCatch:ze,ZodNaN:qe,BRAND:Ve,ZodBranded:He,ZodPipeline:Be,ZodReadonly:We,custom:Je,Schema:L,ZodSchema:L,late:Ye,get ZodFirstPartyTypeKind(){return Ge},coerce:At,any:ot,array:lt,bigint:tt,boolean:rt,date:nt,discriminatedUnion:mt,effect:Ot,enum:St,function:bt,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Je((t=>t instanceof e),t),intersection:yt,lazy:kt,literal:xt,map:_t,nan:et,nativeEnum:Tt,never:ct,null:it,nullable:Nt,number:Qe,object:pt,oboolean:()=>rt().optional(),onumber:()=>Qe().optional(),optional:Zt,ostring:()=>Xe().optional(),pipeline:Pt,preprocess:jt,promise:Et,record:vt,set:wt,strictObject:ht,string:Xe,symbol:at,transformer:Ot,tuple:gt,undefined:st,union:ft,unknown:dt,void:ut,NEVER:Ct,ZodIssueCode:m,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:y});const Rt=It.object({detail:It.string()}),Ft=It.object({error:It.string()});function $t(e){if(!e)return"Unknown error";if(e instanceof Error){const t=Rt.safeParse(e.cause);return t.success?t.data.detail:function(e){const t=function(e){try{return JSON.parse(e)}catch{return e}}(e);if(!t)return e;const r=Rt.safeParse(t);if(r.success)return r.data.detail;const n=Ft.safeParse(t);if(n.success)return n.data.error;return e}(e.message)}if("object"==typeof e){const t=Rt.safeParse(e);if(t.success)return t.data.detail;const r=Ft.safeParse(e);if(r.success)return r.data.error}try{return JSON.stringify(e)}catch{return String(e)}}function Lt(e){return e.FS}const Mt="notebook.py",Dt="/marimo",Ut=Mt,zt=e=>{const t=Lt(e);try{t.mkdirTree(Dt)}catch{}t.chdir(Dt)},qt=e=>{Lt(e).mount(e.FS.filesystems.IDBFS,{root:"."},Dt)},Vt=async e=>{await Kt(e,!0)},Ht=async e=>{await Kt(e,!1)},Bt=e=>{const t=Lt(e),r=`${Dt}/${Mt}`;return u(t.readFile(r))},Wt=e=>{const{pyodide:t,filename:r,code:n}=e,a=Lt(t);if(r&&r!==Mt){const e=(e=>{try{return u(a.readFile(e))}catch{return null}})(r);if(e)return{code:e,filename:r}}return a.writeFile(Mt,n),{code:n,filename:Mt}};function Kt(e,t){return new Promise(((r,n)=>{Lt(e).syncfs(t,(e=>{e instanceof Error?n(e):r()}))}))}var Jt,Yt=Object.defineProperty,Gt=(e,t)=>Yt(e,"name",{value:t,configurable:!0}),Xt=(Jt=function(e){if(typeof require<"u")return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')},typeof require<"u"?require:typeof Proxy<"u"?new Proxy(Jt,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):Jt);function Qt(e){return!isNaN(parseFloat(e))&&isFinite(e)}function er(e){return e.charAt(0).toUpperCase()+e.substring(1)}function tr(e){return function(){return this[e]}}Gt(Qt,"_isNumber"),Gt(er,"_capitalize"),Gt(tr,"_getter");var rr,nr,ar=["isConstructor","isEval","isNative","isToplevel"],sr=["columnNumber","lineNumber"],ir=["fileName","functionName","source"],or=ar.concat(sr,ir,["args"],["evalOrigin"]);function dr(e){if(e)for(var t=0;t<or.length;t++)void 0!==e[or[t]]&&this["set"+er(or[t])](e[or[t]])}for(Gt(dr,"StackFrame"),dr.prototype={getArgs:function(){return this.args},setArgs:function(e){if("[object Array]"!==Object.prototype.toString.call(e))throw new TypeError("Args must be an Array");this.args=e},getEvalOrigin:function(){return this.evalOrigin},setEvalOrigin:function(e){if(e instanceof dr)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new dr(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",r=this.getColumnNumber()||"",n=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+r+")":"[eval]:"+t+":"+r:n?n+" ("+e+":"+t+":"+r+")":e+":"+t+":"+r}},dr.fromString=Gt((function(e){var t=e.indexOf("("),r=e.lastIndexOf(")"),n=e.substring(0,t),a=e.substring(t+1,r).split(","),s=e.substring(r+1);if(0===s.indexOf("@"))var i=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(s,""),o=i[1],d=i[2],c=i[3];return new dr({functionName:n,args:a||void 0,fileName:o,lineNumber:d||void 0,columnNumber:c||void 0})}),"StackFrame$$fromString"),rr=0;rr<ar.length;rr++)dr.prototype["get"+er(ar[rr])]=tr(ar[rr]),dr.prototype["set"+er(ar[rr])]=function(e){return function(t){this[e]=!!t}}(ar[rr]);for(nr=0;nr<sr.length;nr++)dr.prototype["get"+er(sr[nr])]=tr(sr[nr]),dr.prototype["set"+er(sr[nr])]=function(e){return function(t){if(!Qt(t))throw new TypeError(e+" must be a Number");this[e]=Number(t)}}(sr[nr]);for(cr=0;cr<ir.length;cr++)dr.prototype["get"+er(ir[cr])]=tr(ir[cr]),dr.prototype["set"+er(ir[cr])]=function(e){return function(t){this[e]=String(t)}}(ir[cr]);var cr,ur=dr;function lr(){var e=/^\s*at .*(\S+:\d+|\(native\))/m,t=/^(eval@)?(\[native code])?$/;return{parse:Gt((function(t){if(t.stack&&t.stack.match(e))return this.parseV8OrIE(t);if(t.stack)return this.parseFFOrSafari(t);throw new Error("Cannot parse given Error object")}),"ErrorStackParser$$parse"),extractLocation:Gt((function(e){if(-1===e.indexOf(":"))return[e];var t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]}),"ErrorStackParser$$extractLocation"),parseV8OrIE:Gt((function(t){return t.stack.split("\n").filter((function(t){return!!t.match(e)}),this).map((function(e){e.indexOf("(eval ")>-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,""),r=t.match(/ (\(.+\)$)/);t=r?t.replace(r[0],""):t;var n=this.extractLocation(r?r[1]:t),a=r&&t||void 0,s=["eval","<anonymous>"].indexOf(n[0])>-1?void 0:n[0];return new ur({functionName:a,fileName:s,lineNumber:n[1],columnNumber:n[2],source:e})}),this)}),"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:Gt((function(e){return e.stack.split("\n").filter((function(e){return!e.match(t)}),this).map((function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new ur({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,a=this.extractLocation(e.replace(t,""));return new ur({functionName:n,fileName:a[0],lineNumber:a[1],columnNumber:a[2],source:e})}),this)}),"ErrorStackParser$$parseFFOrSafari")}}Gt(lr,"ErrorStackParser");var pr,hr,fr,mr,yr,gr,vr,_r,wr,br=new lr,kr="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&!process.browser,xr=kr&&typeof module<"u"&&typeof module.exports<"u"&&typeof Xt<"u"&&typeof __dirname<"u",Sr=kr&&!xr,Tr=typeof Deno<"u",Er=!kr&&!Tr,Or=Er&&"object"==typeof window&&"object"==typeof document&&"function"==typeof document.createElement&&"sessionStorage"in window&&"function"!=typeof importScripts,Zr=Er&&"function"==typeof importScripts&&"object"==typeof self;async function Nr(){if(!kr||(pr=(await import("./__vite-browser-external-CIEyP2s7.js")).default,mr=await import("./__vite-browser-external-CIEyP2s7.js"),yr=await import("./__vite-browser-external-CIEyP2s7.js"),fr=(await import("./__vite-browser-external-CIEyP2s7.js")).default,hr=await import("./__vite-browser-external-CIEyP2s7.js"),vr=hr.sep,typeof Xt<"u"))return;let e={fs:mr,crypto:await import("./__vite-browser-external-CIEyP2s7.js"),ws:await import("./__vite-browser-external-CIEyP2s7.js"),child_process:await import("./__vite-browser-external-CIEyP2s7.js")};globalThis.require=function(t){return e[t]}}function jr(e,t){return hr.resolve(t||".",e)}function Pr(e,t){return void 0===t&&(t=location),new URL(e,t).toString()}function Ar(e,t){return e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?{response:fetch(e)}:{binary:yr.readFile(e).then((e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))}}function Cr(e,t){let r=new URL(e,location);return{response:fetch(r,t?{integrity:t}:{})}}async function Ir(e,t){let{response:r,binary:n}=_r(e,t);if(n)return n;let a=await r;if(!a.ok)throw new Error(`Failed to load '${e}': request failed.`);return new Uint8Array(await a.arrayBuffer())}if("object"==typeof navigator&&"string"==typeof navigator.userAgent&&-1==navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.indexOf("Safari"),Gt(Nr,"initNodeModules"),Gt(jr,"node_resolvePath"),Gt(Pr,"browser_resolvePath"),gr=kr?jr:Pr,kr||(vr="/"),Gt(Ar,"node_getBinaryResponse"),Gt(Cr,"browser_getBinaryResponse"),_r=kr?Ar:Cr,Gt(Ir,"loadBinaryFile"),Or)wr=Gt((async e=>await import(e)),"loadScript");else if(Zr)wr=Gt((async e=>{try{globalThis.importScripts(e)}catch(Jr){if(!(Jr instanceof TypeError))throw Jr;await import(e)}}),"loadScript");else{if(!kr)throw new Error("Cannot determine runtime environment");wr=Rr}async function Rr(e){e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?fr.runInThisContext(await(await fetch(e)).text()):await import(pr.pathToFileURL(e).href)}async function Fr(e){if(kr){await Nr();let t=await yr.readFile(e,{encoding:"utf8"});return JSON.parse(t)}return await(await fetch(e)).json()}async function $r(){if(xr)return __dirname;let e;try{throw new Error}catch(n){e=n}let t=br.parse(e)[0].fileName;if(kr&&!t.startsWith("file://")&&(t=`file://${t}`),Sr){let e=await import("./__vite-browser-external-CIEyP2s7.js");return(await import("./__vite-browser-external-CIEyP2s7.js")).fileURLToPath(e.dirname(t))}let r=t.lastIndexOf(vr);if(-1===r)throw new Error("Could not extract indexURL path from pyodide module location");return t.slice(0,r)}function Lr(e){let t=e.FS,r=e.FS.filesystems.MEMFS,n=e.PATH,a={DIR_MODE:16895,FILE_MODE:33279,mount:function(e){if(!e.opts.fileSystemHandle)throw new Error("opts.fileSystemHandle is required");return r.mount.apply(null,arguments)},syncfs:async(e,t,r)=>{try{let n=a.getLocalSet(e),s=await a.getRemoteSet(e),i=t?s:n,o=t?n:s;await a.reconcile(e,i,o),r(null)}catch(n){r(n)}},getLocalSet:e=>{let r=Object.create(null);function a(e){return"."!==e&&".."!==e}function s(e){return t=>n.join2(e,t)}Gt(a,"isRealDir"),Gt(s,"toAbsolute");let i=t.readdir(e.mountpoint).filter(a).map(s(e.mountpoint));for(;i.length;){let e=i.pop(),n=t.stat(e);t.isDir(n.mode)&&i.push.apply(i,t.readdir(e).filter(a).map(s(e))),r[e]={timestamp:n.mtime,mode:n.mode}}return{type:"local",entries:r}},getRemoteSet:async e=>{let t=Object.create(null),r=await Mr(e.opts.fileSystemHandle);for(let[s,i]of r)"."!==s&&(t[n.join2(e.mountpoint,s)]={timestamp:"file"===i.kind?new Date((await i.getFile()).lastModified):new Date,mode:"file"===i.kind?a.FILE_MODE:a.DIR_MODE});return{type:"remote",entries:t,handles:r}},loadLocalEntry:e=>{let n=t.lookupPath(e).node,a=t.stat(e);if(t.isDir(a.mode))return{timestamp:a.mtime,mode:a.mode};if(t.isFile(a.mode))return n.contents=r.getFileDataAsTypedArray(n),{timestamp:a.mtime,mode:a.mode,contents:n.contents};throw new Error("node type not supported")},storeLocalEntry:(e,r)=>{if(t.isDir(r.mode))t.mkdirTree(e,r.mode);else{if(!t.isFile(r.mode))throw new Error("node type not supported");t.writeFile(e,r.contents,{canOwn:!0})}t.chmod(e,r.mode),t.utime(e,r.timestamp,r.timestamp)},removeLocalEntry:e=>{var r=t.stat(e);t.isDir(r.mode)?t.rmdir(e):t.isFile(r.mode)&&t.unlink(e)},loadRemoteEntry:async e=>{if("file"===e.kind){let t=await e.getFile();return{contents:new Uint8Array(await t.arrayBuffer()),mode:a.FILE_MODE,timestamp:new Date(t.lastModified)}}if("directory"===e.kind)return{mode:a.DIR_MODE,timestamp:new Date};throw new Error("unknown kind: "+e.kind)},storeRemoteEntry:async(e,r,a)=>{let s=e.get(n.dirname(r)),i=t.isFile(a.mode)?await s.getFileHandle(n.basename(r),{create:!0}):await s.getDirectoryHandle(n.basename(r),{create:!0});if("file"===i.kind){let e=await i.createWritable();await e.write(a.contents),await e.close()}e.set(r,i)},removeRemoteEntry:async(e,t)=>{await e.get(n.dirname(t)).removeEntry(n.basename(t)),e.delete(t)},reconcile:async(e,r,s)=>{let i=0,o=[];Object.keys(r.entries).forEach((function(e){let n=r.entries[e],a=s.entries[e];(!a||t.isFile(n.mode)&&n.timestamp.getTime()>a.timestamp.getTime())&&(o.push(e),i++)})),o.sort();let d=[];if(Object.keys(s.entries).forEach((function(e){r.entries[e]||(d.push(e),i++)})),d.sort().reverse(),!i)return;let c="remote"===r.type?r.handles:s.handles;for(let t of o){let r=n.normalize(t.replace(e.mountpoint,"/")).substring(1);if("local"===s.type){let e=c.get(r),n=await a.loadRemoteEntry(e);a.storeLocalEntry(t,n)}else{let e=a.loadLocalEntry(t);await a.storeRemoteEntry(c,r,e)}}for(let t of d)if("local"===s.type)a.removeLocalEntry(t);else{let r=n.normalize(t.replace(e.mountpoint,"/")).substring(1);await a.removeRemoteEntry(c,r)}}};e.FS.filesystems.NATIVEFS_ASYNC=a}Gt(Rr,"nodeLoadScript"),Gt(Fr,"loadLockFile"),Gt($r,"calculateDirname"),Gt(Lr,"initializeNativeFS");var Mr=Gt((async e=>{let t=[];async function r(e){for await(let n of e.values())t.push(n),"directory"===n.kind&&await r(n)}Gt(r,"collect"),await r(e);let n=new Map;n.set(".",e);for(let a of t){let t=(await e.resolve(a)).join("/");n.set(t,a)}return n}),"getFsHandles");function Dr(e){let t={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Hr(e),quit(e,r){throw t.exited={status:e,toThrow:r},r},print:e.stdout,printErr:e.stderr,thisProgram:e._sysExecutable,arguments:e.args,API:{config:e},locateFile:t=>e.indexURL+t,instantiateWasm:Br(e.indexURL)};return t}function Ur(e){return function(t){try{t.FS.mkdirTree(e)}catch(r){console.error(`Error occurred while making a home directory '${e}':`),console.error(r),console.error("Using '/' for a home directory instead"),e="/"}t.FS.chdir(e)}}function zr(e){return function(t){Object.assign(t.ENV,e)}}function qr(e){return e?[async t=>{t.addRunDependency("fsInitHook");try{await e(t.FS,{sitePackages:t.API.sitePackages})}finally{t.removeRunDependency("fsInitHook")}}]:[]}function Vr(e){let t=Ir(e);return async e=>{let r=e._py_version_major(),n=e._py_version_minor();e.FS.mkdirTree("/lib"),e.API.sitePackages=`/lib/python${r}.${n}/site-packages`,e.FS.mkdirTree(e.API.sitePackages),e.addRunDependency("install-stdlib");try{let a=await t;e.FS.writeFile(`/lib/python${r}${n}.zip`,a)}catch(a){console.error("Error occurred while installing the standard library:"),console.error(a)}finally{e.removeRunDependency("install-stdlib")}}}function Hr(e){let t;return t=null!=e.stdLibURL?e.stdLibURL:e.indexURL+"python_stdlib.zip",[...qr(e.fsInit),Vr(t),Ur(e.env.HOME),zr(e.env),Lr]}function Br(e){if(typeof WasmOffsetConverter<"u")return;let{binary:t,response:r}=_r(e+"pyodide.asm.wasm");return function(e,n){return async function(){try{let a;a=r?await WebAssembly.instantiateStreaming(r,e):await WebAssembly.instantiate(await t,e);let{instance:s,module:i}=a;n(s,i)}catch(a){console.warn("wasm instantiation failed!"),console.warn(a)}}(),{}}}Gt(Dr,"createSettings"),Gt(Ur,"createHomeDirectory"),Gt(zr,"setEnvironment"),Gt(qr,"callFsInitHook"),Gt(Vr,"installStdlib"),Gt(Hr,"getFileSystemInitializationFuncs"),Gt(Br,"getInstantiateWasmFunc");var Wr="0.27.5";async function Kr(e={}){var t,r;await Nr();let n=e.indexURL||await $r();n=gr(n),n.endsWith("/")||(n+="/"),e.indexURL=n;let a={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?globalThis.prompt:void 0,lockFileURL:n+"pyodide-lock.json",args:[],env:{},packageCacheDir:n,packages:[],enableRunUntilComplete:!1,checkAPIVersion:!0,BUILD_ID:"bd0388b62e760f8ba04185eb443fec955f25434f49c7b951efe5b1f792dbe5d4"},s=Object.assign(a,e);(t=s.env).HOME??(t.HOME="/home/pyodide"),(r=s.env).PYTHONINSPECT??(r.PYTHONINSPECT="1");let i,o=Dr(s),d=o.API;if(d.lockFilePromise=Fr(s.lockFileURL),"function"!=typeof _createPyodideModule){let e=`${s.indexURL}pyodide.asm.js`;await wr(e)}if(e._loadSnapshot){let t=await e._loadSnapshot;i=ArrayBuffer.isView(t)?t:new Uint8Array(t),o.noInitialRun=!0,o.INITIAL_MEMORY=i.length}let c,u=await _createPyodideModule(o);if(o.exited)throw o.exited.toThrow;if(e.pyproxyToStringRepr&&d.setPyProxyToStringMethod(!0),d.version!==Wr&&s.checkAPIVersion)throw new Error(`Pyodide version does not match: '${Wr}' <==> '${d.version}'. If you updated the Pyodide version, make sure you also updated the 'indexURL' parameter passed to loadPyodide.`);u.locateFile=e=>{throw new Error("Didn't expect to load any more file_packager files!")},i&&(c=d.restoreSnapshot(i));let l=d.finalizeBootstrap(c,e._snapshotDeserializer);return d.sys.path.insert(0,d.config.env.HOME),l.version.includes("dev")||d.setCdnUrl(`https://cdn.jsdelivr.net/pyodide/v${l.version}/full/`),d._pyodide.set_excepthook(),await d.packageIndexReady,d.initializeStreams(s.stdin,s.stdout,s.stderr),l}Gt(Kr,"loadPyodide");const Jr=new class{constructor(){this.spans=[]}startSpan(e,t={}){const r={name:e,startTime:Date.now(),attributes:t,end:(e="ok")=>this.endSpan(r,e)};return this.spans.push(r),r}endSpan(e,t="ok"){e.endTime=Date.now(),e.status=t}getSpans(){return this.spans}wrap(e,t,r={}){const n=this.startSpan(t||e.name,r);try{const t=e();return this.endSpan(n),t}catch(a){throw this.endSpan(n,"error"),a}}wrapAsync(e,t,r={}){return async(...n)=>{const a=this.startSpan(t||e.name,r);try{const t=await e(...n);return this.endSpan(a),t}catch(s){throw this.endSpan(a,"error"),s}}}logSpans(){}};globalThis.t=Jr;class Yr{constructor(){this.pyodide=null}get requirePyodide(){return function(e,t){if(!e)throw new Error(t)}(this.pyodide,"Pyodide not loaded"),this.pyodide}async bootstrap(e){return await this.loadPyodideAndPackages(e)}async loadPyodideAndPackages(e){if(!Kr)throw new Error("loadPyodide is not defined");const t=Jr.startSpan("loadPyodide");try{const r=await Kr({packages:["micropip","marimo-base","Markdown","pymdown-extensions","narwhals","packaging"],_makeSnapshot:false,lockFileURL:`https://wasm.marimo.app/pyodide-lock.json?v=${e.version}&pyodide=${e.pyodideVersion}`,indexURL:`https://cdn.jsdelivr.net/pyodide/${e.pyodideVersion}/full/`});return this.pyodide=r,t.end("ok"),r}catch(r){throw c.error("Failed to load Pyodide",r),r}}async mountFilesystem(e){const t=Jr.startSpan("mountFilesystem");return zt(this.requirePyodide),qt(this.requirePyodide),await Vt(this.requirePyodide),t.end("ok"),Wt({pyodide:this.requirePyodide,code:e.code,filename:e.filename})}async startSession(e){const{code:t,filename:r,onMessage:n,queryParameters:a,userConfig:s}=e;self.messenger={callback:n},self.query_params=a,self.user_config=s;const i=Jr.startSpan("startSession.runPython"),o=r||Ut,[d,c,u]=this.requirePyodide.runPython(`\n print("[py] Starting marimo...")\n import asyncio\n import js\n from marimo._pyodide.bootstrap import create_session, instantiate\n\n assert js.messenger, "messenger is not defined"\n assert js.query_params, "query_params is not defined"\n\n session, bridge = create_session(\n filename="${o}",\n query_params=js.query_params.to_py(),\n message_callback=js.messenger.callback,\n user_config=js.user_config.to_py(),\n )\n\n def init(auto_instantiate=True):\n instantiate(session, auto_instantiate)\n asyncio.create_task(session.start())\n\n # Find the packages to install\n with open("${o}", "r") as f:\n packages = session.find_packages(f.read())\n\n bridge, init, packages`);i.end();const l=new Set(u.toJs());return this.loadNotebookDeps(t,l).then((()=>c(s.runtime.auto_instantiate))),d}async loadNotebookDeps(e,t){const r=this.requirePyodide;e.includes("mo.sql")&&(e=`import sqlglot\n${e=`import duckdb\n${e=`import pandas\n${e}`}`}`).includes("polars")&&(e=`import pyarrow\n${e}`),e=`import pyodide_http\n${e=`import jedi\n${e=`import pygments\n${e=`import docutils\n${e}`}`}`}`;const n=[...t];let a=Jr.startSpan("pyodide.loadPackage");await r.loadPackagesFromImports(e,{errorCallback:c.error,messageCallback:c.log}),a.end(),a=Jr.startSpan("micropip.install");const s=n.filter((e=>!r.loadedPackages[e]));s.length>0&&await r.runPythonAsync(`\n import micropip\n import sys\n # Filter out builtins\n missing = [p for p in ${JSON.stringify(s)} if p not in sys.modules]\n if len(missing) > 0:\n print("Loading from micropip:", missing)\n await micropip.install(missing)\n `).catch((e=>{c.error("Failed to load packages from micropip",e)})),a.end()}}const Gr=async function(){try{const e=self.name,t=function(e){return e.includes("dev"),`v${Wr}`}(e),r=await async function(e){try{return await import(`/wasm/controller.js?version=${e}`)}catch{return new Yr}}(e);self.controller=r,self.pyodide=await r.bootstrap({version:e,pyodideVersion:t}),await(r.mountFilesystem?.({code:"",filename:null})),Qr.send.initialized({})}catch(e){c.error("Error bootstrapping",e),Qr.send.initializedError({error:$t(e)})}}(),Xr={readFile:async e=>{await Gr;return u(self.pyodide.FS.readFile(e))},readNotebook:async()=>(await Gr,Bt(self.pyodide)),saveNotebook:async e=>{await Gr;const t=self.pyodide.runPython("\n from marimo._pyodide.bootstrap import save_file\n\n save_file\n ");await t(JSON.stringify(e),Ut),await Ht(self.pyodide)}},Qr=function(e){return r(e)}({transport:(en={transportId:"marimo-transport"},a(self,en)),requestHandler:Xr});var en;Qr.send("ready",{});