@marimo-team/frontend 0.14.5 → 0.14.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{ConnectedDataExplorerComponent-Cd8OePNL.js → ConnectedDataExplorerComponent-BdQW-gwg.js} +2 -2
- package/dist/assets/{ImageComparisonComponent-BaounMqb.js → ImageComparisonComponent-BIBfPPuz.js} +1 -1
- package/dist/assets/{VegaLite-BThNu01F.js → VegaLite-GVqhQbDs.js} +4 -4
- package/dist/assets/_baseEach-DtUk7cBy.js +1 -0
- package/dist/assets/_baseMap-zXgLfXUO.js +1 -0
- package/dist/assets/_baseUniq-BuhsH2Gw.js +1 -0
- package/dist/assets/_createAggregator-CCTzDuxr.js +1 -0
- package/dist/assets/{any-language-editor-BwrzhW9s.js → any-language-editor-C16cE8Sc.js} +1 -1
- package/dist/assets/architectureDiagram-IEHRJDOE-A6ZwaSTM.js +36 -0
- package/dist/assets/{blockDiagram-JOT3LUYC-D5tDE05w.js → blockDiagram-JOT3LUYC-CGgOmZ6q.js} +1 -1
- package/dist/assets/{c4Diagram-VJAJSXHY-D2EVIFPE.js → c4Diagram-VJAJSXHY-21Uq3Dg7.js} +1 -1
- package/dist/assets/channel-BAvRfsic.js +1 -0
- package/dist/assets/{chunk-4BMEZGHF-CADZZMGY.js → chunk-4BMEZGHF-DLcqo-x9.js} +1 -1
- package/dist/assets/{chunk-A2AXSNBT-CfEZbXlN.js → chunk-A2AXSNBT-ClwGv4ej.js} +1 -1
- package/dist/assets/{chunk-AEK57VVT-BQlr57ae.js → chunk-AEK57VVT-DXU_Eu70.js} +1 -1
- package/dist/assets/{chunk-D6G4REZN-CcnlvIsn.js → chunk-D6G4REZN-CdJcmRtu.js} +1 -1
- package/dist/assets/{chunk-RZ5BOZE2-BQ7pJY-M.js → chunk-RZ5BOZE2-BjqSfcQg.js} +1 -1
- package/dist/assets/{chunk-XZIHB7SX-BuiqX9Aw.js → chunk-XZIHB7SX-XW5eSvGR.js} +1 -1
- package/dist/assets/{circle-play-Bxr4QwIa.js → circle-play-CxSSFgdO.js} +1 -1
- package/dist/assets/classDiagram-GIVACNV2-CK_KuAvj.js +1 -0
- package/dist/assets/classDiagram-v2-COTLJTTW-CK_KuAvj.js +1 -0
- package/dist/assets/clone-Cho8ekmu.js +1 -0
- package/dist/assets/compile-DnHFbvjV.js +3 -0
- package/dist/assets/cytoscape.esm-UYyVlru8.js +10 -0
- package/dist/assets/dagre-OKDRZEBW-D75XrYB0.js +4 -0
- package/dist/assets/{data-editor-rukfgV6c.js → data-editor-DOJVcXVY.js} +29 -29
- package/dist/assets/diagram-SSKATNLV-BTff3VIp.js +43 -0
- package/dist/assets/diagram-VNBRO52H-LnHBmUxh.js +24 -0
- package/dist/assets/edit-page-CM7Z6do2.js +144 -0
- package/dist/assets/{erDiagram-Q7BY3M3F-DjRQ_etL.js → erDiagram-Q7BY3M3F-DPuHBTLc.js} +5 -5
- package/dist/assets/{flowDiagram-4HSFHLVR-CeFuqcbl.js → flowDiagram-4HSFHLVR-DyJAEc--.js} +1 -1
- package/dist/assets/{ganttDiagram-APWFNJXF-ByTTg73J.js → ganttDiagram-APWFNJXF-CuNs6GsL.js} +3 -3
- package/dist/assets/gitGraphDiagram-7IBYFJ6S-B8RjSR7Y.js +65 -0
- package/dist/assets/{graph-DNRj_GT8.js → graph-DfO_3t8f.js} +1 -1
- package/dist/assets/{home-page-PkK2rOsj.js → home-page-DNroMY0L.js} +3 -3
- package/dist/assets/index-7fo-bO1b.css +1 -0
- package/dist/assets/{index-CfDLJuRd.js → index-BGV64nJA.js} +1 -1
- package/dist/assets/{index-BLEx_XmQ.js → index-BLhUKus3.js} +1 -1
- package/dist/assets/index-BWJPY1iW.js +1 -0
- package/dist/assets/index-BWLBzXjn.js +1 -0
- package/dist/assets/{index-RvePnxjR.js → index-BWRJuAq5.js} +1 -1
- package/dist/assets/{index-D8_wOrAS.js → index-B_2-onrX.js} +1 -1
- package/dist/assets/{index-C4zeEHGR.js → index-Bhxhykeb.js} +1 -1
- package/dist/assets/{index-Dqale_LJ.js → index-BkG9SImY.js} +1 -1
- package/dist/assets/{index-unIeHe6K.js → index-CFqFJcvv.js} +1 -1
- package/dist/assets/index-CSVJhvPj.js +1 -0
- package/dist/assets/index-ChJ6MVK4.js +1 -0
- package/dist/assets/{index-DmNMHBkh.js → index-Ckjkc_22.js} +1 -1
- package/dist/assets/{index-BgLoMO85.js → index-Cu42ofZQ.js} +1 -1
- package/dist/assets/{index-CTa3U4be.js → index-DLz0HVCk.js} +1 -1
- package/dist/assets/{index-Cxi469si.js → index-DhhQl-OJ.js} +1 -1
- package/dist/assets/index-DlQKt39j.js +507 -0
- package/dist/assets/{index-C15JFT_c.js → index-DyyuCOy7.js} +1 -1
- package/dist/assets/{index-DFFTVPrS.js → index-TycZpXM8.js} +1 -1
- package/dist/assets/{index-DUYmArTl.js → index-cyG9KqdX.js} +1 -1
- package/dist/assets/infoDiagram-PH2N3AL5-Dh9JpBgC.js +2 -0
- package/dist/assets/{journeyDiagram-U35MCT3I-BmSbbdbZ.js → journeyDiagram-U35MCT3I-D0z4rhTA.js} +6 -6
- package/dist/assets/{kanban-definition-NDS4AKOZ-wn14wHeG.js → kanban-definition-NDS4AKOZ-0mBTqXp8.js} +1 -1
- package/dist/assets/{katex-BsnJiHtx.js → katex-LV4FpwlL.js} +26 -26
- package/dist/assets/layout-DJLBNR64.js +1 -0
- package/dist/assets/{mermaid-D9TTXveo.js → mermaid-BgCxVw2J.js} +30 -30
- package/dist/assets/{mhchem-C_nT2J_7.js → mhchem-DFRC5yJY.js} +1 -1
- package/dist/assets/min-DTkssK90.js +1 -0
- package/dist/assets/mindmap-definition-ALO5MXBD-LCnJv2FH.js +95 -0
- package/dist/assets/pieDiagram-IB7DONF6-B4-ZhPJf.js +30 -0
- package/dist/assets/{pug-_kJOm_E2.js → pug-BTvK5tSS.js} +1 -1
- package/dist/assets/{quadrantDiagram-7GDLP6J5-CgsaXk59.js → quadrantDiagram-7GDLP6J5-DKB7UlL9.js} +4 -4
- package/dist/assets/{radar-MK3ICKWK-DpxMM0Qw.js → radar-MK3ICKWK-FyfW4UKQ.js} +33 -33
- package/dist/assets/react-plotly-Cq47c_fP.js +4074 -0
- package/dist/assets/{requirementDiagram-KVF5MWMF-rD1Xtg0C.js → requirementDiagram-KVF5MWMF-Kkhfwu0p.js} +1 -1
- package/dist/assets/run-page-GUDMiyk3.js +1 -0
- package/dist/assets/sankeyDiagram-QLVOVGJD-BZ4xSd22.js +10 -0
- package/dist/assets/save-worker-Bm3BvYpV.js +1 -0
- package/dist/assets/{sequenceDiagram-X6HHIX6F-DOr7opXd.js → sequenceDiagram-X6HHIX6F-Dj06cd6Y.js} +1 -1
- package/dist/assets/{shutdown-button-CNHmqusO.js → shutdown-button-D56z6eVx.js} +13 -13
- package/dist/assets/slides-component-CDu4ZSzE.js +1 -0
- package/dist/assets/sortBy-CDXarBT-.js +1 -0
- package/dist/assets/stateDiagram-DGXRK772-j06SHL3p.js +1 -0
- package/dist/assets/stateDiagram-v2-YXO3MK2T-DuT23alC.js +1 -0
- package/dist/assets/storage-Dz2fUeWr.js +27 -0
- package/dist/assets/{terminal-C9AM9Ufr.js → terminal-DZLrrul6.js} +1 -1
- package/dist/assets/{timeline-definition-BDJGKUSR-BQjvgKyo.js → timeline-definition-BDJGKUSR-BQyRy1s7.js} +1 -1
- package/dist/assets/tracing-CDEeF17U.js +2 -0
- package/dist/assets/transform-C5148Z0S.js +1 -0
- package/dist/assets/vega-component-CUPLtVbZ.js +1 -0
- package/dist/assets/worker-CJ614ngf.js +1 -0
- package/dist/assets/worker-C_uu8t-8.js +1 -0
- package/dist/assets/{xychartDiagram-VJFVF3MP-D6G5YXc9.js → xychartDiagram-VJFVF3MP--8SfVdNT.js} +3 -3
- package/dist/index.html +2 -2
- package/package.json +3 -4
- package/dist/assets/_baseEach-AMF-7d2J.js +0 -1
- package/dist/assets/_baseMap-CtLb1-E9.js +0 -1
- package/dist/assets/_baseUniq-DmGC0EvQ.js +0 -1
- package/dist/assets/_createAggregator-nAviCUEI.js +0 -1
- package/dist/assets/arc-ZB5pDULS.js +0 -1
- package/dist/assets/architectureDiagram-IEHRJDOE-DELkI6j7.js +0 -36
- package/dist/assets/channel-Bsq91aIP.js +0 -1
- package/dist/assets/classDiagram-GIVACNV2-uoJGO3VQ.js +0 -1
- package/dist/assets/classDiagram-v2-COTLJTTW-uoJGO3VQ.js +0 -1
- package/dist/assets/clone-Yb_iboYC.js +0 -1
- package/dist/assets/colors-bszWmPJw.js +0 -1
- package/dist/assets/compile-D71Q4H3R.js +0 -10
- package/dist/assets/cytoscape.esm-C11VZyMT.js +0 -10
- package/dist/assets/dagre-OKDRZEBW-DarkVs9y.js +0 -4
- package/dist/assets/diagram-SSKATNLV-D4OT3ifx.js +0 -43
- package/dist/assets/diagram-VNBRO52H-BUvUJmDs.js +0 -24
- package/dist/assets/edit-page-DCGyJssF.js +0 -144
- package/dist/assets/gitGraphDiagram-7IBYFJ6S-DzfS7fCx.js +0 -65
- package/dist/assets/index-9wcEzf6r.js +0 -1
- package/dist/assets/index-BVt8Dtzn.css +0 -1
- package/dist/assets/index-CsvxUqpa.js +0 -1
- package/dist/assets/index-OXxabNuL.js +0 -1
- package/dist/assets/index-g8LxgBK2.js +0 -500
- package/dist/assets/index-rl-fndXu.js +0 -1
- package/dist/assets/infoDiagram-PH2N3AL5-C2E2NFkV.js +0 -2
- package/dist/assets/init-DLRA0X12.js +0 -1
- package/dist/assets/layout-BVHTL_z5.js +0 -1
- package/dist/assets/linear-BCVS3STf.js +0 -1
- package/dist/assets/min-DHnRmciI.js +0 -1
- package/dist/assets/mindmap-definition-ALO5MXBD-a8I3m_98.js +0 -95
- package/dist/assets/ordinal-DDUp3AbE.js +0 -1
- package/dist/assets/pieDiagram-IB7DONF6-DUDocndn.js +0 -30
- package/dist/assets/range-CtcPcB_L.js +0 -1
- package/dist/assets/react-plotly-DvB1Xb5a.js +0 -4074
- package/dist/assets/run-page-B0Hx0CMC.js +0 -1
- package/dist/assets/sankeyDiagram-QLVOVGJD-C0DUUjQG.js +0 -10
- package/dist/assets/save-worker-BDcz2hJn.js +0 -1
- package/dist/assets/slides-component-c1dc16jM.js +0 -1
- package/dist/assets/sortBy-ozOfSDdJ.js +0 -1
- package/dist/assets/stateDiagram-DGXRK772-Ez0EwtuH.js +0 -1
- package/dist/assets/stateDiagram-v2-YXO3MK2T-DzizQt5g.js +0 -1
- package/dist/assets/step-BwsUM5iJ.js +0 -1
- package/dist/assets/storage-DmZs9OBM.js +0 -27
- package/dist/assets/time-Bto2Pv9Y.js +0 -1
- package/dist/assets/timer-B5eI7Tcu.js +0 -1
- package/dist/assets/tracing-42w5ahGA.js +0 -2
- package/dist/assets/transform-BzDy4yXW.js +0 -1
- package/dist/assets/vega-component-DPpmBYts.js +0 -1
- package/dist/assets/worker-BoGc2ntD.js +0 -1
- package/dist/assets/worker-D9uxCaRv.js +0 -1
- package/dist/assets/zoom-COrs4lFh.js +0 -1
- /package/dist/assets/{clojure-DR_hEDJv.js → clojure-DiuoqK-z.js} +0 -0
- /package/dist/assets/{dylan-CHJ5qNM_.js → dylan-DkEP81N9.js} +0 -0
- /package/dist/assets/{elm-D7xaZ7Da.js → elm-DompmV0j.js} +0 -0
- /package/dist/assets/{forth-Dri_5nFc.js → forth-POgR1ypr.js} +0 -0
- /package/dist/assets/{gas-5kEe4nk0.js → gas-bV0CklSb.js} +0 -0
- /package/dist/assets/{haskell-CmdsSjFB.js → haskell-CLQs6EAM.js} +0 -0
- /package/dist/assets/{javascript-D48wDJXV.js → javascript-BpzJj0-u.js} +0 -0
- /package/dist/assets/{ntriples-FFvkTduk.js → ntriples-BSwWqoLa.js} +0 -0
- /package/dist/assets/{stylus-OdhglgkO.js → stylus-Bdo_Aemu.js} +0 -0
- /package/dist/assets/{toml-BQXy8elZ.js → toml-wcPdHu67.js} +0 -0
- /package/dist/assets/{web-vitals-Buym0gfC.js → web-vitals-qptAEYGW.js} +0 -0
@@ -1 +0,0 @@
|
|
1
|
-
import{T as it,t as ot,g as ut,i as st,a as V,b as at,f as X,j as lt,k as ct,l as ft}from"./timer-B5eI7Tcu.js";function z(t,n,e){var r=new it;return n=n==null?0:+n,r.restart(i=>{r.stop(),t(i+n)},n,e),r}var M="http://www.w3.org/1999/xhtml";const H={svg:"http://www.w3.org/2000/svg",xhtml:M,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function T(t){var n=t+="",e=n.indexOf(":");return e>=0&&(n=t.slice(0,e))!=="xmlns"&&(t=t.slice(e+1)),H.hasOwnProperty(n)?{space:H[n],local:t}:t}function ht(t){return function(){var n=this.ownerDocument,e=this.namespaceURI;return e===M&&n.documentElement.namespaceURI===M?n.createElement(t):n.createElementNS(e,t)}}function pt(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function I(t){var n=T(t);return(n.local?pt:ht)(n)}function _t(){}function q(t){return t==null?_t:function(){return this.querySelector(t)}}function vt(){return[]}function R(t){return t==null?vt:function(){return this.querySelectorAll(t)}}function dt(t){return function(){return(n=t.apply(this,arguments))==null?[]:Array.isArray(n)?n:Array.from(n);var n}}function U(t){return function(){return this.matches(t)}}function Y(t){return function(n){return n.matches(t)}}var yt=Array.prototype.find;function mt(){return this.firstElementChild}var gt=Array.prototype.filter;function wt(){return Array.from(this.children)}function $(t){return new Array(t.length)}function L(t,n){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=n}function At(t,n,e,r,i,u){for(var s,o=0,l=n.length,a=u.length;o<a;++o)(s=n[o])?(s.__data__=u[o],r[o]=s):e[o]=new L(t,u[o]);for(;o<l;++o)(s=n[o])&&(i[o]=s)}function xt(t,n,e,r,i,u,s){var o,l,a,c=new Map,f=n.length,h=u.length,p=new Array(f);for(o=0;o<f;++o)(l=n[o])&&(p[o]=a=s.call(l,l.__data__,o,n)+"",c.has(a)?i[o]=l:c.set(a,l));for(o=0;o<h;++o)a=s.call(t,u[o],o,u)+"",(l=c.get(a))?(r[o]=l,l.__data__=u[o],c.delete(a)):e[o]=new L(t,u[o]);for(o=0;o<f;++o)(l=n[o])&&c.get(p[o])===l&&(i[o]=l)}function bt(t){return t.__data__}function Et(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function St(t,n){return t<n?-1:t>n?1:t>=n?0:NaN}function Nt(t){return function(){this.removeAttribute(t)}}function Ct(t){return function(){this.removeAttributeNS(t.space,t.local)}}function kt(t,n){return function(){this.setAttribute(t,n)}}function Pt(t,n){return function(){this.setAttributeNS(t.space,t.local,n)}}function Tt(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttribute(t):this.setAttribute(t,e)}}function Lt(t,n){return function(){var e=n.apply(this,arguments);e==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,e)}}function F(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function Bt(t){return function(){this.style.removeProperty(t)}}function Mt(t,n,e){return function(){this.style.setProperty(t,n,e)}}function qt(t,n,e){return function(){var r=n.apply(this,arguments);r==null?this.style.removeProperty(t):this.style.setProperty(t,r,e)}}function C(t,n){return t.style.getPropertyValue(n)||F(t).getComputedStyle(t,null).getPropertyValue(n)}function Dt(t){return function(){delete this[t]}}function Ot(t,n){return function(){this[t]=n}}function jt(t,n){return function(){var e=n.apply(this,arguments);e==null?delete this[t]:this[t]=e}}function G(t){return t.trim().split(/^|\s+/)}function D(t){return t.classList||new J(t)}function J(t){this._node=t,this._names=G(t.getAttribute("class")||"")}function K(t,n){for(var e=D(t),r=-1,i=n.length;++r<i;)e.add(n[r])}function Q(t,n){for(var e=D(t),r=-1,i=n.length;++r<i;)e.remove(n[r])}function Vt(t){return function(){K(this,t)}}function Xt(t){return function(){Q(this,t)}}function zt(t,n){return function(){(n.apply(this,arguments)?K:Q)(this,t)}}function Ht(){this.textContent=""}function It(t){return function(){this.textContent=t}}function Rt(t){return function(){var n=t.apply(this,arguments);this.textContent=n??""}}function Ut(){this.innerHTML=""}function Yt(t){return function(){this.innerHTML=t}}function $t(t){return function(){var n=t.apply(this,arguments);this.innerHTML=n??""}}function Ft(){this.nextSibling&&this.parentNode.appendChild(this)}function Gt(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Jt(){return null}function Kt(){var t=this.parentNode;t&&t.removeChild(this)}function Qt(){var t=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function Wt(){var t=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(t,this.nextSibling):t}function Zt(t){return function(){var n=this.__on;if(n){for(var e,r=0,i=-1,u=n.length;r<u;++r)e=n[r],t.type&&e.type!==t.type||e.name!==t.name?n[++i]=e:this.removeEventListener(e.type,e.listener,e.options);++i?n.length=i:delete this.__on}}}function tn(t,n,e){return function(){var r,i=this.__on,u=function(l){return function(a){l.call(this,a,this.__data__)}}(n);if(i){for(var s=0,o=i.length;s<o;++s)if((r=i[s]).type===t.type&&r.name===t.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=u,r.options=e),void(r.value=n)}this.addEventListener(t.type,u,e),r={type:t.type,name:t.name,value:n,listener:u,options:e},i?i.push(r):this.__on=[r]}}function W(t,n,e){var r=F(t),i=r.CustomEvent;typeof i=="function"?i=new i(n,e):(i=r.document.createEvent("Event"),e?(i.initEvent(n,e.bubbles,e.cancelable),i.detail=e.detail):i.initEvent(n,!1,!1)),t.dispatchEvent(i)}function nn(t,n){return function(){return W(this,t,n)}}function en(t,n){return function(){return W(this,t,n.apply(this,arguments))}}L.prototype={constructor:L,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,n){return this._parent.insertBefore(t,n)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}},J.prototype={add:function(t){this._names.indexOf(t)<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var n=this._names.indexOf(t);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var Z=[null];function g(t,n){this._groups=t,this._parents=n}function k(){return new g([[document.documentElement]],Z)}function rn(t){return typeof t=="string"?new g([[document.querySelector(t)]],[document.documentElement]):new g([[t]],Z)}g.prototype=k.prototype={constructor:g,select:function(t){typeof t!="function"&&(t=q(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var u,s,o=n[i],l=o.length,a=r[i]=new Array(l),c=0;c<l;++c)(u=o[c])&&(s=t.call(u,u.__data__,c,o))&&("__data__"in u&&(s.__data__=u.__data__),a[c]=s);return new g(r,this._parents)},selectAll:function(t){t=typeof t=="function"?dt(t):R(t);for(var n=this._groups,e=n.length,r=[],i=[],u=0;u<e;++u)for(var s,o=n[u],l=o.length,a=0;a<l;++a)(s=o[a])&&(r.push(t.call(s,s.__data__,a,o)),i.push(s));return new g(r,i)},selectChild:function(t){return this.select(t==null?mt:function(n){return function(){return yt.call(this.children,n)}}(typeof t=="function"?t:Y(t)))},selectChildren:function(t){return this.selectAll(t==null?wt:function(n){return function(){return gt.call(this.children,n)}}(typeof t=="function"?t:Y(t)))},filter:function(t){typeof t!="function"&&(t=U(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var u,s=n[i],o=s.length,l=r[i]=[],a=0;a<o;++a)(u=s[a])&&t.call(u,u.__data__,a,s)&&l.push(u);return new g(r,this._parents)},data:function(t,n){if(!arguments.length)return Array.from(this,bt);var e,r=n?xt:At,i=this._parents,u=this._groups;typeof t!="function"&&(e=t,t=function(){return e});for(var s=u.length,o=new Array(s),l=new Array(s),a=new Array(s),c=0;c<s;++c){var f=i[c],h=u[c],p=h.length,_=Et(t.call(f,f&&f.__data__,c,i)),y=_.length,m=l[c]=new Array(y),d=o[c]=new Array(y);r(f,h,m,d,a[c]=new Array(p),_,n);for(var x,S,v=0,P=0;v<y;++v)if(x=m[v]){for(v>=P&&(P=v+1);!(S=d[P])&&++P<y;);x._next=S||null}}return(o=new g(o,i))._enter=l,o._exit=a,o},enter:function(){return new g(this._enter||this._groups.map($),this._parents)},exit:function(){return new g(this._exit||this._groups.map($),this._parents)},join:function(t,n,e){var r=this.enter(),i=this,u=this.exit();return typeof t=="function"?(r=t(r))&&(r=r.selection()):r=r.append(t+""),n!=null&&(i=n(i))&&(i=i.selection()),e==null?u.remove():e(u),r&&i?r.merge(i).order():i},merge:function(t){for(var n=t.selection?t.selection():t,e=this._groups,r=n._groups,i=e.length,u=r.length,s=Math.min(i,u),o=new Array(i),l=0;l<s;++l)for(var a,c=e[l],f=r[l],h=c.length,p=o[l]=new Array(h),_=0;_<h;++_)(a=c[_]||f[_])&&(p[_]=a);for(;l<i;++l)o[l]=e[l];return new g(o,this._parents)},selection:function(){return this},order:function(){for(var t=this._groups,n=-1,e=t.length;++n<e;)for(var r,i=t[n],u=i.length-1,s=i[u];--u>=0;)(r=i[u])&&(s&&4^r.compareDocumentPosition(s)&&s.parentNode.insertBefore(r,s),s=r);return this},sort:function(t){function n(f,h){return f&&h?t(f.__data__,h.__data__):!f-!h}t||(t=St);for(var e=this._groups,r=e.length,i=new Array(r),u=0;u<r;++u){for(var s,o=e[u],l=o.length,a=i[u]=new Array(l),c=0;c<l;++c)(s=o[c])&&(a[c]=s);a.sort(n)}return new g(i,this._parents).order()},call:function(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r=t[n],i=0,u=r.length;i<u;++i){var s=r[i];if(s)return s}return null},size:function(){let t=0;for(const n of this)++t;return t},empty:function(){return!this.node()},each:function(t){for(var n=this._groups,e=0,r=n.length;e<r;++e)for(var i,u=n[e],s=0,o=u.length;s<o;++s)(i=u[s])&&t.call(i,i.__data__,s,u);return this},attr:function(t,n){var e=T(t);if(arguments.length<2){var r=this.node();return e.local?r.getAttributeNS(e.space,e.local):r.getAttribute(e)}return this.each((n==null?e.local?Ct:Nt:typeof n=="function"?e.local?Lt:Tt:e.local?Pt:kt)(e,n))},style:function(t,n,e){return arguments.length>1?this.each((n==null?Bt:typeof n=="function"?qt:Mt)(t,n,e??"")):C(this.node(),t)},property:function(t,n){return arguments.length>1?this.each((n==null?Dt:typeof n=="function"?jt:Ot)(t,n)):this.node()[t]},classed:function(t,n){var e=G(t+"");if(arguments.length<2){for(var r=D(this.node()),i=-1,u=e.length;++i<u;)if(!r.contains(e[i]))return!1;return!0}return this.each((typeof n=="function"?zt:n?Vt:Xt)(e,n))},text:function(t){return arguments.length?this.each(t==null?Ht:(typeof t=="function"?Rt:It)(t)):this.node().textContent},html:function(t){return arguments.length?this.each(t==null?Ut:(typeof t=="function"?$t:Yt)(t)):this.node().innerHTML},raise:function(){return this.each(Ft)},lower:function(){return this.each(Gt)},append:function(t){var n=typeof t=="function"?t:I(t);return this.select(function(){return this.appendChild(n.apply(this,arguments))})},insert:function(t,n){var e=typeof t=="function"?t:I(t),r=n==null?Jt:typeof n=="function"?n:q(n);return this.select(function(){return this.insertBefore(e.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(Kt)},clone:function(t){return this.select(t?Wt:Qt)},datum:function(t){return arguments.length?this.property("__data__",t):this.node().__data__},on:function(t,n,e){var r,i,u=function(f){return f.trim().split(/^|\s+/).map(function(h){var p="",_=h.indexOf(".");return _>=0&&(p=h.slice(_+1),h=h.slice(0,_)),{type:h,name:p}})}(t+""),s=u.length;if(!(arguments.length<2)){for(o=n?tn:Zt,r=0;r<s;++r)this.each(o(u[r],n,e));return this}var o=this.node().__on;if(o){for(var l,a=0,c=o.length;a<c;++a)for(r=0,l=o[a];r<s;++r)if((i=u[r]).type===l.type&&i.name===l.name)return l.value}},dispatch:function(t,n){return this.each((typeof n=="function"?en:nn)(t,n))},[Symbol.iterator]:function*(){for(var t=this._groups,n=0,e=t.length;n<e;++n)for(var r,i=t[n],u=0,s=i.length;u<s;++u)(r=i[u])&&(yield r)}};var on=ut("start","end","cancel","interrupt"),un=[];function B(t,n,e,r,i,u){var s=t.__transition;if(s){if(e in s)return}else t.__transition={};(function(o,l,a){var c,f=o.__transition;function h(m){a.state=1,a.timer.restart(p,a.delay,a.time),a.delay<=m&&p(m-a.delay)}function p(m){var d,x,S,v;if(a.state!==1)return y();for(d in f)if((v=f[d]).name===a.name){if(v.state===3)return z(p);v.state===4?(v.state=6,v.timer.stop(),v.on.call("interrupt",o,o.__data__,v.index,v.group),delete f[d]):+d<l&&(v.state=6,v.timer.stop(),v.on.call("cancel",o,o.__data__,v.index,v.group),delete f[d])}if(z(function(){a.state===3&&(a.state=4,a.timer.restart(_,a.delay,a.time),_(m))}),a.state=2,a.on.call("start",o,o.__data__,a.index,a.group),a.state===2){for(a.state=3,c=new Array(S=a.tween.length),d=0,x=-1;d<S;++d)(v=a.tween[d].value.call(o,o.__data__,a.index,a.group))&&(c[++x]=v);c.length=x+1}}function _(m){for(var d=m<a.duration?a.ease.call(null,m/a.duration):(a.timer.restart(y),a.state=5,1),x=-1,S=c.length;++x<S;)c[x].call(o,d);a.state===5&&(a.on.call("end",o,o.__data__,a.index,a.group),y())}function y(){for(var m in a.state=6,a.timer.stop(),delete f[l],f)return;delete o.__transition}f[l]=a,a.timer=ot(h,0,a.time)})(t,e,{name:n,index:r,group:i,on,tween:un,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:0})}function O(t,n){var e=w(t,n);if(e.state>0)throw new Error("too late; already scheduled");return e}function A(t,n){var e=w(t,n);if(e.state>3)throw new Error("too late; already running");return e}function w(t,n){var e=t.__transition;if(!e||!(e=e[n]))throw new Error("transition not found");return e}function tt(t,n){var e,r,i,u=t.__transition,s=!0;if(u){for(i in n=n==null?null:n+"",u)(e=u[i]).name===n?(r=e.state>2&&e.state<5,e.state=6,e.timer.stop(),e.on.call(r?"interrupt":"cancel",t,t.__data__,e.index,e.group),delete u[i]):s=!1;s&&delete t.__transition}}function sn(t,n){var e,r;return function(){var i=A(this,t),u=i.tween;if(u!==e){for(var s=0,o=(r=e=u).length;s<o;++s)if(r[s].name===n){(r=r.slice()).splice(s,1);break}}i.tween=r}}function an(t,n,e){var r,i;if(typeof e!="function")throw new Error;return function(){var u=A(this,t),s=u.tween;if(s!==r){i=(r=s).slice();for(var o={name:n,value:e},l=0,a=i.length;l<a;++l)if(i[l].name===n){i[l]=o;break}l===a&&i.push(o)}u.tween=i}}function j(t,n,e){var r=t._id;return t.each(function(){var i=A(this,r);(i.value||(i.value={}))[n]=e.apply(this,arguments)}),function(i){return w(i,r).value[n]}}function nt(t,n){var e;return(typeof n=="number"?st:n instanceof X?V:(e=X(n))?(n=e,V):at)(t,n)}function ln(t){return function(){this.removeAttribute(t)}}function cn(t){return function(){this.removeAttributeNS(t.space,t.local)}}function fn(t,n,e){var r,i,u=e+"";return function(){var s=this.getAttribute(t);return s===u?null:s===r?i:i=n(r=s,e)}}function hn(t,n,e){var r,i,u=e+"";return function(){var s=this.getAttributeNS(t.space,t.local);return s===u?null:s===r?i:i=n(r=s,e)}}function pn(t,n,e){var r,i,u;return function(){var s,o,l=e(this);if(l!=null)return(s=this.getAttribute(t))===(o=l+"")?null:s===r&&o===i?u:(i=o,u=n(r=s,l));this.removeAttribute(t)}}function _n(t,n,e){var r,i,u;return function(){var s,o,l=e(this);if(l!=null)return(s=this.getAttributeNS(t.space,t.local))===(o=l+"")?null:s===r&&o===i?u:(i=o,u=n(r=s,l));this.removeAttributeNS(t.space,t.local)}}function vn(t,n){var e,r;function i(){var u=n.apply(this,arguments);return u!==r&&(e=(r=u)&&function(s,o){return function(l){this.setAttributeNS(s.space,s.local,o.call(this,l))}}(t,u)),e}return i._value=n,i}function dn(t,n){var e,r;function i(){var u=n.apply(this,arguments);return u!==r&&(e=(r=u)&&function(s,o){return function(l){this.setAttribute(s,o.call(this,l))}}(t,u)),e}return i._value=n,i}function yn(t,n){return function(){O(this,t).delay=+n.apply(this,arguments)}}function mn(t,n){return n=+n,function(){O(this,t).delay=n}}function gn(t,n){return function(){A(this,t).duration=+n.apply(this,arguments)}}function wn(t,n){return n=+n,function(){A(this,t).duration=n}}var An=k.prototype.constructor;function et(t){return function(){this.style.removeProperty(t)}}var xn=0;function b(t,n,e,r){this._groups=t,this._parents=n,this._name=e,this._id=r}function rt(){return++xn}var E=k.prototype;b.prototype={constructor:b,select:function(t){var n=this._name,e=this._id;typeof t!="function"&&(t=q(t));for(var r=this._groups,i=r.length,u=new Array(i),s=0;s<i;++s)for(var o,l,a=r[s],c=a.length,f=u[s]=new Array(c),h=0;h<c;++h)(o=a[h])&&(l=t.call(o,o.__data__,h,a))&&("__data__"in o&&(l.__data__=o.__data__),f[h]=l,B(f[h],n,e,h,f,w(o,e)));return new b(u,this._parents,n,e)},selectAll:function(t){var n=this._name,e=this._id;typeof t!="function"&&(t=R(t));for(var r=this._groups,i=r.length,u=[],s=[],o=0;o<i;++o)for(var l,a=r[o],c=a.length,f=0;f<c;++f)if(l=a[f]){for(var h,p=t.call(l,l.__data__,f,a),_=w(l,e),y=0,m=p.length;y<m;++y)(h=p[y])&&B(h,n,e,y,p,_);u.push(p),s.push(l)}return new b(u,s,n,e)},selectChild:E.selectChild,selectChildren:E.selectChildren,filter:function(t){typeof t!="function"&&(t=U(t));for(var n=this._groups,e=n.length,r=new Array(e),i=0;i<e;++i)for(var u,s=n[i],o=s.length,l=r[i]=[],a=0;a<o;++a)(u=s[a])&&t.call(u,u.__data__,a,s)&&l.push(u);return new b(r,this._parents,this._name,this._id)},merge:function(t){if(t._id!==this._id)throw new Error;for(var n=this._groups,e=t._groups,r=n.length,i=e.length,u=Math.min(r,i),s=new Array(r),o=0;o<u;++o)for(var l,a=n[o],c=e[o],f=a.length,h=s[o]=new Array(f),p=0;p<f;++p)(l=a[p]||c[p])&&(h[p]=l);for(;o<r;++o)s[o]=n[o];return new b(s,this._parents,this._name,this._id)},selection:function(){return new An(this._groups,this._parents)},transition:function(){for(var t=this._name,n=this._id,e=rt(),r=this._groups,i=r.length,u=0;u<i;++u)for(var s,o=r[u],l=o.length,a=0;a<l;++a)if(s=o[a]){var c=w(s,n);B(s,t,e,a,o,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new b(r,this._parents,t,e)},call:E.call,nodes:E.nodes,node:E.node,size:E.size,empty:E.empty,each:E.each,on:function(t,n){var e=this._id;return arguments.length<2?w(this.node(),e).on.on(t):this.each(function(r,i,u){var s,o,l=function(a){return(a+"").trim().split(/^|\s+/).every(function(c){var f=c.indexOf(".");return f>=0&&(c=c.slice(0,f)),!c||c==="start"})}(i)?O:A;return function(){var a=l(this,r),c=a.on;c!==s&&(o=(s=c).copy()).on(i,u),a.on=o}}(e,t,n))},attr:function(t,n){var e=T(t),r=e==="transform"?lt:nt;return this.attrTween(t,typeof n=="function"?(e.local?_n:pn)(e,r,j(this,"attr."+t,n)):n==null?(e.local?cn:ln)(e):(e.local?hn:fn)(e,r,n))},attrTween:function(t,n){var e="attr."+t;if(arguments.length<2)return(e=this.tween(e))&&e._value;if(n==null)return this.tween(e,null);if(typeof n!="function")throw new Error;var r=T(t);return this.tween(e,(r.local?vn:dn)(r,n))},style:function(t,n,e){var r=(t+="")=="transform"?ct:nt;return n==null?this.styleTween(t,function(i,u){var s,o,l;return function(){var a=C(this,i),c=(this.style.removeProperty(i),C(this,i));return a===c?null:a===s&&c===o?l:l=u(s=a,o=c)}}(t,r)).on("end.style."+t,et(t)):typeof n=="function"?this.styleTween(t,function(i,u,s){var o,l,a;return function(){var c=C(this,i),f=s(this),h=f+"";return f==null&&(this.style.removeProperty(i),h=f=C(this,i)),c===h?null:c===o&&h===l?a:(l=h,a=u(o=c,f))}}(t,r,j(this,"style."+t,n))).each(function(i,u){var s,o,l,a,c="style."+u,f="end."+c;return function(){var h=A(this,i),p=h.on,_=h.value[c]==null?a||(a=et(u)):void 0;p===s&&l===_||(o=(s=p).copy()).on(f,l=_),h.on=o}}(this._id,t)):this.styleTween(t,function(i,u,s){var o,l,a=s+"";return function(){var c=C(this,i);return c===a?null:c===o?l:l=u(o=c,s)}}(t,r,n),e).on("end.style."+t,null)},styleTween:function(t,n,e){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(n==null)return this.tween(r,null);if(typeof n!="function")throw new Error;return this.tween(r,function(i,u,s){var o,l;function a(){var c=u.apply(this,arguments);return c!==l&&(o=(l=c)&&function(f,h,p){return function(_){this.style.setProperty(f,h.call(this,_),p)}}(i,c,s)),o}return a._value=u,a}(t,n,e??""))},text:function(t){return this.tween("text",typeof t=="function"?function(n){return function(){var e=n(this);this.textContent=e??""}}(j(this,"text",t)):function(n){return function(){this.textContent=n}}(t==null?"":t+""))},textTween:function(t){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;return this.tween(n,function(e){var r,i;function u(){var s=e.apply(this,arguments);return s!==i&&(r=(i=s)&&function(o){return function(l){this.textContent=o.call(this,l)}}(s)),r}return u._value=e,u}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var n=this.parentNode;for(var e in this.__transition)if(+e!==t)return;n&&n.removeChild(this)}}(this._id))},tween:function(t,n){var e=this._id;if(t+="",arguments.length<2){for(var r,i=w(this.node(),e).tween,u=0,s=i.length;u<s;++u)if((r=i[u]).name===t)return r.value;return null}return this.each((n==null?sn:an)(e,t,n))},delay:function(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?yn:mn)(n,t)):w(this.node(),n).delay},duration:function(t){var n=this._id;return arguments.length?this.each((typeof t=="function"?gn:wn)(n,t)):w(this.node(),n).duration},ease:function(t){var n=this._id;return arguments.length?this.each(function(e,r){if(typeof r!="function")throw new Error;return function(){A(this,e).ease=r}}(n,t)):w(this.node(),n).ease},easeVarying:function(t){if(typeof t!="function")throw new Error;return this.each(function(n,e){return function(){var r=e.apply(this,arguments);if(typeof r!="function")throw new Error;A(this,n).ease=r}}(this._id,t))},end:function(){var t,n,e=this,r=e._id,i=e.size();return new Promise(function(u,s){var o={value:s},l={value:function(){--i===0&&u()}};e.each(function(){var a=A(this,r),c=a.on;c!==t&&((n=(t=c).copy())._.cancel.push(o),n._.interrupt.push(o),n._.end.push(l)),a.on=n}),i===0&&u()})},[Symbol.iterator]:E[Symbol.iterator]};var bn={time:null,delay:0,duration:250,ease:function(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}};function En(t,n){for(var e;!(e=t.__transition)||!(e=e[n]);)if(!(t=t.parentNode))throw new Error(`transition ${n} not found`);return e}function N(t,n,e){this.k=t,this.x=n,this.y=e}k.prototype.interrupt=function(t){return this.each(function(){tt(this,t)})},k.prototype.transition=function(t){var n,e;t instanceof b?(n=t._id,t=t._name):(n=rt(),(e=bn).time=ft(),t=t==null?null:t+"");for(var r=this._groups,i=r.length,u=0;u<i;++u)for(var s,o=r[u],l=o.length,a=0;a<l;++a)(s=o[a])&&B(s,t,n,a,o,e||En(s,n));return new b(r,this._parents,t,n)},N.prototype={constructor:N,scale:function(t){return t===1?this:new N(this.k*t,this.x,this.y)},translate:function(t,n){return t===0&n===0?this:new N(this.k,this.x+this.k*t,this.y+this.k*n)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Sn=new N(1,0,0);N.prototype;export{N as T,tt as a,Sn as i,rn as s};
|
@@ -1 +0,0 @@
|
|
1
|
-
import{bk as N,bl as G,bm as E,c as D,aT as W,bn as $,j as g,E as q,U as C,Q as j,bo as T,bp as A,bq as B,L as _,aG as K,br as Q,bs as R,bt as U,bu as J,a4 as X,bv as Y}from"./index-g8LxgBK2.js";import{M as y}from"./compile-D71Q4H3R.js";import{a as ee}from"./VegaLite-BThNu01F.js";import"./time-Bto2Pv9Y.js";import"./timer-B5eI7Tcu.js";import"./linear-BCVS3STf.js";import"./init-DLRA0X12.js";import"./range-CtcPcB_L.js";import"./zoom-COrs4lFh.js";import"./ordinal-DDUp3AbE.js";import"./colors-bszWmPJw.js";import"./arc-ZB5pDULS.js";import"./step-BwsUM5iJ.js";import"./index-D8_wOrAS.js";function L(e){return(t=e,t!=null&&t.schema&&Array.isArray(t.schema.fields)&&typeof t.toArray=="function"?e:function(r){return G(r,{useProxy:!0})}(e)).toArray();var t}L.responseType="arrayBuffer";const V=new Set(["boxplot","errorband","errorbar"]),S={getMarkType(e){const t=typeof e=="string"?e:e.type;if(V.has(t))throw new Error("Not supported");return t},isInteractive(e){const t=typeof e=="string"?e:e.type;return!V.has(t)},makeClickable(e){const t=typeof e=="string"?e:e.type;return t in y?typeof e=="string"?{type:e,cursor:"pointer",tooltip:!0}:{...e,type:t,cursor:"pointer",tooltip:!0}:e},getOpacity:e=>typeof e=="string"?null:"opacity"in e&&typeof e.opacity=="number"?e.opacity:null},te=new Set(["color","fill","fillOpacity","opacity","shape","size"]);function ne(e,t,r,i){const u={and:r.map(d=>({param:d}))};if(e==="opacity"){const d=S.getOpacity(i)||1;return{...t,opacity:{condition:{test:u,value:d},value:d/5}}}return t}const w={point:e=>e==null?"select_point":`select_point_${e}`,interval:e=>e==null?"select_interval":`select_interval_${e}`,legendSelection:e=>`legend_selection_${e}`,HIGHLIGHT:"highlight",PAN_ZOOM:"pan_zoom",hasPoint:e=>e.some(t=>t.startsWith("select_point")),hasInterval:e=>e.some(t=>t.startsWith("select_interval")),hasLegend:e=>e.some(t=>t.startsWith("legend_selection")),hasPanZoom:e=>e.some(t=>t.startsWith("pan_zoom"))},P={highlight:()=>({name:w.HIGHLIGHT,select:{type:"point",on:"mouseover"}}),interval:(e,t)=>({name:w.interval(t),select:{type:"interval",encodings:Z(e),mark:{fill:"#669EFF",fillOpacity:.07,stroke:"#669EFF",strokeOpacity:.4},on:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]",translate:"[mousedown[!event.metaKey], mouseup] > mousemove[!event.metaKey]"}}),point:(e,t)=>({name:w.point(t),select:{type:"point",encodings:Z(e),on:"click[!event.metaKey]"}}),legend:e=>({name:w.legendSelection(e),select:{type:"point",fields:[e]},bind:"legend"}),panZoom:()=>({name:w.PAN_ZOOM,bind:"scales",select:{type:"interval",on:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",translate:"[mousedown[event.metaKey], window:mouseup] > window:mousemove!",zoom:"wheel![event.metaKey]"}})};function Z(e){switch(S.getMarkType(e.mark)){case y.image:case y.trail:return;case y.area:case y.arc:return["color"];case y.bar:{const t=function(r){var d,l;if(!r||!("mark"in r))return;const i=(d=r.encoding)==null?void 0:d.x,u=(l=r.encoding)==null?void 0:l.y;if(i&&"type"in i&&i.type==="nominal")return"vertical";if(u&&"type"in u&&u.type==="nominal"||i&&"aggregate"in i)return"horizontal";if(u&&"aggregate"in u)return"vertical"}(e);return t==="horizontal"?["y"]:t==="vertical"?["x"]:void 0}case y.circle:case y.geoshape:case y.line:case y.point:case y.rect:case y.rule:case y.square:case y.text:case y.tick:return["x","y"]}}function z(e){return"params"in e&&e.params&&e.params.length>0?e.params.filter(t=>t!=null&&"select"in t&&t.select!==void 0).map(t=>t.name):"layer"in e?[...new Set(e.layer.flatMap(z))]:[]}function ae(e,t){var f,v;let{chartSelection:r=!0,fieldSelection:i=!0}=t;if(!r&&!i)return e;if(((f=e.params)==null?void 0:f.some(c=>c.bind==="legend"))&&(i=!1),((v=e.params)==null?void 0:v.some(c=>!c.bind))&&(r=!1),"vconcat"in e){const c=e.vconcat.map(o=>"mark"in o?M(o):o);return{...e,vconcat:c}}if("hconcat"in e){const c=e.hconcat.map(o=>"mark"in o?M(o):o);return{...e,hconcat:c}}if("layer"in e){const c=e.layer.map((o,p)=>{if(!("mark"in o))return o;let s=o;return s=H(s,r,p),s=M(s),p===0&&(s=F(s)),s});return{...e,layer:c}}if(!("mark"in e)||!S.isInteractive(e.mark))return e;let l=e;return l=function(c,o){if(o===!1)return c;let p=function(h){if(!h||!("encoding"in h))return[];const{encoding:x}=h;return x?Object.entries(x).flatMap(n=>{const[a,m]=n;return m&&te.has(a)?"field"in m&&typeof m.field=="string"?[m.field]:"condition"in m&&m.condition&&typeof m.condition=="object"&&"field"in m.condition&&m.condition.field&&typeof m.condition.field=="string"?[m.condition.field]:[]:[]}):[]}(c);Array.isArray(o)&&(p=p.filter(h=>o.includes(h)));const s=p.map(h=>P.legend(h)),b=[...c.params||[],...s];return{...c,params:b}}(l,i),l=H(l,r,void 0),l=M(l),l=F(l),l}function H(e,t,r){if(t===!1)return e;let i;try{i=S.getMarkType(e.mark)}catch{return e}if(i==="geoshape")return e;const u=t===!0?function(f){switch(f){case"arc":case"area":return["point"];case"text":case"bar":default:return["point","interval"];case"line":return}}(i):[t];if(!u)return e;const d=u.map(f=>f==="interval"?P.interval(e,r):P.point(e,r)),l=[...e.params||[],...d];return{...e,params:l}}function F(e){let t;try{t=S.getMarkType(e.mark)}catch{}if(t==="geoshape")return e;const r=e.params||[];return r.some(i=>i.bind==="scales")?e:{...e,params:[...r,P.panZoom()]}}function M(e){const t="encoding"in e?e.encoding:void 0,r=e.params||[],i=r.map(u=>u.name);return r.length===0?e:S.isInteractive(e.mark)?{...e,mark:S.makeClickable(e.mark),encoding:ne("opacity",t||{},i,e.mark)}:e}$("arrow",L);const re=e=>{const t=D.c(11),{value:r,setValue:i,chartSelection:u,fieldSelection:d,spec:l}=e;let f,v;t[0]!==l?(f=async()=>async function(s){if(!s)return s;const b="datasets"in s?{...s.datasets}:{},h=async n=>{if(!n)return n;if("layer"in n){const k=await Promise.all(n.layer.map(h));n={...n,layer:k}}if("hconcat"in n){const k=await Promise.all(n.hconcat.map(h));n={...n,hconcat:k}}if("vconcat"in n){const k=await Promise.all(n.vconcat.map(h));n={...n,vconcat:k}}if("spec"in n&&(n={...n,spec:await h(n.spec)}),!n.data||!("url"in n.data))return n;let a;try{a=N(n.data.url)}catch{return n}const m=await E(a.href,n.data.format);return b[a.pathname]=m,{...n,data:{name:a.pathname}}},x=await h(s);return Object.keys(b).length===0?x:{...x,datasets:b}}(l),v=[l],t[0]=l,t[1]=f,t[2]=v):(f=t[1],v=t[2]);const{data:c,error:o}=W(f,v);if(o){let s;return t[3]!==o?(s=g.jsx(q,{error:o}),t[3]=o,t[4]=s):s=t[4],s}if(!c)return null;let p;return t[5]!==u||t[6]!==d||t[7]!==c||t[8]!==i||t[9]!==r?(p=g.jsx(ie,{value:r,setValue:i,chartSelection:u,fieldSelection:d,spec:c}),t[5]=u,t[6]=d,t[7]=c,t[8]=i,t[9]=r,t[10]=p):p=t[10],p},ie=({value:e,setValue:t,chartSelection:r,fieldSelection:i,spec:u})=>{const{theme:d}=C(),l=j.useRef(void 0),[f,v]=j.useState(),c=T(u),o=j.useMemo(()=>ae(function(a){return a.data&&"url"in a.data&&(a.data.url=N(a.data.url).href),a}(c),{chartSelection:r,fieldSelection:i}),[c,r,i]),p=j.useMemo(()=>z(o),[o]),s=A(a=>{t({...e,...a})}),b=T(p),h=j.useMemo(()=>b.reduce((a,m)=>(w.PAN_ZOOM===m||(a[m]=B((k,I)=>{_.debug("[Vega signal]",k,I);let O=K.mapValues(I,ce);O=K.mapValues(O,se),s({[k]:O})},100)),a),{}),[b,s]),x=A(a=>{_.error(a),_.debug(o),v(a)}),n=A(a=>{_.debug("[Vega view] created",a),l.current=a,v(void 0)});return g.jsxs(g.Fragment,{children:[f&&g.jsxs(Q,{variant:"destructive",children:[g.jsx(R,{children:f.message}),g.jsx("div",{className:"text-md",children:f.stack})]}),g.jsxs("div",{className:"relative",onPointerDown:U.stopPropagation(),children:[g.jsx(ee,{spec:o,theme:d==="dark"?"dark":void 0,actions:oe,signalListeners:h,onError:x,onNewView:n}),(()=>{const a=[];return w.hasPoint(p)&&a.push(["Point selection","click to select a point; hold shift for multi-select"]),w.hasInterval(p)&&a.push(["Interval selection","click and drag to select an interval"]),w.hasLegend(p)&&a.push(["Legend selection","click to select a legend item; hold shift for multi-select"]),w.hasPanZoom(p)&&a.push(["Pan","hold the meta key and drag"],["Zoom","hold the meta key and scroll"]),a.length===0?null:g.jsx(X,{delayDuration:300,side:"left",content:g.jsx("div",{className:"text-xs flex flex-col",children:a.map((m,k)=>g.jsxs("div",{children:[g.jsxs("span",{className:"font-bold tracking-wide",children:[m[0],":"]})," ",m[1]]},k))}),children:g.jsx(Y,{className:"absolute bottom-1 right-0 m-2 h-4 w-4 cursor-help text-muted-foreground hover:text-foreground"})})})()]})]})},oe={source:!1,compiled:!1};function se(e){return e instanceof Set?[...e]:e}function ce(e){return Array.isArray(e)?e.map(t=>t instanceof Date&&J(t)?new Date(t).getTime():t):e}export{re as default};
|
@@ -1 +0,0 @@
|
|
1
|
-
const e=1e3;function t(e,t){const n=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: ${n}`)}function n(n={}){let r={};function a(e){r=e}let s,i={};function o(e){i.unregisterHandler&&i.unregisterHandler(),i=e,i.registerHandler?.(b)}function d(e){s="function"!=typeof e?(t,n)=>{const r=e[t];if(r)return r(n);const a=e._;if(!a)throw new Error(`The requested method has no handler: ${t}`);return a(t,n)}:e}const{maxRequestTime:c=e}=n;n.transport&&o(n.transport),n.requestHandler&&d(n.requestHandler),n._debugHooks&&a(n._debugHooks);let u=0;const l=new Map,p=new Map;function h(e,...n){const a=n[0];return new Promise(((n,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:n,reject:s}),c!==1/0&&p.set(o,setTimeout((()=>{p.delete(o),s(new Error("RPC request timed out."))}),c)),r.onSend?.(d),i.send(d)}))}const m=new Proxy(h,{get:(e,t,n)=>t in e?Reflect.get(e,t,n):e=>h(t,e)}),f=m;function y(e,...n){const a=n[0];if(!i.send)throw t(["send"],"send messages");const s={type:"message",id:e,payload:a};r.onSend?.(s),i.send(s)}const g=new Proxy(y,{get:(e,t,n)=>t in e?Reflect.get(e,t,n):e=>y(t,e)}),v=g,_=new Map,w=new Set;async function b(e){if(r.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(n){if(!(n instanceof Error))throw n;c={type:"response",id:a,success:!1,error:n.message}}return r.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 n of w)n(e.id,e.payload);const t=_.get(e.id);if(!t)return;for(const n of t)n(e.payload)}}else{const t=p.get(e.id);null!=t&&clearTimeout(t);const{resolve:n,reject:r}=l.get(e.id)??{};e.success?n?.(e.payload):r?.(new Error(e.error))}}return{setTransport:o,setRequestHandler:d,request:m,requestProxy:f,send:g,sendProxy:v,addMessageListener:function(e,n){if(!i.registerHandler)throw t(["registerHandler"],"register message listeners");"*"!==e?(_.has(e)||_.set(e,new Set),_.get(e)?.add(n)):w.add(n)},removeMessageListener:function(e,t){"*"!==e?(_.get(e)?.delete(t),0===_.get(e)?.size&&_.delete(e)):w.delete(t)},proxy:{send:v,request:f},_setDebugHooks:a}}const r="[transport-id]";function a(e,t={}){const{transportId:n,filter:a,remotePort:s}=t,i=e,o=s??e;let d;return{send(e){o.postMessage(function(e,t){const{transportId:n}=t;return null!=n?{[r]:n,data:e}:e}(e,{transportId:n}))},registerHandler(e){d=t=>{const s=t.data,[i,o]=function(e,t){const{transportId:n,filter:a}=t,s=a?.();if(null!=n&&null!=s)throw new Error("Cannot use both `transportId` and `filter` at the same time");let i=e;if(n){if(e[r]!==n)return[!0];i=e.data}return!1===s?[!0]:[!1,i]}(s,{transportId:n,filter:()=>a?.(t)});i||e(o)},i.addEventListener("message",d)},unregisterHandler(){d&&i.removeEventListener("message",d)}}}const s=()=>{},i=(e,t)=>{const n=`[${e}]`;return{debug:(...e)=>t.debug(n,...e),log:(...e)=>t.log(n,...e),warn:(...e)=>t.warn(n,...e),error:(...e)=>t.error(n,...e),trace:(...e)=>t.trace(n,...e),get:n=>i(`${e}.${n}`,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 n of e)t[n]=n;return t},e.getValidEnumValues=t=>{const n=e.objectKeys(t).filter((e=>"number"!=typeof t[t[e]])),r={};for(const e of n)r[e]=t[e];return e.objectValues(r)},e.objectValues=t=>e.objectKeys(t).map((function(e){return t[e]})),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},e.find=(e,t)=>{for(const n of e)if(t(n))return n},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"]),m=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}},f=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},n={_errors:[]},r=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(r);else if("invalid_return_type"===a.code)r(a.returnTypeError);else if("invalid_arguments"===a.code)r(a.argumentsError);else if(0===a.path.length)n._errors.push(t(a));else{let e=n,r=0;for(;r<a.path.length;){const n=a.path[r];r===a.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(a))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}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={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}y.create=e=>new y(e);const g=(e,t)=>{let n;switch(e.code){case f.invalid_type:n=e.received===h.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case f.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,l.jsonStringifyReplacer)}`;break;case f.unrecognized_keys:n=`Unrecognized key(s) in object: ${l.joinValues(e.keys,", ")}`;break;case f.invalid_union:n="Invalid input";break;case f.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${l.joinValues(e.options)}`;break;case f.invalid_enum_value:n=`Invalid enum value. Expected ${l.joinValues(e.options)}, received '${e.received}'`;break;case f.invalid_arguments:n="Invalid function arguments";break;case f.invalid_return_type:n="Invalid function return type";break;case f.invalid_date:n="Invalid date";break;case f.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:l.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case f.too_small:n="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 f.too_big:n="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 f.custom:n="Invalid input";break;case f.invalid_intersection_types:n="Intersection results could not be merged";break;case f.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case f.not_finite:n="Number must be finite";break;default:n=t.defaultError,l.assertNever(e)}return{message:n}};let v=g;function _(){return v}const w=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,s=[...n,...a.path||[]],i={...a,path:s};if(void 0!==a.message)return{...a,path:s,message:a.message};let o="";const d=r.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 n=_(),r=w({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,n,n===g?void 0:g].filter((e=>!!e))});e.common.issues.push(r)}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 n=[];for(const r of t){if("aborted"===r.status)return x;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const r of t){const e=await r.key,t=await r.value;n.push({key:e,value:t})}return k.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:a}=r;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&&!r.alwaysSet||(n[t.value]=a.value)}return{status:e.value,value:n}}}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,n,r){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,n,r,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,n),n}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,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}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:n,required_error:r,description:a}=e;if(t&&(n||r))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:r)&&void 0!==s?s:a.defaultError}:"invalid_type"!==t.code?{message:a.defaultError}:{message:null!==(i=null!=o?o:n)&&void 0!==i?i:a.defaultError}},description:a}}class M{get description(){return this._def.description}_getType(e){return m(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:m(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:m(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 n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:m(e)},a=this._parseSync({data:e,path:r.path,parent:r});return F(r,a)}"~validate"(e){var t,n;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:m(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:r});return Z(t)?{value:t.value}:{issues:r.common.issues}}catch(a){(null===(n=null===(t=null==a?void 0:a.message)||void 0===t?void 0:t.toLowerCase())||void 0===n?void 0:n.includes("encountered"))&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then((e=>Z(e)?{value:e.value}:{issues:r.common.issues}))}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={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:m(e)},r=this._parse({data:e,path:n.path,parent:n}),a=await(N(r)?r:Promise.resolve(r));return F(n,a)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const a=e(t),s=()=>r.addIssue({code:f.custom,...n(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(s(),!1))):!!a||(s(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new Me({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 Le.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 Me({...$(this._def),schema:this,typeName:Ge.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ze({...$(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 Ue({...$(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 L=/^c[^\s-]{8,}$/i,D=/^[0-9a-z]+$/,z=/^[0-9A-HJKMNP-TV-Z]{26}$/i,U=/^[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 ne(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 re(e){let t=`${ee}T${ne(e)}`;const n=[];return n.push(e.local?"Z?":"Z"),e.offset&&n.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${n.join("|")})`,new RegExp(`^${t}$`)}function ae(e,t){if(!V.test(e))return!1;try{const[n]=e.split("."),r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),a=JSON.parse(atob(r));return"object"==typeof a&&null!==a&&(!(!a.typ||!a.alg)&&(!t||a.alg===t))}catch(n){return!1}}function se(e,t){return!("v4"!==t&&t||!J.test(e))||!("v6"!==t&&t||!G.test(e))}class ie extends M{_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:f.invalid_type,expected:h.string,received:t.parsedType}),x}const t=new k;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),b(n,{code:f.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&&(n=this._getOrReturnCtx(e,n),b(n,{code:f.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,a=e.data.length<i.value;(r||a)&&(n=this._getOrReturnCtx(e,n),r?b(n,{code:f.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&b(n,{code:f.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)||(n=this._getOrReturnCtx(e,n),b(n,{validation:"email",code:f.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)||(n=this._getOrReturnCtx(e,n),b(n,{validation:"emoji",code:f.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)U.test(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{validation:"uuid",code:f.invalid_string,message:i.message}),t.dirty());else if("nanoid"===i.kind)q.test(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{validation:"nanoid",code:f.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)L.test(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{validation:"cuid",code:f.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)D.test(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{validation:"cuid2",code:f.invalid_string,message:i.message}),t.dirty());else if("ulid"===i.kind)z.test(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{validation:"ulid",code:f.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(s){n=this._getOrReturnCtx(e,n),b(n,{validation:"url",code:f.invalid_string,message:i.message}),t.dirty()}else if("regex"===i.kind){i.regex.lastIndex=0;i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{validation:"regex",code:f.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)||(n=this._getOrReturnCtx(e,n),b(n,{code:f.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)||(n=this._getOrReturnCtx(e,n),b(n,{code:f.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty());else if("endsWith"===i.kind)e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),b(n,{code:f.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty());else if("datetime"===i.kind){re(i).test(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{code:f.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else if("date"===i.kind){te.test(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{code:f.invalid_string,validation:"date",message:i.message}),t.dirty())}else if("time"===i.kind){new RegExp(`^${ne(i)}$`).test(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{code:f.invalid_string,validation:"time",message:i.message}),t.dirty())}else"duration"===i.kind?H.test(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{validation:"duration",code:f.invalid_string,message:i.message}),t.dirty()):"ip"===i.kind?(r=e.data,("v4"!==(a=i.version)&&a||!K.test(r))&&("v6"!==a&&a||!Y.test(r))&&(n=this._getOrReturnCtx(e,n),b(n,{validation:"ip",code:f.invalid_string,message:i.message}),t.dirty())):"jwt"===i.kind?ae(e.data,i.alg)||(n=this._getOrReturnCtx(e,n),b(n,{validation:"jwt",code:f.invalid_string,message:i.message}),t.dirty()):"cidr"===i.kind?se(e.data,i.version)||(n=this._getOrReturnCtx(e,n),b(n,{validation:"cidr",code:f.invalid_string,message:i.message}),t.dirty()):"base64"===i.kind?X.test(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{validation:"base64",code:f.invalid_string,message:i.message}),t.dirty()):"base64url"===i.kind?Q.test(e.data)||(n=this._getOrReturnCtx(e,n),b(n,{validation:"base64url",code:f.invalid_string,message:i.message}),t.dirty()):l.assertNever(i);var r,a;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:f.invalid_string,...A.errToObj(n)})}_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,n;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!==(n=null==e?void 0:e.local)&&void 0!==n&&n,...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 n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r;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 M{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:f.invalid_type,expected:h.number,received:t.parsedType}),x}let t;const n=new k;for(const r of this._def.checks)if("int"===r.kind)l.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),b(t,{code:f.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty());else if("min"===r.kind){(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:f.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else if("max"===r.kind){(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:f.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty())}else"multipleOf"===r.kind?0!==oe(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:f.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),b(t,{code:f.not_finite,message:r.message}),n.dirty()):l.assertNever(r);return{status:n.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,n,r){return new de({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:A.toString(r)}]})}_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 n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.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 M{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch(r){return this._getInvalidInput(e)}if(this._getType(e)!==h.bigint)return this._getInvalidInput(e);let t;const n=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:f.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty())}else if("max"===a.kind){(a.inclusive?e.data>a.value:e.data>=a.value)&&(t=this._getOrReturnCtx(e,t),b(t,{code:f.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),n.dirty())}else"multipleOf"===a.kind?e.data%a.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),b(t,{code:f.not_multiple_of,multipleOf:a.value,message:a.message}),n.dirty()):l.assertNever(a);return{status:n.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return b(t,{code:f.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,n,r){return new ce({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:A.toString(r)}]})}_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 M{_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:f.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 M{_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:f.invalid_type,expected:h.date,received:t.parsedType}),x}if(isNaN(e.data.getTime())){return b(this._getOrReturnCtx(e),{code:f.invalid_date}),x}const t=new k;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),b(n,{code:f.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),b(n,{code:f.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):l.assertNever(r);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 M{_parse(e){if(this._getType(e)!==h.symbol){const t=this._getOrReturnCtx(e);return b(t,{code:f.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 M{_parse(e){if(this._getType(e)!==h.undefined){const t=this._getOrReturnCtx(e);return b(t,{code:f.invalid_type,expected:h.undefined,received:t.parsedType}),x}return T(e.data)}}he.create=e=>new he({typeName:Ge.ZodUndefined,...$(e)});class me extends M{_parse(e){if(this._getType(e)!==h.null){const t=this._getOrReturnCtx(e);return b(t,{code:f.invalid_type,expected:h.null,received:t.parsedType}),x}return T(e.data)}}me.create=e=>new me({typeName:Ge.ZodNull,...$(e)});class fe extends M{constructor(){super(...arguments),this._any=!0}_parse(e){return T(e.data)}}fe.create=e=>new fe({typeName:Ge.ZodAny,...$(e)});class ye extends M{constructor(){super(...arguments),this._unknown=!0}_parse(e){return T(e.data)}}ye.create=e=>new ye({typeName:Ge.ZodUnknown,...$(e)});class ge extends M{_parse(e){const t=this._getOrReturnCtx(e);return b(t,{code:f.invalid_type,expected:h.never,received:t.parsedType}),x}}ge.create=e=>new ge({typeName:Ge.ZodNever,...$(e)});class ve extends M{_parse(e){if(this._getType(e)!==h.undefined){const t=this._getOrReturnCtx(e);return b(t,{code:f.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 M{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==h.array)return b(t,{code:f.invalid_type,expected:h.array,received:t.parsedType}),x;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(e||a)&&(b(t,{code:e?f.too_big:f.too_small,minimum:a?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(b(t,{code:f.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(b(t,{code:f.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new R(t,e,t.path,n))))).then((e=>k.mergeArray(n,e)));const a=[...t.data].map(((e,n)=>r.type._parseSync(new R(t,e,t.path,n))));return k.mergeArray(n,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 n in e.shape){const r=e.shape[n];t[n]=Le.create(we(r))}return new be({...e._def,shape:()=>t})}return e instanceof _e?new _e({...e._def,type:we(e.element)}):e instanceof Le?Le.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 M{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:f.invalid_type,expected:h.object,received:t.parsedType}),x}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof ge&&"strip"===this._def.unknownKeys))for(const o in n.data)a.includes(o)||s.push(o);const i=[];for(const o of a){const e=r[o],t=n.data[o];i.push({key:{status:"valid",value:o},value:e._parse(new R(n,t,n.path,o)),alwaysSet:o in n.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:n.data[t]}});else if("strict"===e)s.length>0&&(b(n,{code:f.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 r=n.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new R(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of i){const n=await t.key,r=await t.value;e.push({key:n,value:r,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,n)=>{var r,a,s,i;const o=null!==(s=null===(a=(r=this._def).errorMap)||void 0===a?void 0:a.call(r,t,n).message)&&void 0!==s?s:n.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((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new be({...this._def,shape:()=>t})}omit(e){const t={};return l.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new be({...this._def,shape:()=>t})}deepPartial(){return we(this)}partial(e){const t={};return l.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new be({...this._def,shape:()=>t})}required(e){const t={};return l.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof Le;)e=e._def.innerType;t[n]=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 M{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const n=e.map((e=>new y(e.ctx.common.issues)));return b(t,{code:f.invalid_union,unionErrors:n}),x}));{let e;const r=[];for(const s of n){const n={...t,common:{...t.common,issues:[]},parent:null},a=s._parseSync({data:t.data,path:t.path,parent:n});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=r.map((e=>new y(e)));return b(t,{code:f.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 Me?xe(e.innerType()):e instanceof Ce?[e.value]:e instanceof Re?e.options:e instanceof Fe?l.objectValues(e.enum):e instanceof ze?xe(e._def.innerType):e instanceof he?[void 0]:e instanceof me?[null]:e instanceof Le?[void 0,...xe(e.unwrap())]:e instanceof De?[null,...xe(e.unwrap())]:e instanceof He||e instanceof We?xe(e.unwrap()):e instanceof Ue?xe(e._def.innerType):[];class Se extends M{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.object)return b(t,{code:f.invalid_type,expected:h.object,received:t.parsedType}),x;const n=this.discriminator,r=t.data[n],a=this.optionsMap.get(r);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:f.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),x)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=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 n of t){if(r.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);r.set(n,a)}}return new Se({typeName:Ge.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...$(n)})}}function Te(e,t){const n=m(e),r=m(t);if(e===t)return{valid:!0,data:e};if(n===h.object&&r===h.object){const n=l.objectKeys(t),r=l.objectKeys(e).filter((e=>-1!==n.indexOf(e))),a={...e,...t};for(const s of r){const n=Te(e[s],t[s]);if(!n.valid)return{valid:!1};a[s]=n.data}return{valid:!0,data:a}}if(n===h.array&&r===h.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const a=Te(e[r],t[r]);if(!a.valid)return{valid:!1};n.push(a.data)}return{valid:!0,data:n}}return n===h.date&&r===h.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class Ee extends M{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(E(e)||E(r))return x;const a=Te(e.value,r.value);return a.valid?((O(e)||O(r))&&t.dirty(),{status:t.value,value:a.data}):(b(n,{code:f.invalid_intersection_types}),x)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Ee.create=(e,t,n)=>new Ee({left:e,right:t,typeName:Ge.ZodIntersection,...$(n)});class Oe extends M{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.array)return b(n,{code:f.invalid_type,expected:h.array,received:n.parsedType}),x;if(n.data.length<this._def.items.length)return b(n,{code:f.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),x;!this._def.rest&&n.data.length>this._def.items.length&&(b(n,{code:f.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new R(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>k.mergeArray(t,e))):k.mergeArray(t,r)}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 M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.object)return b(n,{code:f.invalid_type,expected:h.object,received:n.parsedType}),x;const r=[],a=this._def.keyType,s=this._def.valueType;for(const i in n.data)r.push({key:a._parse(new R(n,i,n.path,i)),value:s._parse(new R(n,n.data[i],n.path,i)),alwaysSet:i in n.data});return n.common.async?k.mergeObjectAsync(t,r):k.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new Ze(t instanceof M?{keyType:e,valueType:t,typeName:Ge.ZodRecord,...$(n)}:{keyType:ie.create(),valueType:e,typeName:Ge.ZodRecord,...$(t)})}}class Ne extends M{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.map)return b(n,{code:f.invalid_type,expected:h.map,received:n.parsedType}),x;const r=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map((([e,t],s)=>({key:r._parse(new R(n,e,n.path,[s,"key"])),value:a._parse(new R(n,t,n.path,[s,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of s){const r=await n.key,a=await n.value;if("aborted"===r.status||"aborted"===a.status)return x;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of s){const r=n.key,a=n.value;if("aborted"===r.status||"aborted"===a.status)return x;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}}}Ne.create=(e,t,n)=>new Ne({valueType:t,keyType:e,typeName:Ge.ZodMap,...$(n)});class je extends M{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==h.set)return b(n,{code:f.invalid_type,expected:h.set,received:n.parsedType}),x;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(b(n,{code:f.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(b(n,{code:f.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const a=this._def.valueType;function s(e){const n=new Set;for(const r of e){if("aborted"===r.status)return x;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const i=[...n.data.values()].map(((e,t)=>a._parse(new R(n,e,n.path,t))));return n.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 M{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==h.function)return b(t,{code:f.invalid_type,expected:h.function,received:t.parsedType}),x;function n(e,n){return w({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_(),g].filter((e=>!!e)),issueData:{code:f.invalid_arguments,argumentsError:n}})}function r(e,n){return w({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,_(),g].filter((e=>!!e)),issueData:{code:f.invalid_return_type,returnTypeError:n}})}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(n(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(r(d,e)),i}))}))}{const e=this;return T((function(...t){const i=e._def.args.safeParse(t,a);if(!i.success)throw new y([n(t,i.error)]);const o=Reflect.apply(s,this,i.data),d=e._def.returns.safeParse(o,a);if(!d.success)throw new y([r(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,n){return new Pe({args:e||Oe.create([]).rest(ye.create()),returns:t||ye.create(),typeName:Ge.ZodFunction,...$(n)})}}class Ae extends M{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 M{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return b(t,{received:t.data,code:f.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 M{constructor(){super(...arguments),C.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return b(t,{expected:l.joinValues(n),received:t.parsedType,code:f.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),n=this._def.values;return b(t,{received:t.data,code:f.invalid_enum_value,options:n}),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 M{constructor(){super(...arguments),I.set(this,void 0)}_parse(e){const t=l.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==h.string&&n.parsedType!==h.number){const e=l.objectValues(t);return b(n,{expected:l.joinValues(e),received:n.parsedType,code:f.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(n,{received:n.data,code:f.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 M{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:f.invalid_type,expected:h.promise,received:t.parsedType}),x;const n=t.parsedType===h.promise?t.data:Promise.resolve(t.data);return T(n.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 Me extends M{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:n}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:e=>{b(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===r.type){const e=r.transform(n.data,a);if(n.common.async)return Promise.resolve(e).then((async e=>{if("aborted"===t.value)return x;const r=await this._def.schema._parseAsync({data:e,path:n.path,parent:n});return"aborted"===r.status?x:"dirty"===r.status||"dirty"===t.value?S(r.value):r}));{if("aborted"===t.value)return x;const r=this._def.schema._parseSync({data:e,path:n.path,parent:n});return"aborted"===r.status?x:"dirty"===r.status||"dirty"===t.value?S(r.value):r}}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,a);if(n.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===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?x:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?x:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Z(e))return e;const s=r.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:n.data,path:n.path,parent:n}).then((e=>Z(e)?Promise.resolve(r.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}l.assertNever(r)}}Me.create=(e,t,n)=>new Me({schema:e,typeName:Ge.ZodEffects,effect:t,...$(n)}),Me.createWithPreprocess=(e,t,n)=>new Me({schema:t,effect:{type:"preprocess",transform:e},typeName:Ge.ZodEffects,...$(n)});class Le extends M{_parse(e){return this._getType(e)===h.undefined?T(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Le.create=(e,t)=>new Le({innerType:e,typeName:Ge.ZodOptional,...$(t)});class De extends M{_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 ze extends M{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===h.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ze.create=(e,t)=>new ze({innerType:e,typeName:Ge.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...$(t)});class Ue extends M{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return N(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new y(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new y(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}Ue.create=(e,t)=>new Ue({innerType:e,typeName:Ge.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...$(t)});class qe extends M{_parse(e){if(this._getType(e)!==h.nan){const t=this._getOrReturnCtx(e);return b(t,{code:f.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 M{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class Be extends M{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?x:"dirty"===e.status?(t.dirty(),S(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})()}{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?x:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new Be({in:e,out:t,typeName:Ge.ZodPipeline})}}class We extends M{_parse(e){const t=this._def.innerType._parse(e),n=e=>(Z(e)&&(e.value=Object.freeze(e.value)),e);return N(t)?t.then((e=>n(e))):n(t)}unwrap(){return this._def.innerType}}function Ke(e,t){const n="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof n?{message:n}:n}function Je(e,t={},n){return e?fe.create().superRefine(((r,a)=>{var s,i;const o=e(r);if(o instanceof Promise)return o.then((e=>{var s,i;if(!e){const e=Ke(t,r),o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:n)||void 0===i||i;a.addIssue({code:"custom",...e,fatal:o})}}));if(!o){const e=Ke(t,r),o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:n)||void 0===i||i;a.addIssue({code:"custom",...e,fatal:o})}})):fe.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,nt=ue.create,rt=le.create,at=pe.create,st=he.create,it=me.create,ot=fe.create,dt=ye.create,ct=ge.create,ut=ve.create,lt=_e.create,pt=be.create,ht=be.strictCreate,mt=ke.create,ft=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=Me.create,Zt=Le.create,Nt=De.create,jt=Me.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:m,ZodType:M,datetimeRegex:re,ZodString:ie,ZodNumber:de,ZodBigInt:ce,ZodBoolean:ue,ZodDate:le,ZodSymbol:pe,ZodUndefined:he,ZodNull:me,ZodAny:fe,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:Me,ZodTransformer:Me,ZodOptional:Le,ZodNullable:De,ZodDefault:ze,ZodCatch:Ue,ZodNaN:qe,BRAND:Ve,ZodBranded:He,ZodPipeline:Be,ZodReadonly:We,custom:Je,Schema:M,ZodSchema:M,late:Ye,get ZodFirstPartyTypeKind(){return Ge},coerce:At,any:ot,array:lt,bigint:tt,boolean:nt,date:rt,discriminatedUnion:ft,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:()=>nt().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:mt,unknown:dt,void:ut,NEVER:Ct,ZodIssueCode:f,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 n=Rt.safeParse(t);if(n.success)return n.data.detail;const r=Ft.safeParse(t);if(r.success)return r.data.error;return e}(e.message)}if("object"==typeof e){const t=Rt.safeParse(e);if(t.success)return t.data.detail;const n=Ft.safeParse(e);if(n.success)return n.data.error}try{return JSON.stringify(e)}catch{return String(e)}}function Mt(e,t){if(!e)throw new Error(t)}function Lt(e){return e.FS}const Dt="notebook.py",zt="/marimo",Ut=Dt,qt=e=>{const t=Lt(e);try{t.mkdirTree(zt)}catch{}t.chdir(zt)},Vt=e=>{Lt(e).mount(e.FS.filesystems.IDBFS,{root:"."},zt)},Ht=async e=>{await Kt(e,!0)},Bt=async e=>{await Kt(e,!1)},Wt=e=>{const{pyodide:t,filename:n,code:r}=e,a=Lt(t);if(n&&n!==Dt){const e=(e=>{try{return u(a.readFile(e))}catch{return null}})(n);if(e)return{code:e,filename:n}}return a.writeFile(Dt,r),{code:r,filename:Dt}};function Kt(e,t){return new Promise(((n,r)=>{Lt(e).syncfs(t,(e=>{e instanceof Error?r(e):n()}))}))}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 en(e){return e.charAt(0).toUpperCase()+e.substring(1)}function tn(e){return function(){return this[e]}}Gt(Qt,"_isNumber"),Gt(en,"_capitalize"),Gt(tn,"_getter");var nn,rn,an=["isConstructor","isEval","isNative","isToplevel"],sn=["columnNumber","lineNumber"],on=["fileName","functionName","source"],dn=an.concat(sn,on,["args"],["evalOrigin"]);function cn(e){if(e)for(var t=0;t<dn.length;t++)void 0!==e[dn[t]]&&this["set"+en(dn[t])](e[dn[t]])}for(Gt(cn,"StackFrame"),cn.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 cn)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new cn(e)}},toString:function(){var e=this.getFileName()||"",t=this.getLineNumber()||"",n=this.getColumnNumber()||"",r=this.getFunctionName()||"";return this.getIsEval()?e?"[eval] ("+e+":"+t+":"+n+")":"[eval]:"+t+":"+n:r?r+" ("+e+":"+t+":"+n+")":e+":"+t+":"+n}},cn.fromString=Gt((function(e){var t=e.indexOf("("),n=e.lastIndexOf(")"),r=e.substring(0,t),a=e.substring(t+1,n).split(","),s=e.substring(n+1);if(0===s.indexOf("@"))var i=/@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(s,""),o=i[1],d=i[2],c=i[3];return new cn({functionName:r,args:a||void 0,fileName:o,lineNumber:d||void 0,columnNumber:c||void 0})}),"StackFrame$$fromString"),nn=0;nn<an.length;nn++)cn.prototype["get"+en(an[nn])]=tn(an[nn]),cn.prototype["set"+en(an[nn])]=function(e){return function(t){this[e]=!!t}}(an[nn]);for(rn=0;rn<sn.length;rn++)cn.prototype["get"+en(sn[rn])]=tn(sn[rn]),cn.prototype["set"+en(sn[rn])]=function(e){return function(t){if(!Qt(t))throw new TypeError(e+" must be a Number");this[e]=Number(t)}}(sn[rn]);for(un=0;un<on.length;un++)cn.prototype["get"+en(on[un])]=tn(on[un]),cn.prototype["set"+en(on[un])]=function(e){return function(t){this[e]=String(t)}}(on[un]);var un,ln=cn;function pn(){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+/,""),n=t.match(/ (\(.+\)$)/);t=n?t.replace(n[0],""):t;var r=this.extractLocation(n?n[1]:t),a=n&&t||void 0,s=["eval","<anonymous>"].indexOf(r[0])>-1?void 0:r[0];return new ln({functionName:a,fileName:s,lineNumber:r[1],columnNumber:r[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 ln({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,a=this.extractLocation(e.replace(t,""));return new ln({functionName:r,fileName:a[0],lineNumber:a[1],columnNumber:a[2],source:e})}),this)}),"ErrorStackParser$$parseFFOrSafari")}}Gt(pn,"ErrorStackParser");var hn,mn,fn,yn,gn,vn,_n,wn,bn,kn=new pn,xn="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&!process.browser,Sn=xn&&typeof module<"u"&&typeof module.exports<"u"&&typeof Xt<"u"&&typeof __dirname<"u",Tn=xn&&!Sn,En=typeof Deno<"u",On=!xn&&!En,Zn=On&&"object"==typeof window&&"object"==typeof document&&"function"==typeof document.createElement&&"sessionStorage"in window&&"function"!=typeof importScripts,Nn=On&&"function"==typeof importScripts&&"object"==typeof self;async function jn(){if(!xn||(hn=(await import("./__vite-browser-external-CIEyP2s7.js")).default,yn=await import("./__vite-browser-external-CIEyP2s7.js"),gn=await import("./__vite-browser-external-CIEyP2s7.js"),fn=(await import("./__vite-browser-external-CIEyP2s7.js")).default,mn=await import("./__vite-browser-external-CIEyP2s7.js"),_n=mn.sep,typeof Xt<"u"))return;let e={fs:yn,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 Pn(e,t){return mn.resolve(t||".",e)}function An(e,t){return void 0===t&&(t=location),new URL(e,t).toString()}function Cn(e,t){return e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?{response:fetch(e)}:{binary:gn.readFile(e).then((e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))}}function In(e,t){let n=new URL(e,location);return{response:fetch(n,t?{integrity:t}:{})}}async function Rn(e,t){let{response:n,binary:r}=wn(e,t);if(r)return r;let a=await n;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(jn,"initNodeModules"),Gt(Pn,"node_resolvePath"),Gt(An,"browser_resolvePath"),vn=xn?Pn:An,xn||(_n="/"),Gt(Cn,"node_getBinaryResponse"),Gt(In,"browser_getBinaryResponse"),wn=xn?Cn:In,Gt(Rn,"loadBinaryFile"),Zn)bn=Gt((async e=>await import(e)),"loadScript");else if(Nn)bn=Gt((async e=>{try{globalThis.importScripts(e)}catch(Yn){if(!(Yn instanceof TypeError))throw Yn;await import(e)}}),"loadScript");else{if(!xn)throw new Error("Cannot determine runtime environment");bn=Fn}async function Fn(e){e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?fn.runInThisContext(await(await fetch(e)).text()):await import(hn.pathToFileURL(e).href)}async function $n(e){if(xn){await jn();let t=await gn.readFile(e,{encoding:"utf8"});return JSON.parse(t)}return await(await fetch(e)).json()}async function Mn(){if(Sn)return __dirname;let e;try{throw new Error}catch(r){e=r}let t=kn.parse(e)[0].fileName;if(xn&&!t.startsWith("file://")&&(t=`file://${t}`),Tn){let e=await import("./__vite-browser-external-CIEyP2s7.js");return(await import("./__vite-browser-external-CIEyP2s7.js")).fileURLToPath(e.dirname(t))}let n=t.lastIndexOf(_n);if(-1===n)throw new Error("Could not extract indexURL path from pyodide module location");return t.slice(0,n)}function Ln(e){let t=e.FS,n=e.FS.filesystems.MEMFS,r=e.PATH,a={DIR_MODE:16895,FILE_MODE:33279,mount:function(e){if(!e.opts.fileSystemHandle)throw new Error("opts.fileSystemHandle is required");return n.mount.apply(null,arguments)},syncfs:async(e,t,n)=>{try{let r=a.getLocalSet(e),s=await a.getRemoteSet(e),i=t?s:r,o=t?r:s;await a.reconcile(e,i,o),n(null)}catch(r){n(r)}},getLocalSet:e=>{let n=Object.create(null);function a(e){return"."!==e&&".."!==e}function s(e){return t=>r.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(),r=t.stat(e);t.isDir(r.mode)&&i.push.apply(i,t.readdir(e).filter(a).map(s(e))),n[e]={timestamp:r.mtime,mode:r.mode}}return{type:"local",entries:n}},getRemoteSet:async e=>{let t=Object.create(null),n=await Dn(e.opts.fileSystemHandle);for(let[s,i]of n)"."!==s&&(t[r.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:n}},loadLocalEntry:e=>{let r=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 r.contents=n.getFileDataAsTypedArray(r),{timestamp:a.mtime,mode:a.mode,contents:r.contents};throw new Error("node type not supported")},storeLocalEntry:(e,n)=>{if(t.isDir(n.mode))t.mkdirTree(e,n.mode);else{if(!t.isFile(n.mode))throw new Error("node type not supported");t.writeFile(e,n.contents,{canOwn:!0})}t.chmod(e,n.mode),t.utime(e,n.timestamp,n.timestamp)},removeLocalEntry:e=>{var n=t.stat(e);t.isDir(n.mode)?t.rmdir(e):t.isFile(n.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,n,a)=>{let s=e.get(r.dirname(n)),i=t.isFile(a.mode)?await s.getFileHandle(r.basename(n),{create:!0}):await s.getDirectoryHandle(r.basename(n),{create:!0});if("file"===i.kind){let e=await i.createWritable();await e.write(a.contents),await e.close()}e.set(n,i)},removeRemoteEntry:async(e,t)=>{await e.get(r.dirname(t)).removeEntry(r.basename(t)),e.delete(t)},reconcile:async(e,n,s)=>{let i=0,o=[];Object.keys(n.entries).forEach((function(e){let r=n.entries[e],a=s.entries[e];(!a||t.isFile(r.mode)&&r.timestamp.getTime()>a.timestamp.getTime())&&(o.push(e),i++)})),o.sort();let d=[];if(Object.keys(s.entries).forEach((function(e){n.entries[e]||(d.push(e),i++)})),d.sort().reverse(),!i)return;let c="remote"===n.type?n.handles:s.handles;for(let t of o){let n=r.normalize(t.replace(e.mountpoint,"/")).substring(1);if("local"===s.type){let e=c.get(n),r=await a.loadRemoteEntry(e);a.storeLocalEntry(t,r)}else{let e=a.loadLocalEntry(t);await a.storeRemoteEntry(c,n,e)}}for(let t of d)if("local"===s.type)a.removeLocalEntry(t);else{let n=r.normalize(t.replace(e.mountpoint,"/")).substring(1);await a.removeRemoteEntry(c,n)}}};e.FS.filesystems.NATIVEFS_ASYNC=a}Gt(Fn,"nodeLoadScript"),Gt($n,"loadLockFile"),Gt(Mn,"calculateDirname"),Gt(Ln,"initializeNativeFS");var Dn=Gt((async e=>{let t=[];async function n(e){for await(let r of e.values())t.push(r),"directory"===r.kind&&await n(r)}Gt(n,"collect"),await n(e);let r=new Map;r.set(".",e);for(let a of t){let t=(await e.resolve(a)).join("/");r.set(t,a)}return r}),"getFsHandles");function zn(e){let t={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:Bn(e),quit(e,n){throw t.exited={status:e,toThrow:n},n},print:e.stdout,printErr:e.stderr,thisProgram:e._sysExecutable,arguments:e.args,API:{config:e},locateFile:t=>e.indexURL+t,instantiateWasm:Wn(e.indexURL)};return t}function Un(e){return function(t){try{t.FS.mkdirTree(e)}catch(n){console.error(`Error occurred while making a home directory '${e}':`),console.error(n),console.error("Using '/' for a home directory instead"),e="/"}t.FS.chdir(e)}}function qn(e){return function(t){Object.assign(t.ENV,e)}}function Vn(e){return e?[async t=>{t.addRunDependency("fsInitHook");try{await e(t.FS,{sitePackages:t.API.sitePackages})}finally{t.removeRunDependency("fsInitHook")}}]:[]}function Hn(e){let t=Rn(e);return async e=>{let n=e._py_version_major(),r=e._py_version_minor();e.FS.mkdirTree("/lib"),e.API.sitePackages=`/lib/python${n}.${r}/site-packages`,e.FS.mkdirTree(e.API.sitePackages),e.addRunDependency("install-stdlib");try{let a=await t;e.FS.writeFile(`/lib/python${n}${r}.zip`,a)}catch(a){console.error("Error occurred while installing the standard library:"),console.error(a)}finally{e.removeRunDependency("install-stdlib")}}}function Bn(e){let t;return t=null!=e.stdLibURL?e.stdLibURL:e.indexURL+"python_stdlib.zip",[...Vn(e.fsInit),Hn(t),Un(e.env.HOME),qn(e.env),Ln]}function Wn(e){if(typeof WasmOffsetConverter<"u")return;let{binary:t,response:n}=wn(e+"pyodide.asm.wasm");return function(e,r){return async function(){try{let a;a=n?await WebAssembly.instantiateStreaming(n,e):await WebAssembly.instantiate(await t,e);let{instance:s,module:i}=a;r(s,i)}catch(a){console.warn("wasm instantiation failed!"),console.warn(a)}}(),{}}}Gt(zn,"createSettings"),Gt(Un,"createHomeDirectory"),Gt(qn,"setEnvironment"),Gt(Vn,"callFsInitHook"),Gt(Hn,"installStdlib"),Gt(Bn,"getFileSystemInitializationFuncs"),Gt(Wn,"getInstantiateWasmFunc");var Kn="0.27.5";async function Jn(e={}){var t,n;await jn();let r=e.indexURL||await Mn();r=vn(r),r.endsWith("/")||(r+="/"),e.indexURL=r;let a={fullStdLib:!1,jsglobals:globalThis,stdin:globalThis.prompt?globalThis.prompt:void 0,lockFileURL:r+"pyodide-lock.json",args:[],env:{},packageCacheDir:r,packages:[],enableRunUntilComplete:!1,checkAPIVersion:!0,BUILD_ID:"bd0388b62e760f8ba04185eb443fec955f25434f49c7b951efe5b1f792dbe5d4"},s=Object.assign(a,e);(t=s.env).HOME??(t.HOME="/home/pyodide"),(n=s.env).PYTHONINSPECT??(n.PYTHONINSPECT="1");let i,o=zn(s),d=o.API;if(d.lockFilePromise=$n(s.lockFileURL),"function"!=typeof _createPyodideModule){let e=`${s.indexURL}pyodide.asm.js`;await bn(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!==Kn&&s.checkAPIVersion)throw new Error(`Pyodide version does not match: '${Kn}' <==> '${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(Jn,"loadPyodide");const Yn=new class{constructor(){this.spans=[]}startSpan(e,t={}){const n={name:e,startTime:Date.now(),attributes:t,end:(e="ok")=>this.endSpan(n,e)};return this.spans.push(n),n}endSpan(e,t="ok"){e.endTime=Date.now(),e.status=t}getSpans(){return this.spans}wrap(e,t,n={}){const r=this.startSpan(t||e.name,n);try{const t=e();return this.endSpan(r),t}catch(a){throw this.endSpan(r,"error"),a}}wrapAsync(e,t,n={}){return async(...r)=>{const a=this.startSpan(t||e.name,n);try{const t=await e(...r);return this.endSpan(a),t}catch(s){throw this.endSpan(a,"error"),s}}}logSpans(){}};globalThis.t=Yn;class Gn{constructor(){this.pyodide=null}get requirePyodide(){return Mt(this.pyodide,"Pyodide not loaded"),this.pyodide}async bootstrap(e){return await this.loadPyodideAndPackages(e)}async loadPyodideAndPackages(e){if(!Jn)throw new Error("loadPyodide is not defined");const t=Yn.startSpan("loadPyodide");try{const n=await Jn({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=n,t.end("ok"),n}catch(n){throw c.error("Failed to load Pyodide",n),n}}async mountFilesystem(e){const t=Yn.startSpan("mountFilesystem");return qt(this.requirePyodide),Vt(this.requirePyodide),await Ht(this.requirePyodide),t.end("ok"),Wt({pyodide:this.requirePyodide,code:e.code,filename:e.filename})}async startSession(e){const{code:t,filename:n,onMessage:r,queryParameters:a,userConfig:s}=e;self.messenger={callback:r},self.query_params=a,self.user_config=s;const i=Yn.startSpan("startSession.runPython"),o=n||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 n=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 r=[...t];let a=Yn.startSpan("pyodide.loadPackage");await n.loadPackagesFromImports(e,{errorCallback:c.error,messageCallback:c.log}),a.end(),a=Yn.startSpan("micropip.install");const s=r.filter((e=>!n.loadedPackages[e]));s.length>0&&await n.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()}}async function Xn(e){try{return await import(`/wasm/controller.js?version=${e}`)}catch{return new Gn}}const Qn=Yn.startSpan("worker:init");const er=new class{constructor(e){this.onMessage=e,this.started=!1,this.push=e=>{this.started?this.onMessage(e):this.buffer.push(e)},this.start=()=>{this.started=!0,this.buffer.forEach((e=>this.onMessage(e))),this.buffer=[]},this.buffer=[]}}((e=>{ar.send.kernelMessage({message:e})})),tr=new class{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.reject=e=>{this.status="rejected",t(e)},this.resolve=t=>{this.status="resolved",e(t)}}))}};let nr=!1;const rr={startSession:async e=>{if(await or,nr)c.warn("Session already started");else{nr=!0;try{Mt(self.controller,"Controller not loaded"),await(self.controller.mountFilesystem?.({code:e.code,filename:e.filename}));const t=Yn.wrapAsync(self.controller.startSession.bind(self.controller)),n=function(e){let t,n=!1;return function(...r){return n||(n=!0,t=e.apply(this,r)),t}}((()=>{ar.send.initializingMessage({message:"Initializing notebook..."}),ar.send.initialized({})}));ar.send.initializingMessage({message:"Loading notebook and dependencies..."});const r=await t({code:e.code,filename:e.filename,queryParameters:e.queryParameters,userConfig:e.userConfig,onMessage:e=>{n(),er.push(e)}});tr.resolve(r),Qn.end("ok")}catch(t){ar.send.initializedError({error:$t(t)}),Qn.end("error")}}},loadPackages:async e=>{const t=Yn.startSpan("loadPackages");await or,e.includes("mo.sql")&&(e=`import sqlglot\n${e=`import duckdb\n${e=`import pandas\n${e}`}`}`).includes("polars")&&(e=`import pyarrow\n${e}`),await self.pyodide.loadPackagesFromImports(e,{messageCallback:c.log,errorCallback:c.error}),t.end()},readFile:async e=>{const t=Yn.startSpan("readFile");await or;const n=u(self.pyodide.FS.readFile(e));return t.end(),n},setInterruptBuffer:async e=>{await or,self.pyodide.setInterruptBuffer(e)},addPackage:async e=>{await or;const{package:t}=e,n=t.split(" ").map((e=>e.trim())),r=await self.pyodide.runPythonAsync(`\n import micropip\n import json\n response = None\n try:\n await micropip.install(${JSON.stringify(n)})\n response = {"success": True}\n except Exception as e:\n response = {"success": False, "error": str(e)}\n json.dumps(response)\n `);return JSON.parse(r)},removePackage:async e=>{await or;const{package:t}=e,n=await self.pyodide.runPythonAsync(`\n import micropip\n import json\n response = None\n try:\n micropip.uninstall("${t}")\n response = {"success": True}\n except Exception as e:\n response = {"success": False, "error": str(e)}\n json.dumps(response)\n `);return JSON.parse(n)},listPackages:async()=>{const e=Yn.startSpan("listPackages");await or;const t=await self.pyodide.runPythonAsync('\n import json\n import micropip\n\n packages = micropip.list()\n packages = [\n {"name": p.name, "version": p.version}\n for p in packages.values()\n ]\n json.dumps(sorted(packages, key=lambda pkg: pkg["name"]))\n ');return e.end(),{packages:JSON.parse(t)}},saveNotebook:async e=>{await or;const t=self.pyodide.runPython("\n from marimo._pyodide.bootstrap import save_file\n save_file\n ");await t(JSON.stringify(e),Ut)},bridge:async e=>{const t=Yn.startSpan("bridge",{functionName:e.functionName});await or;const{functionName:n,payload:r}=e;"format"===n&&await self.pyodide.runPythonAsync('\n import micropip\n\n try:\n import black\n except ModuleNotFoundError:\n await micropip.install("black")\n '),"export_markdown"===n&&await self.pyodide.runPythonAsync('\n import micropip\n\n try:\n import yaml\n except ModuleNotFoundError:\n await micropip.install("pyyaml")\n ');const a=await tr.promise,s=null==r?null:"string"==typeof r?r:JSON.stringify(r),i=null==s?await a[n]():await a[n](s);return ir.has(n)&&Bt(self.pyodide),t.end(),"string"==typeof i?JSON.parse(i):i}},ar=function(e){return n(e)}({transport:(sr={transportId:"marimo-transport"},a(self,sr)),requestHandler:rr});var sr;ar.send("ready",{}),ar.addMessageListener("consumerReady",(async()=>{await or,er.start()}));const ir=new Set(["save","save_app_config","rename_file","create_file_or_directory","delete_file_or_directory","move_file_or_directory","update_file"]);const or=Yn.wrapAsync((async function(){try{const e=self.name,t=function(e){return e.includes("dev"),`v${Kn}`}(e),n=await Yn.wrapAsync(Xn)(e);self.controller=n,ar.send.initializingMessage({message:"Loading marimo..."}),self.pyodide=await Yn.wrapAsync(n.bootstrap.bind(n))({version:e,pyodideVersion:t})}catch(e){c.error("Error bootstrapping",e),ar.send.initializedError({error:$t(e)})}}))();
|
@@ -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?.(w)}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 m=new Proxy(h,{get:(e,t,r)=>t in e?Reflect.get(e,t,r):e=>h(t,e)}),f=m;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,b=new Set;async function w(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 b)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:m,requestProxy:f,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)):b.add(r)},removeMessageListener:function(e,t){"*"!==e?(_.get(e)?.delete(t),0===_.get(e)?.size&&_.delete(e)):b.delete(t)},proxy:{send:v,request:f},_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)}}}var s,i=Object.defineProperty,o=(e,t)=>i(e,"name",{value:t,configurable:!0}),d=(s=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(s,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):s);function c(e){return!isNaN(parseFloat(e))&&isFinite(e)}function u(e){return e.charAt(0).toUpperCase()+e.substring(1)}function l(e){return function(){return this[e]}}o(c,"_isNumber"),o(u,"_capitalize"),o(l,"_getter");var p,h,m=["isConstructor","isEval","isNative","isToplevel"],f=["columnNumber","lineNumber"],y=["fileName","functionName","source"],g=m.concat(f,y,["args"],["evalOrigin"]);function v(e){if(e)for(var t=0;t<g.length;t++)void 0!==e[g[t]]&&this["set"+u(g[t])](e[g[t]])}for(o(v,"StackFrame"),v.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 v)this.evalOrigin=e;else{if(!(e instanceof Object))throw new TypeError("Eval Origin must be an Object or StackFrame");this.evalOrigin=new v(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}},v.fromString=o((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 v({functionName:n,args:a||void 0,fileName:o,lineNumber:d||void 0,columnNumber:c||void 0})}),"StackFrame$$fromString"),p=0;p<m.length;p++)v.prototype["get"+u(m[p])]=l(m[p]),v.prototype["set"+u(m[p])]=function(e){return function(t){this[e]=!!t}}(m[p]);for(h=0;h<f.length;h++)v.prototype["get"+u(f[h])]=l(f[h]),v.prototype["set"+u(f[h])]=function(e){return function(t){if(!c(t))throw new TypeError(e+" must be a Number");this[e]=Number(t)}}(f[h]);for(_=0;_<y.length;_++)v.prototype["get"+u(y[_])]=l(y[_]),v.prototype["set"+u(y[_])]=function(e){return function(t){this[e]=String(t)}}(y[_]);var _,b=v;function w(){var e=/^\s*at .*(\S+:\d+|\(native\))/m,t=/^(eval@)?(\[native code])?$/;return{parse:o((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:o((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:o((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 b({functionName:a,fileName:s,lineNumber:n[1],columnNumber:n[2],source:e})}),this)}),"ErrorStackParser$$parseV8OrIE"),parseFFOrSafari:o((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 b({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,r=e.match(t),n=r&&r[1]?r[1]:void 0,a=this.extractLocation(e.replace(t,""));return new b({functionName:n,fileName:a[0],lineNumber:a[1],columnNumber:a[2],source:e})}),this)}),"ErrorStackParser$$parseFFOrSafari")}}o(w,"ErrorStackParser");var k,x,S,T,E,O,Z,j,N,P=new w,A="object"==typeof process&&"object"==typeof process.versions&&"string"==typeof process.versions.node&&!process.browser,C=A&&typeof module<"u"&&typeof module.exports<"u"&&typeof d<"u"&&typeof __dirname<"u",I=A&&!C,R=typeof Deno<"u",$=!A&&!R,F=$&&"object"==typeof window&&"object"==typeof document&&"function"==typeof document.createElement&&"sessionStorage"in window&&"function"!=typeof importScripts,M=$&&"function"==typeof importScripts&&"object"==typeof self;async function L(){if(!A||(k=(await import("./__vite-browser-external-CIEyP2s7.js")).default,T=await import("./__vite-browser-external-CIEyP2s7.js"),E=await import("./__vite-browser-external-CIEyP2s7.js"),S=(await import("./__vite-browser-external-CIEyP2s7.js")).default,x=await import("./__vite-browser-external-CIEyP2s7.js"),Z=x.sep,typeof d<"u"))return;let e={fs:T,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 D(e,t){return x.resolve(t||".",e)}function z(e,t){return void 0===t&&(t=location),new URL(e,t).toString()}function q(e,t){return e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?{response:fetch(e)}:{binary:E.readFile(e).then((e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength)))}}function U(e,t){let r=new URL(e,location);return{response:fetch(r,t?{integrity:t}:{})}}async function V(e,t){let{response:r,binary:n}=j(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"),o(L,"initNodeModules"),o(D,"node_resolvePath"),o(z,"browser_resolvePath"),O=A?D:z,A||(Z="/"),o(q,"node_getBinaryResponse"),o(U,"browser_getBinaryResponse"),j=A?q:U,o(V,"loadBinaryFile"),F)N=o((async e=>await import(e)),"loadScript");else if(M)N=o((async e=>{try{globalThis.importScripts(e)}catch(Qr){if(!(Qr instanceof TypeError))throw Qr;await import(e)}}),"loadScript");else{if(!A)throw new Error("Cannot determine runtime environment");N=H}async function H(e){e.startsWith("file://")&&(e=e.slice(7)),e.includes("://")?S.runInThisContext(await(await fetch(e)).text()):await import(k.pathToFileURL(e).href)}async function B(e){if(A){await L();let t=await E.readFile(e,{encoding:"utf8"});return JSON.parse(t)}return await(await fetch(e)).json()}async function W(){if(C)return __dirname;let e;try{throw new Error}catch(n){e=n}let t=P.parse(e)[0].fileName;if(A&&!t.startsWith("file://")&&(t=`file://${t}`),I){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(Z);if(-1===r)throw new Error("Could not extract indexURL path from pyodide module location");return t.slice(0,r)}function K(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)}o(a,"isRealDir"),o(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 J(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}o(H,"nodeLoadScript"),o(B,"loadLockFile"),o(W,"calculateDirname"),o(K,"initializeNativeFS");var J=o((async e=>{let t=[];async function r(e){for await(let n of e.values())t.push(n),"directory"===n.kind&&await r(n)}o(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 Y(e){let t={noImageDecoding:!0,noAudioDecoding:!0,noWasmDecoding:!1,preRun:te(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:re(e.indexURL)};return t}function G(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 X(e){return function(t){Object.assign(t.ENV,e)}}function Q(e){return e?[async t=>{t.addRunDependency("fsInitHook");try{await e(t.FS,{sitePackages:t.API.sitePackages})}finally{t.removeRunDependency("fsInitHook")}}]:[]}function ee(e){let t=V(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 te(e){let t;return t=null!=e.stdLibURL?e.stdLibURL:e.indexURL+"python_stdlib.zip",[...Q(e.fsInit),ee(t),G(e.env.HOME),X(e.env),K]}function re(e){if(typeof WasmOffsetConverter<"u")return;let{binary:t,response:r}=j(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)}}(),{}}}o(Y,"createSettings"),o(G,"createHomeDirectory"),o(X,"setEnvironment"),o(Q,"callFsInitHook"),o(ee,"installStdlib"),o(te,"getFileSystemInitializationFuncs"),o(re,"getInstantiateWasmFunc");var ne="0.27.5";async function ae(e={}){var t,r;await L();let n=e.indexURL||await W();n=O(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=Y(s),d=o.API;if(d.lockFilePromise=B(s.lockFileURL),"function"!=typeof _createPyodideModule){let e=`${s.indexURL}pyodide.asm.js`;await N(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!==ne&&s.checkAPIVersion)throw new Error(`Pyodide version does not match: '${ne}' <==> '${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}o(ae,"loadPyodide");const se=()=>{},ie=(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=>ie(`${e}.${r}`,t),disabled:(e=!0)=>e?de:t}},oe={debug:(...e)=>{},log:(...e)=>{console.log(...e)},warn:(...e)=>{console.warn(...e)},error:(...e)=>{console.error(...e)},trace:(...e)=>{console.trace(...e)},get:e=>ie(e,oe),disabled:(e=!0)=>e?de:oe},de={debug:()=>se,log:()=>se,warn:()=>se,error:()=>se,trace:()=>se,get:()=>de,disabled:()=>de};const ce="undefined"!=typeof window&&window.Logger||oe;var ue,le;!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}(ue||(ue={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(le||(le={}));const pe=ue.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),he=e=>{switch(typeof e){case"undefined":return pe.undefined;case"string":return pe.string;case"number":return isNaN(e)?pe.nan:pe.number;case"boolean":return pe.boolean;case"function":return pe.function;case"bigint":return pe.bigint;case"symbol":return pe.symbol;case"object":return Array.isArray(e)?pe.array:null===e?pe.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?pe.promise:"undefined"!=typeof Map&&e instanceof Map?pe.map:"undefined"!=typeof Set&&e instanceof Set?pe.set:"undefined"!=typeof Date&&e instanceof Date?pe.date:pe.object;default:return pe.unknown}},me=ue.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 fe 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 fe))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ue.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()}}fe.create=e=>new fe(e);const ye=(e,t)=>{let r;switch(e.code){case me.invalid_type:r=e.received===pe.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case me.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ue.jsonStringifyReplacer)}`;break;case me.unrecognized_keys:r=`Unrecognized key(s) in object: ${ue.joinValues(e.keys,", ")}`;break;case me.invalid_union:r="Invalid input";break;case me.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ue.joinValues(e.options)}`;break;case me.invalid_enum_value:r=`Invalid enum value. Expected ${ue.joinValues(e.options)}, received '${e.received}'`;break;case me.invalid_arguments:r="Invalid function arguments";break;case me.invalid_return_type:r="Invalid function return type";break;case me.invalid_date:r="Invalid date";break;case me.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}"`:ue.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case me.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 me.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 me.custom:r="Invalid input";break;case me.invalid_intersection_types:r="Intersection results could not be merged";break;case me.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case me.not_finite:r="Number must be finite";break;default:r=t.defaultError,ue.assertNever(e)}return{message:r}};let ge=ye;function ve(){return ge}const _e=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 be(e,t){const r=ve(),n=_e({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===ye?void 0:ye].filter((e=>!!e))});e.common.issues.push(n)}class we{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 ke;"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 we.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 ke;if("aborted"===a.status)return ke;"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 ke=Object.freeze({status:"aborted"}),xe=e=>({status:"dirty",value:e}),Se=e=>({status:"valid",value:e}),Te=e=>"aborted"===e.status,Ee=e=>"dirty"===e.status,Oe=e=>"valid"===e.status,Ze=e=>"undefined"!=typeof Promise&&e instanceof Promise;function je(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 Ne(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 Pe,Ae,Ce;"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}(Pe||(Pe={}));class Ie{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 Re=(e,t)=>{if(Oe(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 fe(e.common.issues);return this._error=t,this._error}}};function $e(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 Fe{get description(){return this._def.description}_getType(e){return he(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:he(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new we,ctx:{common:e.parent.common,data:e.data,parsedType:he(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(Ze(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:he(e)},a=this._parseSync({data:e,path:n.path,parent:n});return Re(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:he(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:n});return Oe(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=>Oe(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:he(e)},n=this._parse({data:e,path:r.path,parent:r}),a=await(Ze(n)?n:Promise.resolve(n));return Re(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:me.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 Ft({schema:this,typeName:Yt.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 Mt.create(this,this._def)}nullable(){return Lt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return vt.create(this)}promise(){return $t.create(this,this._def)}or(e){return wt.create([this,e],this._def)}and(e){return Tt.create(this,e,this._def)}transform(e){return new Ft({...$e(this._def),schema:this,typeName:Yt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new Dt({...$e(this._def),innerType:this,defaultValue:t,typeName:Yt.ZodDefault})}brand(){return new Vt({typeName:Yt.ZodBranded,type:this,...$e(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new zt({...$e(this._def),innerType:this,catchValue:t,typeName:Yt.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return Ht.create(this,e)}readonly(){return Bt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Me=/^c[^\s-]{8,}$/i,Le=/^[0-9a-z]+$/,De=/^[0-9A-HJKMNP-TV-Z]{26}$/i,ze=/^[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,qe=/^[a-z0-9_-]{21}$/i,Ue=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Ve=/^[-+]?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)?)??$/,He=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Be;const We=/^(?:(?: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])$/,Ke=/^(?:(?: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])$/,Je=/^(([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]))$/,Ye=/^(([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])$/,Ge=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Xe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Qe="((\\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])))",et=new RegExp(`^${Qe}$`);function tt(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 rt(e){let t=`${Qe}T${tt(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 nt(e,t){if(!Ue.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 at(e,t){return!("v4"!==t&&t||!Ke.test(e))||!("v6"!==t&&t||!Ye.test(e))}class st extends Fe{_parse(e){this._def.coerce&&(e.data=String(e.data));if(this._getType(e)!==pe.string){const t=this._getOrReturnCtx(e);return be(t,{code:me.invalid_type,expected:pe.string,received:t.parsedType}),ke}const t=new we;let r;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(r=this._getOrReturnCtx(e,r),be(r,{code:me.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),be(r,{code:me.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?be(r,{code:me.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&be(r,{code:me.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)He.test(e.data)||(r=this._getOrReturnCtx(e,r),be(r,{validation:"email",code:me.invalid_string,message:i.message}),t.dirty());else if("emoji"===i.kind)Be||(Be=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Be.test(e.data)||(r=this._getOrReturnCtx(e,r),be(r,{validation:"emoji",code:me.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)ze.test(e.data)||(r=this._getOrReturnCtx(e,r),be(r,{validation:"uuid",code:me.invalid_string,message:i.message}),t.dirty());else if("nanoid"===i.kind)qe.test(e.data)||(r=this._getOrReturnCtx(e,r),be(r,{validation:"nanoid",code:me.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)Me.test(e.data)||(r=this._getOrReturnCtx(e,r),be(r,{validation:"cuid",code:me.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)Le.test(e.data)||(r=this._getOrReturnCtx(e,r),be(r,{validation:"cuid2",code:me.invalid_string,message:i.message}),t.dirty());else if("ulid"===i.kind)De.test(e.data)||(r=this._getOrReturnCtx(e,r),be(r,{validation:"ulid",code:me.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(s){r=this._getOrReturnCtx(e,r),be(r,{validation:"url",code:me.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),be(r,{validation:"regex",code:me.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),be(r,{code:me.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),be(r,{code:me.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),be(r,{code:me.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty());else if("datetime"===i.kind){rt(i).test(e.data)||(r=this._getOrReturnCtx(e,r),be(r,{code:me.invalid_string,validation:"datetime",message:i.message}),t.dirty())}else if("date"===i.kind){et.test(e.data)||(r=this._getOrReturnCtx(e,r),be(r,{code:me.invalid_string,validation:"date",message:i.message}),t.dirty())}else if("time"===i.kind){new RegExp(`^${tt(i)}$`).test(e.data)||(r=this._getOrReturnCtx(e,r),be(r,{code:me.invalid_string,validation:"time",message:i.message}),t.dirty())}else"duration"===i.kind?Ve.test(e.data)||(r=this._getOrReturnCtx(e,r),be(r,{validation:"duration",code:me.invalid_string,message:i.message}),t.dirty()):"ip"===i.kind?(n=e.data,("v4"!==(a=i.version)&&a||!We.test(n))&&("v6"!==a&&a||!Je.test(n))&&(r=this._getOrReturnCtx(e,r),be(r,{validation:"ip",code:me.invalid_string,message:i.message}),t.dirty())):"jwt"===i.kind?nt(e.data,i.alg)||(r=this._getOrReturnCtx(e,r),be(r,{validation:"jwt",code:me.invalid_string,message:i.message}),t.dirty()):"cidr"===i.kind?at(e.data,i.version)||(r=this._getOrReturnCtx(e,r),be(r,{validation:"cidr",code:me.invalid_string,message:i.message}),t.dirty()):"base64"===i.kind?Ge.test(e.data)||(r=this._getOrReturnCtx(e,r),be(r,{validation:"base64",code:me.invalid_string,message:i.message}),t.dirty()):"base64url"===i.kind?Xe.test(e.data)||(r=this._getOrReturnCtx(e,r),be(r,{validation:"base64url",code:me.invalid_string,message:i.message}),t.dirty()):ue.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:me.invalid_string,...Pe.errToObj(r)})}_addCheck(e){return new st({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Pe.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Pe.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Pe.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Pe.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Pe.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Pe.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Pe.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Pe.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Pe.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Pe.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Pe.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Pe.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Pe.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,...Pe.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,...Pe.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...Pe.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...Pe.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...Pe.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...Pe.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...Pe.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...Pe.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...Pe.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...Pe.errToObj(t)})}nonempty(e){return this.min(1,Pe.errToObj(e))}trim(){return new st({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new st({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new st({...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 it(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)}st.create=e=>{var t;return new st({checks:[],typeName:Yt.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...$e(e)})};class ot extends Fe{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)!==pe.number){const t=this._getOrReturnCtx(e);return be(t,{code:me.invalid_type,expected:pe.number,received:t.parsedType}),ke}let t;const r=new we;for(const n of this._def.checks)if("int"===n.kind)ue.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),be(t,{code:me.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),be(t,{code:me.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),be(t,{code:me.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty())}else"multipleOf"===n.kind?0!==it(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),be(t,{code:me.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),be(t,{code:me.not_finite,message:n.message}),r.dirty()):ue.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,Pe.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Pe.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Pe.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Pe.toString(t))}setLimit(e,t,r,n){return new ot({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:Pe.toString(n)}]})}_addCheck(e){return new ot({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Pe.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Pe.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Pe.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:Pe.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Pe.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Pe.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&&ue.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)}}ot.create=e=>new ot({checks:[],typeName:Yt.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...$e(e)});class dt extends Fe{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)!==pe.bigint)return this._getInvalidInput(e);let t;const r=new we;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),be(t,{code:me.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),be(t,{code:me.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),be(t,{code:me.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):ue.assertNever(a);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return be(t,{code:me.invalid_type,expected:pe.bigint,received:t.parsedType}),ke}gte(e,t){return this.setLimit("min",e,!0,Pe.toString(t))}gt(e,t){return this.setLimit("min",e,!1,Pe.toString(t))}lte(e,t){return this.setLimit("max",e,!0,Pe.toString(t))}lt(e,t){return this.setLimit("max",e,!1,Pe.toString(t))}setLimit(e,t,r,n){return new dt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:Pe.toString(n)}]})}_addCheck(e){return new dt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Pe.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Pe.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Pe.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Pe.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:Pe.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}}dt.create=e=>{var t;return new dt({checks:[],typeName:Yt.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...$e(e)})};class ct extends Fe{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==pe.boolean){const t=this._getOrReturnCtx(e);return be(t,{code:me.invalid_type,expected:pe.boolean,received:t.parsedType}),ke}return Se(e.data)}}ct.create=e=>new ct({typeName:Yt.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...$e(e)});class ut extends Fe{_parse(e){this._def.coerce&&(e.data=new Date(e.data));if(this._getType(e)!==pe.date){const t=this._getOrReturnCtx(e);return be(t,{code:me.invalid_type,expected:pe.date,received:t.parsedType}),ke}if(isNaN(e.data.getTime())){return be(this._getOrReturnCtx(e),{code:me.invalid_date}),ke}const t=new we;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),be(r,{code:me.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),be(r,{code:me.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):ue.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ut({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:Pe.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:Pe.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}}ut.create=e=>new ut({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:Yt.ZodDate,...$e(e)});class lt extends Fe{_parse(e){if(this._getType(e)!==pe.symbol){const t=this._getOrReturnCtx(e);return be(t,{code:me.invalid_type,expected:pe.symbol,received:t.parsedType}),ke}return Se(e.data)}}lt.create=e=>new lt({typeName:Yt.ZodSymbol,...$e(e)});class pt extends Fe{_parse(e){if(this._getType(e)!==pe.undefined){const t=this._getOrReturnCtx(e);return be(t,{code:me.invalid_type,expected:pe.undefined,received:t.parsedType}),ke}return Se(e.data)}}pt.create=e=>new pt({typeName:Yt.ZodUndefined,...$e(e)});class ht extends Fe{_parse(e){if(this._getType(e)!==pe.null){const t=this._getOrReturnCtx(e);return be(t,{code:me.invalid_type,expected:pe.null,received:t.parsedType}),ke}return Se(e.data)}}ht.create=e=>new ht({typeName:Yt.ZodNull,...$e(e)});class mt extends Fe{constructor(){super(...arguments),this._any=!0}_parse(e){return Se(e.data)}}mt.create=e=>new mt({typeName:Yt.ZodAny,...$e(e)});class ft extends Fe{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Se(e.data)}}ft.create=e=>new ft({typeName:Yt.ZodUnknown,...$e(e)});class yt extends Fe{_parse(e){const t=this._getOrReturnCtx(e);return be(t,{code:me.invalid_type,expected:pe.never,received:t.parsedType}),ke}}yt.create=e=>new yt({typeName:Yt.ZodNever,...$e(e)});class gt extends Fe{_parse(e){if(this._getType(e)!==pe.undefined){const t=this._getOrReturnCtx(e);return be(t,{code:me.invalid_type,expected:pe.void,received:t.parsedType}),ke}return Se(e.data)}}gt.create=e=>new gt({typeName:Yt.ZodVoid,...$e(e)});class vt extends Fe{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==pe.array)return be(t,{code:me.invalid_type,expected:pe.array,received:t.parsedType}),ke;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,a=t.data.length<n.exactLength.value;(e||a)&&(be(t,{code:e?me.too_big:me.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&&(be(t,{code:me.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&&(be(t,{code:me.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 Ie(t,e,t.path,r))))).then((e=>we.mergeArray(r,e)));const a=[...t.data].map(((e,r)=>n.type._parseSync(new Ie(t,e,t.path,r))));return we.mergeArray(r,a)}get element(){return this._def.type}min(e,t){return new vt({...this._def,minLength:{value:e,message:Pe.toString(t)}})}max(e,t){return new vt({...this._def,maxLength:{value:e,message:Pe.toString(t)}})}length(e,t){return new vt({...this._def,exactLength:{value:e,message:Pe.toString(t)}})}nonempty(e){return this.min(1,e)}}function _t(e){if(e instanceof bt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=Mt.create(_t(n))}return new bt({...e._def,shape:()=>t})}return e instanceof vt?new vt({...e._def,type:_t(e.element)}):e instanceof Mt?Mt.create(_t(e.unwrap())):e instanceof Lt?Lt.create(_t(e.unwrap())):e instanceof Et?Et.create(e.items.map((e=>_t(e)))):e}vt.create=(e,t)=>new vt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Yt.ZodArray,...$e(t)});class bt extends Fe{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=ue.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==pe.object){const t=this._getOrReturnCtx(e);return be(t,{code:me.invalid_type,expected:pe.object,received:t.parsedType}),ke}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof yt&&"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 Ie(r,t,r.path,o)),alwaysSet:o in r.data})}if(this._def.catchall instanceof yt){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&&(be(r,{code:me.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 Ie(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=>we.mergeObjectSync(t,e))):we.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return Pe.errToObj,new bt({...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=Pe.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new bt({...this._def,unknownKeys:"strip"})}passthrough(){return new bt({...this._def,unknownKeys:"passthrough"})}extend(e){return new bt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new bt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Yt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new bt({...this._def,catchall:e})}pick(e){const t={};return ue.objectKeys(e).forEach((r=>{e[r]&&this.shape[r]&&(t[r]=this.shape[r])})),new bt({...this._def,shape:()=>t})}omit(e){const t={};return ue.objectKeys(this.shape).forEach((r=>{e[r]||(t[r]=this.shape[r])})),new bt({...this._def,shape:()=>t})}deepPartial(){return _t(this)}partial(e){const t={};return ue.objectKeys(this.shape).forEach((r=>{const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()})),new bt({...this._def,shape:()=>t})}required(e){const t={};return ue.objectKeys(this.shape).forEach((r=>{if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof Mt;)e=e._def.innerType;t[r]=e}})),new bt({...this._def,shape:()=>t})}keyof(){return Ct(ue.objectKeys(this.shape))}}bt.create=(e,t)=>new bt({shape:()=>e,unknownKeys:"strip",catchall:yt.create(),typeName:Yt.ZodObject,...$e(t)}),bt.strictCreate=(e,t)=>new bt({shape:()=>e,unknownKeys:"strict",catchall:yt.create(),typeName:Yt.ZodObject,...$e(t)}),bt.lazycreate=(e,t)=>new bt({shape:e,unknownKeys:"strip",catchall:yt.create(),typeName:Yt.ZodObject,...$e(t)});class wt extends Fe{_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 fe(e.ctx.common.issues)));return be(t,{code:me.invalid_union,unionErrors:r}),ke}));{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 fe(e)));return be(t,{code:me.invalid_union,unionErrors:a}),ke}}get options(){return this._def.options}}wt.create=(e,t)=>new wt({options:e,typeName:Yt.ZodUnion,...$e(t)});const kt=e=>e instanceof Pt?kt(e.schema):e instanceof Ft?kt(e.innerType()):e instanceof At?[e.value]:e instanceof It?e.options:e instanceof Rt?ue.objectValues(e.enum):e instanceof Dt?kt(e._def.innerType):e instanceof pt?[void 0]:e instanceof ht?[null]:e instanceof Mt?[void 0,...kt(e.unwrap())]:e instanceof Lt?[null,...kt(e.unwrap())]:e instanceof Vt||e instanceof Bt?kt(e.unwrap()):e instanceof zt?kt(e._def.innerType):[];class xt extends Fe{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==pe.object)return be(t,{code:me.invalid_type,expected:pe.object,received:t.parsedType}),ke;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}):(be(t,{code:me.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),ke)}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=kt(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 xt({typeName:Yt.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:n,...$e(r)})}}function St(e,t){const r=he(e),n=he(t);if(e===t)return{valid:!0,data:e};if(r===pe.object&&n===pe.object){const r=ue.objectKeys(t),n=ue.objectKeys(e).filter((e=>-1!==r.indexOf(e))),a={...e,...t};for(const s of n){const r=St(e[s],t[s]);if(!r.valid)return{valid:!1};a[s]=r.data}return{valid:!0,data:a}}if(r===pe.array&&n===pe.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const a=St(e[n],t[n]);if(!a.valid)return{valid:!1};r.push(a.data)}return{valid:!0,data:r}}return r===pe.date&&n===pe.date&&+e===+t?{valid:!0,data:e}:{valid:!1}}class Tt extends Fe{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(Te(e)||Te(n))return ke;const a=St(e.value,n.value);return a.valid?((Ee(e)||Ee(n))&&t.dirty(),{status:t.value,value:a.data}):(be(r,{code:me.invalid_intersection_types}),ke)};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}))}}Tt.create=(e,t,r)=>new Tt({left:e,right:t,typeName:Yt.ZodIntersection,...$e(r)});class Et extends Fe{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==pe.array)return be(r,{code:me.invalid_type,expected:pe.array,received:r.parsedType}),ke;if(r.data.length<this._def.items.length)return be(r,{code:me.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),ke;!this._def.rest&&r.data.length>this._def.items.length&&(be(r,{code:me.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 Ie(r,e,r.path,t)):null})).filter((e=>!!e));return r.common.async?Promise.all(n).then((e=>we.mergeArray(t,e))):we.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new Et({...this._def,rest:e})}}Et.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Et({items:e,typeName:Yt.ZodTuple,rest:null,...$e(t)})};class Ot extends Fe{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!==pe.object)return be(r,{code:me.invalid_type,expected:pe.object,received:r.parsedType}),ke;const n=[],a=this._def.keyType,s=this._def.valueType;for(const i in r.data)n.push({key:a._parse(new Ie(r,i,r.path,i)),value:s._parse(new Ie(r,r.data[i],r.path,i)),alwaysSet:i in r.data});return r.common.async?we.mergeObjectAsync(t,n):we.mergeObjectSync(t,n)}get element(){return this._def.valueType}static create(e,t,r){return new Ot(t instanceof Fe?{keyType:e,valueType:t,typeName:Yt.ZodRecord,...$e(r)}:{keyType:st.create(),valueType:e,typeName:Yt.ZodRecord,...$e(t)})}}class Zt extends Fe{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!==pe.map)return be(r,{code:me.invalid_type,expected:pe.map,received:r.parsedType}),ke;const n=this._def.keyType,a=this._def.valueType,s=[...r.data.entries()].map((([e,t],s)=>({key:n._parse(new Ie(r,e,r.path,[s,"key"])),value:a._parse(new Ie(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 ke;"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 ke;"dirty"!==n.status&&"dirty"!==a.status||t.dirty(),e.set(n.value,a.value)}return{status:t.value,value:e}}}}Zt.create=(e,t,r)=>new Zt({valueType:t,keyType:e,typeName:Yt.ZodMap,...$e(r)});class jt extends Fe{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==pe.set)return be(r,{code:me.invalid_type,expected:pe.set,received:r.parsedType}),ke;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(be(r,{code:me.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&&(be(r,{code:me.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 ke;"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 Ie(r,e,r.path,t))));return r.common.async?Promise.all(i).then((e=>s(e))):s(i)}min(e,t){return new jt({...this._def,minSize:{value:e,message:Pe.toString(t)}})}max(e,t){return new jt({...this._def,maxSize:{value:e,message:Pe.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}jt.create=(e,t)=>new jt({valueType:e,minSize:null,maxSize:null,typeName:Yt.ZodSet,...$e(t)});class Nt extends Fe{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==pe.function)return be(t,{code:me.invalid_type,expected:pe.function,received:t.parsedType}),ke;function r(e,r){return _e({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ve(),ye].filter((e=>!!e)),issueData:{code:me.invalid_arguments,argumentsError:r}})}function n(e,r){return _e({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,ve(),ye].filter((e=>!!e)),issueData:{code:me.invalid_return_type,returnTypeError:r}})}const a={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof $t){const e=this;return Se((async function(...t){const i=new fe([]),o=await e._def.args.parseAsync(t,a).catch((e=>{throw i.addIssue(r(t,e)),i})),d=await Reflect.apply(s,this,o),c=await e._def.returns._def.type.parseAsync(d,a).catch((e=>{throw i.addIssue(n(d,e)),i}));return c}))}{const e=this;return Se((function(...t){const i=e._def.args.safeParse(t,a);if(!i.success)throw new fe([r(t,i.error)]);const o=Reflect.apply(s,this,i.data),d=e._def.returns.safeParse(o,a);if(!d.success)throw new fe([n(o,d.error)]);return d.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new Nt({...this._def,args:Et.create(e).rest(ft.create())})}returns(e){return new Nt({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new Nt({args:e||Et.create([]).rest(ft.create()),returns:t||ft.create(),typeName:Yt.ZodFunction,...$e(r)})}}class Pt extends Fe{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})}}Pt.create=(e,t)=>new Pt({getter:e,typeName:Yt.ZodLazy,...$e(t)});class At extends Fe{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return be(t,{received:t.data,code:me.invalid_literal,expected:this._def.value}),ke}return{status:"valid",value:e.data}}get value(){return this._def.value}}function Ct(e,t){return new It({values:e,typeName:Yt.ZodEnum,...$e(t)})}At.create=(e,t)=>new At({value:e,typeName:Yt.ZodLiteral,...$e(t)});class It extends Fe{constructor(){super(...arguments),Ae.set(this,void 0)}_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return be(t,{expected:ue.joinValues(r),received:t.parsedType,code:me.invalid_type}),ke}if(je(this,Ae)||Ne(this,Ae,new Set(this._def.values)),!je(this,Ae).has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return be(t,{received:t.data,code:me.invalid_enum_value,options:r}),ke}return Se(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 It.create(e,{...this._def,...t})}exclude(e,t=this._def){return It.create(this.options.filter((t=>!e.includes(t))),{...this._def,...t})}}Ae=new WeakMap,It.create=Ct;class Rt extends Fe{constructor(){super(...arguments),Ce.set(this,void 0)}_parse(e){const t=ue.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==pe.string&&r.parsedType!==pe.number){const e=ue.objectValues(t);return be(r,{expected:ue.joinValues(e),received:r.parsedType,code:me.invalid_type}),ke}if(je(this,Ce)||Ne(this,Ce,new Set(ue.getValidEnumValues(this._def.values))),!je(this,Ce).has(e.data)){const e=ue.objectValues(t);return be(r,{received:r.data,code:me.invalid_enum_value,options:e}),ke}return Se(e.data)}get enum(){return this._def.values}}Ce=new WeakMap,Rt.create=(e,t)=>new Rt({values:e,typeName:Yt.ZodNativeEnum,...$e(t)});class $t extends Fe{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==pe.promise&&!1===t.common.async)return be(t,{code:me.invalid_type,expected:pe.promise,received:t.parsedType}),ke;const r=t.parsedType===pe.promise?t.data:Promise.resolve(t.data);return Se(r.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}$t.create=(e,t)=>new $t({type:e,typeName:Yt.ZodPromise,...$e(t)});class Ft extends Fe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Yt.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=>{be(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 ke;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?ke:"dirty"===n.status||"dirty"===t.value?xe(n.value):n}));{if("aborted"===t.value)return ke;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?ke:"dirty"===n.status||"dirty"===t.value?xe(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?ke:("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?ke:("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(!Oe(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=>Oe(e)?Promise.resolve(n.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}ue.assertNever(n)}}Ft.create=(e,t,r)=>new Ft({schema:e,typeName:Yt.ZodEffects,effect:t,...$e(r)}),Ft.createWithPreprocess=(e,t,r)=>new Ft({schema:t,effect:{type:"preprocess",transform:e},typeName:Yt.ZodEffects,...$e(r)});class Mt extends Fe{_parse(e){return this._getType(e)===pe.undefined?Se(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Mt.create=(e,t)=>new Mt({innerType:e,typeName:Yt.ZodOptional,...$e(t)});class Lt extends Fe{_parse(e){return this._getType(e)===pe.null?Se(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Lt.create=(e,t)=>new Lt({innerType:e,typeName:Yt.ZodNullable,...$e(t)});class Dt extends Fe{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===pe.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}Dt.create=(e,t)=>new Dt({innerType:e,typeName:Yt.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...$e(t)});class zt extends Fe{_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 Ze(n)?n.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new fe(r.common.issues)},input:r.data})}))):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new fe(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}zt.create=(e,t)=>new zt({innerType:e,typeName:Yt.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...$e(t)});class qt extends Fe{_parse(e){if(this._getType(e)!==pe.nan){const t=this._getOrReturnCtx(e);return be(t,{code:me.invalid_type,expected:pe.nan,received:t.parsedType}),ke}return{status:"valid",value:e.data}}}qt.create=e=>new qt({typeName:Yt.ZodNaN,...$e(e)});const Ut=Symbol("zod_brand");class Vt extends Fe{_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 Ht extends Fe{_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?ke:"dirty"===e.status?(t.dirty(),xe(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?ke:"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 Ht({in:e,out:t,typeName:Yt.ZodPipeline})}}class Bt extends Fe{_parse(e){const t=this._def.innerType._parse(e),r=e=>(Oe(e)&&(e.value=Object.freeze(e.value)),e);return Ze(t)?t.then((e=>r(e))):r(t)}unwrap(){return this._def.innerType}}function Wt(e,t){const r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r}function Kt(e,t={},r){return e?mt.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=Wt(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=Wt(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})}})):mt.create()}Bt.create=(e,t)=>new Bt({innerType:e,typeName:Yt.ZodReadonly,...$e(t)});const Jt={object:bt.lazycreate};var Yt;!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"}(Yt||(Yt={}));const Gt=st.create,Xt=ot.create,Qt=qt.create,er=dt.create,tr=ct.create,rr=ut.create,nr=lt.create,ar=pt.create,sr=ht.create,ir=mt.create,or=ft.create,dr=yt.create,cr=gt.create,ur=vt.create,lr=bt.create,pr=bt.strictCreate,hr=wt.create,mr=xt.create,fr=Tt.create,yr=Et.create,gr=Ot.create,vr=Zt.create,_r=jt.create,br=Nt.create,wr=Pt.create,kr=At.create,xr=It.create,Sr=Rt.create,Tr=$t.create,Er=Ft.create,Or=Mt.create,Zr=Lt.create,jr=Ft.createWithPreprocess,Nr=Ht.create,Pr={string:e=>st.create({...e,coerce:!0}),number:e=>ot.create({...e,coerce:!0}),boolean:e=>ct.create({...e,coerce:!0}),bigint:e=>dt.create({...e,coerce:!0}),date:e=>ut.create({...e,coerce:!0})},Ar=ke;var Cr=Object.freeze({__proto__:null,defaultErrorMap:ye,setErrorMap:function(e){ge=e},getErrorMap:ve,makeIssue:_e,EMPTY_PATH:[],addIssueToContext:be,ParseStatus:we,INVALID:ke,DIRTY:xe,OK:Se,isAborted:Te,isDirty:Ee,isValid:Oe,isAsync:Ze,get util(){return ue},get objectUtil(){return le},ZodParsedType:pe,getParsedType:he,ZodType:Fe,datetimeRegex:rt,ZodString:st,ZodNumber:ot,ZodBigInt:dt,ZodBoolean:ct,ZodDate:ut,ZodSymbol:lt,ZodUndefined:pt,ZodNull:ht,ZodAny:mt,ZodUnknown:ft,ZodNever:yt,ZodVoid:gt,ZodArray:vt,ZodObject:bt,ZodUnion:wt,ZodDiscriminatedUnion:xt,ZodIntersection:Tt,ZodTuple:Et,ZodRecord:Ot,ZodMap:Zt,ZodSet:jt,ZodFunction:Nt,ZodLazy:Pt,ZodLiteral:At,ZodEnum:It,ZodNativeEnum:Rt,ZodPromise:$t,ZodEffects:Ft,ZodTransformer:Ft,ZodOptional:Mt,ZodNullable:Lt,ZodDefault:Dt,ZodCatch:zt,ZodNaN:qt,BRAND:Ut,ZodBranded:Vt,ZodPipeline:Ht,ZodReadonly:Bt,custom:Kt,Schema:Fe,ZodSchema:Fe,late:Jt,get ZodFirstPartyTypeKind(){return Yt},coerce:Pr,any:ir,array:ur,bigint:er,boolean:tr,date:rr,discriminatedUnion:mr,effect:Er,enum:xr,function:br,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>Kt((t=>t instanceof e),t),intersection:fr,lazy:wr,literal:kr,map:vr,nan:Qt,nativeEnum:Sr,never:dr,null:sr,nullable:Zr,number:Xt,object:lr,oboolean:()=>tr().optional(),onumber:()=>Xt().optional(),optional:Or,ostring:()=>Gt().optional(),pipeline:Nr,preprocess:jr,promise:Tr,record:gr,set:_r,strictObject:pr,string:Gt,symbol:nr,transformer:Er,tuple:yr,undefined:ar,union:hr,unknown:or,void:cr,NEVER:Ar,ZodIssueCode:me,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:fe});const Ir=Cr.object({detail:Cr.string()}),Rr=Cr.object({error:Cr.string()});function $r(e){if(!e)return"Unknown error";if(e instanceof Error){const t=Ir.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=Ir.safeParse(t);if(r.success)return r.data.detail;const n=Rr.safeParse(t);if(n.success)return n.data.error;return e}(e.message)}if("object"==typeof e){const t=Ir.safeParse(e);if(t.success)return t.data.detail;const r=Rr.safeParse(e);if(r.success)return r.data.error}try{return JSON.stringify(e)}catch{return String(e)}}function Fr(e,t){if(!e)throw new Error(t)}const Mr=["normal","compact","medium","full","columns"],Lr=["auto","native","polars","lazy-polars","pandas"],Dr=Cr.object({completion:Cr.object({activate_on_typing:Cr.boolean().default(!0),copilot:Cr.union([Cr.boolean(),Cr.enum(["github","codeium","custom"])]).default(!1).transform((e=>!0===e?"github":e)),codeium_api_key:Cr.string().nullish()}).passthrough().default({}),save:Cr.object({autosave:Cr.enum(["off","after_delay"]).default("after_delay"),autosave_delay:Cr.number().nonnegative().transform((e=>Math.max(e,1e3))).default(1e3),format_on_save:Cr.boolean().default(!1)}).passthrough().default({}),formatting:Cr.object({line_length:Cr.number().nonnegative().default(79).transform((e=>Math.min(e,1e3)))}).passthrough().default({}),keymap:Cr.object({preset:Cr.enum(["default","vim"]).default("default"),overrides:Cr.record(Cr.string()).default({})}).passthrough().default({}),runtime:Cr.object({auto_instantiate:Cr.boolean().default(!0),on_cell_change:Cr.enum(["lazy","autorun"]).default("autorun"),auto_reload:Cr.enum(["off","lazy","autorun"]).default("off"),watcher_on_save:Cr.enum(["lazy","autorun"]).default("lazy"),default_sql_output:Cr.enum(Lr).default("auto")}).passthrough().default({}),display:Cr.object({theme:Cr.enum(["light","dark","system"]).default("light"),code_editor_font_size:Cr.number().nonnegative().default(14),cell_output:Cr.enum(["above","below"]).default("above"),dataframes:Cr.enum(["rich","plain"]).default("rich"),default_table_page_size:Cr.number().default(10),default_width:Cr.enum(Mr).default("medium").transform((e=>"normal"===e?"compact":e))}).passthrough().default({}),package_management:Cr.object({manager:Cr.enum(["pip","uv","rye","poetry","pixi"]).default("pip")}).passthrough().default({manager:"pip"}),ai:Cr.object({rules:Cr.string().default(""),open_ai:Cr.object({api_key:Cr.string().optional(),base_url:Cr.string().optional(),model:Cr.string().optional()}).optional(),anthropic:Cr.object({api_key:Cr.string().optional()}).optional(),google:Cr.object({api_key:Cr.string().optional()}).optional(),bedrock:Cr.object({region_name:Cr.string().optional(),profile_name:Cr.string().optional(),aws_access_key_id:Cr.string().optional(),aws_secret_access_key:Cr.string().optional()}).optional()}).passthrough().default({}),experimental:Cr.object({markdown:Cr.boolean().optional(),rtc:Cr.boolean().optional()}).passthrough().default({}),server:Cr.object({}).passthrough().default({})}).passthrough().default({completion:{},save:{},formatting:{},keymap:{},runtime:{},display:{},experimental:{},server:{},ai:{rules:"",open_ai:{}}}),zr=Cr.string(),qr=Cr.enum(Lr).default("auto");Cr.object({width:Cr.enum(Mr).default("medium").transform((e=>"normal"===e?"compact":e)),app_title:zr.nullish(),css_file:Cr.string().nullish(),html_head_file:Cr.string().nullish(),auto_download:Cr.array(Cr.enum(["html","markdown","ipynb"])).default([]),sql_output:qr}).default({width:"medium",auto_download:[]});const Ur=e=>(new TextDecoder).decode(e);function Vr(e){return e.FS}const Hr="notebook.py",Br="/marimo",Wr=Hr,Kr=e=>{const t=Vr(e);try{t.mkdirTree(Br)}catch{}t.chdir(Br)},Jr=e=>{Vr(e).mount(e.FS.filesystems.IDBFS,{root:"."},Br)},Yr=async e=>{await Xr(e,!0)},Gr=e=>{const{pyodide:t,filename:r,code:n}=e,a=Vr(t);if(r&&r!==Hr){const e=(e=>{try{return Ur(a.readFile(e))}catch{return null}})(r);if(e)return{code:e,filename:r}}return a.writeFile(Hr,n),{code:n,filename:Hr}};function Xr(e,t){return new Promise(((r,n)=>{Vr(e).syncfs(t,(e=>{e instanceof Error?n(e):r()}))}))}const Qr=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=Qr;class en{constructor(){this.pyodide=null}get requirePyodide(){return Fr(this.pyodide,"Pyodide not loaded"),this.pyodide}async bootstrap(e){return await this.loadPyodideAndPackages(e)}async loadPyodideAndPackages(e){if(!ae)throw new Error("loadPyodide is not defined");const t=Qr.startSpan("loadPyodide");try{const r=await ae({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 ce.error("Failed to load Pyodide",r),r}}async mountFilesystem(e){const t=Qr.startSpan("mountFilesystem");return Kr(this.requirePyodide),Jr(this.requirePyodide),await Yr(this.requirePyodide),t.end("ok"),Gr({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=Qr.startSpan("startSession.runPython"),o=r||Wr,[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=Qr.startSpan("pyodide.loadPackage");await r.loadPackagesFromImports(e,{errorCallback:ce.error,messageCallback:ce.log}),a.end(),a=Qr.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=>{ce.error("Failed to load packages from micropip",e)})),a.end()}}class tn extends en{async bootstrap(e){return await super.bootstrap(e)}async mountFilesystem(e){const{code:t,filename:r}=e;try{return Kr(this.requirePyodide),Gr({pyodide:this.requirePyodide,code:t,filename:r})}catch(n){ce.error(n)}return{code:t,filename:r}}async startSession(e){return super.startSession({queryParameters:{},code:e.code,filename:e.filename,onMessage:e.onMessage,userConfig:Dr.parse({})})}}const rn=async function(){const e=self.name,t=function(e){return e.includes("dev"),`v${ne}`}(e);try{self.controller=new tn,self.pyodide=await self.controller.bootstrap({version:e,pyodideVersion:t})}catch(r){ce.error("Error bootstrapping",r),on.send.initializedError({error:$r(r)})}}(),nn=new class{constructor(e){this.onMessage=e,this.started=!1,this.push=e=>{this.started?this.onMessage(e):this.buffer.push(e)},this.start=()=>{this.started=!0,this.buffer.forEach((e=>this.onMessage(e))),this.buffer=[]},this.buffer=[]}}((e=>{on.send.kernelMessage({message:e})})),an=new class{constructor(){this.status="pending",this.promise=new Promise(((e,t)=>{this.reject=e=>{this.status="rejected",t(e)},this.resolve=t=>{this.status="resolved",e(t)}}))}},sn={startSession:async e=>{await rn;try{Fr(self.controller,"Controller not loaded");const t=await self.controller.mountFilesystem({code:e.code,filename:`app-${e.appId}.py`}),r=await self.controller.startSession({...t,onMessage:nn.push});an.resolve(r),on.send.initialized({})}catch(t){on.send.initializedError({error:$r(t)})}},loadPackages:async e=>{await rn,e.includes("mo.sql")&&(e=`import sqlglot\n${e=`import duckdb\n${e=`import pandas\n${e}`}`}`).includes("polars")&&(e=`import pyarrow\n${e}`),await self.pyodide.loadPackagesFromImports(e,{messageCallback:ce.log,errorCallback:ce.error})},bridge:async e=>{await rn;const{functionName:t,payload:r}=e,n=await an.promise,a=null==r?null:"string"==typeof r?r:JSON.stringify(r),s=null==a?await n[t]():await n[t](a);return"string"==typeof s?JSON.parse(s):s}},on=function(e){return r(e)}({transport:(dn={transportId:"marimo-transport"},a(self,dn)),requestHandler:sn});var dn;on.send("ready",{}),on.addMessageListener("consumerReady",(async()=>{await rn,nn.start()}));
|
@@ -1 +0,0 @@
|
|
1
|
-
function w(h){return((h=Math.exp(h))+1/h)/2}const B=function h(n,p,m){function q(o,a){var r,u,l=o[0],v=o[1],t=o[2],y=a[0],z=a[1],e=a[2],f=y-l,c=z-v,s=f*f+c*c;if(s<1e-12)u=Math.log(e/t)/n,r=function(i){return[l+i*f,v+i*c,t*Math.exp(n*i*u)]};else{var S=Math.sqrt(s),T=(e*e-t*t+m*s)/(2*t*p*S),d=(e*e-t*t-m*s)/(2*e*p*S),M=Math.log(Math.sqrt(T*T+1)-T),A=Math.log(Math.sqrt(d*d+1)-d);u=(A-M)/n,r=function(i){var x,b=i*u,j=w(M),k=t/(p*S)*(j*(x=n*b+M,((x=Math.exp(2*x))-1)/(x+1))-function(g){return((g=Math.exp(g))-1/g)/2}(M));return[l+k*f,v+k*c,t*j/w(n*b+M)]}}return r.duration=1e3*u*n/Math.SQRT2,r}return q.rho=function(o){var a=Math.max(.001,+o),r=a*a;return h(a,r,r*r)},q}(Math.SQRT2,2,4);export{B as i};
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|