@oss-autopilot/core 3.33.0 → 3.34.0
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-pre-action.js +20 -20
- package/dist/cli-registry.js +59 -23
- package/dist/cli.bundle.cjs +140 -129
- package/dist/commands/check-integration.d.ts +2 -2
- package/dist/commands/comments.js +3 -3
- package/dist/commands/compliance-score.js +1 -1
- package/dist/commands/config.js +1 -1
- package/dist/commands/daily-render.js +6 -13
- package/dist/commands/daily.d.ts +1 -2
- package/dist/commands/daily.js +8 -4
- package/dist/commands/dashboard-cache.js +1 -1
- package/dist/commands/dashboard-data.js +7 -6
- package/dist/commands/dashboard-lifecycle.js +3 -5
- package/dist/commands/dashboard-server.js +3 -3
- package/dist/commands/detect-formatters.d.ts +1 -1
- package/dist/commands/dismiss.js +2 -2
- package/dist/commands/doctor.js +3 -3
- package/dist/commands/eval.d.ts +11 -0
- package/dist/commands/eval.js +11 -0
- package/dist/commands/features.js +1 -1
- package/dist/commands/guidelines.js +5 -5
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.js +1 -0
- package/dist/commands/init.js +1 -1
- package/dist/commands/ledger-backfill.d.ts +40 -0
- package/dist/commands/ledger-backfill.js +216 -0
- package/dist/commands/local-repos.d.ts +1 -1
- package/dist/commands/overnight.js +13 -18
- package/dist/commands/parse-list.d.ts +2 -2
- package/dist/commands/parse-list.js +7 -7
- package/dist/commands/repo-vet.js +3 -3
- package/dist/commands/search.js +9 -10
- package/dist/commands/setup.js +8 -8
- package/dist/commands/startup.js +1 -1
- package/dist/commands/status.d.ts +1 -1
- package/dist/commands/vet-list.js +17 -7
- package/dist/commands/vet.js +5 -3
- package/dist/core/__fixtures__/prompt-injection-payloads.js +1 -1
- package/dist/core/anti-llm-policy.js +3 -3
- package/dist/core/checklist-analysis.d.ts +3 -0
- package/dist/core/checklist-analysis.js +67 -16
- package/dist/core/ci-analysis.js +1 -1
- package/dist/core/close-reason.d.ts +25 -0
- package/dist/core/close-reason.js +28 -0
- package/dist/core/comment-decision.js +1 -1
- package/dist/core/compliance-score.js +2 -2
- package/dist/core/daily-logic.d.ts +12 -0
- package/dist/core/daily-logic.js +11 -2
- package/dist/core/display-utils.js +1 -1
- package/dist/core/errors.js +4 -5
- package/dist/core/eval-report.d.ts +55 -0
- package/dist/core/eval-report.js +211 -0
- package/dist/core/follow-up-history.d.ts +1 -2
- package/dist/core/follow-up-history.js +1 -1
- package/dist/core/github-stats.d.ts +9 -0
- package/dist/core/github-stats.js +27 -1
- package/dist/core/guidelines-store.js +2 -2
- package/dist/core/http-cache.js +1 -2
- package/dist/core/index.d.ts +3 -2
- package/dist/core/index.js +3 -2
- package/dist/core/issue-conversation.js +1 -1
- package/dist/core/issue-effort.js +12 -6
- package/dist/core/paths.d.ts +7 -0
- package/dist/core/paths.js +25 -3
- package/dist/core/pick-snapshot.d.ts +23 -0
- package/dist/core/pick-snapshot.js +51 -0
- package/dist/core/pr-comments-fetcher.js +1 -1
- package/dist/core/review-analysis.js +5 -9
- package/dist/core/state-persistence.js +1 -1
- package/dist/core/state-schema.d.ts +117 -0
- package/dist/core/state-schema.js +48 -0
- package/dist/core/state.d.ts +22 -1
- package/dist/core/state.js +65 -12
- package/dist/core/strategy.js +2 -3
- package/dist/core/types.d.ts +1 -1
- package/dist/core/untrusted-content.js +9 -9
- package/dist/core/urls.js +1 -1
- package/dist/dashboard/assets/chart-panel-DPKNBUts.js +3 -0
- package/dist/dashboard/assets/{confetti.module-BYDB1iN2.js → confetti.module-D2UmBLOm.js} +1 -1
- package/dist/dashboard/assets/index-B25bZOYX.js +55 -0
- package/dist/dashboard/index.html +1 -1
- package/dist/formatters/json.d.ts +10 -2
- package/dist/formatters/json.js +2 -2
- package/package.json +1 -1
- package/dist/dashboard/assets/chart-panel-CmNIsCjO.js +0 -3
- package/dist/dashboard/assets/index-CTKGc-Ns.js +0 -55
|
@@ -0,0 +1,55 @@
|
|
|
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(i|n|o|s|text|space)$/,m=Array.isArray,h=f.slice,g=Object.assign;function _(e){e&&e.parentNode&&e.remove()}function v(e,t,n){var r,i,a,o={},s=arguments.length;for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return s>2&&(o.children=s>3?h.call(arguments,2):n),y(e,o,r,i,null)}function y(n,r,i,a,o){var s={type:n,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o||++t,__i:-1,__u:0};return!o&&e.vnode&&e.vnode(s),s}function b(e){return e.children}function x(e,t){this.props=e,this.context=t,this.__g=0}function ee(e,t){if(t==null)return e.__&&ee(e.__,e.__i+1);for(var n;t<e.__k.length;t++)if((n=e.__k[t])&&n.__e)return n.__e;return typeof e.type!=`function`||e.props.__P?null:ee(e)}function S(e){if((e=e.__)&&e.__c&&!e.props.__P)return e.__e=null,e.__k.some(function(t){return t&&(e.__e=t.__e)}),S(e)}function C(t){(8&t.__g||(t.__g|=8,n.push(t),i++))&&r==e.debounceRendering||((r=e.debounceRendering)||queueMicrotask)(w)}function w(){var t,o,s,c,l,u,d,f,p;try{for(o=1;n.length;)n.length>o&&n.sort(a),t=n.shift(),o=n.length,8&t.__g&&(c=void 0,l=void 0,u=(l=(s=t).__v).__e,d=[],f=[],(p=s.__P)&&((c=g({constructor:void 0},l)).__v=l.__v+1,e.vnode&&e.vnode(c),ae(p,c,l,s.__n,p.namespaceURI,32&l.__u?[u]:null,d,u||ee(l),32&l.__u,f),c.__v=l.__v,c.__.__k[c.__i]=c,O(d,c,f),l.__=l.__e=null,c.__e!=u&&S(c)))}finally{(i=n.length)&&(r||queueMicrotask)(w)}}function te(e,t,n,r,i,a,o,s,c,l,u){var p,m,h,g,_,v,y=r.__k||f,b=t.length;for(c=T(n,t,y,c,b),p=0;p<b;p++)(h=n.__k[p])!=null&&(m=~h.__i&&y[h.__i]||d,h.__i=p,v=ae(e,h,m,i,a,o,s,c,l,u),g=h.__e,(m.ref!=h.ref||8&m.__u)&&(m.ref&&k(m.ref,null,h,m),h.ref&&u.push(h.ref,h.__c||g,h)),_||=g,4&h.__u?(c=E(h,c,e,!m.__v),m.__e&&(m.__e=null)):typeof h.type==`function`&&v!==void 0?c=v:g&&(c=g.nextSibling),h.__u&=-21);return n.__e=_,c}function T(e,t,n,r,i){var a,o,s,c,l,u,d,f,p,h=n.length,g=h,_=0,v=0,x=e.__k=Array(i);for(a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o!=`object`||o.constructor==String?o=x[a]=y(null,o):m(o)?o=x[a]=y(b,{children:o}):o.constructor===void 0&&o.__b?o=x[a]=y(o.type,o.props,o.key,o.ref,o.__v):x[a]=o,c=a+_,o.__=e,o.__b=e.__b+1,s=null,~(l=o.__i=D(o,n,c,g))&&(g--,(s=n[l])&&(s.__u|=2)),s&&s.__v?(o.__u|=16,l==c-1?_--:l==c+1?_++:l!=c&&(l>c?_--:_++,v=1)):(~l||(i>h?_--:i<h&&_++),typeof o.type!=`function`&&(o.__u|=4))):x[a]=null;if(v){for(u=[],d=[],a=0;a<i;a++)if((o=x[a])&&16&o.__u){for(_=0,f=u.length;_<f;)u[p=_+f>>1]<o.__i?_=p+1:f=p;u[_]=o.__i,d[a]=_+1}for(_=u.length;a--;)d[a]&&(d[a]==_?_--:x[a].__u|=4)}if(g)for(a=0;a<h;a++)!(s=n[a])||2&s.__u||(s.__e==r&&(r=ee(s)),le(s,s));return r}function E(e,t,n,r){var i,a,o,s;if(typeof e.type==`function`){if(e.props.__P)return t;if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&(i[a].__=e,t=E(i[a],t,n,!1));return t}for(t&&!t.parentNode&&(t=ee(e))&&!t.parentNode&&(t=null),o=e.__e,s=t;s&&s.nodeType==8;)s=s.nextSibling;for(o!=s&&(!r&&n.moveBefore&&o.parentNode?n.moveBefore(o,t):n.insertBefore(o,t||null)),t=o;(t&&=t.nextSibling)&&t.nodeType==8&&!t.data.startsWith(`$s`););return t}function D(e,t,n,r){var i,a=e.key,o=e.type,s=t[n],c=s&&!(2&s.__u);if(s===null&&a==null||c&&a==s.key&&o==s.type)return n;if(r>+!!c){for(i=n-1;i>=0;i--)if((s=t[i])&&!(2&s.__u)&&a==s.key&&o==s.type)return i;for(i=n+1;i<t.length;i++)if((s=t[i])&&!(2&s.__u)&&a==s.key&&o==s.type)return i}return-1}function ne(e,t,n){n??=``,t[0]==`-`?e.setProperty(t,n):e[t]=n}function re(e,t,n,r,i){var a,o;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||ne(e.style,t);if(n)for(t in n)r&&n[t]==r[t]||ne(e.style,t,n[t])}}else if(t[0]==`o`&&t[1]==`n`)(e.__e||={})[t]=n,n&&r||(o=l[t]||(l[t]=ie(t)),(e.__a||={})[t]=c,a=t!=(t=t.replace(s,`$1`)),(t=t.slice(2))[0]<`a`&&(t=t.toLowerCase()),n?e.addEventListener(t,o,a):e.removeEventListener(t,o,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??``;return}catch{}if(typeof n==`function`)return;n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n)}}function ie(t){return function(n){var r=this.__e;if(r){if(r=r[t],n[o]==null)n[o]=c++;else if(n[o]<this.__a[t])return;return r(e.event?e.event(n):n)}}}function ae(t,n,r,i,a,o,s,c,l,u){var d,p,h,v,y,S,C,w,T,E,D,ne,re,ie,ae,O,k,A,de=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=32&r.__u,d=r.__c.__z)&&(n.__u|=l,p=o=[],d.nodeType==8?c=oe(d,o):o.push(d),c=o[0]||c),(d=e.__b)&&d(n);n:if(typeof de==`function`){h=s.length;try{if(w=n.props,T=(d=de.prototype)&&d.render,E=(d=de.contextType)&&i[d.__c],D=d?E?E.props.value:d.__:i,(v=r.__c)?(n.__c=v,2&v.__g&&(v.__g|=1)):(T?n.__c=v=new de(w,D):(n.__c=v=new x(w,D),v.constructor=de,v.render=ue),E&&E.sub(v),v.state||(v.state={}),v.__n=i,v.__g|=8,v.__h=[],v.__k=[]),T&&(v.__s||(v.__s=v.state),de.getDerivedStateFromProps&&(v.__s==v.state&&(v.__s=g({},v.__s)),g(v.__s,de.getDerivedStateFromProps(w,v.__s)))),y=v.props,S=v.state,v.__v=n,r.__c){if(w!==y&&T&&!de.getDerivedStateFromProps&&v.componentWillReceiveProps&&v.componentWillReceiveProps(w,D),n.__v==r.__v&&!(8&v.__g)||!(4&v.__g)&&v.shouldComponentUpdate&&!1===v.shouldComponentUpdate(w,v.__s,D)){n.__v!=r.__v&&(v.props=w,v.state=v.__s,v.__g&=-9),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),f.push.apply(v.__h,v.__k),v.__k=[],v.__h.length&&s.push(v),c=ee(r);break n}v.componentWillUpdate&&v.componentWillUpdate(w,v.__s,D),T&&v.componentDidUpdate&&v.__h.push(function(){v.componentDidUpdate(y,S,C)})}else T&&!de.getDerivedStateFromProps&&v.componentWillMount&&v.componentWillMount(),T&&v.componentDidMount&&v.__h.push(v.componentDidMount);if(v.context=D,v.props=w,v.__P=t,v.__g&=-5,ne=e.__r,re=0,T)v.state=v.__s,v.__g&=-9,ne&&ne(n),d=v.render(v.props,v.state,v.context),f.push.apply(v.__h,v.__k),v.__k=[];else do v.__g&=-9,ne&&ne(n),d=v.render(v.props,v.state,v.context),v.state=v.__s;while(8&v.__g&&++re<25);v.state=v.__s,v.getChildContext&&(i=g({},i,v.getChildContext())),T&&r.__c&&v.getSnapshotBeforeUpdate&&(C=v.getSnapshotBeforeUpdate(y,S)),ie=d&&d.type===b&&d.key==null?d.props.children:d,w.__P&&(d=c,a=(t=w.__P).namespaceURI,l=o=null,r.props&&r.props.__P!=t&&(r.__k.some(function(e){e&&le(e,e)}),r.__k=null),c=r.__k?ee(r,0):null),c=te(t,m(ie)?ie:[ie],n,r,i,a,o,s,c,l,u),w.__P&&(n.__e=null,c=d),n.__u&=-161,p&&p.some(_),v.__h.length&&s.push(v),1&v.__g&&(v.__g&=-4)}catch(t){if(s.length=h,n.__v=null,l||o){if(t.then){if(ae=0,n.__u|=128|l,o){for(~(k=o.indexOf(c||void 0))||(k=o.length);(A=o[k-1])&&A.nodeType==8;)k--;for(;k<o.length;k++)if(A=o[k]){if(o[k]=null,A.nodeType==8){if(A.data.startsWith(`$s`))ae++||(O=A);else if(ae&&A.data.startsWith(`/$s`)&&!--ae)break}else if(!ae)break}}if(!O){for(;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;O=c}(d=oe(O=n.__c.__z||(n.__c.__z=O)))?(n.__e=O,c=d):n.__e=c,c&&=c.nextSibling}else o&&o.some(_)}else n.__e=r.__e;n.__k||=r.__k||[],t.then||se(n),e.__e(t,n,r)}}else c=n.__e=ce(r.__e,n,r,i,a,o,s,l,u,t);return(d=e.diffed)&&d(n),c}function oe(e,t){if(e&&e.nodeType==8&&e.data.startsWith(`$s`))for(var n=1;e=e.nextSibling;){if(e.nodeType==8){if(e.data.startsWith(`$s`))n++;else if(e.data.startsWith(`/$s`)&&!--n)return e}t&&t.push(e)}}function se(e){e&&(e.__c&&(e.__c.__g|=4),e.__k&&e.__k.some(se))}function O(t,n,r){for(var i=0;i<r.length;)k(r[i++],r[i++],r[i++]);e.__c&&e.__c(n,t),t.some(function(n){try{t=n.__h,n.__h=[],t.some(function(e){e.call(n)})}catch(t){e.__e(t,n.__v)}})}function ce(t,n,r,i,a,o,s,c,l,u){var f,g,v,y,b,x,S,C,w,T=r.props||d,E=n.props,D=n.type;if(D==`svg`?a=`http://www.w3.org/2000/svg`:D==`math`?a=`http://www.w3.org/1998/Math/MathML`:a||=`http://www.w3.org/1999/xhtml`,o){for(f=0;f<o.length;f++)if((b=o[f])&&(D?b.localName==D:b.nodeType==3)){t=b,o[f]=null;break}}if(!t){if(C=u.ownerDocument||document,!D)return C.createTextNode(E);t=C.createElementNS(a,D,E.is&&E),c&&=(e.__m&&e.__m(n,o),!1),o=null}if(D){if(u=D==`template`?t.content:t,o=D==`textarea`&&E.defaultValue!=null?null:o&&h.call(u.childNodes),!c&&o)for(T={},f=0;f<t.attributes.length;f++)T[(b=t.attributes[f]).name]=b.value;for(f in T)b=T[f],f==`dangerouslySetInnerHTML`?v=b:f==`children`||f in E||f==`value`&&`defaultValue`in E||f==`checked`&&`defaultChecked`in E||re(t,f,null,b,a);for(f in w=1&r.__u,E)b=E[f],f==`children`?y=b:f==`dangerouslySetInnerHTML`?g=b:f==`value`?x=b:f==`checked`?S=b:c&&typeof b!=`function`||!(T[f]!==b||w&&b!=null)||re(t,f,b,T[f],a);g?(c||v&&(g.__html==v.__html||g.__html==t.innerHTML)||(t.innerHTML=g.__html),n.__k=[]):(v&&(t.textContent=``),(D==`foreignObject`||a==`http://www.w3.org/1998/Math/MathML`&&p.test(D))&&(a=`http://www.w3.org/1999/xhtml`),te(u,m(y)?y:[y],n,r,i,a,o,s,o?o[0]:r.__k&&ee(r,0),c,l),o&&o.some(_)),c&&D!=`textarea`||(f=`value`,D==`progress`&&x==null?t.removeAttribute(f):x==null||x===t[f]&&(D!=`progress`||x)||re(t,f,x,T[f],a),f=`checked`,S!=null&&S!=t[f]&&re(t,f,S,T[f],a))}else T===E||c&&t.data==E||(t.data=E);return t}function k(t,n,r,i){try{typeof t==`function`?n?n.__x=t(n)||1:(i&&=i.__c||i.__e)&&(n=i.__x)&&(i.__x=null,typeof n==`function`?n():t(null)):t.current=n}catch(t){e.__e(t,r)}}function le(t,n,r){var i,a,o,s;if(e.unmount&&e.unmount(t),!(i=t.ref)||i.current&&i.current!=t.__e||k(i,null,n,t),i=t.__c){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(t){e.__e(t,n)}i.__P=i.__n=null}if(i=t.__k)for(s=0;s<i.length;s++)i[s]&&le(i[s],n,typeof t.type!=`function`||r&&!t.props.__P);!r&&(i=t.__c)&&(i=i.__z)&&(a=oe(i,o=[]))&&(i==t.__e&&o.some(_),_(a),_(i)),(i=t.__e)&&(r||_(i),i.__e&&(i.__e=null)),t.__e=t.__c=t.__=null}function ue(e,t,n){return this.constructor(e,n)}function A(t,n){var r,i,a,o;e.__&&e.__(t,n),n.nodeType==9&&(n=n.documentElement),i=(r=t&&32&t.__u)?null:n.__k,n.__k=y(b,{children:[t]}),a=[],o=[],ae(n,n.__k,i||d,d,n.namespaceURI,i?null:n.firstChild?h.call(n.childNodes):null,a,i?i.__e:n.firstChild,r,o),O(a,n.__k,o),n.__k.props.children=null}function de(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__g|=4,C(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.delete(e),t&&t.call(e)}}),e.children}return t.__c=`__cC`+u++,t.__=e,t.Provider=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}e={__e:function(e,t,n,r){for(var a,o,s;t=t.__;)if((a=t.__c)&&!(1&a.__g)){a.__g|=4;try{if((s=(o=a.constructor)&&o.getDerivedStateFromError)&&a.setState(o.getDerivedStateFromError(e)),a.componentDidCatch&&(a.componentDidCatch(e,r||{}),s=1),s&&8&a.__g)return void(a.__g|=2)}catch(t){e=t}}throw i=0,e}},t=0,x.prototype.setState=function(e,t){var n=this.__s;n&&n!=this.state||(n=this.__s=g({},this.state)),typeof e==`function`&&(e=e(g({},n),this.props)),e&&(g(n,e),this.__v&&(t&&this.__k.push(t),C(this)))},x.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),C(this))},x.prototype.render=b,n=[],i=0,a=function(e,t){return e.__v.__b-t.__v.__b},o=Symbol(),s=/(PointerCapture)$|Capture$/i,c=0,l={},u=0;var fe,j,pe,me,he=Object.is,ge=0,_e=[],ve=[],M=e,ye=M.__b,be=M.__r,xe=M.diffed,Se=M.__c,Ce=M.unmount,we=M.__;function Te(e,t){M.__h&&M.__h(j,e,ge||t),ge=0;var n=j.__H||(j.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function N(e){return ge=1,Ee(Le,e)}function Ee(e,t,n){var r=Te(fe++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):Le(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);he(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=j,!j.__f)){j.__f=!0;var i=j.shouldComponentUpdate;j.shouldComponentUpdate=function(e,t,n){var r=this.__H;if(!r)return!0;var a=!1,o=this.props!=e;if(r.__.some(function(e){e.__N&&(a=!0,he(e.__[0],e.__N[0])||(o=!0))}),i){var s=i.call(this,e,t,n);return a?s||o:s}return!a||o}}return r.__}function P(e,t){var n=Te(fe++,3);!M.__s&&Ie(n.__H,t)&&(n.__P=!0,n.__=e,n.u=t,j.__H.__h.push(n))}function De(e,t){var n=Te(fe++,4);!M.__s&&Ie(n.__H,t)&&(n.__P=!1,n.__=e,n.u=t,j.__h.push(n))}function Oe(e){return ge=5,F(function(){return{current:e}},[])}function F(e,t){var n=Te(fe++,7);return Ie(n.__H,t)&&(n.__=e(),n.__H=t),n.__}function I(e,t){return ge=8,F(function(){return e},t)}function ke(e){var t=j.context[e.__c],n=Te(fe++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(j)),t.props.value):e.__}function Ae(){var e;do{for(;e=ve.shift();)try{Pe(e)}catch(t){M.__e(t,{__:(e=e.__P)&&e.__v})}for(;e=_e.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Pe),t.__h.some(Fe),t.__h=[]}catch(n){t.__h=[],M.__e(n,e.__v)}}}while(ve.length)}M.__b=function(e){j=null,ye&&ye(e)},M.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),we&&we(e,t)},M.__r=function(e){be&&be(e),fe=0;var t=(j=e.__c).__H;t&&(pe==j?j.__h=[]:(t.__h.some(Pe),t.__h.some(Fe),fe=0),t.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})),pe=j},M.diffed=function(e){xe&&xe(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&Ne(_e.push(t)),t.__H.__.some(function(e){e.u&&(e.__H=e.u)})),pe=j=null},M.__c=function(e,t){t.some(function(e){try{e.__h.some(Pe),e.__h=e.__h.filter(function(e){return!e.__||Fe(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],M.__e(n,e.__v)}}),Se&&Se(e,t)},M.unmount=function(e){Ce&&Ce(e);var t,n,r=e.__c;r&&r.__H&&(r.__H.__.some(function(r){try{if(r.__P&&r.__c){if(n===void 0){for(n=e.__;n&&(!n.__c||!n.__c.__P);)n=n.__;n&&=n.__c}r.__P=n,Ne(ve.push(r))}else Pe(r)}catch(e){t=e}}),r.__H=void 0,t&&M.__e(t,r.__v))};var je=typeof requestAnimationFrame==`function`;function Me(e){var t,n=function(){clearTimeout(r),je&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);je&&(t=requestAnimationFrame(n))}function Ne(e){e!=1&&me==M.requestAnimationFrame||((me=M.requestAnimationFrame)||Me)(Ae)}function Pe(e){var t=j,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),j=t}function Fe(e){var t=j;e.__c=e.__(),j=t}function Ie(e,t){return!e||e.length!=t.length||t.some(function(t,n){return!he(t,e[n])})}function Le(e,t){return typeof t==`function`?t(e):t}var Re,ze;function Be(e){return!ze||(typeof ze==`string`?e.startsWith(ze):ze.test(e))}function Ve(e,t){let n=``;if(Re=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)||!Be(i)||r.download)return e;Re=!0,t.preventDefault(),n=r.href.replace(location.origin,``)}else t&&t.url?(Re=!t.replace,n=t.url):n=location.pathname+location.search;return Re===!0?history.pushState(null,``,n):Re===!1&&history.replaceState(null,``,n),n}function He(e){let[t,n]=Ee(Ve,e.url||location.pathname+location.search);e.scope&&(ze=e.scope);let r=Re===!0,i=F(()=>{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 De(()=>(addEventListener(`click`,n),addEventListener(`popstate`,n),()=>{removeEventListener(`click`,n),removeEventListener(`popstate`,n)}),[]),v(He.ctx.Provider,{value:i},e.children)}Promise.resolve(),He.ctx=de({}),de({});var Ue=()=>ke(He.ctx),We=`modulepreload`,Ge=function(e){return`/`+e},Ke={},qe=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=Ge(t,n),t=s(t),t in Ke)return;Ke[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`:We,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 Je(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 Ye(e,t=`|`){return e.map(e=>yt(e)).join(t)}function Xe(e,t){return typeof t==`bigint`?t.toString():t}var Ze=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Qe(e){return new Ze(e)}function $e(e){return e==null}function et(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function tt(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 nt(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function rt(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function it(e){return rt(e._zod.def)??e._zod.def.shape}function at(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return nt(this,t,e),e},enumerable:!0,configurable:!0})}function ot(e,t,n){t in e?nt(e,t,n):e[t]=n}function st(e,t,n,r){let i=it(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?at(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):ot(e,a,r?r(n.value,a):n.value))}}function ct(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?at(e,n,()=>t[n]):ot(e,n,r.value))}}function L(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function lt(e){return JSON.stringify(e)}function ut(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var dt=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function ft(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var pt=Qe(()=>{if(ln.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function mt(e){if(ft(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return ft(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ht(e){return mt(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var gt=new Set([`string`,`number`,`symbol`]);function _t(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function vt(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function R(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 yt(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function bt(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var xt={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},St={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function Ct(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`);let i={};return st(i,e,wt(e,t)),vt(e,L(n,{shape:i,checks:[]}))}function wt(e,t){let n=it(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Tt(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`);let i=new Set(wt(e,t)),a={};return st(a,e,Reflect.ownKeys(it(e)).filter(e=>!i.has(e))),vt(e,L(n,{shape:a,checks:[]}))}function Et(e,t){if(!mt(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=it(e);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 vt(e,L(e._zod.def,{shape:Dt(e,t)}))}function Dt(e,t){let n={};return st(n,e,Reflect.ownKeys(it(e))),ct(n,t),n}function Ot(e,t){if(!mt(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return vt(e,L(e._zod.def,{shape:Dt(e,t)}))}function kt(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.`);let n={};return st(n,e,Reflect.ownKeys(it(e))),st(n,t,Reflect.ownKeys(it(t))),vt(e,L(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function At(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`);let a=n?new Set(wt(t,n)):void 0,o={};return st(o,t,Reflect.ownKeys(it(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),vt(t,L(t._zod.def,{shape:o,checks:[]}))}function jt(e,t,n){let r=n?new Set(wt(t,n)):void 0,i={};return st(i,t,Reflect.ownKeys(it(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),vt(t,L(t._zod.def,{shape:i}))}function Mt(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 Nt(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 Pt(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function Ft(e){return typeof e==`string`?e:e?.message}function It(e){let t=[];for(let n of e??[]){let e=n._zod.def;if(!/_(length|size)$|_equals$/.test(e.check))break;let r=e.maximum??e.length??e.size;r>=0&&t.push([r,n])}return t}function Lt(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function Rt(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:Ft(e.inst?._zod.def?.error?.(e))??Ft(a?.(e))??Ft(t?.error?.(e))??Ft(n.customError?.(e))??Ft(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var zt=/[\uD800-\uDBFF]/;function Bt(e){let t=e.length;if(!zt.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 Vt(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function Ht(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 Ut(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function Wt(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):Jt(e,n,r.value)}}function Gt(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function Kt(e,t,n){return Gt(e,t,n,!1)}function qt(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return Gt(this,n,r(this))},set(e){Gt(this,n,e)}})}return t}function Jt(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:Gt(this,t,n.bind(this))},set(e){Gt(this,t,e)}})}function Yt(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var Xt,Zt=!1,Qt={configurable:!0,get(){Zt=!0}};function z(e,t,n){let r=Object.getPrototypeOf(e._zod);t in r&&Xt!==e._zod?Xt=void 0:(Xt=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,Qt);let e=Zt;Zt=!1;try{let r=n(this);return Zt?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),Zt||=e,r}catch(n){throw delete this[t],Zt||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}}))}function $t(e,t,n,r){let i=Yt(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 en=`~constantCatch`;function tn(e){let t=()=>e;return t[en]=!0,t}var nn,rn={value:void 0,enumerable:!1},an=`captureStackTrace`in Error?Error:null;function on(e){let t=an;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return an=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function B(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){rn.value=new a(r);try{Object.defineProperty(n,"_zod",rn)}finally{rn.value=void 0}}else 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),Wt(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?on(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 sn=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},cn=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(nn=globalThis).__zod_globalConfig??(nn.__zod_globalConfig={});var ln=globalThis.__zod_globalConfig;function un(e){return e&&Object.assign(ln,e),ln}function dn(){let e=this._zod;return e.message??=JSON.stringify(e.def,Xe,2),e.message}function fn(e){this._zod.message=e}var pn={get:dn,set:fn,enumerable:!0,configurable:!0},mn={value:void 0,enumerable:!1},hn=new WeakSet([Object.prototype,Error.prototype]),gn=B(`$ZodError`,(e,t)=>{e.name=`$ZodError`,mn.value=t,Object.defineProperty(e,"issues",mn),mn.value=void 0,Object.defineProperty(e,"message",pn);let n=Object.getPrototypeOf(e);hn.has(n)||(hn.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})}}))});function _n(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 vn(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?_n(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function yn(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 bn(e,t){return{callee:t?.callee??e,Err:t?.Err}}var xn=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 sn;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>Rt(e,o,un())));throw dt(n,a?.callee??t),n}return s.value};return t},Sn=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=>Rt(e,o,un())));throw dt(n,a?.callee??t),n}return s.value};return t},Cn=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 sn;return a.issues.length?wn(e,a.issues,i):{success:!0,data:a.value}};function wn(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>Rt(e,n,un()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Tn=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?wn(e,a.issues,i):{success:!0,data:a.value}},En=Symbol.for(`zod.compile.invalid`),Dn=Symbol.for(`zod.compile.fallback`),On=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==En)return!0;if(r.definite===!0&&n===void 0)return!1}return kn(e,t,n)});function kn(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Dn]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new sn;return a.issues.length===0}var An=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},jn=e=>{let t=xn(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,bn(n,a))};return n},Mn=e=>{let t=xn(e),n=(e,r,i,a)=>t(e,r,i,bn(n,a));return n},Nn=e=>{let t=Sn(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,bn(n,a))};return n},Pn=e=>{let t=Sn(e),n=async(e,r,i,a)=>await t(e,r,i,bn(n,a));return n},Fn=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Cn(e)(t,n,i)},In=e=>(t,n,r)=>Cn(e)(t,n,r),Ln=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Tn(e)(t,n,i)},Rn=e=>async(t,n,r)=>Tn(e)(t,n,r),zn=/^[cC][0-9a-z]{6,}$/,Bn=/^[0-9a-z]+$/,Vn=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,Hn=/^[0-9a-vA-V]{20}$/,Un=/^[A-Za-z0-9]{27}$/,Wn=/^[a-zA-Z0-9_-]{21}$/;function Gn(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var Kn=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,qn=/^([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})$/,Jn=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)$/,Yn=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Xn=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function Zn(){return new RegExp(Xn,`u`)}var Qn=/^(?:(?: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])$/,$n=/^(([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}|:))$/,er=/^((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])$/,tr=/^(([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])$/,nr=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,rr=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,ir=/^https?$/,ar=/^\+[1-9]\d{6,14}$/,or=`(?:(?:\\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 sr(e){return RegExp(`^${e}$`)}var cr=sr(or);function lr(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 ur(e){return RegExp(`^${lr(e)}$`)}function dr(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${lr({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${lr({precision:e.precision})}`:n;return RegExp(`^${or}T(?:${r})$`)}var fr=/^[\s\S]{0,}$/,pr=/^-?\d+$/,mr=/^-?\d+(?:\.\d+)?$/,hr=/^(?:true|false)$/i,gr=/^[^A-Z]*$/,_r=/^[^a-z]*$/,V=B(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),vr=e=>{let t=e.value;return!$e(t)&&t.length!==void 0},yr={number:`number`,bigint:`bigint`,object:`date`},br=B(`$ZodCheckLessThan`,(e,t)=>{V.init(e,t);let n=yr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:yr[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})}}),xr=B(`$ZodCheckGreaterThan`,(e,t)=>{V.init(e,t);let n=yr[typeof t.value];e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:yr[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})}}),Sr=B(`$ZodCheckMultipleOf`,(e,t)=>{V.init(e,t),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):tt(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})}}),Cr=B(`$ZodCheckNumberFormat`,(e,t)=>{V.init(e,t),t.format=t.format||`float64`;let n=t.format?.includes(`int`),r=n?`int`:`number`,[i,a]=xt[t.format];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})}}),wr=B(`$ZodCheckMaxLength`,(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=vr),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?Bt(r):i)<=t.maximum)return;let a=Vt(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Tr=B(`$ZodCheckMinLength`,(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=vr),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?Bt(r):i)>=t.minimum)return;let a=Vt(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Er=B(`$ZodCheckLengthEquals`,(e,t)=>{var n;V.init(e,t),(n=e._zod.def).when??(n.when=vr),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?Bt(r):i;if(a===t.length)return;let o=Vt(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})}}),Dr=B(`$ZodCheckStringFormat`,(e,t)=>{var n,r;V.init(e,t),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=()=>{})}),Or=B(`$ZodCheckRegex`,(e,t)=>{Dr.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})}}),kr=B(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=gr,Dr.init(e,t)}),Ar=B(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=_r,Dr.init(e,t)}),jr=B(`$ZodCheckIncludes`,(e,t)=>{V.init(e,t);let n=_t(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),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})}}),Mr=B(`$ZodCheckStartsWith`,(e,t)=>{V.init(e,t);let n=RegExp(`^${_t(t.prefix)}.*`);t.pattern??=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})}}),Nr=B(`$ZodCheckEndsWith`,(e,t)=>{V.init(e,t);let n=RegExp(`.*${_t(t.suffix)}$`);t.pattern??=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})}}),Pr=B(`$ZodCheckOverwrite`,(e,t)=>{V.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Fr=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--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))}},Ir={major:4,minor:6,patch:7},H=B(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=Ir;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=Mt(t),a;for(let o of n){if(o._zod.def.when){if(Nt(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 sn;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(Lt(t.issues,n,e),i||=Mt(t,n))});else{if(t.issues.length===n)continue;Lt(t.issues,n,e),i||=Mt(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(Mt(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new sn;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 sn;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return Kt(this,`~standard`,zr(this))},set"~standard"(e){Gt(this,`~standard`,e)}}),Lr=(e,t)=>e.issues.length?{issues:e.issues.map(e=>Rt(e,t,un()))}:{value:e.value};async function Rr(e,t){let n={async:!0};return Lr(await e._zod.run({value:t,issues:[]},n),n)}function zr(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return Lr(r,n)}catch{}return Rr(e,t)},vendor:`zod`,version:1}}var Br=B(`$ZodString`,(e,t)=>{H.init(e,t),e._zod.pattern=t.pattern??fr,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=B(`$ZodStringFormat`,(e,t)=>{Dr.init(e,t),Br.init(e,t)}),Vr=B(`$ZodGUID`,(e,t)=>{t.pattern??=qn,U.init(e,t)}),Hr=B(`$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??=Jn(e)}else t.pattern??=Jn();U.init(e,t)}),Ur=B(`$ZodEmail`,(e,t)=>{t.pattern??=Yn,U.init(e,t)});function Wr(e){try{return typeof URL<`u`&&typeof URL.canParse==`function`?URL.canParse(e):(new URL(e),!0)}catch{return!1}}function Gr(e,t){return!(`normalize`in t)&&!(`hostname`in t)&&!(`protocol`in t)?Wr(e)||2:Kr(e,t)}function Kr(e,t){if(!t.normalize&&t.protocol?.source===ir.source&&!/^https?:\/\//i.test(e))return 1;try{if(typeof URL<`u`){let t=URL;if(typeof t.parse==`function`)return t.parse(e)??2}return new URL(e)}catch{return 2}}var qr=/[\t\n\r]/g;function Jr(e){return e.replace(qr,``)}function Yr(e,t){return t.lastIndex=0,t.test(e.hostname)}function Xr(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var Zr=B(`$ZodURL`,(e,t)=>{U.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=Gr(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}if(i===!0){n.value=Jr(r);return}t.hostname&&!Yr(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&&!Xr(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:Jr(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Qr=B(`$ZodEmoji`,(e,t)=>{t.pattern??=Zn(),U.init(e,t)}),$r=B(`$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?Wn:Gn(t.length),U.init(e,t)}),ei=B(`$ZodCUID`,(e,t)=>{t.pattern??=zn,U.init(e,t)}),ti=B(`$ZodCUID2`,(e,t)=>{t.pattern??=Bn,U.init(e,t)}),ni=B(`$ZodULID`,(e,t)=>{t.pattern??=Vn,U.init(e,t)}),ri=B(`$ZodXID`,(e,t)=>{t.pattern??=Hn,U.init(e,t)}),ii=B(`$ZodKSUID`,(e,t)=>{t.pattern??=Un,U.init(e,t)}),ai=B(`$ZodISODateTime`,(e,t)=>{t.pattern??=dr(t),U.init(e,t)}),oi=B(`$ZodISODate`,(e,t)=>{t.pattern??=cr,U.init(e,t)}),si=B(`$ZodISOTime`,(e,t)=>{t.pattern??=ur(t),U.init(e,t)}),ci=B(`$ZodISODuration`,(e,t)=>{t.pattern??=Kn,U.init(e,t)}),li=B(`$ZodIPv4`,(e,t)=>{t.pattern??=Qn,U.init(e,t)}),ui=/^[0-9a-fA-F:.]+$/;function di(e){return ui.test(e)?Wr(`http://[${e}]`):!1}var fi=B(`$ZodIPv6`,(e,t)=>{t.pattern??=$n,U.init(e,t),e._zod.check=n=>{di(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),pi=B(`$ZodCIDRv4`,(e,t)=>{t.pattern??=er,U.init(e,t)});function mi(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:di(n)}var hi=B(`$ZodCIDRv6`,(e,t)=>{t.pattern??=tr,U.init(e,t),e._zod.check=n=>{mi(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function gi(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var _i=/^[0-9a-zA-Z+/]*={0,2}$/,vi=B(`$ZodBase64`,(e,t)=>{t.pattern??=_i,U.init(e,t),e._zod.check=n=>{gi(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),yi=/^[A-Za-z0-9_-]*$/;function bi(e){if(!yi.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return gi(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var xi=B(`$ZodBase64URL`,(e,t)=>{t.pattern??=yi,U.init(e,t),e._zod.check=n=>{bi(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Si=B(`$ZodE164`,(e,t)=>{t.pattern??=ar,U.init(e,t)});function Ci(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 wi=B(`$ZodJWT`,(e,t)=>{U.init(e,t),e._zod.check=n=>{Ci(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),Ti=B(`$ZodNumber`,(e,t)=>{H.init(e,t),e._zod.pattern=mr,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}}),Ei=B(`$ZodNumberFormat`,(e,t)=>{Cr.init(e,t),Ti.init(e,t)}),Di=B(`$ZodBoolean`,(e,t)=>{H.init(e,t),e._zod.pattern=hr,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}}),Oi=B(`$ZodUnknown`,(e,t)=>{H.init(e,t),e._zod.parse=e=>e}),ki=B(`$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 Ai(e,t){let n=It(e._zod.def.checks);if(!n.length)return;let r=Math.min(...n.map(e=>e[0])),i=e._zod.parse;e._zod.parse=(n,a)=>{let o=t(n.value);if(o>r&&!a?.skipChecks&&a?.direction!==`backward`){for(let[t,r]of It(e._zod.def.checks))if(o>t&&r._zod.def.when(n)){let t=n.issues.length;return r._zod.check(n),n.issues[t].continue=!1,Lt(n.issues,t,e),n}}return i(n,a)}}var ji=e=>Array.isArray(e)?e.length:-1;function Mi(e,t,n){e.issues.length&&t.issues.push(...Pt(n,e.issues)),t.value[n]=e.value}var Ni=B(`$ZodArray`,(e,t)=>{H.init(e,t);let n=ln.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=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>Mi(t,r,e)));else if(Mi(c,r,e),s&&c.issues.length!==0&&Mt(c))break}return o.length?Promise.all(o).then(()=>r):r},Ai(e,ji)});function Pi(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(...Pt(n,e.issues))}!o&&i===void 0?e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]}):e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var Fi=[];function Ii(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:Fi,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=bt(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function Li(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(Mt(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>Pi(e,n,i,t,d,f))):Pi(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var Ri=B(`$ZodObject`,(e,t)=>{H.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Qe(()=>Ii(t));z(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)||nt(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 a=ft,o=t.catchall,s,c=ln.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(Mt(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>Pi(n,t,e,r,a,o))):Pi(s,t,e,r,a,o)}return o?Li(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),zi=B(`$ZodObjectJIT`,(e,t)=>{Ri.init(e,t);let n=e._zod.parse,r=Qe(()=>Ii(t)),i=ln.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Fr([`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
|
+
let ${e}_ab = false;
|
|
5
|
+
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
6
|
+
const iss = ${e}.issues[i];
|
|
7
|
+
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
8
|
+
payload.issues.push(iss);
|
|
9
|
+
if (iss.continue !== true) ${e}_ab = true;
|
|
10
|
+
}
|
|
11
|
+
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
12
|
+
payload.value = newResult;
|
|
13
|
+
return payload;
|
|
14
|
+
}`;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)}]`:lt(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(`
|
|
15
|
+
const ${n}_present = ${i};
|
|
16
|
+
if (!${n}.issues.length || ${n}_present) {
|
|
17
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (${e}) {
|
|
21
|
+
newResult[${r}] = ${n}.value;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
`)}else f?(o.write(`
|
|
26
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
27
|
+
}
|
|
28
|
+
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
29
|
+
if (${n}.value !== undefined || ${i}) {
|
|
30
|
+
newResult[${r}] = ${n}.value;
|
|
31
|
+
}
|
|
32
|
+
`)):o.write(`
|
|
33
|
+
const ${n}_present = ${i};
|
|
34
|
+
if (${n}.issues.length) {${c(n,r)}
|
|
35
|
+
}
|
|
36
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
37
|
+
payload.issues.push({
|
|
38
|
+
code: "invalid_type",
|
|
39
|
+
expected: "nonoptional",
|
|
40
|
+
input: undefined,
|
|
41
|
+
path: [${r}]
|
|
42
|
+
});
|
|
43
|
+
if (ctx && ctx.abortEarly) {
|
|
44
|
+
payload.value = newResult;
|
|
45
|
+
return payload;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (${n}_present) {
|
|
50
|
+
newResult[${r}] = ${n}.value;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=ft,c=!ln.jitless,l=c&&pt.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?Li([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function Bi(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=>!Mt(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=>Rt(e,r,un())))}),t)}var Vi=B(`$ZodUnion`,(e,t)=>{H.init(e,t),z(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),z(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),z(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)))}),z(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=>et(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=>Bi(t,r,e,i)):Bi(o,r,e,i)}}),Hi=B(`$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])=>Wi(e,t,n)):Wi(e,i,a)}});function Ui(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(mt(e)&&mt(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=Ui(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=Ui(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 Wi(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=Ui(t.value,n.value);if(!c.valid){if(Mt(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var Gi=B(`$ZodRecord`,(e,t)=>{H.init(e,t);let n=ln.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!mt(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=>Rt(e,i,un())),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(...Pt(n,e.issues)),r.value[l]=e.value})):(u.issues.length&&r.issues.push(...Pt(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`&&mr.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=>Rt(e,i,un())),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(...Pt(n,e.issues)),r.value[u]=e.value})):(d.issues.length&&r.issues.push(...Pt(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}}),Ki=B(`$ZodEnum`,(e,t)=>{H.init(e,t);let n=Je(t.entries),r=new Set(n);e._zod.values=r,z(e,`pattern`,e=>{let t=Je(e.def.entries).filter(e=>gt.has(typeof e));return RegExp(t.length?`^(${t.map(e=>_t(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}}),qi=B(`$ZodTransform`,(e,t)=>{H.init(e,t),e._zod.optin=`optional`,ln.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new cn(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 sn;return n.value=i,n}});function Ji(e,t){return e.value=t.issues.length?void 0:t.value,e}var Yi=B(`$ZodOptional`,(e,t)=>{H.init(e,t),z(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,z(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),z(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${et(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=>Ji(e,t)):Ji(e,r)}return t.innerType._zod.run(e,n)}}),Xi=B(`$ZodExactOptional`,(e,t)=>{Yi.init(e,t),z(e,`values`,e=>e.def.innerType._zod.values),z(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),Zi=B(`$ZodNullable`,(e,t)=>{H.init(e,t),z(e,`optin`,e=>e.def.innerType._zod.optin),z(e,`optout`,e=>e.def.innerType._zod.optout),z(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${et(t.source)}|null)$`):void 0}),z(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)}),Qi=B(`$ZodDefault`,(e,t)=>{H.init(e,t),e._zod.optin=`defaulted`,z(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=>$i(e,t)):$i(r,t)}});function $i(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ea=B(`$ZodPrefault`,(e,t)=>{H.init(e,t),e._zod.optin=`defaulted`,z(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))}),ta=B(`$ZodNonOptional`,(e,t)=>{H.init(e,t),z(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=>na(t,e)):na(i,e)}});function na(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 ra(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>Rt(e,r,un()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var ia=B(`$ZodCatch`,(e,t)=>{H.init(e,t),z(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),z(e,`optout`,e=>e.def.innerType._zod.optout),z(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=>ra(e,r,t,n)):ra(e,r,t,n)}}),aa=B(`$ZodPipe`,(e,t)=>{H.init(e,t),z(e,`values`,e=>e.def.in._zod.values),z(e,`optin`,e=>e.def.in._zod.optin),z(e,`optout`,e=>e.def.out._zod.optout),z(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=>oa(e,t.in,n)):oa(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>oa(e,t.out,n)):oa(r,t.out,n)}});function oa(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 sa=B(`$ZodReadonly`,(e,t)=>{H.init(e,t),z(e,`propValues`,e=>e.def.innerType._zod.propValues),z(e,`values`,e=>e.def.innerType._zod.values),z(e,`optin`,e=>e.def.innerType?._zod?.optin),z(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(ca):ca(r)}});function ca(e){return e.memo||(e.value=Object.freeze(e.value)),e}var la=B(`$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=>ua(t,n,r,e));ua(i,n,r,e)}});function ua(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(Ut(e))}}var da=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},fa=`~memo`,pa=[];function ma(e){return typeof e==`object`&&!!e}function ha(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var ga=new WeakMap,_a=0,va=1,ya=2;function ba(e,t,n){let r=ga.get(e);if(r!==void 0)return r?ya:_a;if(t.has(e))return ya;t.add(e);let i=_a,a=e=>{if(i!==ya&&e?._zod){let r=ba(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=_a;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?va:o.value?._zod?ba(o.value,t,n):_a;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=rt(c);s(e?o(e,!0):va),a(c.catchall);break}case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?ba(r,t,!1):va);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 c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),xa(e,i)}function xa(e,t){return t!==va&&ga.set(e,t===ya),t}function Sa(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var Ca,wa=[],Ta={alloc(e,t,n){let r=Ca;if(!r)return n;Ca=void 0;let i={value:n,issues:null};return r.set(t.value,i),wa.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`&&Da(n,e.value))throw new da;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=ba(e,new Set,!1);if(i===_a)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===ya||r?n=!0:r=!0}let l=s.value;if(!ma(l))return t(s,c);let u=c[fa];u||(u={buckets:new WeakMap,backEdges:void 0},c[fa]=u);let d;i===c?d=a:(d=Sa(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...ha(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;Ca=d;let p=wa.length,m=t(s,c);Ca=void 0;let h=wa.length>p?wa.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?ha(e.issues):pa),e)):(h&&(h.issues=m.issues.length?ha(m.issues):pa),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function Ea(){return Ta}function Da(e,t){let n=e[fa]?.backEdges;return n!==void 0&&ma(t)&&n.has(t)}var Oa=()=>{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`,currency_code:`currency code`,credit_card:`credit card number`,iban:`IBAN`,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(Ht(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${yt(e.values[0])}`:`Invalid option: expected one of ${Ye(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`:``}: ${Ye(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 ka(){return{localeError:Oa()}}var Aa,ja=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 Ma(){return new ja}(Aa=globalThis).__zod_globalRegistry??(Aa.__zod_globalRegistry=Ma());var Na=globalThis.__zod_globalRegistry;function Pa(e){return e.checks&&=[...e.checks],e}function Fa(e,t){return new e(Pa({type:`string`,...R(t)}))}function Ia(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...R(t)})}function La(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...R(t)})}function Ra(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...R(t)})}function za(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...R(t)})}function Ba(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...R(t)})}function Va(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...R(t)})}function Ha(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...R(t)})}function Ua(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...R(t)})}function Wa(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...R(t)})}function Ga(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...R(t)})}function Ka(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...R(t)})}function qa(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...R(t)})}function Ja(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...R(t)})}function Ya(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...R(t)})}function Xa(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...R(t)})}function Za(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...R(t)})}function Qa(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...R(t)})}function $a(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...R(t)})}function eo(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...R(t)})}function to(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...R(t)})}function no(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...R(t)})}function ro(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...R(t)})}function io(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...R(t)})}function ao(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...R(t)})}function oo(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...R(t)})}function so(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...R(t)})}function co(e,t){return new e(Pa({type:`number`,checks:[],...R(t)}))}function lo(e,t){return new e({type:`number`,check:`number_format`,abort:!1,format:`safeint`,...R(t)})}function uo(e,t){return new e({type:`boolean`,...R(t)})}function fo(e){return new e({type:`unknown`})}function po(e,t){return new e({type:`never`,...R(t)})}function mo(e,t){return new br({check:`less_than`,...R(t),value:e,inclusive:!1})}function ho(e,t){return new br({check:`less_than`,...R(t),value:e,inclusive:!0})}function go(e,t){return new xr({check:`greater_than`,...R(t),value:e,inclusive:!1})}function _o(e,t){return new xr({check:`greater_than`,...R(t),value:e,inclusive:!0})}function vo(e,t){return new Sr({check:`multiple_of`,...R(t),value:e})}function yo(e,t){return new wr({check:`max_length`,...R(t),maximum:e})}function bo(e,t){return new Tr({check:`min_length`,...R(t),minimum:e})}function xo(e,t){return new Er({check:`length_equals`,...R(t),length:e})}function So(e,t){return new Or({check:`string_format`,format:`regex`,...R(t),pattern:e})}function Co(e){return new kr({check:`string_format`,format:`lowercase`,...R(e)})}function wo(e){return new Ar({check:`string_format`,format:`uppercase`,...R(e)})}function To(e,t){return new jr({check:`string_format`,format:`includes`,...R(t),includes:e})}function Eo(e,t){return new Mr({check:`string_format`,format:`starts_with`,...R(t),prefix:e})}function Do(e,t){return new Nr({check:`string_format`,format:`ends_with`,...R(t),suffix:e})}function Oo(e){return new Pr({check:`overwrite`,tx:e})}function ko(e){return Oo(t=>t.normalize(e))}function Ao(){return Oo(e=>e.trim())}function jo(){return Oo(e=>e.toLowerCase())}function Mo(){return Oo(e=>e.toUpperCase())}function No(){return Oo(e=>ut(e))}function Po(e,t,n){return new e({type:`array`,element:t,...R(n)})}function Fo(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...R(n)})}function Io(e,t){let n=Lo(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(Ut(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(Ut(r))}},e(t.value,t)),t);return n}function Lo(e,t){let n=new V({check:`custom`,...R(t)});return n._zod.check=e,n}function Ro(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&nt(e,t,n[t]);return e}function zo(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??Na,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 Bo(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&&Ro(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 Vo(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Ho(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}/${Vo(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+Vo(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>
|
|
54
|
+
|
|
55
|
+
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);else{if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}(e.metadataRegistry.get(n[0])?.id||r.cycle||r.count>1&&e.reused===`ref`)&&a(n)}}e.external&&(e.sharedDefsExtractedFor=e.external)}function Uo(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;Uo(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 Wo=new Set([`type`,`properties`,`required`,`additionalProperties`]),Go=[`oneOf`,`anyOf`];function Ko(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function qo(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Wo.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]??Ko(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}nt(n,r,e.length===1?e[0]:qo(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=Ko(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 Jo(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Wo)if(t in e)return;let n=t.filter(e=>Go.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=qo(t);else{let e=n[0],i=Go.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=>qo([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,Ro(e,r))}function Yo(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)):Ro(i,s),Ro(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())Uo(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)??[])Jo(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)}Ro(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,nt(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:Zo(t,`input`,e.processors),output:Zo(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 Xo=(e,t={})=>n=>{let r=zo({...n,processors:t});return W(e,r),Ho(r,e),Yo(r,e)},Zo=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=zo({...i??{},target:a,io:t,processors:n});return W(e,o),Ho(o,e),Yo(o,e)},Qo=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},$o=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},es=(e,t)=>{Qo(e,`minimum`,t),$o(e,`maximum`,t)},ts=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},ns=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},rs=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},is=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},as=(e,t)=>Qo(e,`minimum`,t.minimum),os=(e,t)=>$o(e,`maximum`,t.maximum),ss=e=>(t,n)=>{is(t,n.format);let[r,i]=e[n.format];Qo(t,`minimum`,r),$o(t,`maximum`,i)},cs={greater_than:(e,t)=>Qo(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>$o(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>ts(e,t.value),number_format:ss(xt),bigint_format:ss(St),min_length:as,max_length:os,length_equals:(e,t)=>es(e,t.length),min_size:as,max_size:os,size_equals:(e,t)=>es(e,t.size),string_format:(e,t)=>{is(e,t.format),t.pattern&&ns(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>rs(e,t.mime)};function ls(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)cs[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&Qo(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&Qo(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&$o(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&$o(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&ts(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&rs(t,i.mime);for(let e of i.patterns??[])ns(t,e);return t}var us={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},ds=new Map([[_i,nr],[yi,rr]]),fs=e=>ds.get(e)??e,ps=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=ls(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=us[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(fs);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}))])}},ms=(e,t,n,r)=>{let i=n,{minimum:a,maximum:o,multipleOf:s,exclusiveMaximum:c,exclusiveMinimum:l,isInt:u}=ls(e);i.type=u?`integer`:`number`;let d=typeof l==`number`&&l>=(a??-1/0),f=typeof c==`number`&&c<=(o??1/0),p=t.target===`draft-04`||t.target===`openapi-3.0`;if(d?p?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l:typeof a==`number`&&(i.minimum=a),f?p?(i.maximum=c,i.exclusiveMaximum=!0):i.exclusiveMaximum=c:typeof o==`number`&&(i.maximum=o),s){let n=new Set;for(let a of s)Number.isFinite(a)&&a!==0?n.add(Math.abs(a)):Bo(e,t,i,r,`A multipleOf divisor of ${a} cannot be represented in JSON Schema`);let[a,...o]=n;a!==void 0&&(i.multipleOf=a),o.length&&(i.allOf=[...i.allOf??[],...o.map(e=>({multipleOf:e}))])}},hs=(e,t,n,r)=>{n.type=`boolean`},gs=(e,t,n,r)=>{n.not={}},_s=(e,t,n,r)=>{let i=e._zod.def,a=Je(i.entries);a.length===0?n.not={}:(a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a)},vs=(e,t,n,r)=>{Bo(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},ys=(e,t,n,r)=>{Bo(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},bs=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=ls(e);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 xs(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?xs(t.out):t.type===`catch`?xs(t.innerType):e._zod.optin}var Ss=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Bo(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)nt(i.properties,e,W(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=[];for(let e of Object.keys(o)){let n=a.shape[e];(t.io===`input`?xs(n)===void 0:n._zod.optout===void 0)&&s.push(e)}s.length>0&&(i.required=s),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)},Cs=(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},ws=(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 Ts(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=Ts(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=>Ts(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`)?mr:pr).source)),p}var Es=new WeakMap;function Ds(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 Es.get(e)??[]){let i=e.seen.get(r),a=(i?.def??i?.schema)?.propertyNames;if(!a||a===!0||n.has(a))continue;let o=Ts(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 Os=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`;let o=a.keyType,s=ls(o).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)nt(i.patternProperties,fs(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=Es.get(t);n||(n=[],Es.set(t,n),t.deferred.push(()=>Ds(t))),n.push(e)}i.additionalProperties=W(a.valueType,t,{...r,path:[...r.path,`additionalProperties`]})}let c=o._zod.values,l=t.io===`input`&&xs(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))}},ks=(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`}]},As=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},js=Symbol();function Ms(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Bo(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),js):JSON.parse(o)}var Ns=(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=Ms(i.defaultValue,e,t,n,r);o!==js&&(n.default=o)},Ps=(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=Ms(i.defaultValue,e,t,n,r);o!==js&&(n._prefault=o)},Fs=(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{Bo(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},Is=(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},Ls=(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},Rs=(e,t,n,r)=>{let i=e._zod.def;W(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},zs=new WeakSet([Object.prototype,Error.prototype]);function Bs(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=B(`ZodError`,(e,t)=>{gn.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);zs.has(n)||(zs.add(n),Bs(n,`format`,e=>t=>yn(e,t)),Bs(n,`flatten`,e=>t=>vn(e,t)),Bs(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Xe,2)}),Bs(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Xe,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),Vs=xn(K),Hs=Sn(K),Us=Cn(K),Ws=Tn(K),Gs=jn(K),Ks=Mn(K),qs=Nn(K),Js=Pn(K),Ys=Fn(K),Xs=In(K),Zs=Ln(K),Qs=Rn(K);function $s(){ln.localeError||un(ka())}function ec(){ln.memoizer||un({memoizer:Ea()})}var q=B(`ZodType`,(e,t)=>($s(),H.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(L(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 vt(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(fl(e,t))},superRefine(e,t){return this.check(pl(e,t))},overwrite(e){return this.check(Oo(e))},optional(){return Jc(this)},exactOptional(){return Xc(this)},nullable(){return Qc(this)},nullish(){return Jc(Qc(this))},nonoptional(e){return il(this,e)},array(){return Q(this)},or(e){return Rc([this,e])},and(e){return Bc(this,e)},transform(e){return cl(this,Kc(e))},default(e){return el(this,e)},prefault(e){return nl(this,e)},catch(e){return ol(this,e)},pipe(e){return cl(this,e)},readonly(){return ul(this)},describe(e){let t=this.clone();return Na.add(t,{description:e}),t},meta(...e){if(e.length===0)return Na.get(this);let t=this.clone();return Na.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 Kt(this,`~standard`,{...zr(this),jsonSchema:{input:Zo(this,`input`),output:Zo(this,`output`)}})},set"~standard"(e){Gt(this,`~standard`,e)},parse:function e(t,n){return Vs(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await Hs(this,t,n,{callee:e})},safeParse(e,t){return Us(this,e,t)},async safeParseAsync(e,t){return Ws(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){Gt(this,`spa`,e)},validate(e,t){return On(this,e,t)},validateAsync(e,t){return An(this,e,t)},encode:function e(t,n){return Gs(this,t,n,{callee:e})},decode:function e(t,n){return Ks(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await qs(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await Js(this,t,n,{callee:e})},safeEncode(e,t){return Ys(this,e,t)},safeDecode(e,t){return Xs(this,e,t)},async safeEncodeAsync(e,t){return Zs(this,e,t)},async safeDecodeAsync(e,t){return Qs(this,e,t)},toJSONSchema(e){return Xo(this,{})(e)},get description(){return Na.get(this)?.description},get _def(){return this._zod.def}}),tc=B(`_ZodString`,(e,t)=>{Br.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ps(e,t,n,r)},qt({format:e=>ls(e).format??null,minLength:e=>ls(e).minimum??null,maxLength:e=>ls(e).maximum??null},{regex(...e){return this.check(So(...e))},includes(...e){return this.check(To(...e))},startsWith(...e){return this.check(Eo(...e))},endsWith(...e){return this.check(Do(...e))},min(...e){return this.check(bo(...e))},max(...e){return this.check(yo(...e))},length(...e){return this.check(xo(...e))},nonempty(...e){return this.check(bo(1,...e))},lowercase(e){return this.check(Co(e))},uppercase(e){return this.check(wo(e))},trim(){return this.check(Ao())},normalize(...e){return this.check(ko(...e))},toLowerCase(){return this.check(jo())},toUpperCase(){return this.check(Mo())},slugify(){return this.check(No())}})),nc=B(`ZodString`,(e,t)=>{Br.init(e,t),tc.init(e,t)},{email(e){return this.check(Ia(sc,e))},url(e){return this.check(Ha(uc,e))},jwt(e){return this.check(ro(Tc,e))},emoji(e){return this.check(Ua(dc,e))},guid(e){return this.check(La(cc,e))},uuid(e){return this.check(Ra(lc,e))},uuidv4(e){return this.check(za(lc,e))},uuidv6(e){return this.check(Ba(lc,e))},uuidv7(e){return this.check(Va(lc,e))},nanoid(e){return this.check(Wa(fc,e))},cuid(e){return this.check(Ga(pc,e))},cuid2(e){return this.check(Ka(mc,e))},ulid(e){return this.check(qa(hc,e))},base64(e){return this.check(eo(Sc,e))},base64url(e){return this.check(to(Cc,e))},xid(e){return this.check(Ja(gc,e))},ksuid(e){return this.check(Ya(_c,e))},ipv4(e){return this.check(Xa(vc,e))},ipv6(e){return this.check(Za(yc,e))},cidrv4(e){return this.check(Qa(bc,e))},cidrv6(e){return this.check($a(xc,e))},e164(e){return this.check(no(wc,e))},datetime(e){return this.check(io(rc,e))},date(e){return this.check(ao(ic,e))},time(e){return this.check(oo(ac,e))},duration(e){return this.check(so(oc,e))}});function J(e){return Fa(nc,e)}var Y=B(`ZodStringFormat`,(e,t)=>{U.init(e,t),tc.init(e,t)}),rc=B(`ZodISODateTime`,(e,t)=>{ai.init(e,t),Y.init(e,t)}),ic=B(`ZodISODate`,(e,t)=>{oi.init(e,t),Y.init(e,t)}),ac=B(`ZodISOTime`,(e,t)=>{si.init(e,t),Y.init(e,t)}),oc=B(`ZodISODuration`,(e,t)=>{ci.init(e,t),Y.init(e,t)}),sc=B(`ZodEmail`,(e,t)=>{Ur.init(e,t),Y.init(e,t)}),cc=B(`ZodGUID`,(e,t)=>{Vr.init(e,t),Y.init(e,t)}),lc=B(`ZodUUID`,(e,t)=>{Hr.init(e,t),Y.init(e,t)}),uc=B(`ZodURL`,(e,t)=>{Zr.init(e,t),Y.init(e,t)}),dc=B(`ZodEmoji`,(e,t)=>{Qr.init(e,t),Y.init(e,t)}),fc=B(`ZodNanoID`,(e,t)=>{$r.init(e,t),Y.init(e,t)}),pc=B(`ZodCUID`,(e,t)=>{ei.init(e,t),Y.init(e,t)}),mc=B(`ZodCUID2`,(e,t)=>{ti.init(e,t),Y.init(e,t)}),hc=B(`ZodULID`,(e,t)=>{ni.init(e,t),Y.init(e,t)}),gc=B(`ZodXID`,(e,t)=>{ri.init(e,t),Y.init(e,t)}),_c=B(`ZodKSUID`,(e,t)=>{ii.init(e,t),Y.init(e,t)}),vc=B(`ZodIPv4`,(e,t)=>{li.init(e,t),Y.init(e,t)}),yc=B(`ZodIPv6`,(e,t)=>{fi.init(e,t),Y.init(e,t)}),bc=B(`ZodCIDRv4`,(e,t)=>{pi.init(e,t),Y.init(e,t)}),xc=B(`ZodCIDRv6`,(e,t)=>{hi.init(e,t),Y.init(e,t)}),Sc=B(`ZodBase64`,(e,t)=>{vi.init(e,t),Y.init(e,t)}),Cc=B(`ZodBase64URL`,(e,t)=>{xi.init(e,t),Y.init(e,t)}),wc=B(`ZodE164`,(e,t)=>{Si.init(e,t),Y.init(e,t)}),Tc=B(`ZodJWT`,(e,t)=>{wi.init(e,t),Y.init(e,t)}),Ec=B(`ZodNumber`,(e,t)=>{Ti.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ms(e,t,n,r),e.isFinite=!0},qt({minValue:e=>{let{minimum:t,exclusiveMinimum:n}=ls(e);return Math.max(t??-1/0,n??-1/0)},maxValue:e=>{let{maximum:t,exclusiveMaximum:n}=ls(e);return Math.min(t??1/0,n??1/0)},isInt:e=>{let{isInt:t,multipleOf:n}=ls(e);return!!t||!!n?.some(Number.isSafeInteger)},format:e=>ls(e).format??null},{gt(e,t){return this.check(go(e,t))},gte(e,t){return this.check(_o(e,t))},min(e,t){return this.check(_o(e,t))},lt(e,t){return this.check(mo(e,t))},lte(e,t){return this.check(ho(e,t))},max(e,t){return this.check(ho(e,t))},int(e){return this.check(Oc(e))},safe(e){return this.check(Oc(e))},positive(e){return this.check(go(0,e))},nonnegative(e){return this.check(_o(0,e))},negative(e){return this.check(mo(0,e))},nonpositive(e){return this.check(ho(0,e))},multipleOf(e,t){return this.check(vo(e,t))},step(e,t){return this.check(vo(e,t))},finite(){return this}}));function X(e){return co(Ec,e)}var Dc=B(`ZodNumberFormat`,(e,t)=>{Ei.init(e,t),Ec.init(e,t)});function Oc(e){return lo(Dc,e)}var kc=B(`ZodBoolean`,(e,t)=>{Di.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>hs(e,t,n,r)});function Ac(e){return uo(kc,e)}var jc=B(`ZodUnknown`,(e,t)=>{Oi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function Z(){return fo(jc)}var Mc=B(`ZodNever`,(e,t)=>{ki.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gs(e,t,n,r)});function Nc(e){return po(Mc,e)}var Pc=B(`ZodArray`,(e,t)=>{ec(),Ni.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bs(e,t,n,r),e.element=t.element},{min(e,t){return this.check(bo(e,t))},nonempty(e){return this.check(bo(1,e))},max(e,t){return this.check(yo(e,t))},length(e,t){return this.check(xo(e,t))},unwrap(){return this.element}});function Q(e,t){return Po(Pc,e,t)}var Fc=B(`ZodObject`,(e,t)=>{ec(),zi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ss(e,t,n,r),$t(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return Wc(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(L(this._zod.def,{catchall:e}))},passthrough(){return this.clone(L(this._zod.def,{catchall:Z()}))},loose(){return this.clone(L(this._zod.def,{catchall:Z()}))},strict(){return this.clone(L(this._zod.def,{catchall:Nc()}))},strip(){return this.clone(L(this._zod.def,{catchall:void 0}))},extend(e){return Et(this,e)},safeExtend(e){return Ot(this,e)},merge(e){return kt(this,e)},pick(e){return Ct(this,e)},omit(e){return Tt(this,e)},partial(...e){return At(qc,this,e[0])},exactPartial(...e){return At(Yc,this,e[0],`exactPartial`)},required(...e){return jt(rl,this,e[0])}});function Ic(e,t){return new Fc({type:`object`,shape:e??{},...R(t)})}var Lc=B(`ZodUnion`,(e,t)=>{Vi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cs(e,t,n,r),e.options=t.options});function Rc(e,t){return new Lc({type:`union`,options:e,...R(t)})}var zc=B(`ZodIntersection`,(e,t)=>{Hi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ws(e,t,n,r)});function Bc(e,t){return new zc({type:`intersection`,left:e,right:t})}var Vc=B(`ZodRecord`,(e,t)=>{ec(),Gi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Os(e,t,n,r),e.keyType=t.keyType,e.valueType=t.valueType});function Hc(e,t,n){return!t||!t._zod?new Vc({type:`record`,keyType:J(),valueType:e,...R(t)}):new Vc({type:`record`,keyType:e,valueType:t,...R(n)})}var Uc=B(`ZodEnum`,(e,t)=>{Ki.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_s(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];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 Uc({...t,checks:[],...R(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 Uc({...t,checks:[],...R(r),entries:i})}});function Wc(e,t){return new Uc({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...R(t)})}var Gc=B(`ZodTransform`,(e,t)=>{ec(),qi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ys(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new cn(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(Ut(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(Ut(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function Kc(e){return new Gc({type:`transform`,transform:e})}var qc=B(`ZodOptional`,(e,t)=>{Yi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Jc(e){return new qc({type:`optional`,innerType:e})}var Yc=B(`ZodExactOptional`,(e,t)=>{Xi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Xc(e){return new Yc({type:`optional`,innerType:e})}var Zc=B(`ZodNullable`,(e,t)=>{Zi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ks(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Qc(e){return new Zc({type:`nullable`,innerType:e})}var $c=B(`ZodDefault`,(e,t)=>{Qi.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ns(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function el(e,t){return new $c({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ht(t)}})}var tl=B(`ZodPrefault`,(e,t)=>{ea.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ps(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function nl(e,t){return new tl({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ht(t)}})}var rl=B(`ZodNonOptional`,(e,t)=>{ta.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>As(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function il(e,t){return new rl({type:`nonoptional`,innerType:e,...R(t)})}var al=B(`ZodCatch`,(e,t)=>{ia.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Fs(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function ol(e,t){return new al({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:tn(t)})}var sl=B(`ZodPipe`,(e,t)=>{aa.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Is(e,t,n,r),e.in=t.in,e.out=t.out});function cl(e,t){return new sl({type:`pipe`,in:e,out:t})}var ll=B(`ZodReadonly`,(e,t)=>{sa.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Ls(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ul(e){return new ll({type:`readonly`,innerType:e})}var dl=B(`ZodCustom`,(e,t)=>{la.init(e,t),q.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vs(e,t,n,r)});function fl(e,t={}){return Fo(dl,e,t)}function pl(e,t){return Io(e,t)}var ml=Ic({activePRs:X(),shelvedPRs:X(),mergedPRs:X(),closedPRs:X(),mergeRate:J(),availableIssues:X().optional()}),hl=Ic({active:X(),merged:X(),closed:X()}),gl=Ic({repo:J(),active:X(),merged:X(),closed:X()}),_l=Ic({stats:ml,prsByRepo:Hc(J(),hl),topRepos:Q(gl),monthlyMerged:Hc(J(),X()),monthlyOpened:Hc(J(),X()),monthlyClosed:Hc(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:Hc(J(),Z()).optional(),vettedIssues:Z().nullable().optional(),offline:Ac().optional(),lastUpdated:J().optional(),partialFailures:Q(J()).optional()});function vl(e){let t=_l.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 yl=15e3,bl=Symbol(`csrf-rejected`),xl=class extends Error{kind=bl;constructor(e){super(e)}},Sl=Symbol(`conflict`),Cl=class extends Error{kind=Sl;constructor(e){super(e)}};async function wl(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 xl(e):n.status===409?new Cl(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=vl(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 Tl(){let[e,t]=N(null),[n,r]=N(!0),[i,a]=N(!1),[o,s]=N(null),[c,l]=N(null),[u,d]=N(!1),[f,p]=N(null),[m,h]=N(0),g=Oe(null),_=I(e=>{e.csrfToken&&(g.current=e.csrfToken),t(e.data),d(e.stale),p(e.staleReason),h(0)},[]),v=I(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=I(async(e,t)=>{try{return await wl(e,v(t))}catch(n){if(!(n instanceof xl)&&!(n instanceof Cl))throw n;try{let e=await wl(`/api/data`);e.csrfToken&&(g.current=e.csrfToken)}catch{throw n}return wl(e,v(t))}},[v]),b=I(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=I(()=>b(()=>wl(`/api/data`)),[b]),ee=I(()=>b(()=>y(`/api/refresh`)),[b,y]),S=I(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]),C=I(async e=>{try{let t=await y(`/api/action`,JSON.stringify(e));_(t),s(null)}catch(e){try{_(await wl(`/api/data`))}catch(e){console.error(`Failed to re-fetch dashboard data after action error:`,e)}throw e}},[_,y]);return P(()=>{x();let e=setTimeout(()=>{S()},5e3);return()=>clearTimeout(e)},[x,S]),P(()=>{if(m<1||m>=2)return;let e=setTimeout(()=>{S()},yl);return()=>clearTimeout(e)},[m,S]),{data:e,loading:n,refreshing:i,error:o,clearError:I(()=>s(null),[]),refresh:ee,performAction:C,lastUpdated:c,stale:u,staleReason:f,autoRefreshFailures:m}}var El=`oss-autopilot-theme`;function Dl(){try{let e=localStorage.getItem(El);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 Ol(e){document.documentElement.setAttribute(`data-theme`,e)}function kl(){let[e,t]=N(Dl);return P(()=>{Ol(e)},[e]),P(()=>{if(!window.matchMedia)return;let e=window.matchMedia(`(prefers-color-scheme: light)`),n=e=>{try{if(localStorage.getItem(El))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:I(()=>{t(e=>{let t=e===`dark`?`light`:`dark`;try{localStorage.setItem(El,t)}catch(e){console.warn(`[useTheme] Failed to persist theme preference:`,e)}return t})},[])}}var Al=null,jl=null;function Ml(){return Al?Promise.resolve(Al):jl||(jl=qe(()=>import(`./confetti.module-D2UmBLOm.js`).then(e=>(Al=e.default,Al)),[]).catch(e=>(console.warn(`[useCelebration] canvas-confetti import failed, skipping animation:`,e),null)),jl)}var Nl=`oss-autopilot-merged-count`;function Pl(){try{let e=localStorage.getItem(Nl);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=${Nl}):`,e),null;throw e}}function Fl(e){try{localStorage.setItem(Nl,String(e))}catch(t){if(t instanceof DOMException){console.warn(`[useCelebration] Failed to persist merged count (value=${e}):`,t);return}throw t}}function Il(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 Ll(){(typeof window>`u`||window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches!==!0)&&Ml().then(e=>{e&&Il(e)}).catch(()=>{})}function Rl(e){let[t,n]=N(null);return P(()=>{if(e===void 0)return;let t=Pl();if(t===null||e<=t){t!==e&&Fl(e);return}let r=e-t;Fl(e),Ll();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:I(()=>n(null),[]),trigger:I((e=3)=>{Ll();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 zl(e,t){let n=t?.duration??800,[r,i]=N(0),a=Oe(0);a.current=r;let o=Oe(0),s=Oe(0),c=Oe(0);return P(()=>{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 Bl=0;Array.isArray;function $(t,n,r,i,a,o){n||={};var s,c,l=n;if(`ref`in l&&typeof t!=`function`)for(c in l={},n)c==`ref`?s=n[c]:l[c]=n[c];var u={type:t,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Bl,__i:-1,__u:0};return(a||o)&&(u.__source=a,u.__self=o),e.vnode&&e.vnode(u),u}function Vl({value:e}){let t=typeof e==`string`?e.match(/^(\d+)([^\d.].*)?$/):null,n=zl(typeof e==`number`?e:t?parseInt(t[1]??`0`,10):0);return typeof e==`number`?$(b,{children:n}):t?$(b,{children:[n,t[2]??``]}):$(b,{children:e})}function Hl({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:$(Vl,{value:e.value})}),$(`span`,{class:`stat-label`,children:e.label})]},e.label))})}var Ul={needs_addressing:`Needs Addressing`,waiting_on_maintainer:`Waiting on Maintainer`};function Wl(e){return Ul[e]??e}function Gl({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:Wl(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 Kl(e){return e.replaceAll(/^\[|\]$/g,``)}function ql(e){switch(Kl(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 Jl(e,t){return e.length>t?e.slice(0,t)+`...`:e}function Yl(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 Xl(e){return e.attentionBucket??(e.status===`needs_addressing`?`needs_attention`:`waiting`)}function Zl(e){switch(e){case`needs_addressing`:return`var(--red)`;case`waiting_on_maintainer`:return`var(--blue)`;default:return`var(--text-muted)`}}function Ql(e){switch(e){case`passing`:return`var(--green)`;case`failing`:return`var(--red)`;case`pending`:return`var(--amber)`;default:return`var(--text-muted)`}}function $l(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}var eu={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 tu(e){return e?eu[e]??`var(--text-muted)`:`var(--text-muted)`}function nu(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 ru(e,t){return e?`Refreshing...`:t?`Updating...`:`Refresh`}var iu=[{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 au(e){switch(e){case`needs_addressing`:return`pr-row--need-attention`;case`waiting_on_maintainer`:return`pr-row--waiting`;default:return``}}function ou({pr:e,selected:t,onSelect:n}){return $(`div`,{class:`pr-row ${au(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:Zl(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:Jl(e.title,50)}),e.displayLabel&&$(`span`,{class:`pill ${ql(e.displayLabel)}`,children:Kl(e.displayLabel)}),$(`span`,{class:`pr-row-age`,children:[e.daysSinceActivity,`d ago`]})]})}function su({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=>$(ou,{pr:e,selected:e.url===t,onSelect:n},e.url))]})}function cu({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=iu.map(({bucket:e,id:t,title:n,dotClass:r})=>({id:t,title:n,dotClass:r,prs:o.filter(t=>Xl(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=>$(su,{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=>$(ou,{pr:e,selected:e.url===t,onSelect:n},e.url))})]})]})}function lu({pr:e,isShelved:t,onAction:n}){let[r,i]=N(!1),[a,o]=N(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 uu(e){switch(e){case`approved`:return`Approved`;case`changes_requested`:return`Changes Requested`;case`review_required`:return`Review Required`;default:return`Unknown`}}function du(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 fu(e){switch(e){case`passing`:return`green`;case`failing`:return`red`;case`pending`:return`amber`;default:return``}}function pu(e){switch(e){case`approved`:return`green`;case`changes_requested`:return`red`;case`review_required`:return`amber`;default:return``}}function mu(e){return e>=7?`red`:e>=3?`amber`:`green`}function hu(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 gu({pr:e,isShelved:t,onAction:n,onClose:r}){let i=fu(e.ciStatus),a=pu(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 ${ql(e.displayLabel)}`,children:Kl(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:Ql(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:hu(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:du(e.reviewDecision)},children:uu(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:[`· `,Yl(e.lastMaintainerComment.createdAt)]})]}),$(`p`,{class:`pr-detail-comment-body`,children:Jl(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 ${mu(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:Yl(e.createdAt)})]}),$(`div`,{class:`pr-detail-field`,children:[$(`span`,{class:`pr-detail-field-label`,children:`Updated`}),$(`span`,{class:`pr-detail-field-value`,children:Yl(e.updatedAt)})]})]}),$(lu,{pr:e,isShelved:t,onAction:n})]})}var _u=null,vu=null;function yu(){return _u?Promise.resolve(_u):vu||(vu=qe(()=>import(`./chart-panel-DPKNBUts.js`).then(e=>(_u=e.ChartPanel,_u)),[]),vu)}function bu(){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:`240px`}})]}),$(`div`,{class:`chart-card`,children:[$(`h3`,{class:`chart-card-title`,children:`Top Repos`}),$(`div`,{class:`chart-canvas-wrapper`,style:{minHeight:`240px`}})]})]})}function xu(e){let[t,n]=N(()=>_u),[r,i]=N(null);return P(()=>{if(t)return;let e=!1;return yu().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}):$(bu,{})}function Su({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=>$(Cu,{issue:e,onAction:t},e.url))})]})}function Cu({issue:e,onAction:t}){let[n,r]=N(!1),[i,a]=N(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:Jl(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:Yl(e.lastResponseAt)})]}),$(`p`,{class:`issue-item-response-body`,children:Jl(e.lastResponseBody,150)}),$(`span`,{class:`issue-item-age`,children:[e.daysSinceUserComment,`d since your comment`]})]})}function wu({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:Jl(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:Yl(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:Jl(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:Yl(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:Jl(e.title,60)}),$(`a`,{class:`recent-activity-link`,href:e.url,target:`_blank`,rel:`noopener noreferrer`,children:[e.repo,`#`,e.number]})]},e.url))})]})]})}function Tu({mergedPRs:e,repoMetadata:t,onBack:n}){let[r,i]=N(`date`),[a,o]=N(`desc`);function s(e){r===e?o(e=>e===`asc`?`desc`:`asc`):(i(e),o(e===`date`||e===`stars`?`desc`:`asc`))}let c=F(()=>[...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:Jl(e.title,80)})]}),$(`td`,{class:`merged-table-col-stars`,children:$(`span`,{class:`merged-table-stars`,children:n?.stars==null?`—`:`★ ${$l(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:tu(n.language)}}),n.language]}):$(`span`,{class:`merged-table-language`,children:`—`})}),$(`td`,{children:$(`span`,{class:`merged-table-date`,children:Yl(e.mergedAt)})})]},e.url)})})]})]})}function Eu({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:Jl(e.title,80)})]}),$(`td`,{children:$(`span`,{class:`merged-table-date`,children:Yl(e.closedAt)})})]},e.url))})]})]})}function Du(e){return e>=8?`vetted-score--high`:e>=6?`vetted-score--mid`:``}function Ou(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)].at(-1)?.[1]?.trim();return{stars:t,language:r}}function ku({vettedIssues:e,repoMetadata:t,onBack:n}){let[r,i]=N(``),a=F(()=>e.available.filter(e=>e.score!==void 0&&e.score>=6).sort((e,t)=>(t.score??0)-(e.score??0)),[e.available]),o=F(()=>{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?Ou(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:Jl(e.title,80)})]}),$(`td`,{class:`merged-table-col-stars`,children:$(`span`,{class:`merged-table-stars`,children:i==null?`—`:`\u{2605} ${$l(i)}`})}),$(`td`,{class:`merged-table-col-language`,children:a?$(`span`,{class:`merged-table-language`,children:[$(`span`,{class:`merged-table-language-dot`,style:{backgroundColor:tu(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 ${Du(e.score)}`,children:[e.score,`/10`]})})]},e.url)})})]})]})}function Au(){return $(`div`,{class:`skeleton-row`,children:[...[,,,,,]].map((e,t)=>$(`div`,{class:`skeleton-card`},t))})}function ju(){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 Mu(){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 Nu({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`?ju:Mu,{})})}var Pu=5e3;function Fu({celebration:e,onDismiss:t}){return P(()=>{if(!e)return;let n=setTimeout(t,Pu);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 Iu(){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 Lu=3e4;function Ru({stats:e,loading:t,refreshing:n,lastUpdated:r,onRefresh:i,theme:a,onToggleTheme:o,onCelebrate:s}){let[,c]=N(0);return P(()=>{let e=setInterval(()=>c(e=>e+1),Lu);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:nu(r)}),$(Nu,{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`}):$(Iu,{}),ru(t,n)]})]})]})]})}var zu=new Set([`/`,`/merged`,`/closed`,`/issues`]),Bu=[];function Vu(){let{data:e,loading:t,refreshing:n,error:r,clearError:i,refresh:a,performAction:o,lastUpdated:s,stale:c,staleReason:l,autoRefreshFailures:u}=Tl(),{theme:d,toggleTheme:f}=kl(),{celebration:p,dismiss:m,trigger:h}=Rl(e?.stats.mergedPRs),[g,_]=N({status:`all`,repo:`all`,search:``}),[v,y]=N(null),[x,ee]=N(!1),{path:S,route:C}=Ue(),w=Oe(null);P(()=>{w.current?.focus({preventScroll:!1})},[S]),P(()=>{let t=new Set(e?.shelvedPRUrls??[]),n=(e?.activePRs??[]).filter(e=>!t.has(e.url)&&Xl(e)===`needs_attention`).length;document.title=n>0?`(${n}) OSS Autopilot`:`OSS Autopilot Dashboard`},[e?.activePRs,e?.shelvedPRUrls]),P(()=>{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 te=F(()=>new Set(e?.shelvedPRUrls??[]),[e?.shelvedPRUrls]),T=e?.activePRs??Bu,E=F(()=>[...new Set(T.map(e=>e.repo))].sort(),[T]),D=F(()=>[...new Set(T.map(e=>e.status))].sort(),[T]),ne=F(()=>T.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}),[T,g.status,g.repo,g.search]),re=F(()=>T.filter(e=>!te.has(e.url)),[T,te]);if(t&&!e)return $(`div`,{class:`skeleton-wrapper`,children:[$(Au,{}),$(`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 ie={stats:e.stats,loading:t,refreshing:n,lastUpdated:s,onRefresh:a,theme:d,onToggleTheme:f,onCelebrate:h},ae=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,oe=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,se=$(b,{children:[r?$(`div`,{class:`error-banner`,role:`alert`,children:[$(`span`,{children:r}),$(`button`,{class:`error-banner-dismiss`,onClick:i,children:`Dismiss`})]}):null,oe?$(`div`,{class:`partial-banner stale-banner`,role:`status`,"aria-live":`polite`,children:$(`span`,{children:oe})}):null,ae]});if(S===`/merged`){let t=e.allMergedPRs??[];return $(`div`,{class:`dashboard`,children:[$(Ru,{...ie}),se,$(`main`,{id:`main-content`,class:`dashboard-main`,children:[$(`h2`,{ref:w,tabIndex:-1,class:`visually-hidden`,children:`Merged pull requests`}),$(Tu,{mergedPRs:t,repoMetadata:e.repoMetadata,onBack:()=>C(`/`)})]}),$(Fu,{celebration:p,onDismiss:m})]})}if(S===`/closed`){let t=e.allClosedPRs??[];return $(`div`,{class:`dashboard`,children:[$(Ru,{...ie}),se,$(`main`,{id:`main-content`,class:`dashboard-main`,children:[$(`h2`,{ref:w,tabIndex:-1,class:`visually-hidden`,children:`Closed pull requests`}),$(Eu,{closedPRs:t,onBack:()=>C(`/`)})]}),$(Fu,{celebration:p,onDismiss:m})]})}if(S===`/issues`)return $(`div`,{class:`dashboard`,children:[$(Ru,{...ie}),se,$(`main`,{id:`main-content`,class:`dashboard-main`,children:[$(`h2`,{ref:w,tabIndex:-1,class:`visually-hidden`,children:`Vetted issues`}),e.vettedIssues?$(ku,{vettedIssues:e.vettedIssues,repoMetadata:e.repoMetadata,onBack:()=>C(`/`)}):$(`div`,{class:`merged-view merged-view--full-width`,children:[$(`div`,{class:`merged-view-header`,children:[$(`button`,{class:`merged-view-back`,onClick:()=>C(`/`),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.`})]})]}),$(Fu,{celebration:p,onDismiss:m})]});if(!zu.has(S))return $(`div`,{class:`dashboard`,children:[$(Ru,{...ie}),se,$(`main`,{id:`main-content`,class:`dashboard-main`,children:$(`div`,{class:`merged-view merged-view--full-width`,role:`alert`,children:[$(`div`,{class:`merged-view-header`,children:[$(`button`,{class:`merged-view-back`,onClick:()=>C(`/`),type:`button`,children:`← Back to dashboard`}),$(`div`,{children:$(`h2`,{ref:w,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.`]})})]})}),$(Fu,{celebration:p,onDismiss:m})]});let O=v?e.activePRs.find(e=>e.url===v)??null:null,ce=re.filter(e=>Xl(e)===`needs_attention`).length,k=re.filter(e=>Xl(e)===`stuck_ci`).length,le=re.filter(e=>Xl(e)===`dormant_followup`).length,ue=re.filter(e=>Xl(e)===`waiting`).length,A=e=>{let t=document.getElementById(e);t&&t.scrollIntoView({behavior:`smooth`,block:`start`})};return $(`div`,{class:`dashboard`,children:[$(Ru,{...ie}),se,$(`main`,{id:`main-content`,class:`dashboard-main`,children:[$(`h2`,{ref:w,tabIndex:-1,class:`visually-hidden`,children:`Dashboard`}),$(`div`,{class:`animate-in delay-1`,children:$(Hl,{stats:e.stats,needAttentionCount:ce,stuckCICount:k,dormantFollowupCount:le,waitingCount:ue,onNeedAttentionClick:()=>A(`section-action`),onStuckCIClick:()=>A(`section-stuck`),onDormantFollowupClick:()=>A(`section-dormant`),onWaitingClick:()=>A(`section-waiting`),onShelvedClick:()=>{ee(!0),setTimeout(()=>A(`section-shelved`),50)},onMergedClick:()=>C(`/merged`),onClosedClick:()=>C(`/closed`),onIssuesClick:()=>C(`/issues`)})}),$(`div`,{class:`animate-in delay-2`,children:$(Gl,{filters:g,onFilterChange:_,repos:E,statuses:D,totalCount:e.activePRs.length,filteredCount:ne.length})}),$(`div`,{class:`dashboard-content animate-in delay-3`,children:[$(cu,{prs:ne,selectedUrl:v,onSelect:y,shelvedUrls:te,shelvedOpen:x,onShelvedToggle:()=>ee(!x)}),O&&$(gu,{pr:O,isShelved:te.has(O.url),onAction:o,onClose:()=>y(null)})]}),$(`div`,{class:`animate-in delay-4`,children:$(xu,{monthlyMerged:e.monthlyMerged,monthlyOpened:e.monthlyOpened,monthlyClosed:e.monthlyClosed,topRepos:e.topRepos,theme:d})}),$(`div`,{class:`animate-in delay-5`,children:$(wu,{mergedPRs:e.recentlyMergedPRs??[],closedPRs:e.recentlyClosedPRs??[],autoUnshelvedPRs:e.autoUnshelvedPRs??[]})}),$(`div`,{class:`animate-in delay-6`,children:$(Su,{issues:e.issueResponses,onAction:o})})]}),$(Fu,{celebration:p,onDismiss:m})]})}function Hu(){return $(He,{children:[$(`a`,{class:`skip-link`,href:`#main-content`,children:`Skip to main content`}),$(Vu,{})]})}var Uu=class extends x{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:`640px`,margin:`2rem auto`,padding:`1.5rem`,border:`1px solid var(--error, #c0392b)`,borderRadius:`6px`,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`})]})]})}},Wu=document.getElementById(`app`);Wu?A($(Uu,{children:$(Hu,{})}),Wu):(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{P as n,Oe as r,$ as t};
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
})();
|
|
18
18
|
</script>
|
|
19
19
|
<!-- Fonts are self-hosted (#1119) — see src/fonts.css. No third-party fetches. -->
|
|
20
|
-
<script type="module" crossorigin src="/assets/index-
|
|
20
|
+
<script type="module" crossorigin src="/assets/index-B25bZOYX.js"></script>
|
|
21
21
|
<link rel="stylesheet" crossorigin href="/assets/index-CTiG-vjC.css">
|
|
22
22
|
</head>
|
|
23
23
|
<body>
|
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { z, type ZodType } from 'zod';
|
|
6
6
|
import type { AttentionSummary } from '../core/pr-attention.js';
|
|
7
|
-
import type { FetchedPR, DailyDigest, AgentState, RepoGroup, CommentedIssue, ShelvedPRRef, SearchPriority, CapacityAssessment, ActionableIssue,
|
|
7
|
+
import type { FetchedPR, DailyDigest, AgentState, RepoGroup, CommentedIssue, ShelvedPRRef, SearchPriority, CapacityAssessment, ActionableIssue, CompactActionableIssue, ActionMenu } from '../core/types.js';
|
|
8
8
|
import type { ContributionStats } from '../core/stats.js';
|
|
9
9
|
import type { PRCheckFailure } from '../core/pr-monitor.js';
|
|
10
10
|
import type { CIFormatterDiagnosis, FormatterDetectionResult } from '../core/formatter-detection.js';
|
|
11
11
|
import type { IssueAvailabilityVerdict, IssueVerification, VerifiedLinkedPR } from '../core/issue-verification.js';
|
|
12
|
-
export type { CapacityAssessment, ActionableIssue, ActionableIssueType, CompactActionableIssue, ActionMenuItem, ActionMenu, };
|
|
13
12
|
export type ErrorCode = 'AUTH_REQUIRED' | 'RATE_LIMITED' | 'VALIDATION' | 'CONFIGURATION' | 'NETWORK' | 'NOT_FOUND' | 'STATE_CORRUPTED' | 'CONCURRENCY' | 'UNKNOWN';
|
|
14
13
|
export interface JsonOutput<T = unknown> {
|
|
15
14
|
success: boolean;
|
|
@@ -1576,6 +1575,10 @@ export interface VetListOutput {
|
|
|
1576
1575
|
*/
|
|
1577
1576
|
error?: string;
|
|
1578
1577
|
};
|
|
1578
|
+
/** Set when the vet-time predictions (#1824) could not be saved locally. */
|
|
1579
|
+
pickRecordError?: string;
|
|
1580
|
+
/** Set when the saved predictions could not be pushed to the Gist. */
|
|
1581
|
+
gistSyncWarning?: string;
|
|
1579
1582
|
}
|
|
1580
1583
|
/** Output of the vet command */
|
|
1581
1584
|
export interface VetOutput {
|
|
@@ -1630,6 +1633,10 @@ export interface VetOutput {
|
|
|
1630
1633
|
score: number;
|
|
1631
1634
|
reason: string;
|
|
1632
1635
|
};
|
|
1636
|
+
/** Set when the vet-time prediction (#1824) could not be saved locally. */
|
|
1637
|
+
pickRecordError?: string;
|
|
1638
|
+
/** Set when the saved prediction could not be pushed to the Gist. */
|
|
1639
|
+
gistSyncWarning?: string;
|
|
1633
1640
|
}
|
|
1634
1641
|
/** Output of the comments command */
|
|
1635
1642
|
export interface CommentsOutput {
|
|
@@ -1745,3 +1752,4 @@ export declare function formatJson<T>(schema: ZodType<T>, data: unknown): JsonOu
|
|
|
1745
1752
|
* {@link formatJson}; the validated envelope is what gets printed.
|
|
1746
1753
|
*/
|
|
1747
1754
|
export declare function outputJsonValidated<T>(schema: ZodType<T>, data: unknown): void;
|
|
1755
|
+
export { type ActionableIssueType, type ActionMenuItem, type CapacityAssessment, type ActionableIssue, type CompactActionableIssue, type ActionMenu, } from '../core/types.js';
|
package/dist/formatters/json.js
CHANGED
|
@@ -837,7 +837,7 @@ export function jsonSuccess(data) {
|
|
|
837
837
|
success: true,
|
|
838
838
|
data,
|
|
839
839
|
timestamp: new Date().toISOString(),
|
|
840
|
-
...(envelopeGistWarning && !dataCarriesGistInitWarning(data)
|
|
840
|
+
...(envelopeGistWarning && !dataCarriesGistInitWarning(data) && { gistInitWarning: envelopeGistWarning }),
|
|
841
841
|
};
|
|
842
842
|
}
|
|
843
843
|
/**
|
|
@@ -849,7 +849,7 @@ export function jsonError(message, errorCode) {
|
|
|
849
849
|
error: message,
|
|
850
850
|
errorCode,
|
|
851
851
|
timestamp: new Date().toISOString(),
|
|
852
|
-
...(envelopeGistWarning
|
|
852
|
+
...(envelopeGistWarning && { gistInitWarning: envelopeGistWarning }),
|
|
853
853
|
};
|
|
854
854
|
}
|
|
855
855
|
/**
|