@oss-autopilot/core 3.31.2 → 3.31.3
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/cli.bundle.cjs +121 -115
- package/dist/dashboard/assets/{chart-panel-0drzwc3-.js → chart-panel-CmNIsCjO.js} +1 -1
- package/dist/dashboard/assets/index-CTKGc-Ns.js +55 -0
- package/dist/dashboard/index.html +1 -1
- package/package.json +3 -3
- package/dist/dashboard/assets/index-C0LCGMVi.js +0 -50
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h={},g=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function y(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function x(t,n,r){var i,a,o,s={};for(o in n)o==`key`?i=n[o]:o==`ref`?a=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):r),typeof t==`function`&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return S(t,s,i,a,null)}function S(e,r,i,a,o){var s={type:e,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++n,__i:-1,__u:0};return o==null&&t.vnode!=null&&t.vnode(s),s}function C(e){return e.children}function w(e,t){this.props=e,this.context=t}function T(e,t){if(t==null)return e.__?T(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?T(e):null}function E(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],a=[],o=y({},n);o.__v=n.__v+1,t.vnode&&t.vnode(o),se(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??T(n),!!(32&n.__u),a),o.__v=n.__v,o.__.__k[o.__i]=o,le(i,o,a),n.__e=n.__=null,o.__e!=r&&D(o)}}function D(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),D(e)}function ee(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!O.__r++||i!=t.debounceRendering)&&((i=t.debounceRendering)||a)(O)}function O(){try{for(var e,t=1;r.length;)r.length>t&&r.sort(o),e=r.shift(),t=r.length,E(e)}finally{r.length=O.__r=0}}function te(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,_,v,y=r&&r.__k||g,b=t.length;for(c=ne(n,t,y,c,b),d=0;d<b;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&y[p.__i]||h,p.__i=d,v=se(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&fe(f.ref,null,p),u.push(p.ref,p.__c||m,p)),_==null&&m!=null&&(_=m),4&p.__u?(c=re(p,c,e),f.__e&&(f.__e=null)):typeof p.type==`function`&&v!==void 0?c=v:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=_,c}function ne(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=S(null,o,null,null,null):v(o)?o=e.__k[a]=S(C,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=S(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=ie(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=T(s)),pe(s,s));return r}function re(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=re(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=T(e)),t=n.insertBefore(e.__e,t||null));do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function ie(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&!(2&l.__u);if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function ae(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||_.test(t)?n:n+`px`}function k(e,t,n,r,i){var a,o;n:if(t==`style`){if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||ae(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||ae(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(u,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n[l]=r[l]:(n[l]=d,e.addEventListener(t,a?p:f,a)):e.removeEventListener(t,a?p:f,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function oe(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n[c]==null)n[c]=d++;else if(n[c]<r[l])return;return r(t.event?t.event(n):n)}}}function se(e,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,_,x,S,E,D,ee,O,ne,re,ie,ae,k=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=n.__e=r.__e]),(d=t.__b)&&d(n);n:if(typeof k==`function`){f=s.length;try{if(E=n.props,D=k.prototype&&k.prototype.render,ee=(d=k.contextType)&&i[d.__c],O=d?ee?ee.props.value:d.__:i,r.__c?S=(p=n.__c=r.__c).__=p.__E:(D?n.__c=p=new k(E,O):(n.__c=p=new w(E,O),p.constructor=k,p.render=me),ee&&ee.sub(p),p.state||(p.state={}),p.__n=i,m=p.__d=!0,p.__h=[],p._sb=[]),D&&p.__s==null&&(p.__s=p.state),D&&k.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=y({},p.__s)),y(p.__s,k.getDerivedStateFromProps(E,p.__s))),h=p.props,_=p.state,p.__v=n,m)D&&k.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),D&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(D&&k.getDerivedStateFromProps==null&&E!==h&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(E,O),n.__v==r.__v||!p.__e&&p.shouldComponentUpdate!=null&&!1===p.shouldComponentUpdate(E,p.__s,O)){n.__v!=r.__v&&(p.props=E,p.state=p.__s,p.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),g.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p),c=T(r);break n}p.componentWillUpdate!=null&&p.componentWillUpdate(E,p.__s,O),D&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,_,x)})}if(p.context=O,p.props=E,p.__P=e,p.__e=!1,ne=t.__r,re=0,D)p.state=p.__s,p.__d=!1,ne&&ne(n),d=p.render(p.props,p.state,p.context),g.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,ne&&ne(n),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++re<25);p.state=p.__s,p.getChildContext!=null&&(i=y(y({},i),p.getChildContext())),D&&!m&&p.getSnapshotBeforeUpdate!=null&&(x=p.getSnapshotBeforeUpdate(h,_)),ie=d!=null&&d.type===C&&d.key==null?ue(d.props.children):d,c=te(e,v(ie)?ie:[ie],n,r,i,a,o,s,c,l,u),p.base=n.__e,n.__u&=-161,p.__h.length&&s.push(p),S&&(p.__E=p.__=null)}catch(e){if(s.length=f,n.__v=null,l||o!=null){if(e.then){for(n.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o!=null&&(o[o.indexOf(c)]=null),n.__e=c}else if(o!=null)for(ae=o.length;ae--;)b(o[ae])}else n.__e=r.__e;n.__k??=r.__k||[],e.then||ce(n),t.__e(e,n,r)}}else o==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=de(r.__e,n,r,i,a,o,s,l,u);return(d=t.diffed)&&d(n),128&n.__u?void 0:c}function ce(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(ce))}function le(e,n,r){for(var i=0;i<r.length;i++)fe(r[i],r[++i],r[++i]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){t.__e(e,n.__v)}})}function ue(e){return typeof e!=`object`||!e||e.__b>0?e:v(e)?e.map(ue):e.constructor===void 0?y({},e):null}function de(n,r,i,a,o,s,c,l,u){var d,f,p,m,g,_,y,x=i.props||h,S=r.props,C=r.type;if(C==`svg`?o=`http://www.w3.org/2000/svg`:C==`math`?o=`http://www.w3.org/1998/Math/MathML`:o||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((g=s[d])&&`setAttribute`in g==!!C&&(C?g.localName==C:g.nodeType==3)){n=g,s[d]=null;break}}if(n==null){if(C==null)return document.createTextNode(S);n=document.createElementNS(o,C,S.is&&S),l&&=(t.__m&&t.__m(r,s),!1),s=null}if(C==null)x===S||l&&n.data==S||(n.data=S);else{if(s=C==`textarea`&&S.defaultValue!=null?null:s&&e.call(n.childNodes),!l&&s!=null)for(x={},d=0;d<n.attributes.length;d++)x[(g=n.attributes[d]).name]=g.value;for(d in x)g=x[d],d==`dangerouslySetInnerHTML`?p=g:d==`children`||d in S||d==`value`&&`defaultValue`in S||d==`checked`&&`defaultChecked`in S||k(n,d,null,g,o);for(d in S)g=S[d],d==`children`?m=g:d==`dangerouslySetInnerHTML`?f=g:d==`value`?_=g:d==`checked`?y=g:l&&typeof g!=`function`||x[d]===g||k(n,d,g,x[d],o);if(f)l||p&&(f.__html==p.__html||f.__html==n.innerHTML)||(n.innerHTML=f.__html),r.__k=[];else if(p&&(n.innerHTML=``),te(r.type==`template`?n.content:n,v(m)?m:[m],r,i,a,C==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:i.__k&&T(i,0),l,u),s!=null)for(d=s.length;d--;)b(s[d]);l&&C!=`textarea`||(d=`value`,C==`progress`&&_==null?n.removeAttribute(`value`):_!=null&&(_!==n[d]||C==`progress`&&!_||C==`option`&&_!=x[d])&&k(n,d,_,x[d],o),d=`checked`,y!=null&&y!=n[d]&&k(n,d,y,x[d],o))}return n}function fe(e,n,r){try{if(typeof e==`function`){var i=typeof e.__u==`function`;i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(e){t.__e(e,r)}}function pe(e,n,r){var i,a;if(t.unmount&&t.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||fe(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){t.__e(e,n)}i.base=i.__P=i.__n=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&pe(i[a],n,r||typeof e.type!=`function`);r||b(e.__e),e.__c=e.__=e.__e=void 0}function me(e,t,n){return this.constructor(e,n)}function he(n,r,i){var a,o,s,c;r==document&&(r=document.documentElement),t.__&&t.__(n,r),o=(a=typeof i==`function`)?null:i&&i.__k||r.__k,s=[],c=[],se(r,n=(!a&&i||r).__k=x(C,null,[n]),o||h,h,r.namespaceURI,!a&&i?[i]:o?null:r.firstChild?e.call(r.childNodes):null,s,!a&&i?i:o?o.__e:r.firstChild,a,c),le(s,n,c),n.props.children=null}function ge(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,ee(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c=`__cC`+m++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}e=g.slice,t={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},n=0,w.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=y({},this.state);typeof e==`function`&&(e=e(y({},n),this.props)),e&&y(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),ee(this))},w.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ee(this))},w.prototype.render=C,r=[],a=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,o=function(e,t){return e.__v.__b-t.__v.__b},O.__r=0,s=Math.random().toString(8),c=`__d`+s,l=`__a`+s,u=/(PointerCapture)$|Capture$/i,d=0,f=oe(!1),p=oe(!0),m=0;var _e,A,ve,ye,be=0,xe=[],j=t,Se=j.__b,Ce=j.__r,we=j.diffed,Te=j.__c,Ee=j.unmount,De=j.__;function Oe(e,t){j.__h&&j.__h(A,e,be||t),be=0;var n=A.__H||(A.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function M(e){return be=1,ke(ze,e)}function ke(e,t,n){var r=Oe(_e++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ze(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=A,!A.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=!1,o=r.__c.props!==e;if(r.__c.__H.__.some(function(e){if(e.__N){i=!0;var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),a){var s=a.call(this,e,t,n);return i?s||o:s}return!i||o};A.__f=!0;var a=A.shouldComponentUpdate,o=A.componentWillUpdate;A.componentWillUpdate=function(e,t,n){if(this.__e){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},A.shouldComponentUpdate=i}return r.__N||r.__}function N(e,t){var n=Oe(_e++,3);!j.__s&&Re(n.__H,t)&&(n.__=e,n.u=t,A.__H.__h.push(n))}function Ae(e,t){var n=Oe(_e++,4);!j.__s&&Re(n.__H,t)&&(n.__=e,n.u=t,A.__h.push(n))}function je(e){return be=5,P(function(){return{current:e}},[])}function P(e,t){var n=Oe(_e++,7);return Re(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function F(e,t){return be=8,P(function(){return e},t)}function Me(e){var t=A.context[e.__c],n=Oe(_e++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(A)),t.props.value):e.__}function Ne(){for(var e;e=xe.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Ie),t.__h.some(Le),t.__h=[]}catch(n){t.__h=[],j.__e(n,e.__v)}}}j.__b=function(e){A=null,Se&&Se(e)},j.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),De&&De(e,t)},j.__r=function(e){Ce&&Ce(e),_e=0;var t=(A=e.__c).__H;t&&(ve===A?(t.__h=[],A.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Ie),t.__h.some(Le),t.__h=[],_e=0)),ve=A},j.diffed=function(e){we&&we(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(xe.push(t)!==1&&ye===j.requestAnimationFrame||((ye=j.requestAnimationFrame)||Fe)(Ne)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),ve=A=null},j.__c=function(e,t){t.some(function(e){try{e.__h.some(Ie),e.__h=e.__h.filter(function(e){return!e.__||Le(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],j.__e(n,e.__v)}}),Te&&Te(e,t)},j.unmount=function(e){Ee&&Ee(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Ie(e)}catch(e){t=e}}),n.__H=void 0,t&&j.__e(t,n.__v))};var Pe=typeof requestAnimationFrame==`function`;function Fe(e){var t,n=function(){clearTimeout(r),Pe&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);Pe&&(t=requestAnimationFrame(n))}function Ie(e){var t=A,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),A=t}function Le(e){var t=A;e.__c=e.__(),A=t}function Re(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function ze(e,t){return typeof t==`function`?t(e):t}var Be,Ve;function He(e){return!Ve||(typeof Ve==`string`?e.startsWith(Ve):Ve.test(e))}function Ue(e,t){let n=``;if(Be=void 0,t&&t.type===`click`){if(t.ctrlKey||t.metaKey||t.altKey||t.shiftKey||t.button!==0)return e;let r=t.composedPath().find(e=>e.nodeName==`A`&&e.href),i=r&&r.getAttribute(`href`);if(!r||r.origin!=location.origin||/^#/.test(i)||!/^(_?self)?$/i.test(r.target)||!He(i)||r.download)return e;Be=!0,t.preventDefault(),n=r.href.replace(location.origin,``)}else t&&t.url?(Be=!t.replace,n=t.url):n=location.pathname+location.search;return Be===!0?history.pushState(null,``,n):Be===!1&&history.replaceState(null,``,n),n}function We(e){let[t,n]=ke(Ue,e.url||location.pathname+location.search);e.scope&&(Ve=e.scope);let r=Be===!0,i=P(()=>{let e=new URL(t,location.origin),i=e.pathname.replace(/\/+$/g,``)||`/`;return{url:t,path:i,query:Object.fromEntries(e.searchParams),route:(e,t)=>n({url:e,replace:t}),back:()=>{history.back()},forward:()=>{history.forward()},wasPush:r}},[t]);return Ae(()=>(addEventListener(`click`,n),addEventListener(`popstate`,n),()=>{removeEventListener(`click`,n),removeEventListener(`popstate`,n)}),[]),x(We.ctx.Provider,{value:i},e.children)}Promise.resolve(),We.ctx=ge({}),ge({});var Ge=()=>Me(We.ctx),Ke=`modulepreload`,qe=function(e){return`/`+e},Je={},Ye=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=qe(t,n),t=s(t),t in Je)return;Je[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:Ke,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})};function Xe(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function Ze(e,t=`|`){return e.map(e=>mt(e)).join(t)}function Qe(e,t){return typeof t==`bigint`?t.toString():t}function $e(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function et(e){return e==null}function tt(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function nt(e,t){let n=e/t,r=Math.round(n),i=4*2**-52*Math.max(Math.abs(n),1);return Math.abs(n-r)<i?0:n-r}function I(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function rt(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function it(e){return JSON.stringify(e)}function at(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var ot=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function st(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var ct=$e(()=>{if(B.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function lt(e){if(st(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return st(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ut(e){return lt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var dt=new Set([`string`,`number`,`symbol`]);function ft(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function pt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function L(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function mt(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function ht(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var gt={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]};function _t(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return pt(e,rt(e._zod.def,{get shape(){let e={};for(let r of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,r))throw Error(`Unrecognized key: "${String(r)}"`);t[r]&&I(e,r,n.shape[r])}return I(this,`shape`,e),e},checks:[]}))}function vt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return pt(e,rt(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e of Reflect.ownKeys(t)){if(!Object.prototype.hasOwnProperty.call(n.shape,e))throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&delete r[e]}return I(this,`shape`,r),r},checks:[]}))}function yt(e,t){if(!lt(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return pt(e,rt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return I(this,`shape`,n),n}}))}function bt(e,t){if(!lt(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return pt(e,rt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return I(this,`shape`,n),n}}))}function xt(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return pt(e,rt(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return I(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function St(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);return pt(t,rt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(r,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t of Reflect.ownKeys(r))i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return I(this,`shape`,i),i},checks:[]}))}function Ct(e,t,n){return pt(t,rt(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t of Reflect.ownKeys(n)){if(!Object.prototype.hasOwnProperty.call(i,t))throw Error(`Unrecognized key: "${String(t)}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t of Reflect.ownKeys(r))i[t]=new e({type:`nonoptional`,innerType:r[t]});return I(this,`shape`,i),i}}))}function wt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function Tt(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function Et(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Dt(e){return typeof e==`string`?e:e?.message}function Ot(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function kt(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:Dt(e.inst?._zod.def?.error?.(e))??Dt(a?.(e))??Dt(t?.error?.(e))??Dt(n.customError?.(e))??Dt(n.localeError?.(e))??`Invalid input`,{inst:s,schema:c,continue:l,input:u,...d}=e;return d.path??=[],d.message=o,t?.reportInput&&(d.input=u),d}var At=/[\uD800-\uDBFF]/;function jt(e){let t=e.length;if(!At.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function Mt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Nt(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function Pt(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Ft(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Rt(e,n,r.value)}}function It(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Lt(e,t,n){return It(e,t,n,!1)}function Rt(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:It(this,t,n.bind(this))},set(e){It(this,t,e)}})}function zt(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Bt,Vt=!1,Ht={configurable:!0,get(){Vt=!0}};function R(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&Bt!==e._zod){Bt=void 0;return}Bt=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Ht);let e=Vt;Vt=!1;try{let r=n(this);return Vt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Vt||=e,r}catch(n){throw delete this[t],Vt||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function Ut(e,t,n,r){let i=zt(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var Wt=`~constantCatch`;function Gt(e){let t=()=>e;return t[Wt]=!0,t}var Kt,qt={value:void 0,enumerable:!1},Jt=`captureStackTrace`in Error?Error:null;function Yt(e){let t=Jt;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Jt=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function z(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){qt.value=new a(r);try{Object.defineProperty(n,"_zod",qt)}finally{qt.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),Ft(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?Yt(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Xt=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Zt=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Kt=globalThis).__zod_globalConfig??(Kt.__zod_globalConfig={});var B=globalThis.__zod_globalConfig;function Qt(e){return e&&Object.assign(B,e),B}function $t(){let e=this._zod;return e.message??=JSON.stringify(e.def,Qe,2),e.message}function en(e){this._zod.message=e}var tn={get:$t,set:en,enumerable:!0,configurable:!0},nn={value:void 0,enumerable:!1},rn={value:void 0,enumerable:!1},an=new WeakSet([Object.prototype,Error.prototype]),on=(e,t)=>{e.name=`$ZodError`,nn.value=e._zod,Object.defineProperty(e,"_zod",nn),rn.value=t,Object.defineProperty(e,"issues",rn),nn.value=void 0,rn.value=void 0,Object.defineProperty(e,"message",tn);let n=Object.getPrototypeOf(e);an.has(n)||(an.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},sn=z(`$ZodError`,on),cn=z(`$ZodError`,on,void 0,{Parent:Error});function ln(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function un(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?ln(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function dn(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function fn(e,t){return{callee:t?.callee??e,Err:t?.Err}}var pn=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Xt;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>kt(e,o,Qt())));throw ot(n,a?.callee??t),n}return s.value};return t},mn=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>kt(e,o,Qt())));throw ot(n,a?.callee??t),n}return s.value};return t},hn=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Xt;return a.issues.length?{success:!1,error:new(e??sn)(a.issues.map(e=>kt(e,i,Qt())))}:{success:!0,data:a.value}},gn=hn(cn),_n=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>kt(e,i,Qt())))}:{success:!0,data:a.value}},vn=_n(cn),yn=e=>{let t=pn(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,fn(n,a))};return n},bn=e=>{let t=pn(e),n=(e,r,i,a)=>t(e,r,i,fn(n,a));return n},xn=e=>{let t=mn(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,fn(n,a))};return n},Sn=e=>{let t=mn(e),n=async(e,r,i,a)=>await t(e,r,i,fn(n,a));return n},Cn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return hn(e)(t,n,i)},wn=e=>(t,n,r)=>hn(e)(t,n,r),Tn=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return _n(e)(t,n,i)},En=e=>async(t,n,r)=>_n(e)(t,n,r),Dn=/^[cC][0-9a-z]{6,}$/,On=/^[0-9a-z]+$/,kn=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,An=/^[0-9a-vA-V]{20}$/,jn=/^[A-Za-z0-9]{27}$/,Mn=/^[a-zA-Z0-9_-]{21}$/;function Nn(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Pn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Fn=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,In=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ln=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Rn=`^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function zn(){return new RegExp(Rn,`u`)}var Bn=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Vn=/^(([0-9a-fA-F]{1,4}:){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}|:))$/,Hn=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,Un=/^(([0-9a-fA-F]{1,4}:){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}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Wn=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Gn=/^[A-Za-z0-9_-]*$/,Kn=/^https?$/,qn=/^\+[1-9]\d{6,14}$/,Jn=`(?:(?:\\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])))`;function Yn(e){return RegExp(`^${e}$`)}var Xn=Yn(Jn);function Zn(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Qn(e){return RegExp(`^${Zn(e)}$`)}function $n(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Zn({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Zn({precision:e.precision})}`:n;return RegExp(`^${Jn}T(?:${r})$`)}var er=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},tr=/^-?\d+$/,nr=/^-?\d+(?:\.\d+)?$/,rr=/^(?:true|false)$/i,ir=/^[^A-Z]*$/,ar=/^[^a-z]*$/,V=z(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),or=e=>{let t=e.value;return!et(t)&&t.length!==void 0},sr={number:`number`,bigint:`bigint`,object:`date`},cr=z(`$ZodCheckLessThan`,(e,t)=>{V.init(e,t);let n=sr[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.maximum:n.exclusiveMaximum)??1/0;t.value<r&&(t.inclusive?n.maximum=t.value:n.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:sr[typeof r.value]??n,code:`too_big`,maximum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),lr=z(`$ZodCheckGreaterThan`,(e,t)=>{V.init(e,t);let n=sr[typeof t.value];e._zod.onattach.push(e=>{let n=e._zod.bag,r=(t.inclusive?n.minimum:n.exclusiveMinimum)??-1/0;t.value>r&&(t.inclusive?n.minimum=t.value:n.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:sr[typeof r.value]??n,code:`too_small`,minimum:typeof t.value==`object`?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),ur=z(`$ZodCheckMultipleOf`,(e,t)=>{V.init(e,t),e._zod.onattach.push(e=>{var n;(n=e._zod.bag).multipleOf??(n.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw Error(`Cannot mix number and bigint in multiple_of check.`);(typeof n.value==`bigint`?t.value!==BigInt(0)&&n.value%t.value===BigInt(0):nt(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:`not_multiple_of`,divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),dr=z(`$ZodCheckNumberFormat`,(e,t)=>{V.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=gt[t.format];e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,r.minimum=i,r.maximum=a,n&&(r.pattern=tr)}),e._zod.check=o=>{let s=o.value;if(n){if(!Number.isInteger(s)){o.issues.push({expected:r,format:t.format,code:`invalid_type`,continue:!1,input:s,inst:e});return}if(!Number.isSafeInteger(s)){s>0?o.issues.push({input:s,code:`too_big`,maximum:2**53-1,note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort}):o.issues.push({input:s,code:`too_small`,minimum:-(2**53-1),note:`Integers must be within the safe integer range.`,inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}s<i&&o.issues.push({origin:`number`,input:s,code:`too_small`,minimum:i,inclusive:!0,inst:e,continue:!t.abort}),s>a&&o.issues.push({origin:`number`,input:s,code:`too_big`,maximum:a,inclusive:!0,inst:e,continue:!t.abort})}}),fr=z(`$ZodCheckMaxLength`,(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=or),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?jt(r):i)<=t.maximum)return;let a=Mt(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),pr=z(`$ZodCheckMinLength`,(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=or),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?jt(r):i)>=t.minimum)return;let a=Mt(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),mr=z(`$ZodCheckLengthEquals`,(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=or),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?jt(r):i;if(a===t.length)return;let o=Mt(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),hr=z(`$ZodCheckStringFormat`,(e,t)=>{var n,r;V.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),gr=z(`$ZodCheckRegex`,(e,t)=>{hr.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),_r=z(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=ir,hr.init(e,t)}),vr=z(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=ar,hr.init(e,t)}),yr=z(`$ZodCheckIncludes`,(e,t)=>{V.init(e,t);let n=ft(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),br=z(`$ZodCheckStartsWith`,(e,t)=>{V.init(e,t);let n=RegExp(`^${ft(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),xr=z(`$ZodCheckEndsWith`,(e,t)=>{V.init(e,t);let n=RegExp(`.*${ft(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Sr=z(`$ZodCheckOverwrite`,(e,t)=>{V.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Cr=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
2
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
3
|
-
`)}\n};`)(...Object.values(this.closed))}},wr={major:4,minor:5,patch:4},H=z(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=wr;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=wt(t),a;for(let o of n){if(o._zod.def.when){if(Tt(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Xt;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Ot(t.issues,n,e),i||=wt(t,n))});else{if(t.issues.length===n)continue;Ot(t.issues,n,e),i||=wt(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(wt(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Xt;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Xt;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Lt(this,`~standard`,Er(this))},set"~standard"(e){It(this,`~standard`,e)}}),Tr=e=>e.success?{value:e.data}:{issues:e.error?.issues};function Er(e){return{validate:t=>{try{return Tr(gn(e,t))}catch{return vn(e,t).then(Tr)}},vendor:`zod`,version:1}}var Dr=z(`$ZodString`,(e,t)=>{H.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??er(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),U=z(`$ZodStringFormat`,(e,t)=>{hr.init(e,t),Dr.init(e,t)}),Or=z(`$ZodGUID`,(e,t)=>{t.pattern??=Fn,U.init(e,t)}),kr=z(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=In(e)}else t.pattern??=In();U.init(e,t)}),Ar=z(`$ZodEmail`,(e,t)=>{t.pattern??=Ln,U.init(e,t)});function jr(e,t){if(!t.normalize&&t.protocol?.source===Kn.source&&!/^https?:\/\//i.test(e))return 1;try{return new URL(e)}catch{return 2}}var Mr=/[\t\n\r]/g;function Nr(e){return e.replace(Mr,``)}function Pr(e,t){return t.lastIndex=0,t.test(e.hostname)}function Fr(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Ir=z(`$ZodURL`,(e,t)=>{U.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=jr(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!Pr(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!Fr(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:Nr(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Lr=z(`$ZodEmoji`,(e,t)=>{t.pattern??=zn(),U.init(e,t)}),Rr=z(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?Mn:Nn(t.length),U.init(e,t)}),zr=z(`$ZodCUID`,(e,t)=>{t.pattern??=Dn,U.init(e,t)}),Br=z(`$ZodCUID2`,(e,t)=>{t.pattern??=On,U.init(e,t)}),Vr=z(`$ZodULID`,(e,t)=>{t.pattern??=kn,U.init(e,t)}),Hr=z(`$ZodXID`,(e,t)=>{t.pattern??=An,U.init(e,t)}),Ur=z(`$ZodKSUID`,(e,t)=>{t.pattern??=jn,U.init(e,t)}),Wr=z(`$ZodISODateTime`,(e,t)=>{t.pattern??=$n(t),U.init(e,t),(t.local||t.precision===-1)&&(e._zod.bag.laxFormat=!0,e._zod.onattach.push(e=>{e._zod.bag.laxFormat=!0}))}),Gr=z(`$ZodISODate`,(e,t)=>{t.pattern??=Xn,U.init(e,t)}),Kr=z(`$ZodISOTime`,(e,t)=>{t.pattern??=Qn(t),U.init(e,t)}),qr=z(`$ZodISODuration`,(e,t)=>{t.pattern??=Pn,U.init(e,t)}),Jr=z(`$ZodIPv4`,(e,t)=>{t.pattern??=Bn,U.init(e,t),e._zod.bag.format=`ipv4`}),Yr=/^[0-9a-fA-F:.]+$/;function Xr(e){if(!Yr.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var Zr=z(`$ZodIPv6`,(e,t)=>{t.pattern??=Vn,U.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{Xr(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),Qr=z(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Hn,U.init(e,t)});function $r(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:Xr(n)}var ei=z(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Un,U.init(e,t),e._zod.check=n=>{$r(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function ti(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var ni=z(`$ZodBase64`,(e,t)=>{t.pattern??=Wn,U.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{ti(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function ri(e){if(!Gn.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return ti(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var ii=z(`$ZodBase64URL`,(e,t)=>{t.pattern??=Gn,U.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{ri(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),ai=z(`$ZodE164`,(e,t)=>{t.pattern??=qn,U.init(e,t)});function oi(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var si=z(`$ZodJWT`,(e,t)=>{U.init(e,t),e._zod.check=n=>{oi(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),ci=z(`$ZodNumber`,(e,t)=>{H.init(e,t),e._zod.pattern=e._zod.bag.pattern??nr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=Number(n.value)}catch{}let i=n.value;if(typeof i==`number`&&!Number.isNaN(i)&&Number.isFinite(i))return n;let a=typeof i==`number`?Number.isNaN(i)?`NaN`:Number.isFinite(i)?void 0:String(i):void 0;return n.issues.push({expected:`number`,code:`invalid_type`,input:i,inst:e,...a?{received:a}:{}}),n}}),li=z(`$ZodNumberFormat`,(e,t)=>{dr.init(e,t),ci.init(e,t)}),ui=z(`$ZodBoolean`,(e,t)=>{H.init(e,t),e._zod.pattern=rr,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=!!n.value}catch{}let i=n.value;return typeof i==`boolean`||n.issues.push({expected:`boolean`,code:`invalid_type`,input:i,inst:e}),n}}),di=z(`$ZodUnknown`,(e,t)=>{H.init(e,t),e._zod.parse=e=>e}),fi=z(`$ZodNever`,(e,t)=>{H.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function pi(e,t,n){e.issues.length&&t.issues.push(...Et(n,e.issues)),t.value[n]=e.value}var mi=z(`$ZodArray`,(e,t)=>{H.init(e,t);let n=B.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[];for(let e=0;e<a.length;e++){let n=a[e],s=t.element._zod.run({value:n,issues:[]},i);s instanceof Promise?o.push(s.then(t=>pi(t,r,e))):pi(s,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function hi(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(!(!o&&s&&i===`optional`)){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...Et(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}}var gi=[];function _i(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:gi,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=ht(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function vi(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin,d=c.optout;for(let i in t){if(s.has(i))continue;if(i===`__proto__`){l===`never`&&o.push(i);continue}if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>hi(e,n,i,t,u,d))):hi(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var yi=new WeakMap,bi=z(`$ZodObject`,(e,t)=>{if(H.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;yi.set(t,e),Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),yi.set(t,n),n}})}let n=$e(()=>_i(t));R(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||I(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let r=st,i=t.catchall,a,o=B.memoizer;o?.attach(e),e._zod.parse=(t,s)=>{a??=n.value;let c=t.value;if(!r(c))return t.issues.push({expected:`object`,code:`invalid_type`,input:c,inst:e}),t;t.value=o?o.alloc(e,t,{},s):{};let l=[],u=a.shape;for(let e of a.allKeys){if(e===`__proto__`)continue;let n=u[e],r=n._zod.optin,i=n._zod.optout,a=n._zod.run({value:c[e],issues:[]},s);a instanceof Promise?l.push(a.then(n=>hi(n,t,e,c,r,i))):hi(a,t,e,c,r,i)}return i?vi(l,c,t,s,n.value,e):l.length?Promise.all(l).then(()=>t):t}}),xi=z(`$ZodObjectJIT`,(e,t)=>{bi.init(e,t);let n=e._zod.parse,r=$e(()=>_i(t)),i=B.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Cr([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
4
|
-
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
5
|
-
const iss = ${e}.issues[i];
|
|
6
|
-
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
7
|
-
payload.issues.push(iss);
|
|
8
|
-
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:it(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
9
|
-
const ${n}_present = ${i};
|
|
10
|
-
if (!${n}.issues.length || ${n}_present) {
|
|
11
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
if (${e}) {
|
|
15
|
-
newResult[${r}] = ${n}.value;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
`)}else f?o.write(`
|
|
20
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
if (${n}.value === undefined) {
|
|
24
|
-
if (${i}) {
|
|
25
|
-
newResult[${r}] = undefined;
|
|
26
|
-
}
|
|
27
|
-
} else {
|
|
28
|
-
newResult[${r}] = ${n}.value;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
`):o.write(`
|
|
32
|
-
const ${n}_present = ${i};
|
|
33
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
34
|
-
}
|
|
35
|
-
if (!${n}_present && !${n}.issues.length) {
|
|
36
|
-
payload.issues.push({
|
|
37
|
-
code: "invalid_type",
|
|
38
|
-
expected: "nonoptional",
|
|
39
|
-
input: undefined,
|
|
40
|
-
path: [${r}]
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (${n}_present) {
|
|
45
|
-
newResult[${r}] = ${n}.value;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=st,c=!B.jitless,l=c&&ct.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?vi([],p,i,f,d,e):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Si(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!wt(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>kt(e,r,Qt())))}),t)}var Ci=z(`$ZodUnion`,(e,t)=>{H.init(e,t),R(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),R(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),R(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),R(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>tt(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Si(t,r,e,i)):Si(o,r,e,i)}}),wi=z(`$ZodIntersection`,(e,t)=>{H.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Ei(e,t,n)):Ei(e,i,a)}});function Ti(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(lt(e)&<(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=Ti(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Ti(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Ei(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=Ti(t.value,n.value);if(!c.valid){if(wt(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Di=z(`$ZodRecord`,(e,t)=>{H.init(e,t);let n=B.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!lt(a))return r.issues.push({expected:`record`,code:`invalid_type`,input:a,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s&&!t.partial){r.value=n?n.alloc(e,r,{},i):{};let c=new Set;for(let n of s)if(typeof n==`string`||typeof n==`number`||typeof n==`symbol`){if(c.add(typeof n==`number`?n.toString():n),n===`__proto__`)continue;let s=t.keyType._zod.run({value:n,issues:[]},i);if(s instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(s.issues.length){r.issues.push({code:`invalid_key`,origin:`record`,issues:s.issues.map(e=>kt(e,i,Qt())),input:n,path:[n],inst:e});continue}let l=s.value;if(l===`__proto__`)continue;let u=t.valueType._zod.run({value:a[n],issues:[]},i);u instanceof Promise?o.push(u.then(e=>{e.issues.length&&r.issues.push(...Et(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Et(n,u.issues)),r.value[l]=u.value)}let l;for(let e in a)if(!c.has(e)){if(t.mode===`loose`){if(e===`__proto__`)continue;r.value[e]=a[e]}else l??=[],l.push(e)}l&&l.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:l,continue:!0})}else{r.value=n?n.alloc(e,r,{},i):{};let c;for(let n of Reflect.ownKeys(a)){if(n===`__proto__`||!Object.prototype.propertyIsEnumerable.call(a,n))continue;let l=t.keyType._zod.run({value:n,issues:[]},i);if(l instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);if(typeof n==`string`&&nr.test(n)&&l.issues.length){let e=t.keyType._zod.run({value:Number(n),issues:[]},i);if(e instanceof Promise)throw Error(`Async schemas not supported in object keys currently`);e.issues.length===0&&(l=e)}if(l.issues.length){t.mode===`loose`?r.value[n]=a[n]:s?(c??=[],c.push(n)):r.issues.push({code:`invalid_key`,origin:`record`,issues:l.issues.map(e=>kt(e,i,Qt())),input:n,path:[n],inst:e});continue}let u=l.value;if(u===`__proto__`)continue;let d=t.valueType._zod.run({value:a[n],issues:[]},i);d instanceof Promise?o.push(d.then(e=>{e.issues.length&&r.issues.push(...Et(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Et(n,d.issues)),r.value[u]=d.value)}c&&c.length>0&&r.issues.push({code:`unrecognized_keys`,input:a,inst:e,keys:c,continue:!0})}return o.length?Promise.all(o).then(()=>r):r}}),Oi=z(`$ZodEnum`,(e,t)=>{H.init(e,t);let n=Xe(t.entries),r=new Set(n);e._zod.values=r;let i=n.filter(e=>dt.has(typeof e));e._zod.pattern=RegExp(i.length?`^(${i.map(e=>ft(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),ki=z(`$ZodTransform`,(e,t)=>{H.init(e,t),e._zod.optin=`optional`,B.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Zt(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Xt;return n.value=i,n}});function Ai(e,t){return e.value=t.issues.length?void 0:t.value,e}var ji=z(`$ZodOptional`,(e,t)=>{H.init(e,t),R(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,R(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),R(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${tt(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>Ai(e,t)):Ai(e,r)}return t.innerType._zod.run(e,n)}}),Mi=z(`$ZodExactOptional`,(e,t)=>{ji.init(e,t),R(e,`values`,e=>e.def.innerType._zod.values),R(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Ni=z(`$ZodNullable`,(e,t)=>{H.init(e,t),R(e,`optin`,e=>e.def.innerType._zod.optin),R(e,`optout`,e=>e.def.innerType._zod.optout),R(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${tt(t.source)}|null)$`):void 0}),R(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),Pi=z(`$ZodDefault`,(e,t)=>{H.init(e,t),e._zod.optin=`defaulted`,R(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>Fi(e,t)):Fi(r,t)}});function Fi(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var Ii=z(`$ZodPrefault`,(e,t)=>{H.init(e,t),e._zod.optin=`defaulted`,R(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),Li=z(`$ZodNonOptional`,(e,t)=>{H.init(e,t),R(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>Ri(t,e)):Ri(i,e)}});function Ri(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function zi(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>kt(e,r,Qt()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var Bi=z(`$ZodCatch`,(e,t)=>{H.init(e,t),R(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),R(e,`optout`,e=>e.def.innerType._zod.optout),R(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>zi(e,r,t,n)):zi(e,r,t,n)}}),Vi=z(`$ZodPipe`,(e,t)=>{H.init(e,t),R(e,`values`,e=>e.def.in._zod.values),R(e,`optin`,e=>e.def.in._zod.optin),R(e,`optout`,e=>e.def.out._zod.optout),R(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>Hi(e,t.in,n)):Hi(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>Hi(e,t.out,n)):Hi(r,t.out,n)}});function Hi(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var Ui=z(`$ZodReadonly`,(e,t)=>{H.init(e,t),R(e,`propValues`,e=>e.def.innerType._zod.propValues),R(e,`values`,e=>e.def.innerType._zod.values),R(e,`optin`,e=>e.def.innerType?._zod?.optin),R(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(Wi):Wi(r)}});function Wi(e){return e.memo||(e.value=Object.freeze(e.value)),e}var Gi=z(`$ZodCustom`,(e,t)=>{V.init(e,t),H.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>Ki(t,n,r,e));Ki(i,n,r,e)}});function Ki(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(Pt(e))}}var qi=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},Ji=`~memo`,Yi=[];function Xi(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var Zi=new WeakMap;function Qi(e,t){let n=Zi.get(e);if(n!==void 0)return n;if(t.has(e))return!0;t.add(e);let r=!1,i=e=>{!r&&e?._zod&&Qi(e,t)&&(r=!0)},a=e._zod.def;switch(a.type){case`object`:for(let e of Reflect.ownKeys(a.shape))i(a.shape[e]);i(a.catchall);break;case`array`:i(a.element);break;case`tuple`:for(let e of a.items)i(e);i(a.rest);break;case`record`:case`map`:i(a.keyType),i(a.valueType);break;case`set`:i(a.valueType);break;case`union`:for(let e of a.options)i(e);break;case`intersection`:i(a.left),i(a.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:i(a.innerType);break;case`pipe`:i(a.in),i(a.out);break;case`function`:i(a.input),i(a.output);break;case`lazy`:i(e._zod.innerType);break;case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in a){let t=Object.getOwnPropertyDescriptor(a,e);if(!t||t.get)continue;let n=t.value;if(!(!n||typeof n!=`object`)){if(n._zod)i(n);else if(Array.isArray(n))for(let e of n)i(e)}}}return t.delete(e),Zi.set(e,r),r}function $i(e,t){let n=e.buckets.get(t);return n||(n=new Map,e.buckets.set(t,n)),n}var ea,ta=[],na={alloc(e,t,n){let r=ea;if(!r)return n;ea=void 0;let i={value:n,issues:null};return r.set(t.value,i),ta.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&ia(n,e.value))throw new qi;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r,i;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,a=(o,s)=>{if(n===void 0&&(n=Qi(e,new Set),!n))return e._zod.parse=t,e._zod.run===a&&(e._zod.run=t),t(o,s);let c=o.value;if(typeof c!=`object`||!c)return t(o,s);let l=s[Ji];l||(l={buckets:new Map,backEdges:void 0},s[Ji]=l);let u;r===s?u=i:(u=$i(l,e),r=s,i=u);let d=u.get(c);if(d)return o.value=d.value,d.issues?d.issues.length&&o.issues.push(...Xi(d.issues)):(o.memo=!0,l.backEdges??(l.backEdges=new Set),l.backEdges.add(d.value)),o;ea=u;let f=ta.length,p=t(o,s);ea=void 0;let m=ta.length>f?ta.pop():void 0;return p instanceof Promise?p.then(e=>(m&&(m.issues=e.issues.length?Xi(e.issues):Yi),e)):(m&&(m.issues=p.issues.length?Xi(p.issues):Yi),p)};e._zod.parse=a,e._zod.run===t&&(e._zod.run=a)})}};function ra(){return na}function ia(e,t){let n=e[Ji]?.backEdges;return n!==void 0&&typeof t==`object`&&!!t&&n.has(t)}var aa=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,credit_card:`credit card number`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(Nt(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${mt(e.values[0])}`:`Invalid option: expected one of ${Ze(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${Ze(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function oa(){return{localeError:aa()}}var sa,ca=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function la(){return new ca}(sa=globalThis).__zod_globalRegistry??(sa.__zod_globalRegistry=la());var ua=globalThis.__zod_globalRegistry;function da(e,t){return new e({type:`string`,...L(t)})}function fa(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...L(t)})}function pa(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...L(t)})}function ma(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...L(t)})}function ha(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...L(t)})}function ga(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...L(t)})}function _a(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...L(t)})}function va(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...L(t)})}function ya(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...L(t)})}function ba(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...L(t)})}function xa(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...L(t)})}function Sa(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...L(t)})}function Ca(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...L(t)})}function wa(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...L(t)})}function Ta(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...L(t)})}function Ea(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...L(t)})}function Da(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...L(t)})}function Oa(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...L(t)})}function ka(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...L(t)})}function Aa(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...L(t)})}function ja(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...L(t)})}function Ma(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...L(t)})}function Na(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...L(t)})}function Pa(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...L(t)})}function Fa(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...L(t)})}function Ia(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...L(t)})}function La(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...L(t)})}function Ra(e,t){return new e({type:`number`,checks:[],...L(t)})}function za(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...L(t)})}function Ba(e,t){return new e({type:`boolean`,...L(t)})}function Va(e){return new e({type:`unknown`})}function Ha(e,t){return new e({type:`never`,...L(t)})}function Ua(e,t){return new cr({check:`less_than`,...L(t),value:e,inclusive:!1})}function Wa(e,t){return new cr({check:`less_than`,...L(t),value:e,inclusive:!0})}function Ga(e,t){return new lr({check:`greater_than`,...L(t),value:e,inclusive:!1})}function Ka(e,t){return new lr({check:`greater_than`,...L(t),value:e,inclusive:!0})}function qa(e,t){return new ur({check:`multiple_of`,...L(t),value:e})}function Ja(e,t){return new fr({check:`max_length`,...L(t),maximum:e})}function Ya(e,t){return new pr({check:`min_length`,...L(t),minimum:e})}function Xa(e,t){return new mr({check:`length_equals`,...L(t),length:e})}function Za(e,t){return new gr({check:`string_format`,format:`regex`,...L(t),pattern:e})}function Qa(e){return new _r({check:`string_format`,format:`lowercase`,...L(e)})}function $a(e){return new vr({check:`string_format`,format:`uppercase`,...L(e)})}function eo(e,t){return new yr({check:`string_format`,format:`includes`,...L(t),includes:e})}function to(e,t){return new br({check:`string_format`,format:`starts_with`,...L(t),prefix:e})}function no(e,t){return new xr({check:`string_format`,format:`ends_with`,...L(t),suffix:e})}function ro(e){return new Sr({check:`overwrite`,tx:e})}function io(e){return ro(t=>t.normalize(e))}function ao(){return ro(e=>e.trim())}function oo(){return ro(e=>e.toLowerCase())}function so(){return ro(e=>e.toUpperCase())}function co(){return ro(e=>at(e))}function lo(e,t,n){return new e({type:`array`,element:t,...L(n)})}function uo(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...L(n)})}function fo(e,t){let n=po(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Pt(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(Pt(r))}},e(t.value,t)),t);return n}function po(e,t){let n=new V({check:`custom`,...L(t)});return n._zod.check=e,n}function mo(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&I(e,t,n[t]);return e}function ho(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??ua,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function go(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function W(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,W(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&mo(o.schema,c),t.io===`input`&&G(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function _o(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function vo(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${_o(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+_o(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
49
|
-
|
|
50
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}e.external&&(e.sharedDefsExtractedFor=e.external)}function yo(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;yo(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var bo=new Set([`type`,`properties`,`required`,`additionalProperties`]),xo=[`oneOf`,`anyOf`];function So(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Co(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!bo.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??So(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}I(n,r,e.length===1?e[0]:Co(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=So(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function wo(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of bo)if(t in e)return;let n=t.filter(e=>xo.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Co(t);else{let e=n[0],i=xo.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Co([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,mo(e,r))}function To(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):mo(i,s),mo(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())yo(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])wo(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}mo(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,I(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:Do(t,`input`,e.processors),output:Do(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function G(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return G(r.element,n);if(r.type===`set`)return G(r.valueType,n);if(r.type===`lazy`)return G(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return G(r.innerType,n);if(r.type===`intersection`)return G(r.left,n)||G(r.right,n);if(r.type===`record`||r.type===`map`)return G(r.keyType,n)||G(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:G(r.in,n)||G(r.out,n);if(r.type===`object`){for(let e in r.shape)if(G(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(G(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(G(e,n))return!0;return!!(r.rest&&G(r.rest,n))}return!1}var Eo=(e,t={})=>n=>{let r=ho({...n,processors:t});return W(e,r),vo(r,e),To(r,e)},Do=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=ho({...i??{},target:a,io:t,processors:n});return W(e,o),vo(o,e),To(o,e)},Oo={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ko=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=Oo[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},Ao=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,format:s,multipleOf:c,exclusiveMaximum:l,exclusiveMinimum:u}=e._zod.bag;i.type=typeof s==`string`&&s.includes(`int`)?`integer`:`number`;let d=typeof u==`number`&&u>=(a??-1/0),f=typeof l==`number`&&l<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;d?p?(i.minimum=u,i.exclusiveMinimum=!0):i.exclusiveMinimum=u:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=l,i.exclusiveMaximum=!0):i.exclusiveMaximum=l:typeof o==`number`&&(i.maximum=o),typeof c==`number`&&(Number.isFinite(c)&&c!==0?i.multipleOf=Math.abs(c):go(e,t,i,r,`A multipleOf divisor of ${c} cannot be represented in JSON Schema`))},jo=(e,t,n,r)=>{n.type=`boolean`},Mo=(e,t,n,r)=>{n.not={}},No=(e,t,n,r)=>{let i=e._zod.def,a=Xe(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},Po=(e,t,n,r)=>{go(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},Fo=(e,t,n,r)=>{go(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},Io=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=W(a.element,t,{...r,path:[...r.path,`items`]})};function Lo(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?Lo(t.out):t.type===`catch`?Lo(t.innerType):e._zod.optin}var Ro=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&go(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)I(i.properties,e,W(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e];return t.io===`input`?Lo(n)===void 0:n._zod.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=W(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},zo=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>W(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Bo=(e,t,n,r)=>{let i=e._zod.def,a=W(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=W(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)};function Vo(e,t,n){if(t.$ref){if(n.has(t))return t;n.add(t);let r=e.get(t)?.def;if(!r)return t;let i=Vo(e,r,n);return i===r?t:i}for(let r of[`anyOf`,`oneOf`]){let i=t[r];if(!Array.isArray(i))continue;let a=i.map(t=>Vo(e,t,n));a.some((e,t)=>e!==i[t])&&(t={...t,[r]:a})}let r=Array.isArray(t.type)?t.type:[t.type],i=!r.includes(`string`)&&r.some(e=>e===`number`||e===`integer`),a=t.enum??(t.const===void 0?void 0:[t.const]);if(!i&&!a?.some(e=>typeof e==`number`))return t;let{minimum:o,maximum:s,exclusiveMinimum:c,exclusiveMaximum:l,multipleOf:u,format:d,id:f,...p}=t;return p.enum?p.enum=p.enum.map(e=>typeof e==`number`?String(e):e):typeof p.const==`number`&&(p.const=String(p.const)),i?(p.type=`string`,a||(p.pattern=(r.includes(`number`)?nr:tr).source),p):p}var Ho=new WeakMap;function Uo(e){let t=new Map;for(let n of e.seen.values())n.def&&!t.has(n.schema)&&t.set(n.schema,n);let n=new Map;for(let r of Ho.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Vo(t,a,new Set);o!==a&&n.set(a,o)}if(n.size)for(let t of e.seen.values())for(let e of[t.schema,t.def]){let t=e&&n.get(e.propertyNames);t&&(e.propertyNames=t)}}var Wo=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=o._zod.bag?.patterns;if(a.mode===`loose`&&s&&s.size>0){let e=W(a.valueType,t,{...r,path:[...r.path,`patternProperties`,`*`]});i.patternProperties={};for(let t of s)I(i.patternProperties,t.source,e)}else{if(t.target===`draft-07`||t.target===`draft-2020-12`){i.propertyNames=W(a.keyType,t,{...r,path:[...r.path,`propertyNames`]});let n=Ho.get(t);n||(n=[],Ho.set(t,n),t.deferred.push(()=>Uo(t))),n.push(e)}i.additionalProperties=W(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&Lo(a.valueType)!==void 0;if(c&&!a.partial&&!l){let e=[...c].filter(e=>typeof e==`string`||typeof e==`number`);e.length>0&&(i.required=e.map(String))}},Go=(e,t,n,r)=>{let i=e._zod.def,a=W(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Ko=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},qo=Symbol();function Jo(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(go(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),qo):JSON.parse(o)}var Yo=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=Jo(i.defaultValue,e,t,n,r);o!==qo&&(n.default=o)},Xo=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=Jo(i.defaultValue,e,t,n,r);o!==qo&&(n._prefault=o)},Zo=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{go(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Qo=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;W(o,t,r);let s=t.seen.get(e);s.ref=o},$o=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},es=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},ts=new WeakSet([Object.prototype,Error.prototype]);function ns(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var K=z(`ZodError`,(e,t)=>{sn.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);ts.has(n)||(ts.add(n),ns(n,`format`,e=>t=>dn(e,t)),ns(n,`flatten`,e=>t=>un(e,t)),ns(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Qe,2)}),ns(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Qe,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),rs=pn(K),is=mn(K),as=hn(K),os=_n(K),ss=yn(K),cs=bn(K),ls=xn(K),us=Sn(K),ds=Cn(K),fs=wn(K),ps=Tn(K),ms=En(K);function hs(){B.localeError||Qt(oa())}function gs(){B.memoizer||Qt({memoizer:ra()})}var q=z(`ZodType`,(e,t)=>(hs(),H.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(rt(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return pt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Oc(e,t))},superRefine(e,t){return this.check(kc(e,t))},overwrite(e){return this.check(ro(e))},optional(){return uc(this)},exactOptional(){return fc(this)},nullable(){return mc(this)},nullish(){return uc(mc(this))},nonoptional(e){return bc(this,e)},array(){return Q(this)},or(e){return ec([this,e])},and(e){return nc(this,e)},transform(e){return wc(this,cc(e))},default(e){return gc(this,e)},prefault(e){return vc(this,e)},catch(e){return Sc(this,e)},pipe(e){return wc(this,e)},readonly(){return Ec(this)},describe(e){let t=this.clone();return ua.add(t,{description:e}),t},meta(...e){if(e.length===0)return ua.get(this);let t=this.clone();return ua.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return Lt(this,`~standard`,{...Er(this),jsonSchema:{input:Do(this,`input`),output:Do(this,`output`)}})},set"~standard"(e){It(this,`~standard`,e)},parse:function e(t,n){return rs(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await is(this,t,n,{callee:e})},safeParse(e,t){return as(this,e,t)},async safeParseAsync(e,t){return os(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){It(this,`spa`,e)},encode:function e(t,n){return ss(this,t,n,{callee:e})},decode:function e(t,n){return cs(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await ls(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await us(this,t,n,{callee:e})},safeEncode(e,t){return ds(this,e,t)},safeDecode(e,t){return fs(this,e,t)},async safeEncodeAsync(e,t){return ps(this,e,t)},async safeDecodeAsync(e,t){return ms(this,e,t)},toJSONSchema(e){return Eo(this,{})(e)},get description(){return ua.get(this)?.description},get _def(){return this._zod.def}}),_s=z(`_ZodString`,(e,t)=>{Dr.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ko(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null},{regex(...e){return this.check(Za(...e))},includes(...e){return this.check(eo(...e))},startsWith(...e){return this.check(to(...e))},endsWith(...e){return this.check(no(...e))},min(...e){return this.check(Ya(...e))},max(...e){return this.check(Ja(...e))},length(...e){return this.check(Xa(...e))},nonempty(...e){return this.check(Ya(1,...e))},lowercase(e){return this.check(Qa(e))},uppercase(e){return this.check($a(e))},trim(){return this.check(ao())},normalize(...e){return this.check(io(...e))},toLowerCase(){return this.check(oo())},toUpperCase(){return this.check(so())},slugify(){return this.check(co())}}),vs=z(`ZodString`,(e,t)=>{Dr.init(e,t),_s.init(e,t)},{email(e){return this.check(fa(Cs,e))},url(e){return this.check(va(Es,e))},jwt(e){return this.check(Na(Vs,e))},emoji(e){return this.check(ya(Ds,e))},guid(e){return this.check(pa(ws,e))},uuid(e){return this.check(ma(Ts,e))},uuidv4(e){return this.check(ha(Ts,e))},uuidv6(e){return this.check(ga(Ts,e))},uuidv7(e){return this.check(_a(Ts,e))},nanoid(e){return this.check(ba(Os,e))},cuid(e){return this.check(xa(ks,e))},cuid2(e){return this.check(Sa(As,e))},ulid(e){return this.check(Ca(js,e))},base64(e){return this.check(Aa(Rs,e))},base64url(e){return this.check(ja(zs,e))},xid(e){return this.check(wa(Ms,e))},ksuid(e){return this.check(Ta(Ns,e))},ipv4(e){return this.check(Ea(Ps,e))},ipv6(e){return this.check(Da(Fs,e))},cidrv4(e){return this.check(Oa(Is,e))},cidrv6(e){return this.check(ka(Ls,e))},e164(e){return this.check(Ma(Bs,e))},datetime(e){return this.check(Pa(ys,e))},date(e){return this.check(Fa(bs,e))},time(e){return this.check(Ia(xs,e))},duration(e){return this.check(La(Ss,e))}});function J(e){return da(vs,e)}var Y=z(`ZodStringFormat`,(e,t)=>{U.init(e,t),_s.init(e,t)}),ys=z(`ZodISODateTime`,(e,t)=>{Wr.init(e,t),Y.init(e,t)}),bs=z(`ZodISODate`,(e,t)=>{Gr.init(e,t),Y.init(e,t)}),xs=z(`ZodISOTime`,(e,t)=>{Kr.init(e,t),Y.init(e,t)}),Ss=z(`ZodISODuration`,(e,t)=>{qr.init(e,t),Y.init(e,t)}),Cs=z(`ZodEmail`,(e,t)=>{Ar.init(e,t),Y.init(e,t)}),ws=z(`ZodGUID`,(e,t)=>{Or.init(e,t),Y.init(e,t)}),Ts=z(`ZodUUID`,(e,t)=>{kr.init(e,t),Y.init(e,t)}),Es=z(`ZodURL`,(e,t)=>{Ir.init(e,t),Y.init(e,t)}),Ds=z(`ZodEmoji`,(e,t)=>{Lr.init(e,t),Y.init(e,t)}),Os=z(`ZodNanoID`,(e,t)=>{Rr.init(e,t),Y.init(e,t)}),ks=z(`ZodCUID`,(e,t)=>{zr.init(e,t),Y.init(e,t)}),As=z(`ZodCUID2`,(e,t)=>{Br.init(e,t),Y.init(e,t)}),js=z(`ZodULID`,(e,t)=>{Vr.init(e,t),Y.init(e,t)}),Ms=z(`ZodXID`,(e,t)=>{Hr.init(e,t),Y.init(e,t)}),Ns=z(`ZodKSUID`,(e,t)=>{Ur.init(e,t),Y.init(e,t)}),Ps=z(`ZodIPv4`,(e,t)=>{Jr.init(e,t),Y.init(e,t)}),Fs=z(`ZodIPv6`,(e,t)=>{Zr.init(e,t),Y.init(e,t)}),Is=z(`ZodCIDRv4`,(e,t)=>{Qr.init(e,t),Y.init(e,t)}),Ls=z(`ZodCIDRv6`,(e,t)=>{ei.init(e,t),Y.init(e,t)}),Rs=z(`ZodBase64`,(e,t)=>{ni.init(e,t),Y.init(e,t)}),zs=z(`ZodBase64URL`,(e,t)=>{ii.init(e,t),Y.init(e,t)}),Bs=z(`ZodE164`,(e,t)=>{ai.init(e,t),Y.init(e,t)}),Vs=z(`ZodJWT`,(e,t)=>{si.init(e,t),Y.init(e,t)}),Hs=z(`ZodNumber`,(e,t)=>{ci.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ao(e,t,n,r);let n=e._zod.bag;e.minValue=Math.max(n.minimum??-1/0,n.exclusiveMinimum??-1/0)??null,e.maxValue=Math.min(n.maximum??1/0,n.exclusiveMaximum??1/0)??null,e.isInt=(n.format??``).includes(`int`)||Number.isSafeInteger(n.multipleOf??.5),e.isFinite=!0,e.format=n.format??null},{gt(e,t){return this.check(Ga(e,t))},gte(e,t){return this.check(Ka(e,t))},min(e,t){return this.check(Ka(e,t))},lt(e,t){return this.check(Ua(e,t))},lte(e,t){return this.check(Wa(e,t))},max(e,t){return this.check(Wa(e,t))},int(e){return this.check(Ws(e))},safe(e){return this.check(Ws(e))},positive(e){return this.check(Ga(0,e))},nonnegative(e){return this.check(Ka(0,e))},negative(e){return this.check(Ua(0,e))},nonpositive(e){return this.check(Wa(0,e))},multipleOf(e,t){return this.check(qa(e,t))},step(e,t){return this.check(qa(e,t))},finite(){return this}});function X(e){return Ra(Hs,e)}var Us=z(`ZodNumberFormat`,(e,t)=>{li.init(e,t),Hs.init(e,t)});function Ws(e){return za(Us,e)}var Gs=z(`ZodBoolean`,(e,t)=>{ui.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jo(e,t,n,r)});function Ks(e){return Ba(Gs,e)}var qs=z(`ZodUnknown`,(e,t)=>{di.init(e,t),q.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Z(){return Va(qs)}var Js=z(`ZodNever`,(e,t)=>{fi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Mo(e,t,n,r)});function Ys(e){return Ha(Js,e)}var Xs=z(`ZodArray`,(e,t)=>{gs(),mi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Io(e,t,n,r),e.element=t.element},{min(e,t){return this.check(Ya(e,t))},nonempty(e){return this.check(Ya(1,e))},max(e,t){return this.check(Ja(e,t))},length(e,t){return this.check(Xa(e,t))},unwrap(){return this.element}});function Q(e,t){return lo(Xs,e,t)}var Zs=z(`ZodObject`,(e,t)=>{gs(),xi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ro(e,t,n,r),Ut(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return oc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:Z()})},loose(){return this.clone({...this._zod.def,catchall:Z()})},strict(){return this.clone({...this._zod.def,catchall:Ys()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return yt(this,e)},safeExtend(e){return bt(this,e)},merge(e){return xt(this,e)},pick(e){return _t(this,e)},omit(e){return vt(this,e)},partial(...e){return St(lc,this,e[0])},exactPartial(...e){return St(dc,this,e[0],`exactPartial`)},required(...e){return Ct(yc,this,e[0])}});function Qs(e,t){return new Zs({type:`object`,shape:e??{},...L(t)})}var $s=z(`ZodUnion`,(e,t)=>{Ci.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zo(e,t,n,r),e.options=t.options});function ec(e,t){return new $s({type:`union`,options:e,...L(t)})}var tc=z(`ZodIntersection`,(e,t)=>{wi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bo(e,t,n,r)});function nc(e,t){return new tc({type:`intersection`,left:e,right:t})}var rc=z(`ZodRecord`,(e,t)=>{gs(),Di.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wo(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function ic(e,t,n){return!t||!t._zod?new rc({type:`record`,keyType:J(),valueType:e,...L(t)}):new rc({type:`record`,keyType:e,valueType:t,...L(n)})}var ac=z(`ZodEnum`,(e,t)=>{Oi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>No(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new ac({...t,checks:[],...L(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new ac({...t,checks:[],...L(r),entries:i})}});function oc(e,t){return new ac({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...L(t)})}var sc=z(`ZodTransform`,(e,t)=>{gs(),ki.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fo(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Zt(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Pt(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(Pt(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function cc(e){return new sc({type:`transform`,transform:e})}var lc=z(`ZodOptional`,(e,t)=>{ji.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>es(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function uc(e){return new lc({type:`optional`,innerType:e})}var dc=z(`ZodExactOptional`,(e,t)=>{Mi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>es(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function fc(e){return new dc({type:`optional`,innerType:e})}var pc=z(`ZodNullable`,(e,t)=>{Ni.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Go(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function mc(e){return new pc({type:`nullable`,innerType:e})}var hc=z(`ZodDefault`,(e,t)=>{Pi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function gc(e,t){return new hc({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ut(t)}})}var _c=z(`ZodPrefault`,(e,t)=>{Ii.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vc(e,t){return new _c({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ut(t)}})}var yc=z(`ZodNonOptional`,(e,t)=>{Li.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ko(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bc(e,t){return new yc({type:`nonoptional`,innerType:e,...L(t)})}var xc=z(`ZodCatch`,(e,t)=>{Bi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zo(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Sc(e,t){return new xc({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Gt(t)})}var Cc=z(`ZodPipe`,(e,t)=>{Vi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qo(e,t,n,r),e.in=t.in,e.out=t.out});function wc(e,t){return new Cc({type:`pipe`,in:e,out:t})}var Tc=z(`ZodReadonly`,(e,t)=>{Ui.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>$o(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ec(e){return new Tc({type:`readonly`,innerType:e})}var Dc=z(`ZodCustom`,(e,t)=>{Gi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Po(e,t,n,r)});function Oc(e,t={}){return uo(Dc,e,t)}function kc(e,t){return fo(e,t)}var Ac=Qs({activePRs:X(),shelvedPRs:X(),mergedPRs:X(),closedPRs:X(),mergeRate:J(),availableIssues:X().optional()}),jc=Qs({active:X(),merged:X(),closed:X()}),Mc=Qs({repo:J(),active:X(),merged:X(),closed:X()}),Nc=Qs({stats:Ac,prsByRepo:ic(J(),jc),topRepos:Q(Mc),monthlyMerged:ic(J(),X()),monthlyOpened:ic(J(),X()),monthlyClosed:ic(J(),X()),activePRs:Q(Z()),shelvedPRUrls:Q(J()),recentlyMergedPRs:Q(Z()),recentlyClosedPRs:Q(Z()),autoUnshelvedPRs:Q(Z()),commentedIssues:Q(Z()),issueResponses:Q(Z()),allMergedPRs:Q(Z()),allClosedPRs:Q(Z()),repoMetadata:ic(J(),Z()).optional(),vettedIssues:Z().nullable().optional(),offline:Ks().optional(),lastUpdated:J().optional(),partialFailures:Q(J()).optional()});function Pc(e){let t=Nc.safeParse(e);return t.success?{ok:!0,data:t.data}:{ok:!1,message:`Server response did not match expected shape — ${t.error.issues.slice(0,3).map(e=>`${e.path.join(`.`)||`<root>`}: ${e.message}`).join(`; `)}${t.error.issues.length>3?` (+${t.error.issues.length-3} more)`:``}`}}var Fc=15e3,Ic=Symbol(`csrf-rejected`),Lc=class extends Error{kind=Ic;constructor(e){super(e)}},Rc=Symbol(`conflict`),zc=class extends Error{kind=Rc;constructor(e){super(e)}};async function Bc(e,t){let n=await fetch(e,t);if(!n.ok){let e=(await n.json().catch(()=>null))?.error||`HTTP ${n.status}`;throw n.status===403&&typeof e==`string`&&/csrf token/i.test(e)?new Lc(e):n.status===409?new zc(typeof e==`string`?e:`HTTP ${n.status}`):Error(e)}let r=n.headers.get(`X-CSRF-Token`),i=n.headers.get(`X-Dashboard-Stale`)===`1`,a=n.headers.get(`X-Dashboard-Stale-Reason`),o=await n.json(),s=Pc(o);if(!s.ok)throw console.error(`[dashboard] /api/data schema validation failed:`,s.message,o),Error(s.message);return{data:s.data,csrfToken:r,stale:i,staleReason:a}}function Vc(){let[e,t]=M(null),[n,r]=M(!0),[i,a]=M(!1),[o,s]=M(null),[c,l]=M(null),[u,d]=M(!1),[f,p]=M(null),[m,h]=M(0),g=je(null),_=F(e=>{e.csrfToken&&(g.current=e.csrfToken),t(e.data),d(e.stale),p(e.staleReason),h(0)},[]),v=F(e=>{let t={method:`POST`},n={};return e!==void 0&&(n[`Content-Type`]=`application/json`,t.body=e),g.current&&(n[`X-CSRF-Token`]=g.current),Object.keys(n).length>0&&(t.headers=n),t},[]),y=F(async(e,t)=>{try{return await Bc(e,v(t))}catch(n){if(!(n instanceof Lc)&&!(n instanceof zc))throw n;try{let e=await Bc(`/api/data`);e.csrfToken&&(g.current=e.csrfToken)}catch{throw n}return Bc(e,v(t))}},[v]),b=F(async e=>{try{r(!0),_(await e()),l(Date.now()),s(null)}catch(e){s(e instanceof Error?e.message:String(e))}finally{r(!1)}},[_]),x=F(()=>b(()=>Bc(`/api/data`)),[b]),S=F(()=>b(()=>y(`/api/refresh`)),[b,y]),C=F(async()=>{try{a(!0),_(await y(`/api/refresh`)),l(Date.now()),s(null)}catch(e){console.warn(`Auto-refresh failed:`,e instanceof Error?e.message:String(e)),h(e=>e+1)}finally{a(!1)}},[_,y]),w=F(async e=>{try{let t=await y(`/api/action`,JSON.stringify(e));_(t),s(null)}catch(e){try{_(await Bc(`/api/data`))}catch(e){console.error(`Failed to re-fetch dashboard data after action error:`,e)}throw e}},[_,y]);return N(()=>{x();let e=setTimeout(()=>{C()},5e3);return()=>clearTimeout(e)},[x,C]),N(()=>{if(m<1||m>=2)return;let e=setTimeout(()=>{C()},Fc);return()=>clearTimeout(e)},[m,C]),{data:e,loading:n,refreshing:i,error:o,clearError:F(()=>s(null),[]),refresh:S,performAction:w,lastUpdated:c,stale:u,staleReason:f,autoRefreshFailures:m}}var Hc=`oss-autopilot-theme`;function Uc(){try{let e=localStorage.getItem(Hc);if(e===`light`||e===`dark`)return e}catch(e){console.warn(`[useTheme] localStorage unavailable, falling back to OS preference:`,e)}return typeof window<`u`&&window.matchMedia?.(`(prefers-color-scheme: light)`).matches?`light`:`dark`}function Wc(e){document.documentElement.setAttribute(`data-theme`,e)}function Gc(){let[e,t]=M(Uc);return N(()=>{Wc(e)},[e]),N(()=>{if(!window.matchMedia)return;let e=window.matchMedia(`(prefers-color-scheme: light)`),n=e=>{try{if(localStorage.getItem(Hc))return}catch(e){console.warn(`[useTheme] Could not read localStorage to check for user override:`,e);return}t(e.matches?`light`:`dark`)};return e.addEventListener(`change`,n),()=>e.removeEventListener(`change`,n)},[]),{theme:e,toggleTheme:F(()=>{t(e=>{let t=e===`dark`?`light`:`dark`;try{localStorage.setItem(Hc,t)}catch(e){console.warn(`[useTheme] Failed to persist theme preference:`,e)}return t})},[])}}var Kc=null,qc=null;function Jc(){return Kc?Promise.resolve(Kc):qc||(qc=Ye(()=>import(`./confetti.module-BYDB1iN2.js`).then(e=>(Kc=e.default,Kc)),[]).catch(e=>(console.warn(`[useCelebration] canvas-confetti import failed, skipping animation:`,e),null)),qc)}var Yc=`oss-autopilot-merged-count`;function Xc(){try{let e=localStorage.getItem(Yc);if(e===null)return null;let t=Number.parseInt(e,10);return Number.isFinite(t)?t:null}catch(e){if(e instanceof DOMException)return console.warn(`[useCelebration] localStorage unavailable (key=${Yc}):`,e),null;throw e}}function Zc(e){try{localStorage.setItem(Yc,String(e))}catch(t){if(t instanceof DOMException){console.warn(`[useCelebration] Failed to persist merged count (value=${e}):`,t);return}throw t}}function Qc(e){let t={startVelocity:30,spread:360,ticks:60,zIndex:9999},n=Date.now()+800;function r(){try{for(let n of[0,.7])e({...t,particleCount:50,origin:{x:n+Math.random()*.3,y:Math.random()-.2}})}catch(e){console.warn(`[useCelebration] confetti failed, aborting animation:`,e);return}Date.now()<n&&requestAnimationFrame(r)}r()}function $c(){typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0||Jc().then(e=>{e&&Qc(e)}).catch(()=>{})}function el(e){let[t,n]=M(null);return N(()=>{if(e===void 0)return;let t=Xc();if(t===null||e<=t){t!==e&&Zc(e);return}let r=e-t;Zc(e),$c();let i=r===1?`1 new PR merged. Great work!`:`${r} new PRs merged. Great work!`;n({message:i,shownAt:Date.now()})},[e]),{celebration:t,dismiss:F(()=>n(null),[]),trigger:F((e=3)=>{$c();let t=Number.isFinite(e)&&e>0?Math.floor(e):3,r=t===1?`1 new PR merged. Great work!`:`${t} new PRs merged. Great work!`;n({message:r,shownAt:Date.now()})},[])}}function tl(e,t){let n=t?.duration??800,[r,i]=M(0),a=je(0);a.current=r;let o=je(0),s=je(0),c=je(0);return N(()=>{if(typeof window<`u`&&window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches===!0){i(e);return}if(e===0){i(0);return}c.current=a.current,s.current=0;let t=r=>{s.current||=r;let a=r-s.current,l=Math.min(a/n,1),u=1-(1-l)**3,d=Math.round(c.current+(e-c.current)*u);i(d),l<1&&(o.current=requestAnimationFrame(t))};return o.current=requestAnimationFrame(t),()=>{o.current&&cancelAnimationFrame(o.current)}},[e,n]),r}var nl=0;Array.isArray;function $(e,n,r,i,a,o){n||={};var s,c,l=n;if(`ref`in l)for(c in l={},n)c==`ref`?s=n[c]:l[c]=n[c];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--nl,__i:-1,__u:0,__source:a,__self:o};if(typeof e==`function`&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return t.vnode&&t.vnode(u),u}function rl({value:e}){let t=typeof e==`string`?e.match(/^(\d+)([^\d.].*)?$/):null,n=tl(typeof e==`number`?e:t?parseInt(t[1]??`0`,10):0);return typeof e==`number`?$(C,{children:n}):t?$(C,{children:[n,t[2]??``]}):$(C,{children:e})}function il({stats:e,needAttentionCount:t,stuckCICount:n=0,dormantFollowupCount:r=0,waitingCount:i,onNeedAttentionClick:a,onStuckCIClick:o,onDormantFollowupClick:s,onWaitingClick:c,onShelvedClick:l,onMergedClick:u,onClosedClick:d,onIssuesClick:f}){let p=[{label:`Need Attention`,value:t,colorClass:`red`,onClick:a},...n>0?[{label:`Stuck CI`,value:n,colorClass:`amber`,onClick:o}]:[],...r>0?[{label:`Dormant Follow-up`,value:r,colorClass:`amber`,onClick:s}]:[],{label:`Waiting on Others`,value:i,colorClass:`blue`,onClick:c},{label:`Shelved`,value:e.shelvedPRs,colorClass:`muted`,onClick:l},{label:`Merged PRs`,value:e.mergedPRs,colorClass:`purple`,onClick:u},{label:`Closed PRs`,value:e.closedPRs,colorClass:`red`,onClick:d}];return e.availableIssues!==void 0&&p.push({label:`Vetted Issues`,value:e.availableIssues,colorClass:`teal`,onClick:f}),$(`div`,{class:`stats-bar`,children:p.map(e=>$(e.onClick?`button`:`div`,{class:`stat-card ${e.colorClass}${e.onClick?` stat-card--clickable`:``}`,onClick:e.onClick,...e.onClick?{type:`button`}:{},children:[$(`span`,{class:`stat-value`,children:$(rl,{value:e.value})}),$(`span`,{class:`stat-label`,children:e.label})]},e.label))})}var al={needs_addressing:`Needs Addressing`,waiting_on_maintainer:`Waiting on Maintainer`};function ol(e){return al[e]??e}function sl({filters:e,onFilterChange:t,repos:n,statuses:r,totalCount:i,filteredCount:a}){return $(`div`,{class:`filter-bar`,children:[$(`select`,{class:`filter-select`,"aria-label":`Filter by status`,value:e.status,onChange:n=>t({...e,status:n.target.value}),children:[$(`option`,{value:`all`,children:`All Statuses`}),r.map(e=>$(`option`,{value:e,children:ol(e)},e))]}),$(`select`,{class:`filter-select`,"aria-label":`Filter by repository`,value:e.repo,onChange:n=>t({...e,repo:n.target.value}),children:[$(`option`,{value:`all`,children:`All Repos`}),n.map(e=>$(`option`,{value:e,children:e},e))]}),$(`input`,{class:`filter-input`,type:`text`,"aria-label":`Search PRs`,placeholder:`Search PRs...`,value:e.search,onInput:n=>t({...e,search:n.target.value})}),i!=null&&a!=null&&$(`span`,{class:`filter-count`,children:[`Showing `,a,` of `,i,` PRs`]})]})}function cl(e){return e.replace(/^\[|\]$/g,``)}function ll(e){switch(cl(e).toLowerCase()){case`needs response`:case`needs changes`:case`ci failing`:case`merge conflict`:case`missing files`:case`needs addressing`:return`pill--red`;case`incomplete checklist`:case`ci not running`:case`needs rebase`:case`ci blocked`:case`stale ci failure`:return`pill--amber`;case`waiting on maintainer`:return`pill--blue`;default:return`pill--muted`}}function ul(e,t){return e.length>t?e.slice(0,t)+`...`:e}function dl(e){try{let t=new Date(e);return isNaN(t.getTime())?e:t.toLocaleDateString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})}catch{return e}}function fl(e){return e.attentionBucket??(e.status===`needs_addressing`?`needs_attention`:`waiting`)}function pl(e){switch(e){case`needs_addressing`:return`var(--red)`;case`waiting_on_maintainer`:return`var(--blue)`;default:return`var(--text-muted)`}}function ml(e){switch(e){case`passing`:return`var(--green)`;case`failing`:return`var(--red)`;case`pending`:return`var(--amber)`;default:return`var(--text-muted)`}}function hl(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}var gl={TypeScript:`#3178c6`,JavaScript:`#f1e05a`,Python:`#3572A5`,Rust:`#dea584`,Go:`#00ADD8`,Java:`#b07219`,"C#":`#178600`,C:`#555555`,"C++":`#f34b7d`,Ruby:`#701516`,PHP:`#4F5D95`,Swift:`#F05138`,Kotlin:`#A97BFF`,Dart:`#00B4AB`,Shell:`#89e051`,HTML:`#e34c26`,CSS:`#563d7c`,Scala:`#c22d40`,Elixir:`#6e4a7e`,Lua:`#000080`};function _l(e){return e?gl[e]??`var(--text-muted)`:`var(--text-muted)`}function vl(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return`Updated just now`;let n=Math.floor(t/60);return n<60?`Updated ${n}m ago`:`Updated ${Math.floor(n/60)}h ago`}function yl(e,t){return e?`Refreshing...`:t?`Updating...`:`Refresh`}var bl=[{bucket:`needs_attention`,id:`action`,title:`Need Attention`,dotClass:`red`},{bucket:`stuck_ci`,id:`stuck`,title:`Stuck CI`,dotClass:`amber`},{bucket:`dormant_followup`,id:`dormant`,title:`Dormant Follow-up`,dotClass:`amber`},{bucket:`waiting`,id:`waiting`,title:`Waiting on Others`,dotClass:`blue`}];function xl(e){switch(e){case`needs_addressing`:return`pr-row--need-attention`;case`waiting_on_maintainer`:return`pr-row--waiting`;default:return``}}function Sl({pr:e,selected:t,onSelect:n}){return $(`div`,{class:`pr-row ${xl(e.status)} ${t?`pr-row--selected`:``}`,onClick:()=>n(e.url),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),n(e.url))},role:`button`,tabIndex:0,children:[$(`span`,{class:`pr-row-dot`,style:{background:pl(e.status)}}),$(`a`,{class:`pr-row-id`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>e.stopPropagation(),children:[e.repo,`#`,e.number]}),$(`span`,{class:`pr-row-title`,children:ul(e.title,50)}),e.displayLabel&&$(`span`,{class:`pill ${ll(e.displayLabel)}`,children:cl(e.displayLabel)}),$(`span`,{class:`pr-row-age`,children:[e.daysSinceActivity,`d ago`]})]})}function Cl({section:e,selectedUrl:t,onSelect:n}){return $(`div`,{class:`pr-section`,id:`section-${e.id}`,children:[$(`div`,{class:`pr-section-header`,children:[$(`span`,{class:`pr-section-dot ${e.dotClass}`}),$(`span`,{class:`pr-section-title`,children:e.title}),$(`span`,{class:`pr-section-count`,children:e.prs.length})]}),e.prs.map(e=>$(Sl,{pr:e,selected:e.url===t,onSelect:n},e.url))]})}function wl({prs:e,selectedUrl:t,onSelect:n,shelvedUrls:r,shelvedOpen:i,onShelvedToggle:a}){let o=e.filter(e=>!r.has(e.url)),s=e.filter(e=>r.has(e.url)),c=bl.map(({bucket:e,id:t,title:n,dotClass:r})=>({id:t,title:n,dotClass:r,prs:o.filter(t=>fl(t)===e)})).filter(e=>e.prs.length>0);return $(`div`,{class:`pr-list`,children:[c.length===0&&s.length===0&&$(`p`,{class:`pr-list-empty`,children:`No PRs to display`}),c.map(e=>$(Cl,{section:e,selectedUrl:t,onSelect:n},e.id)),s.length>0&&$(`div`,{class:`pr-section pr-section--shelved`,id:`section-shelved`,children:[$(`div`,{class:`pr-section-header pr-section-header--collapsible`,onClick:a,"aria-expanded":i,"aria-controls":`shelved-pr-list`,role:`button`,tabIndex:0,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),a())},children:[$(`span`,{class:`pr-section-dot muted`}),$(`span`,{class:`pr-section-title`,children:`Shelved`}),$(`span`,{class:`pr-section-count`,children:s.length}),$(`span`,{class:`pr-section-chevron ${i?`pr-section-chevron--open`:``}`,children:`▸`})]}),$(`div`,{id:`shelved-pr-list`,children:i&&s.map(e=>$(Sl,{pr:e,selected:e.url===t,onSelect:n},e.url))})]})]})}function Tl({pr:e,isShelved:t,onAction:n}){let[r,i]=M(!1),[a,o]=M(null);async function s(e){i(!0),o(null);try{await n(e)}catch(e){o(e instanceof Error?e.message:`Action failed`)}finally{i(!1)}}let c=e.status===`needs_addressing`?`Move to Waiting`:`Move to Need Attention`,l=e.status===`needs_addressing`?`waiting`:`attention`;return $(`div`,{class:`action-bar`,children:[a&&$(`p`,{class:`action-error`,role:`alert`,children:a}),$(`button`,{class:`action-btn ${t?`action-btn--unshelve`:`action-btn--shelve`}`,disabled:r,onClick:()=>s({action:`move`,url:e.url,target:t?`auto`:`shelved`}),children:t?`Unshelve`:`Shelve`}),$(`button`,{class:`action-btn action-btn--override`,disabled:r,onClick:()=>s({action:`move`,url:e.url,target:l}),children:c})]})}function El(e){switch(e){case`approved`:return`Approved`;case`changes_requested`:return`Changes Requested`;case`review_required`:return`Review Required`;default:return`Unknown`}}function Dl(e){switch(e){case`approved`:return`var(--green)`;case`changes_requested`:return`var(--red)`;case`review_required`:return`var(--amber)`;default:return`var(--text-muted)`}}function Ol(e){switch(e){case`passing`:return`green`;case`failing`:return`red`;case`pending`:return`amber`;default:return``}}function kl(e){switch(e){case`approved`:return`green`;case`changes_requested`:return`red`;case`review_required`:return`amber`;default:return``}}function Al(e){return e>=7?`red`:e>=3?`amber`:`green`}function jl(e){switch(e){case`actionable`:return`Actionable`;case`fork_limitation`:return`Fork Limitation`;case`auth_gate`:return`Auth Gate`;case`infrastructure`:return`Infrastructure`;default:return e}}function Ml({pr:e,isShelved:t,onAction:n,onClose:r}){let i=Ol(e.ciStatus),a=kl(e.reviewDecision);return $(`div`,{class:`pr-detail`,children:[$(`div`,{class:`pr-detail-header`,children:[$(`h2`,{class:`pr-detail-title`,children:e.title}),$(`button`,{class:`pr-detail-close`,onClick:r,"aria-label":`Close`,children:`×`})]}),$(`div`,{class:`pr-detail-meta`,children:[$(`span`,{class:`pill ${ll(e.displayLabel)}`,children:cl(e.displayLabel)}),$(`span`,{class:`pr-detail-description`,children:e.displayDescription})]}),$(`div`,{class:`pr-detail-links`,children:$(`a`,{href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]})}),$(`div`,{class:`pr-detail-fields`,children:[$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`CI Status`}),$(`span`,{class:`pr-detail-field-value`,children:[i&&$(`span`,{class:`dot ${i}`}),$(`span`,{style:{color:ml(e.ciStatus)},children:e.ciStatus.charAt(0).toUpperCase()+e.ciStatus.slice(1)})]})]}),e.classifiedChecks.length>0&&$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Failing Checks`}),$(`div`,{class:`pr-detail-checks`,children:e.classifiedChecks.map(e=>$(`div`,{class:`pr-detail-check`,children:[$(`span`,{class:`pr-detail-check-name`,children:e.name}),$(`span`,{class:`pr-detail-check-badge pr-detail-check-badge--${e.category}`,children:jl(e.category)})]},e.name))})]}),$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Review`}),$(`span`,{class:`pr-detail-field-value`,children:[a&&$(`span`,{class:`dot ${a}`}),$(`span`,{style:{color:Dl(e.reviewDecision)},children:El(e.reviewDecision)})]})]}),e.lastMaintainerComment&&$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Maintainer Comment`}),$(`div`,{class:`pr-detail-comment`,children:[$(`div`,{class:`pr-detail-comment-header`,children:[$(`div`,{class:`pr-detail-comment-avatar`}),$(`span`,{class:`pr-detail-comment-author`,children:[`@`,e.lastMaintainerComment.author]}),$(`span`,{class:`pr-detail-comment-date`,children:[`· `,dl(e.lastMaintainerComment.createdAt)]})]}),$(`p`,{class:`pr-detail-comment-body`,children:ul(e.lastMaintainerComment.body,200)})]})]}),e.hasIncompleteChecklist&&e.checklistStats&&$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Checklist`}),$(`span`,{class:`pr-detail-field-value`,style:{color:`var(--amber)`},children:[e.checklistStats.checked,`/`,e.checklistStats.total,` checked`]})]}),$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Days Since Activity`}),$(`span`,{class:`pr-detail-field-value`,children:[$(`span`,{class:`dot ${Al(e.daysSinceActivity)}`}),$(`span`,{children:[e.daysSinceActivity,` `,e.daysSinceActivity===1?`day`:`days`]})]})]}),e.hasMergeConflict&&$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Merge Conflict`}),$(`span`,{class:`pr-detail-field-value`,style:{color:`var(--red)`},children:`Yes`})]}),$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Created`}),$(`span`,{class:`pr-detail-field-value`,children:dl(e.createdAt)})]}),$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Updated`}),$(`span`,{class:`pr-detail-field-value`,children:dl(e.updatedAt)})]})]}),$(Tl,{pr:e,isShelved:t,onAction:n})]})}var Nl=null,Pl=null;function Fl(){return Nl?Promise.resolve(Nl):Pl||(Pl=Ye(()=>import(`./chart-panel-0drzwc3-.js`).then(e=>(Nl=e.ChartPanel,Nl)),[]),Pl)}function Il(){return $(`div`,{class:`chart-panel`,"aria-busy":`true`,"aria-label":`Loading charts`,children:[$(`div`,{class:`chart-card`,children:[$(`h3`,{class:`chart-card-title`,children:`Monthly Activity`}),$(`div`,{class:`chart-canvas-wrapper`,style:{minHeight:240}})]}),$(`div`,{class:`chart-card`,children:[$(`h3`,{class:`chart-card-title`,children:`Top Repos`}),$(`div`,{class:`chart-canvas-wrapper`,style:{minHeight:240}})]})]})}function Ll(e){let[t,n]=M(()=>Nl),[r,i]=M(null);return N(()=>{if(t)return;let e=!1;return Fl().then(t=>{e||n(()=>t)}).catch(t=>{e||(i(t instanceof Error?t.message:String(t)),console.error(`[dashboard] failed to load chart-panel chunk:`,t))}),()=>{e=!0}},[t]),r?$(`div`,{class:`chart-panel`,role:`status`,children:$(`p`,{style:{margin:`1rem 0`,opacity:.8},children:[`Charts failed to load (`,r,`). The rest of the dashboard is unaffected.`]})}):t?$(t,{...e}):$(Il,{})}function Rl({issues:e,onAction:t}){return e.length===0?null:$(`div`,{class:`issue-list`,children:[$(`h3`,{class:`issue-list-title`,children:`Issue Responses`}),$(`div`,{class:`issue-list-items`,children:e.map(e=>$(zl,{issue:e,onAction:t},e.url))})]})}function zl({issue:e,onAction:t}){let[n,r]=M(!1),[i,a]=M(null);async function o(){if(t){r(!0),a(null);try{await t({action:`dismiss_issue_response`,url:e.url})}catch(e){a(e instanceof Error?e.message:`Dismiss failed`)}finally{r(!1)}}}return $(`div`,{class:`issue-item`,children:[i&&$(`p`,{class:`action-error`,role:`alert`,children:i}),t&&$(`button`,{class:`issue-item-dismiss`,"aria-label":`Dismiss`,disabled:n,onClick:o,children:`×`}),$(`div`,{class:`issue-item-header`,children:[$(`a`,{class:`issue-item-id`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]}),$(`span`,{class:`issue-item-badge ${e.isFromMaintainer?`issue-item-badge--maintainer`:`issue-item-badge--community`}`,children:e.isFromMaintainer?`Maintainer`:`Community`})]}),$(`div`,{class:`issue-item-title`,children:ul(e.title,60)}),$(`div`,{class:`issue-item-response`,children:[$(`span`,{class:`issue-item-response-author`,children:[`Response from @`,e.lastResponseAuthor]}),$(`span`,{class:`issue-item-response-date`,children:dl(e.lastResponseAt)})]}),$(`p`,{class:`issue-item-response-body`,children:ul(e.lastResponseBody,150)}),$(`span`,{class:`issue-item-age`,children:[e.daysSinceUserComment,`d since your comment`]})]})}function Bl({mergedPRs:e,closedPRs:t,autoUnshelvedPRs:n}){return e.length===0&&t.length===0&&n.length===0?null:$(`div`,{class:`recent-activity`,children:[$(`h3`,{class:`recent-activity-title`,children:`Recent Activity (Last 7 Days)`}),e.length>0&&$(`div`,{class:`recent-activity-section`,children:[$(`h4`,{class:`recent-activity-section-title recent-activity-section-title--merged`,children:[`Merged (`,e.length,`)`]}),$(`div`,{class:`recent-activity-items`,children:e.map(e=>$(`div`,{class:`recent-activity-item`,children:[$(`span`,{class:`recent-activity-badge recent-activity-badge--merged`,children:`Merged`}),$(`span`,{class:`recent-activity-item-title`,children:ul(e.title,60)}),$(`a`,{class:`recent-activity-link`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]}),$(`span`,{class:`recent-activity-date`,children:dl(e.mergedAt)})]},e.url))})]}),t.length>0&&$(`div`,{class:`recent-activity-section`,children:[$(`h4`,{class:`recent-activity-section-title recent-activity-section-title--closed`,children:[`Closed (`,t.length,`)`]}),$(`div`,{class:`recent-activity-items`,children:t.map(e=>$(`div`,{class:`recent-activity-item`,children:[$(`span`,{class:`recent-activity-badge recent-activity-badge--closed`,children:`Closed`}),$(`span`,{class:`recent-activity-item-title`,children:ul(e.title,60)}),$(`a`,{class:`recent-activity-link`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]}),$(`span`,{class:`recent-activity-date`,children:dl(e.closedAt)})]},e.url))})]}),n.length>0&&$(`div`,{class:`recent-activity-section`,children:[$(`h4`,{class:`recent-activity-section-title recent-activity-section-title--unshelved`,children:[`Auto-Unshelved (`,n.length,`)`]}),$(`div`,{class:`recent-activity-items`,children:n.map(e=>$(`div`,{class:`recent-activity-item`,children:[$(`span`,{class:`recent-activity-badge recent-activity-badge--unshelved`,children:`Unshelved`}),$(`span`,{class:`recent-activity-item-title`,children:ul(e.title,60)}),$(`a`,{class:`recent-activity-link`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]})]},e.url))})]})]})}function Vl({mergedPRs:e,repoMetadata:t,onBack:n}){let[r,i]=M(`date`),[a,o]=M(`desc`);function s(e){r===e?o(e=>e===`asc`?`desc`:`asc`):(i(e),o(e===`date`||e===`stars`?`desc`:`asc`))}let c=P(()=>[...e].sort((e,n)=>{let i=0;switch(r){case`repo`:i=e.repo.localeCompare(n.repo);break;case`stars`:i=(t?.[e.repo]?.stars??0)-(t?.[n.repo]?.stars??0);break;case`language`:{let r=t?.[e.repo]?.language??``,a=t?.[n.repo]?.language??``;i=r.localeCompare(a);break}case`date`:i=e.mergedAt.localeCompare(n.mergedAt)}return a===`asc`?i:-i}),[e,t,r,a]);function l(e,t,n){let i=r===e?a===`asc`?`▲`:`▼`:null;return $(`th`,{class:n?`${n} sortable-th`:`sortable-th`,scope:`col`,onClick:()=>s(e),onKeyDown:t=>{(t.key===`Enter`||t.key===` `)&&(t.preventDefault(),s(e))},tabIndex:0,role:`button`,"aria-sort":r===e?a===`asc`?`ascending`:`descending`:void 0,children:[t,` `,i&&$(`span`,{class:`sort-arrow`,children:i})]})}return $(`div`,{class:`merged-view merged-view--full-width`,children:[$(`div`,{class:`merged-view-header`,children:[$(`button`,{class:`merged-view-back`,onClick:n,type:`button`,children:`← Back`}),$(`div`,{children:[$(`h2`,{class:`merged-view-title`,children:`Merged PRs`}),$(`span`,{class:`merged-view-subtitle`,children:[e.length,` total`]})]})]}),e.length===0?$(`div`,{class:`merged-view-empty`,children:`No merged PRs found. Run a dashboard refresh to populate.`}):$(`table`,{class:`merged-table`,children:[$(`thead`,{children:$(`tr`,{children:[l(`repo`,`PR`),l(`stars`,`Stars`,`merged-table-col-stars`),l(`language`,`Language`,`merged-table-col-language`),l(`date`,`Date Merged`)]})}),$(`tbody`,{children:c.map(e=>{let n=t?.[e.repo];return $(`tr`,{children:[$(`td`,{children:[$(`a`,{class:`merged-table-pr-link`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]}),$(`div`,{class:`merged-table-pr-title`,children:ul(e.title,80)})]}),$(`td`,{class:`merged-table-col-stars`,children:$(`span`,{class:`merged-table-stars`,children:n?.stars==null?`—`:`★ ${hl(n.stars)}`})}),$(`td`,{class:`merged-table-col-language`,children:n?.language?$(`span`,{class:`merged-table-language`,children:[$(`span`,{class:`merged-table-language-dot`,style:{backgroundColor:_l(n.language)}}),n.language]}):$(`span`,{class:`merged-table-language`,children:`—`})}),$(`td`,{children:$(`span`,{class:`merged-table-date`,children:dl(e.mergedAt)})})]},e.url)})})]})]})}function Hl({closedPRs:e,onBack:t}){return $(`div`,{class:`merged-view merged-view--full-width`,children:[$(`div`,{class:`merged-view-header`,children:[$(`button`,{class:`merged-view-back`,onClick:t,type:`button`,children:`← Back`}),$(`div`,{children:[$(`h2`,{class:`merged-view-title`,children:`Closed PRs`}),$(`span`,{class:`merged-view-subtitle`,children:[e.length,` total`]})]})]}),e.length===0?$(`div`,{class:`merged-view-empty`,children:`No closed PRs found. Run a dashboard refresh to populate.`}):$(`table`,{class:`merged-table`,children:[$(`thead`,{children:$(`tr`,{children:[$(`th`,{scope:`col`,children:`PR`}),$(`th`,{scope:`col`,children:`Date Closed`})]})}),$(`tbody`,{children:e.map(e=>$(`tr`,{children:[$(`td`,{children:[$(`a`,{class:`merged-table-pr-link`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]}),$(`div`,{class:`merged-table-pr-title`,children:ul(e.title,80)})]}),$(`td`,{children:$(`span`,{class:`merged-table-date`,children:dl(e.closedAt)})})]},e.url))})]})]})}function Ul(e){return e>=8?`vetted-score--high`:e>=6?`vetted-score--mid`:``}function Wl(e){let t,n=e.match(/\(([\d.]+)(k)?★\)/i);if(n&&n[1]!==void 0){let e=parseFloat(n[1]);t=n[2]?Math.round(e*1e3):e}let r=[...e.matchAll(/\(([^\d)★][^)]*)\)/g)],i=r[r.length-1]?.[1]?.trim();return{stars:t,language:i}}function Gl({vettedIssues:e,repoMetadata:t,onBack:n}){let[r,i]=M(``),a=P(()=>e.available.filter(e=>e.score!==void 0&&e.score>=6).sort((e,t)=>(t.score??0)-(e.score??0)),[e.available]),o=P(()=>{if(!r)return a;let e=r.toLowerCase();return a.filter(t=>`${t.title} ${t.repo} ${t.number}`.toLowerCase().includes(e))},[a,r]);return $(`div`,{class:`merged-view merged-view--full-width`,children:[$(`div`,{class:`merged-view-header`,children:[$(`button`,{class:`merged-view-back`,onClick:n,type:`button`,children:`← Back`}),$(`div`,{children:[$(`h2`,{class:`merged-view-title`,children:`Vetted Issues`}),$(`span`,{class:`merged-view-subtitle`,children:[a.length,` available`]})]})]}),$(`div`,{class:`vetted-search-bar`,children:$(`input`,{class:`vetted-search-input`,type:`text`,"aria-label":`Search issues`,placeholder:`Search issues...`,value:r,onInput:e=>i(e.target.value)})}),o.length===0?$(`div`,{class:`merged-view-empty`,children:a.length===0?`No vetted issues found.`:`No issues match your search.`}):$(`table`,{class:`merged-table`,children:[$(`thead`,{children:$(`tr`,{children:[$(`th`,{scope:`col`,children:`Issue`}),$(`th`,{scope:`col`,class:`merged-table-col-stars`,children:`Stars`}),$(`th`,{scope:`col`,class:`merged-table-col-language`,children:`Language`}),$(`th`,{scope:`col`,class:`vetted-col-score`,children:`Score`})]})}),$(`tbody`,{children:o.map(e=>{let n=t?.[e.repo],r=!n?.stars||!n?.language?Wl(e.group??e.tier):null,i=n?.stars??r?.stars,a=n?.language??r?.language;return $(`tr`,{children:[$(`td`,{children:[$(`a`,{class:`merged-table-pr-link`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]}),$(`div`,{class:`merged-table-pr-title`,children:ul(e.title,80)})]}),$(`td`,{class:`merged-table-col-stars`,children:$(`span`,{class:`merged-table-stars`,children:i==null?`—`:`\u2605 ${hl(i)}`})}),$(`td`,{class:`merged-table-col-language`,children:a?$(`span`,{class:`merged-table-language`,children:[$(`span`,{class:`merged-table-language-dot`,style:{backgroundColor:_l(a)}}),a]}):$(`span`,{class:`merged-table-language`,children:`—`})}),$(`td`,{class:`vetted-col-score`,children:e.score==null?$(`span`,{class:`vetted-score`,children:`—`}):$(`span`,{class:`vetted-score ${Ul(e.score)}`,children:[e.score,`/10`]})})]},e.url)})})]})]})}function Kl(){return $(`div`,{class:`skeleton-row`,children:[...[,,,,,]].map((e,t)=>$(`div`,{class:`skeleton-card`},t))})}function ql(){return $(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,children:[$(`circle`,{cx:`12`,cy:`12`,r:`5`}),$(`line`,{x1:`12`,y1:`1`,x2:`12`,y2:`3`}),$(`line`,{x1:`12`,y1:`21`,x2:`12`,y2:`23`}),$(`line`,{x1:`4.22`,y1:`4.22`,x2:`5.64`,y2:`5.64`}),$(`line`,{x1:`18.36`,y1:`18.36`,x2:`19.78`,y2:`19.78`}),$(`line`,{x1:`1`,y1:`12`,x2:`3`,y2:`12`}),$(`line`,{x1:`21`,y1:`12`,x2:`23`,y2:`12`}),$(`line`,{x1:`4.22`,y1:`19.78`,x2:`5.64`,y2:`18.36`}),$(`line`,{x1:`18.36`,y1:`5.64`,x2:`19.78`,y2:`4.22`})]})}function Jl(){return $(`svg`,{width:`16`,height:`16`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`,children:$(`path`,{d:`M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z`})})}function Yl({theme:e,onToggle:t}){return $(`button`,{class:`theme-toggle`,onClick:t,"aria-label":e===`dark`?`Switch to light mode`:`Switch to dark mode`,type:`button`,children:$(e===`dark`?ql:Jl,{})})}var Xl=5e3;function Zl({celebration:e,onDismiss:t}){return N(()=>{if(!e)return;let n=setTimeout(t,Xl);return()=>clearTimeout(n)},[e?.shownAt,t]),e?$(`div`,{class:`celebration-toast`,role:`status`,"aria-live":`polite`,children:[$(`span`,{class:`celebration-toast-message`,children:e.message}),$(`button`,{type:`button`,class:`celebration-toast-dismiss`,"aria-label":`Dismiss celebration`,onClick:t,children:`×`})]}):null}function Ql(){return $(`svg`,{width:`14`,height:`14`,viewBox:`0 0 16 16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.5`,children:[$(`path`,{d:`M14 8A6 6 0 1 1 8 2`}),$(`path`,{d:`M8 2L11 2L11 5`})]})}var $l=3e4;function eu({stats:e,loading:t,refreshing:n,lastUpdated:r,onRefresh:i,theme:a,onToggleTheme:o,onCelebrate:s}){let[,c]=M(0);return N(()=>{let e=setInterval(()=>c(e=>e+1),$l);return()=>clearInterval(e)},[]),$(`header`,{class:`dashboard-header`,children:[$(`div`,{class:`header-brand`,children:[$(`img`,{class:`header-icon`,src:`/favicon.svg`,alt:``,width:`72`,height:`72`}),$(`h1`,{children:`OSS Autopilot`})]}),$(`div`,{class:`header-bar`,children:[$(`div`,{class:`header-stats`,children:[$(`span`,{children:[$(`span`,{class:`val`,style:{color:`var(--green)`},children:e.activePRs}),` `,`active`]}),$(`span`,{class:`header-sep`}),$(`span`,{children:[$(`span`,{class:`val`,style:{color:`var(--purple)`},children:e.mergedPRs}),` `,`merged`]}),$(`span`,{class:`header-sep`}),$(`span`,{children:[$(`span`,{class:`val`,style:{color:`var(--amber)`},children:e.mergeRate}),` `,`merge rate`]})]}),$(`div`,{class:`header-right`,children:[r&&$(`span`,{class:`last-updated`,children:vl(r)}),$(Yl,{theme:a,onToggle:o}),$(`button`,{type:`button`,class:`celebrate-btn`,onClick:s,"aria-label":`Celebrate`,children:`🎉`}),$(`button`,{class:`refresh-btn`,onClick:i,disabled:t||n,children:[t||n?$(`span`,{class:`spinner`}):$(Ql,{}),yl(t,n)]})]})]})]})}var tu=new Set([`/`,`/merged`,`/closed`,`/issues`]),nu=[];function ru(){let{data:e,loading:t,refreshing:n,error:r,clearError:i,refresh:a,performAction:o,lastUpdated:s,stale:c,staleReason:l,autoRefreshFailures:u}=Vc(),{theme:d,toggleTheme:f}=Gc(),{celebration:p,dismiss:m,trigger:h}=el(e?.stats.mergedPRs),[g,_]=M({status:`all`,repo:`all`,search:``}),[v,y]=M(null),[b,x]=M(!1),{path:S,route:w}=Ge(),T=je(null);N(()=>{T.current?.focus({preventScroll:!1})},[S]),N(()=>{let t=new Set(e?.shelvedPRUrls??[]),n=(e?.activePRs??[]).filter(e=>!t.has(e.url)&&fl(e)===`needs_attention`).length;document.title=n>0?`(${n}) OSS Autopilot`:`OSS Autopilot Dashboard`},[e?.activePRs,e?.shelvedPRUrls]),N(()=>{let e=e=>{if(!e.shiftKey||e.key!==`C`)return;let t=e.target;if(t){let e=t.tagName;if(e===`INPUT`||e===`TEXTAREA`||t.isContentEditable)return}e.preventDefault(),h()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[h]);let E=P(()=>new Set(e?.shelvedPRUrls??[]),[e?.shelvedPRUrls]),D=e?.activePRs??nu,ee=P(()=>[...new Set(D.map(e=>e.repo))].sort(),[D]),O=P(()=>[...new Set(D.map(e=>e.status))].sort(),[D]),te=P(()=>D.filter(e=>{if(g.status!==`all`&&e.status!==g.status||g.repo!==`all`&&e.repo!==g.repo)return!1;if(g.search){let t=g.search.toLowerCase();if(!`${e.title} ${e.repo} ${e.number}`.toLowerCase().includes(t))return!1}return!0}),[D,g.status,g.repo,g.search]),ne=P(()=>D.filter(e=>!E.has(e.url)),[D,E]);if(t&&!e)return $(`div`,{class:`skeleton-wrapper`,children:[$(Kl,{}),$(`div`,{class:`shell-center shell-center--skeleton`,children:$(`p`,{class:`shell-status`,children:`Loading dashboard data...`})})]});if(r&&!e)return $(`div`,{class:`shell-center`,role:`alert`,children:[$(`p`,{class:`shell-status shell-error`,children:`Failed to load dashboard data`}),$(`p`,{class:`shell-detail`,children:r}),$(`button`,{class:`shell-retry`,onClick:()=>window.location.reload(),children:`Retry`})]});if(!e)return null;let re={stats:e.stats,loading:t,refreshing:n,lastUpdated:s,onRefresh:a,theme:d,onToggleTheme:f,onCelebrate:h},ie=e.partialFailures&&e.partialFailures.length>0?$(`div`,{class:`partial-banner`,role:`status`,"aria-live":`polite`,children:$(`span`,{children:[`Showing partial data — `,e.partialFailures.length,` background operation`,e.partialFailures.length===1?``:`s`,` failed (`,e.partialFailures.join(`, `),`). Some sections may be incomplete; try refreshing.`]})}):null,ae=c?`Dashboard data may be stale${l?` (${l})`:``} — the server is serving cached data. Try refreshing.`:u>=2?`Background refresh failed ${u} times in a row — data may be out of date. Try refreshing.`:null,k=$(C,{children:[r?$(`div`,{class:`error-banner`,role:`alert`,children:[$(`span`,{children:r}),$(`button`,{class:`error-banner-dismiss`,onClick:i,children:`Dismiss`})]}):null,ae?$(`div`,{class:`partial-banner stale-banner`,role:`status`,"aria-live":`polite`,children:$(`span`,{children:ae})}):null,ie]});if(S===`/merged`){let t=e.allMergedPRs??[];return $(`div`,{class:`dashboard`,children:[$(eu,{...re}),k,$(`main`,{id:`main-content`,class:`dashboard-main`,children:[$(`h2`,{ref:T,tabIndex:-1,class:`visually-hidden`,children:`Merged pull requests`}),$(Vl,{mergedPRs:t,repoMetadata:e.repoMetadata,onBack:()=>w(`/`)})]}),$(Zl,{celebration:p,onDismiss:m})]})}if(S===`/closed`){let t=e.allClosedPRs??[];return $(`div`,{class:`dashboard`,children:[$(eu,{...re}),k,$(`main`,{id:`main-content`,class:`dashboard-main`,children:[$(`h2`,{ref:T,tabIndex:-1,class:`visually-hidden`,children:`Closed pull requests`}),$(Hl,{closedPRs:t,onBack:()=>w(`/`)})]}),$(Zl,{celebration:p,onDismiss:m})]})}if(S===`/issues`)return $(`div`,{class:`dashboard`,children:[$(eu,{...re}),k,$(`main`,{id:`main-content`,class:`dashboard-main`,children:[$(`h2`,{ref:T,tabIndex:-1,class:`visually-hidden`,children:`Vetted issues`}),e.vettedIssues?$(Gl,{vettedIssues:e.vettedIssues,repoMetadata:e.repoMetadata,onBack:()=>w(`/`)}):$(`div`,{class:`merged-view merged-view--full-width`,children:[$(`div`,{class:`merged-view-header`,children:[$(`button`,{class:`merged-view-back`,onClick:()=>w(`/`),type:`button`,children:`← Back`}),$(`div`,{children:$(`h2`,{class:`merged-view-title`,children:`Vetted Issues`})})]}),$(`div`,{class:`merged-view-empty`,children:`No vetted issue list found. Configure one via /setup-oss or create a potential-issue-list.md file.`})]})]}),$(Zl,{celebration:p,onDismiss:m})]});if(!tu.has(S))return $(`div`,{class:`dashboard`,children:[$(eu,{...re}),k,$(`main`,{id:`main-content`,class:`dashboard-main`,role:`alert`,children:$(`div`,{class:`merged-view merged-view--full-width`,children:[$(`div`,{class:`merged-view-header`,children:[$(`button`,{class:`merged-view-back`,onClick:()=>w(`/`),type:`button`,children:`← Back to dashboard`}),$(`div`,{children:$(`h2`,{ref:T,tabIndex:-1,class:`merged-view-title`,children:`Page not found`})})]}),$(`div`,{class:`merged-view-empty`,children:$(`p`,{children:[`The path `,$(`code`,{children:S}),` doesn't match any known route. Try the dashboard home, or one of the stat pills to navigate to merged / closed / issue views.`]})})]})}),$(Zl,{celebration:p,onDismiss:m})]});let oe=v?e.activePRs.find(e=>e.url===v)??null:null,se=ne.filter(e=>fl(e)===`needs_attention`).length,ce=ne.filter(e=>fl(e)===`stuck_ci`).length,le=ne.filter(e=>fl(e)===`dormant_followup`).length,ue=ne.filter(e=>fl(e)===`waiting`).length,de=e=>{let t=document.getElementById(e);t&&t.scrollIntoView({behavior:`smooth`,block:`start`})};return $(`div`,{class:`dashboard`,children:[$(eu,{...re}),k,$(`main`,{id:`main-content`,class:`dashboard-main`,children:[$(`h2`,{ref:T,tabIndex:-1,class:`visually-hidden`,children:`Dashboard`}),$(`div`,{class:`animate-in delay-1`,children:$(il,{stats:e.stats,needAttentionCount:se,stuckCICount:ce,dormantFollowupCount:le,waitingCount:ue,onNeedAttentionClick:()=>de(`section-action`),onStuckCIClick:()=>de(`section-stuck`),onDormantFollowupClick:()=>de(`section-dormant`),onWaitingClick:()=>de(`section-waiting`),onShelvedClick:()=>{x(!0),setTimeout(()=>de(`section-shelved`),50)},onMergedClick:()=>w(`/merged`),onClosedClick:()=>w(`/closed`),onIssuesClick:()=>w(`/issues`)})}),$(`div`,{class:`animate-in delay-2`,children:$(sl,{filters:g,onFilterChange:_,repos:ee,statuses:O,totalCount:e.activePRs.length,filteredCount:te.length})}),$(`div`,{class:`dashboard-content animate-in delay-3`,children:[$(wl,{prs:te,selectedUrl:v,onSelect:y,shelvedUrls:E,shelvedOpen:b,onShelvedToggle:()=>x(!b)}),oe&&$(Ml,{pr:oe,isShelved:E.has(oe.url),onAction:o,onClose:()=>y(null)})]}),$(`div`,{class:`animate-in delay-4`,children:$(Ll,{monthlyMerged:e.monthlyMerged,monthlyOpened:e.monthlyOpened,monthlyClosed:e.monthlyClosed,topRepos:e.topRepos,theme:d})}),$(`div`,{class:`animate-in delay-5`,children:$(Bl,{mergedPRs:e.recentlyMergedPRs??[],closedPRs:e.recentlyClosedPRs??[],autoUnshelvedPRs:e.autoUnshelvedPRs??[]})}),$(`div`,{class:`animate-in delay-6`,children:$(Rl,{issues:e.issueResponses,onAction:o})})]}),$(Zl,{celebration:p,onDismiss:m})]})}function iu(){return $(We,{children:[$(`a`,{class:`skip-link`,href:`#main-content`,children:`Skip to main content`}),$(ru,{})]})}var au=class extends w{state={error:null};static getDerivedStateFromError(e){return{error:e instanceof Error?e:Error(String(e))}}componentDidCatch(e,t){console.error(`[dashboard] uncaught render error:`,e,t)}retry=()=>{this.setState({error:null})};render(){let{error:e}=this.state;if(!e)return this.props.children;if(this.props.fallback){let t=this.props.fallback;return $(t,{error:e,retry:this.retry})}return $(`div`,{role:`alert`,"aria-live":`assertive`,style:{maxWidth:640,margin:`2rem auto`,padding:`1.5rem`,border:`1px solid var(--error, #c0392b)`,borderRadius:6,background:`var(--surface, #fff)`,color:`var(--text-primary, #111)`,fontFamily:`system-ui, -apple-system, sans-serif`},children:[$(`h2`,{style:{marginTop:0},children:`Dashboard crashed`}),$(`p`,{children:`Something went wrong rendering the dashboard. This usually means the server returned an unexpected response shape or a UI component hit a null field.`}),$(`details`,{style:{margin:`1rem 0`},children:[$(`summary`,{style:{cursor:`pointer`},children:`Technical details`}),$(`pre`,{style:{whiteSpace:`pre-wrap`,fontSize:`0.85em`,marginTop:`0.5rem`},children:e.message})]}),$(`p`,{style:{fontSize:`0.9em`},children:[`Troubleshooting:`,$(`br`,{}),`• Check the CLI console that started the dashboard server for errors.`,$(`br`,{}),`• Open `,$(`code`,{children:`/api/data`}),` directly in a new tab to inspect the response shape.`,$(`br`,{}),`• Rebuild the CLI with `,$(`code`,{children:`pnpm run bundle`}),` if you changed server code recently.`]}),$(`div`,{style:{display:`flex`,gap:`0.5rem`,marginTop:`1rem`},children:[$(`button`,{type:`button`,onClick:this.retry,children:`Retry`}),$(`button`,{type:`button`,onClick:()=>location.reload(),children:`Reload page`})]})]})}},ou=document.getElementById(`app`);ou?he($(au,{children:$(iu,{})}),ou):(console.error(`Dashboard mount point #app not found. Check that index.html contains <div id="app"></div>.`),document.body.textContent=`Dashboard failed to load: mount point not found.`);export{je as n,N as r,$ as t};
|