truecourse 0.6.0-next.0 → 0.6.0-next.2
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/README.md +171 -168
- package/cli.mjs +80 -160
- package/package.json +1 -1
- package/public/assets/{index-agCyYXoU.js → index-CkKIAyL2.js} +1 -1
- package/public/index.html +1 -1
- package/server.mjs +13 -2
|
@@ -532,7 +532,7 @@ Please change the parent <Route path="${x}"> to <Route path="${x==="/"?"*":`${x}
|
|
|
532
532
|
*
|
|
533
533
|
* This source code is licensed under the ISC license.
|
|
534
534
|
* See the LICENSE file in the root directory of this source tree.
|
|
535
|
-
*/const Ine=Ae("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);function xS(){return typeof window<"u"}function OO(t){return kq(t)?(t.nodeName||"").toLowerCase():"#document"}function ai(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function kl(t){var e;return(e=(kq(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function kq(t){return xS()?t instanceof Node||t instanceof ai(t).Node:!1}function jn(t){return xS()?t instanceof Element||t instanceof ai(t).Element:!1}function yi(t){return xS()?t instanceof HTMLElement||t instanceof ai(t).HTMLElement:!1}function qy(t){return!xS()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ai(t).ShadowRoot}function fO(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=fo(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&i!=="inline"&&i!=="contents"}function nxe(t){return/^(table|td|th)$/.test(OO(t))}function QS(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const rxe=/transform|translate|scale|rotate|perspective|filter/,ixe=/paint|layout|strict|content/,HO=t=>!!t&&t!=="none";let pk;function _q(t){const e=jn(t)?fo(t):t;return HO(e.transform)||HO(e.translate)||HO(e.scale)||HO(e.rotate)||HO(e.perspective)||!bS()&&(HO(e.backdropFilter)||HO(e.filter))||rxe.test(e.willChange||"")||ixe.test(e.contain||"")}function axe(t){let e=Cc(t);for(;yi(e)&&!bc(e);){if(_q(e))return e;if(QS(e))return null;e=Cc(e)}return null}function bS(){return pk==null&&(pk=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pk}function bc(t){return/^(html|body|#document)$/.test(OO(t))}function fo(t){return ai(t).getComputedStyle(t)}function SS(t){return jn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Cc(t){if(OO(t)==="html")return t;const e=t.assignedSlot||t.parentNode||qy(t)&&t.host||kl(t);return qy(e)?e.host:e}function Dne(t){const e=Cc(t);return bc(e)?t.ownerDocument?t.ownerDocument.body:t.body:yi(e)&&fO(e)?e:Dne(e)}function Zy(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Dne(t),a=i===((r=t.ownerDocument)==null?void 0:r.body),o=ai(i);if(a){const s=zC(o);return e.concat(o,o.visualViewport||[],fO(i)?i:[],s&&n?Zy(s):[])}else return e.concat(i,Zy(i,[],n))}function zC(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const e8={};function yo(t,e){const n=_.useRef(e8);return n.current===e8&&(n.current=t(e)),n}const mk=tne[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],oxe=mk&&mk!==_.useLayoutEffect?mk:t=>t();function tn(t){const e=yo(sxe).current;return e.next=t,oxe(e.effect),e.trampoline}function sxe(){const t={next:void 0,callback:lxe,trampoline:(...e)=>{var n;return(n=t.callback)==null?void 0:n.call(t,...e)},effect:()=>{t.callback=t.next}};return t}function lxe(){}const cxe={...tne},uxe=()=>{},qt=typeof document<"u"?_.useLayoutEffect:uxe;function YC(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}const sy={};function Xq(t,e,n,r,i){let a={...AC(t,sy)};return e&&(a=Pb(a,e)),n&&(a=Pb(a,n)),r&&(a=Pb(a,r)),a}function Oxe(t){if(t.length===0)return sy;if(t.length===1)return AC(t[0],sy);let e={...AC(t[0],sy)};for(let n=1;n<t.length;n+=1)e=Pb(e,t[n]);return e}function Pb(t,e){return Lne(e)?e(t):fxe(t,e)}function fxe(t,e){if(!e)return t;for(const n in e){const r=e[n];switch(n){case"style":{t[n]=YC(t.style,r);break}case"className":{t[n]=Gne(t.className,r);break}default:dxe(n,r)?t[n]=hxe(t[n],r):t[n]=r}}return t}function dxe(t,e){const n=t.charCodeAt(0),r=t.charCodeAt(1),i=t.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof e=="function"||typeof e>"u")}function Lne(t){return typeof t=="function"}function AC(t,e){return Lne(t)?t(e):t??sy}function hxe(t,e){return e?t?n=>{if(pxe(n)){const i=n;qC(i);const a=e(i);return i.baseUIHandlerPrevented||t==null||t(i),a}const r=e(n);return t==null||t(n),r}:e:t}function qC(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function Gne(t,e){return e?t?e+" "+t:e:t}function pxe(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function mxe(t,e){return function(r,...i){const a=new URL(t);return a.searchParams.set("code",r.toString()),i.forEach(o=>a.searchParams.append("args[]",o)),`${e} error #${r}; visit ${a} for the full message.`}}const _s=mxe("https://base-ui.com/production-error","Base UI"),gxe=_.createContext(void 0);function yxe(t=!1){const e=_.useContext(gxe);if(e===void 0&&!t)throw new Error(_s(16));return e}function $xe(t){const{focusableWhenDisabled:e,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=t,o=r&&e!==!1,s=r&&e===!1;return{props:_.useMemo(()=>{const c={onKeyDown(u){n&&e&&u.key!=="Tab"&&u.preventDefault()}};return r||(c.tabIndex=i,!a&&n&&(c.tabIndex=e?i:-1)),(a&&(e||o)||!a&&n)&&(c["aria-disabled"]=n),a&&(!e||s)&&(c.disabled=n),c},[r,n,e,o,s,a,i])}}function Rq(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=t,o=_.useRef(null),s=yxe(!0),l=a??s!==void 0,{props:c}=$xe({focusableWhenDisabled:n,disabled:e,composite:l,tabIndex:r,isNativeButton:i}),u=_.useCallback(()=>{const p=o.current;gk(p)&&l&&e&&c.disabled===void 0&&p.disabled&&(p.disabled=!1)},[e,c.disabled,l]);qt(u,[u]);const f=_.useCallback((p={})=>{const{onClick:y,onMouseDown:v,onKeyUp:$,onKeyDown:x,onPointerDown:S,...b}=p;return Xq({type:i?"button":void 0,onClick(w){if(e){w.preventDefault();return}y==null||y(w)},onMouseDown(w){e||v==null||v(w)},onKeyDown(w){if(e||(qC(w),x==null||x(w),w.baseUIHandlerPrevented))return;const P=w.target===w.currentTarget,k=w.currentTarget,R=gk(k),E=!i&&vxe(k),C=P&&(i?R:!E),z=w.key==="Enter",Y=w.key===" ",W=k.getAttribute("role"),A=(W==null?void 0:W.startsWith("menuitem"))||W==="option"||W==="gridcell";if(P&&l&&Y){if(w.defaultPrevented&&A)return;w.preventDefault(),E||i&&R?(k.click(),w.preventBaseUIHandler()):C&&(y==null||y(w),w.preventBaseUIHandler());return}C&&(!i&&(Y||z)&&w.preventDefault(),!i&&z&&(y==null||y(w)))},onKeyUp(w){if(!e){if(qC(w),$==null||$(w),w.target===w.currentTarget&&i&&l&&gk(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!i&&!l&&w.key===" "&&(y==null||y(w))}},onPointerDown(w){if(e){w.preventDefault();return}S==null||S(w)}},i?void 0:{role:"button"},c,b)},[e,c,l,i]),h=tn(p=>{o.current=p,u()});return{getButtonProps:f,buttonRef:h}}function gk(t){return yi(t)&&t.tagName==="BUTTON"}function vxe(t){return!!((t==null?void 0:t.tagName)==="A"&&(t!=null&&t.href))}function a0(t,e,n,r){const i=yo(Bne).current;return Qxe(i,t,e,n,r)&&Fne(i,[t,e,n,r]),i.callback}function xxe(t){const e=yo(Bne).current;return bxe(e,t)&&Fne(e,t),e.callback}function Bne(){return{callback:null,cleanup:null,refs:[]}}function Qxe(t,e,n,r,i){return t.refs[0]!==e||t.refs[1]!==n||t.refs[2]!==r||t.refs[3]!==i}function bxe(t,e){return t.refs.length!==e.length||t.refs.some((n,r)=>n!==e[r])}function Fne(t,e){if(t.refs=e,e.every(n=>n==null)){t.callback=null;return}t.callback=n=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),n!=null){const r=Array(e.length).fill(null);for(let i=0;i<e.length;i+=1){const a=e[i];if(a!=null)switch(typeof a){case"function":{const o=a(n);typeof o=="function"&&(r[i]=o);break}case"object":{a.current=n;break}}}t.cleanup=()=>{for(let i=0;i<e.length;i+=1){const a=e[i];if(a!=null)switch(typeof a){case"function":{const o=r[i];typeof o=="function"?o():a(null);break}case"object":{a.current=null;break}}}}}}}const Sxe=parseInt(_.version,10);function jq(t){return Sxe>=t}function t8(t){if(!_.isValidElement(t))return null;const e=t,n=e.props;return(jq(19)?n==null?void 0:n.ref:e.ref)??null}function wxe(t,e){const n={};for(const r in t){const i=t[r];if(e!=null&&e.hasOwnProperty(r)){const a=e[r](i);a!=null&&Object.assign(n,a);continue}i===!0?n[`data-${r.toLowerCase()}`]="":i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Pxe(t,e){return typeof t=="function"?t(e):t}function Txe(t,e){return typeof t=="function"?t(e):t}function Ra(){}const Ii=Object.freeze({}),kxe={style:{transition:"none"}},Hne="data-base-ui-click-trigger",_xe={fallbackAxisSide:"end"},Xxe={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function ha(t,e,n={}){const r=e.render,i=Rxe(e,n);if(n.enabled===!1)return null;const a=n.state??Ii;return Exe(t,r,i,a)}function Rxe(t,e={}){const{className:n,style:r,render:i}=t,{state:a=Ii,ref:o,props:s,stateAttributesMapping:l,enabled:c=!0}=e,u=c?Pxe(n,a):void 0,f=c?Txe(r,a):void 0,h=c?wxe(a,l):Ii,p=c?YC(h,Array.isArray(s)?Oxe(s):s)??Ii:Ii;return typeof document<"u"&&(c?Array.isArray(o)?p.ref=xxe([p.ref,t8(i),...o]):p.ref=a0(p.ref,t8(i),o):a0(null,null)),c?(u!==void 0&&(p.className=Gne(p.className,u)),f!==void 0&&(p.style=YC(p.style,f)),p):Ii}const jxe=Symbol.for("react.lazy");function Exe(t,e,n,r){if(e){if(typeof e=="function")return e(n,r);const i=Xq(n,e.props);i.ref=n.ref;let a=e;return(a==null?void 0:a.$$typeof)===jxe&&(a=_.Children.toArray(e)[0]),_.cloneElement(a,i)}if(t&&typeof t=="string")return Cxe(t,n);throw new Error(_s(8))}function Cxe(t,e){return t==="button"?_.createElement("button",{type:"button",...e,key:e.key}):t==="img"?_.createElement("img",{alt:"",...e,key:e.key}):_.createElement(t,e)}const zxe=_.forwardRef(function(e,n){const{render:r,className:i,disabled:a=!1,focusableWhenDisabled:o=!1,nativeButton:s=!0,...l}=e,{getButtonProps:c,buttonRef:u}=Rq({disabled:a,focusableWhenDisabled:o,native:s});return ha("button",e,{state:{disabled:a},ref:[n,u],props:[l,c]})});function Kne(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=Kne(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function zt(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Kne(t))&&(r&&(r+=" "),r+=e);return r}const n8=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,r8=zt,Eq=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return r8(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=e,o=Object.keys(i).map(c=>{const u=n==null?void 0:n[c],f=a==null?void 0:a[c];if(u===null)return null;const h=n8(u)||n8(f);return i[c][h]}),s=n&&Object.entries(n).reduce((c,u)=>{let[f,h]=u;return h===void 0||(c[f]=h),c},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:h,...p}=u;return Object.entries(p).every(y=>{let[v,$]=y;return Array.isArray($)?$.includes({...a,...s}[v]):{...a,...s}[v]===$})?[...c,f,h]:c},[]);return r8(t,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},Yxe=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},Axe=(t,e)=>({classGroupId:t,validator:e}),Jne=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),o0="-",i8=[],qxe="arbitrary..",Zxe=t=>{const e=Uxe(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Vxe(o);const s=o.split(o0),l=s[0]===""&&s.length>1?1:0;return ere(s,l,e)},getConflictingClassGroupIds:(o,s)=>{if(s){const l=r[o],c=n[o];return l?c?Yxe(c,l):l:c||i8}return n[o]||i8}}},ere=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const i=t[e],a=n.nextPart.get(i);if(a){const c=ere(t,e+1,a);if(c)return c}const o=n.validators;if(o===null)return;const s=e===0?t.join(o0):t.slice(e).join(o0),l=o.length;for(let c=0;c<l;c++){const u=o[c];if(u.validator(s))return u.classGroupId}},Vxe=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?qxe+r:void 0})(),Uxe=t=>{const{theme:e,classGroups:n}=t;return Nxe(n,e)},Nxe=(t,e)=>{const n=Jne();for(const r in t){const i=t[r];Cq(i,n,r,e)}return n},Cq=(t,e,n,r)=>{const i=t.length;for(let a=0;a<i;a++){const o=t[a];Wxe(o,e,n,r)}},Wxe=(t,e,n,r)=>{if(typeof t=="string"){Mxe(t,e,n);return}if(typeof t=="function"){Ixe(t,e,n,r);return}Dxe(t,e,n,r)},Mxe=(t,e,n)=>{const r=t===""?e:tre(e,t);r.classGroupId=n},Ixe=(t,e,n,r)=>{if(Lxe(t)){Cq(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Axe(n,t))},Dxe=(t,e,n,r)=>{const i=Object.entries(t),a=i.length;for(let o=0;o<a;o++){const[s,l]=i[o];Cq(l,tre(e,s),n,r)}},tre=(t,e)=>{let n=t;const r=e.split(o0),i=r.length;for(let a=0;a<i;a++){const o=r[a];let s=n.nextPart.get(o);s||(s=Jne(),n.nextPart.set(o,s)),n=s}return n},Lxe=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Gxe=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const i=(a,o)=>{n[a]=o,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(a){let o=n[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return i(a,o),o},set(a,o){a in n?n[a]=o:i(a,o)}}},ZC="!",a8=":",Bxe=[],o8=(t,e,n,r,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Fxe=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=i=>{const a=[];let o=0,s=0,l=0,c;const u=i.length;for(let v=0;v<u;v++){const $=i[v];if(o===0&&s===0){if($===a8){a.push(i.slice(l,v)),l=v+1;continue}if($==="/"){c=v;continue}}$==="["?o++:$==="]"?o--:$==="("?s++:$===")"&&s--}const f=a.length===0?i:i.slice(l);let h=f,p=!1;f.endsWith(ZC)?(h=f.slice(0,-1),p=!0):f.startsWith(ZC)&&(h=f.slice(1),p=!0);const y=c&&c>l?c-l:void 0;return o8(a,p,h,y)};if(e){const i=e+a8,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):o8(Bxe,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},Hxe=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const o=n[a],s=o[0]==="[",l=e.has(o);s||l?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},Kxe=t=>({cache:Gxe(t.cacheSize),parseClassName:Fxe(t),sortModifiers:Hxe(t),...Zxe(t)}),Jxe=/\s+/,eQe=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=e,o=[],s=t.trim().split(Jxe);let l="";for(let c=s.length-1;c>=0;c-=1){const u=s[c],{isExternal:f,modifiers:h,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:v}=n(u);if(f){l=u+(l.length>0?" "+l:l);continue}let $=!!v,x=r($?y.substring(0,v):y);if(!x){if(!$){l=u+(l.length>0?" "+l:l);continue}if(x=r(y),!x){l=u+(l.length>0?" "+l:l);continue}$=!1}const S=h.length===0?"":h.length===1?h[0]:a(h).join(":"),b=p?S+ZC:S,T=b+x;if(o.indexOf(T)>-1)continue;o.push(T);const w=i(x,$);for(let P=0;P<w.length;++P){const k=w[P];o.push(b+k)}l=u+(l.length>0?" "+l:l)}return l},tQe=(...t)=>{let e=0,n,r,i="";for(;e<t.length;)(n=t[e++])&&(r=nre(n))&&(i&&(i+=" "),i+=r);return i},nre=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=nre(t[r]))&&(n&&(n+=" "),n+=e);return n},nQe=(t,...e)=>{let n,r,i,a;const o=l=>{const c=e.reduce((u,f)=>f(u),t());return n=Kxe(c),r=n.cache.get,i=n.cache.set,a=s,s(l)},s=l=>{const c=r(l);if(c)return c;const u=eQe(l,n);return i(l,u),u};return a=o,(...l)=>a(tQe(...l))},rQe=[],hi=t=>{const e=n=>n[t]||rQe;return e.isThemeGetter=!0,e},rre=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ire=/^\((?:(\w[\w-]*):)?(.+)\)$/i,iQe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,aQe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oQe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sQe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lQe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cQe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Tu=t=>iQe.test(t),Lt=t=>!!t&&!Number.isNaN(Number(t)),ku=t=>!!t&&Number.isInteger(Number(t)),yk=t=>t.endsWith("%")&&Lt(t.slice(0,-1)),rc=t=>aQe.test(t),are=()=>!0,uQe=t=>oQe.test(t)&&!sQe.test(t),zq=()=>!1,OQe=t=>lQe.test(t),fQe=t=>cQe.test(t),dQe=t=>!nt(t)&&!it(t),hQe=t=>dO(t,lre,zq),nt=t=>rre.test(t),KO=t=>dO(t,cre,uQe),s8=t=>dO(t,QQe,Lt),pQe=t=>dO(t,Ore,are),mQe=t=>dO(t,ure,zq),l8=t=>dO(t,ore,zq),gQe=t=>dO(t,sre,fQe),lQ=t=>dO(t,fre,OQe),it=t=>ire.test(t),xg=t=>Hf(t,cre),yQe=t=>Hf(t,ure),c8=t=>Hf(t,ore),$Qe=t=>Hf(t,lre),vQe=t=>Hf(t,sre),cQ=t=>Hf(t,fre,!0),xQe=t=>Hf(t,Ore,!0),dO=(t,e,n)=>{const r=rre.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Hf=(t,e,n=!1)=>{const r=ire.exec(t);return r?r[1]?e(r[1]):n:!1},ore=t=>t==="position"||t==="percentage",sre=t=>t==="image"||t==="url",lre=t=>t==="length"||t==="size"||t==="bg-size",cre=t=>t==="length",QQe=t=>t==="number",ure=t=>t==="family-name",Ore=t=>t==="number"||t==="weight",fre=t=>t==="shadow",bQe=()=>{const t=hi("color"),e=hi("font"),n=hi("text"),r=hi("font-weight"),i=hi("tracking"),a=hi("leading"),o=hi("breakpoint"),s=hi("container"),l=hi("spacing"),c=hi("radius"),u=hi("shadow"),f=hi("inset-shadow"),h=hi("text-shadow"),p=hi("drop-shadow"),y=hi("blur"),v=hi("perspective"),$=hi("aspect"),x=hi("ease"),S=hi("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...T(),it,nt],P=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],R=()=>[it,nt,l],E=()=>[Tu,"full","auto",...R()],C=()=>[ku,"none","subgrid",it,nt],z=()=>["auto",{span:["full",ku,it,nt]},ku,it,nt],Y=()=>[ku,"auto",it,nt],W=()=>["auto","min","max","fr",it,nt],A=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...R()],Z=()=>[Tu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],D=()=>[Tu,"screen","full","dvw","lvw","svw","min","max","fit",...R()],M=()=>[Tu,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],V=()=>[t,it,nt],I=()=>[...T(),c8,l8,{position:[it,nt]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",$Qe,hQe,{size:[it,nt]}],J=()=>[yk,xg,KO],K=()=>["","none","full",c,it,nt],H=()=>["",Lt,xg,KO],re=()=>["solid","dashed","dotted","double"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>[Lt,yk,c8,l8],ie=()=>["","none",y,it,nt],se=()=>["none",Lt,it,nt],ae=()=>["none",Lt,it,nt],ue=()=>[Lt,it,nt],Oe=()=>[Tu,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[rc],breakpoint:[rc],color:[are],container:[rc],"drop-shadow":[rc],ease:["in","out","in-out"],font:[dQe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[rc],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[rc],shadow:[rc],spacing:["px",Lt],text:[rc],"text-shadow":[rc],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Tu,nt,it,$]}],container:["container"],columns:[{columns:[Lt,nt,it,s]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{"inset-s":E(),start:E()}],end:[{"inset-e":E(),end:E()}],"inset-bs":[{"inset-bs":E()}],"inset-be":[{"inset-be":E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[ku,"auto",it,nt]}],basis:[{basis:[Tu,"full","auto",s,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Lt,Tu,"auto","initial","none",nt]}],grow:[{grow:["",Lt,it,nt]}],shrink:[{shrink:["",Lt,it,nt]}],order:[{order:[ku,"first","last","none",it,nt]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...A(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...A()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mbs:[{mbs:N()}],mbe:[{mbe:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...D()]}],"min-inline-size":[{"min-inline":["auto",...D()]}],"max-inline-size":[{"max-inline":["none",...D()]}],"block-size":[{block:["auto",...M()]}],"min-block-size":[{"min-block":["auto",...M()]}],"max-block-size":[{"max-block":["none",...M()]}],w:[{w:[s,"screen",...Z()]}],"min-w":[{"min-w":[s,"screen","none",...Z()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",n,xg,KO]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,xQe,pQe]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yk,nt]}],"font-family":[{font:[yQe,mQe,e]}],"font-features":[{"font-features":[nt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,it,nt]}],"line-clamp":[{"line-clamp":[Lt,"none",it,s8]}],leading:[{leading:[a,...R()]}],"list-image":[{"list-image":["none",it,nt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",it,nt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[Lt,"from-font","auto",it,KO]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[Lt,"auto",it,nt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",it,nt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",it,nt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ku,it,nt],radial:["",it,nt],conic:[ku,it,nt]},vQe,gQe]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-bs":[{"border-bs":H()}],"border-w-be":[{"border-be":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":H()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-bs":[{"border-bs":V()}],"border-color-be":[{"border-be":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Lt,it,nt]}],"outline-w":[{outline:["",Lt,xg,KO]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",u,cQ,lQ]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",f,cQ,lQ]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[Lt,KO]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",h,cQ,lQ]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[Lt,it,nt]}],"mix-blend":[{"mix-blend":[...F(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":F()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Lt]}],"mask-image-linear-from-pos":[{"mask-linear-from":te()}],"mask-image-linear-to-pos":[{"mask-linear-to":te()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":te()}],"mask-image-t-to-pos":[{"mask-t-to":te()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":te()}],"mask-image-r-to-pos":[{"mask-r-to":te()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":te()}],"mask-image-b-to-pos":[{"mask-b-to":te()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":te()}],"mask-image-l-to-pos":[{"mask-l-to":te()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":te()}],"mask-image-x-to-pos":[{"mask-x-to":te()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":te()}],"mask-image-y-to-pos":[{"mask-y-to":te()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[it,nt]}],"mask-image-radial-from-pos":[{"mask-radial-from":te()}],"mask-image-radial-to-pos":[{"mask-radial-to":te()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[Lt]}],"mask-image-conic-from-pos":[{"mask-conic-from":te()}],"mask-image-conic-to-pos":[{"mask-conic-to":te()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",it,nt]}],filter:[{filter:["","none",it,nt]}],blur:[{blur:ie()}],brightness:[{brightness:[Lt,it,nt]}],contrast:[{contrast:[Lt,it,nt]}],"drop-shadow":[{"drop-shadow":["","none",p,cQ,lQ]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",Lt,it,nt]}],"hue-rotate":[{"hue-rotate":[Lt,it,nt]}],invert:[{invert:["",Lt,it,nt]}],saturate:[{saturate:[Lt,it,nt]}],sepia:[{sepia:["",Lt,it,nt]}],"backdrop-filter":[{"backdrop-filter":["","none",it,nt]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[Lt,it,nt]}],"backdrop-contrast":[{"backdrop-contrast":[Lt,it,nt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Lt,it,nt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Lt,it,nt]}],"backdrop-invert":[{"backdrop-invert":["",Lt,it,nt]}],"backdrop-opacity":[{"backdrop-opacity":[Lt,it,nt]}],"backdrop-saturate":[{"backdrop-saturate":[Lt,it,nt]}],"backdrop-sepia":[{"backdrop-sepia":["",Lt,it,nt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",it,nt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Lt,"initial",it,nt]}],ease:[{ease:["linear","initial",x,it,nt]}],delay:[{delay:[Lt,it,nt]}],animate:[{animate:["none",S,it,nt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,it,nt]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[it,nt,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Oe()}],"translate-x":[{"translate-x":Oe()}],"translate-y":[{"translate-y":Oe()}],"translate-z":[{"translate-z":Oe()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",it,nt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",it,nt]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[Lt,xg,KO,s8]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},SQe=nQe(bQe);function jr(...t){return SQe(zt(t))}const Tb=Eq("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function xn({className:t,variant:e="default",size:n="default",...r}){return m.jsx(zxe,{"data-slot":"button",className:jr(Tb({variant:e,size:n,className:t})),...r})}var wn;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const o of i)a[o]=o;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(const s of a)o[s]=i[s];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},t.find=(i,a)=>{for(const o of i)if(a(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(wn||(wn={}));var u8;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(u8||(u8={}));const rt=wn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Au=t=>{switch(typeof t){case"undefined":return rt.undefined;case"string":return rt.string;case"number":return Number.isNaN(t)?rt.nan:rt.number;case"boolean":return rt.boolean;case"function":return rt.function;case"bigint":return rt.bigint;case"symbol":return rt.symbol;case"object":return Array.isArray(t)?rt.array:t===null?rt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?rt.promise:typeof Map<"u"&&t instanceof Map?rt.map:typeof Set<"u"&&t instanceof Set?rt.set:typeof Date<"u"&&t instanceof Date?rt.date:rt.object;default:return rt.unknown}},Ve=wn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class zc extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let s=r,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(o))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return i(this),r}static assert(e){if(!(e instanceof zc))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,wn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}zc.create=t=>new zc(t);const VC=(t,e)=>{let n;switch(t.code){case Ve.invalid_type:t.received===rt.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Ve.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,wn.jsonStringifyReplacer)}`;break;case Ve.unrecognized_keys:n=`Unrecognized key(s) in object: ${wn.joinValues(t.keys,", ")}`;break;case Ve.invalid_union:n="Invalid input";break;case Ve.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${wn.joinValues(t.options)}`;break;case Ve.invalid_enum_value:n=`Invalid enum value. Expected ${wn.joinValues(t.options)}, received '${t.received}'`;break;case Ve.invalid_arguments:n="Invalid function arguments";break;case Ve.invalid_return_type:n="Invalid function return type";break;case Ve.invalid_date:n="Invalid date";break;case Ve.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:wn.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Ve.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Ve.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Ve.custom:n="Invalid input";break;case Ve.invalid_intersection_types:n="Intersection results could not be merged";break;case Ve.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Ve.not_finite:n="Number must be finite";break;default:n=e.defaultError,wn.assertNever(t)}return{message:n}};let wQe=VC;function PQe(){return wQe}const TQe=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)s=c(o,{data:e,defaultError:s}).message;return{...i,path:a,message:s}};function Be(t,e){const n=PQe(),r=TQe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===VC?void 0:VC].filter(i=>!!i)});t.common.issues.push(r)}class ua{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return Rt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const a=await i.key,o=await i.value;r.push({key:a,value:o})}return ua.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return Rt;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[a.value]=o.value)}return{status:e.value,value:r}}}const Rt=Object.freeze({status:"aborted"}),Bg=t=>({status:"dirty",value:t}),Io=t=>({status:"valid",value:t}),O8=t=>t.status==="aborted",f8=t=>t.status==="dirty",Fh=t=>t.status==="valid",s0=t=>typeof Promise<"u"&&t instanceof Promise;var st;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(st||(st={}));class Ql{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const d8=(t,e)=>{if(Fh(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new zc(t.common.issues);return this._error=n,this._error}}};function Mt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,s)=>{const{message:l}=t;return o.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??r??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:l??n??s.defaultError}},description:i}}class fn{get description(){return this._def.description}_getType(e){return Au(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Au(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ua,ctx:{common:e.parent.common,data:e.data,parsedType:Au(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(s0(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Au(e)},i=this._parseSync({data:e,path:r.path,parent:r});return d8(r,i)}"~validate"(e){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Au(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:n});return Fh(a)?{value:a.value}:{issues:n.common.issues}}catch(a){(i=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(a=>Fh(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Au(e)},i=this._parse({data:e,path:r.path,parent:r}),a=await(s0(i)?i:Promise.resolve(i));return d8(r,a)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{const o=e(i),s=()=>a.addIssue({code:Ve.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Jh({schema:this,typeName:Xt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Fu.create(this,this._def)}nullable(){return ep.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return dl.create(this)}promise(){return f0.create(this,this._def)}or(e){return c0.create([this,e],this._def)}and(e){return u0.create(this,e,this._def)}transform(e){return new Jh({...Mt(this._def),schema:this,typeName:Xt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new WC({...Mt(this._def),innerType:this,defaultValue:n,typeName:Xt.ZodDefault})}brand(){return new FQe({typeName:Xt.ZodBranded,type:this,...Mt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new MC({...Mt(this._def),innerType:this,catchValue:n,typeName:Xt.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Yq.create(this,e)}readonly(){return IC.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const kQe=/^c[^\s-]{8,}$/i,_Qe=/^[0-9a-z]+$/,XQe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,RQe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,jQe=/^[a-z0-9_-]{21}$/i,EQe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,CQe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,zQe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,YQe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let $k;const AQe=/^(?:(?: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])$/,qQe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ZQe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,VQe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,UQe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,NQe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dre="((\\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])))",WQe=new RegExp(`^${dre}$`);function hre(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function MQe(t){return new RegExp(`^${hre(t)}$`)}function IQe(t){let e=`${dre}T${hre(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function DQe(t,e){return!!((e==="v4"||!e)&&AQe.test(t)||(e==="v6"||!e)&&ZQe.test(t))}function LQe(t,e){if(!EQe.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function GQe(t,e){return!!((e==="v4"||!e)&&qQe.test(t)||(e==="v6"||!e)&&VQe.test(t))}class mc extends fn{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==rt.string){const a=this._getOrReturnCtx(e);return Be(a,{code:Ve.invalid_type,expected:rt.string,received:a.parsedType}),Rt}const r=new ua;let i;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const o=e.data.length>a.value,s=e.data.length<a.value;(o||s)&&(i=this._getOrReturnCtx(e,i),o?Be(i,{code:Ve.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&Be(i,{code:Ve.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")zQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"email",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")$k||($k=new RegExp(YQe,"u")),$k.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"emoji",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")RQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"uuid",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")jQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"nanoid",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")kQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"cuid",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")_Qe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"cuid2",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")XQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"ulid",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Be(i,{validation:"url",code:Ve.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"regex",code:Ve.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?IQe(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?WQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?MQe(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?CQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"duration",code:Ve.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?DQe(e.data,a.version)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"ip",code:Ve.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?LQe(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"jwt",code:Ve.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?GQe(e.data,a.version)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"cidr",code:Ve.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?UQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"base64",code:Ve.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?NQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"base64url",code:Ve.invalid_string,message:a.message}),r.dirty()):wn.assertNever(a);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:Ve.invalid_string,...st.errToObj(r)})}_addCheck(e){return new mc({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...st.errToObj(e)})}url(e){return this._addCheck({kind:"url",...st.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...st.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...st.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...st.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...st.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...st.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...st.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...st.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...st.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...st.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...st.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...st.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...st.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...st.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...st.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...st.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...st.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...st.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...st.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...st.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...st.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...st.errToObj(n)})}nonempty(e){return this.min(1,st.errToObj(e))}trim(){return new mc({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new mc({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new mc({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}mc.create=t=>new mc({checks:[],typeName:Xt.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Mt(t)});function BQe(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,a=Number.parseInt(t.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return a%o/10**i}class Hh extends fn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==rt.number){const a=this._getOrReturnCtx(e);return Be(a,{code:Ve.invalid_type,expected:rt.number,received:a.parsedType}),Rt}let r;const i=new ua;for(const a of this._def.checks)a.kind==="int"?wn.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Be(r,{code:Ve.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Ve.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Ve.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?BQe(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Ve.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Be(r,{code:Ve.not_finite,message:a.message}),i.dirty()):wn.assertNever(a);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,st.toString(n))}gt(e,n){return this.setLimit("min",e,!1,st.toString(n))}lte(e,n){return this.setLimit("max",e,!0,st.toString(n))}lt(e,n){return this.setLimit("max",e,!1,st.toString(n))}setLimit(e,n,r,i){return new Hh({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:st.toString(i)}]})}_addCheck(e){return new Hh({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:st.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:st.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:st.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:st.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:st.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:st.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:st.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:st.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:st.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&wn.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Hh.create=t=>new Hh({checks:[],typeName:Xt.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Mt(t)});class Vy extends fn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==rt.bigint)return this._getInvalidInput(e);let r;const i=new ua;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Ve.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Ve.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Ve.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):wn.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Be(n,{code:Ve.invalid_type,expected:rt.bigint,received:n.parsedType}),Rt}gte(e,n){return this.setLimit("min",e,!0,st.toString(n))}gt(e,n){return this.setLimit("min",e,!1,st.toString(n))}lte(e,n){return this.setLimit("max",e,!0,st.toString(n))}lt(e,n){return this.setLimit("max",e,!1,st.toString(n))}setLimit(e,n,r,i){return new Vy({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:st.toString(i)}]})}_addCheck(e){return new Vy({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:st.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:st.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:st.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:st.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:st.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Vy.create=t=>new Vy({checks:[],typeName:Xt.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Mt(t)});class UC extends fn{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==rt.boolean){const r=this._getOrReturnCtx(e);return Be(r,{code:Ve.invalid_type,expected:rt.boolean,received:r.parsedType}),Rt}return Io(e.data)}}UC.create=t=>new UC({typeName:Xt.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Mt(t)});class l0 extends fn{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==rt.date){const a=this._getOrReturnCtx(e);return Be(a,{code:Ve.invalid_type,expected:rt.date,received:a.parsedType}),Rt}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return Be(a,{code:Ve.invalid_date}),Rt}const r=new ua;let i;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):wn.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new l0({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:st.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:st.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}l0.create=t=>new l0({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Xt.ZodDate,...Mt(t)});class h8 extends fn{_parse(e){if(this._getType(e)!==rt.symbol){const r=this._getOrReturnCtx(e);return Be(r,{code:Ve.invalid_type,expected:rt.symbol,received:r.parsedType}),Rt}return Io(e.data)}}h8.create=t=>new h8({typeName:Xt.ZodSymbol,...Mt(t)});class p8 extends fn{_parse(e){if(this._getType(e)!==rt.undefined){const r=this._getOrReturnCtx(e);return Be(r,{code:Ve.invalid_type,expected:rt.undefined,received:r.parsedType}),Rt}return Io(e.data)}}p8.create=t=>new p8({typeName:Xt.ZodUndefined,...Mt(t)});class m8 extends fn{_parse(e){if(this._getType(e)!==rt.null){const r=this._getOrReturnCtx(e);return Be(r,{code:Ve.invalid_type,expected:rt.null,received:r.parsedType}),Rt}return Io(e.data)}}m8.create=t=>new m8({typeName:Xt.ZodNull,...Mt(t)});class g8 extends fn{constructor(){super(...arguments),this._any=!0}_parse(e){return Io(e.data)}}g8.create=t=>new g8({typeName:Xt.ZodAny,...Mt(t)});class y8 extends fn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Io(e.data)}}y8.create=t=>new y8({typeName:Xt.ZodUnknown,...Mt(t)});class eO extends fn{_parse(e){const n=this._getOrReturnCtx(e);return Be(n,{code:Ve.invalid_type,expected:rt.never,received:n.parsedType}),Rt}}eO.create=t=>new eO({typeName:Xt.ZodNever,...Mt(t)});class $8 extends fn{_parse(e){if(this._getType(e)!==rt.undefined){const r=this._getOrReturnCtx(e);return Be(r,{code:Ve.invalid_type,expected:rt.void,received:r.parsedType}),Rt}return Io(e.data)}}$8.create=t=>new $8({typeName:Xt.ZodVoid,...Mt(t)});class dl extends fn{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==rt.array)return Be(n,{code:Ve.invalid_type,expected:rt.array,received:n.parsedType}),Rt;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(o||s)&&(Be(n,{code:o?Ve.too_big:Ve.too_small,minimum:s?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Be(n,{code:Ve.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Be(n,{code:Ve.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,s)=>i.type._parseAsync(new Ql(n,o,n.path,s)))).then(o=>ua.mergeArray(r,o));const a=[...n.data].map((o,s)=>i.type._parseSync(new Ql(n,o,n.path,s)));return ua.mergeArray(r,a)}get element(){return this._def.type}min(e,n){return new dl({...this._def,minLength:{value:e,message:st.toString(n)}})}max(e,n){return new dl({...this._def,maxLength:{value:e,message:st.toString(n)}})}length(e,n){return new dl({...this._def,exactLength:{value:e,message:st.toString(n)}})}nonempty(e){return this.min(1,e)}}dl.create=(t,e)=>new dl({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Xt.ZodArray,...Mt(e)});function ph(t){if(t instanceof ei){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Fu.create(ph(r))}return new ei({...t._def,shape:()=>e})}else return t instanceof dl?new dl({...t._def,type:ph(t.element)}):t instanceof Fu?Fu.create(ph(t.unwrap())):t instanceof ep?ep.create(ph(t.unwrap())):t instanceof Rf?Rf.create(t.items.map(e=>ph(e))):t}class ei extends fn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=wn.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==rt.object){const c=this._getOrReturnCtx(e);return Be(c,{code:Ve.invalid_type,expected:rt.object,received:c.parsedType}),Rt}const{status:r,ctx:i}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof eO&&this._def.unknownKeys==="strip"))for(const c in i.data)o.includes(c)||s.push(c);const l=[];for(const c of o){const u=a[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Ql(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof eO){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")s.length>0&&(Be(i,{code:Ve.unrecognized_keys,keys:s}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of s){const f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Ql(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const f=await u.key,h=await u.value;c.push({key:f,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>ua.mergeObjectSync(r,c)):ua.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return st.errToObj,new ei({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var a,o;const i=((o=(a=this._def).errorMap)==null?void 0:o.call(a,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:st.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new ei({...this._def,unknownKeys:"strip"})}passthrough(){return new ei({...this._def,unknownKeys:"passthrough"})}extend(e){return new ei({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ei({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Xt.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ei({...this._def,catchall:e})}pick(e){const n={};for(const r of wn.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new ei({...this._def,shape:()=>n})}omit(e){const n={};for(const r of wn.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new ei({...this._def,shape:()=>n})}deepPartial(){return ph(this)}partial(e){const n={};for(const r of wn.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new ei({...this._def,shape:()=>n})}required(e){const n={};for(const r of wn.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof Fu;)a=a._def.innerType;n[r]=a}return new ei({...this._def,shape:()=>n})}keyof(){return pre(wn.objectKeys(this.shape))}}ei.create=(t,e)=>new ei({shape:()=>t,unknownKeys:"strip",catchall:eO.create(),typeName:Xt.ZodObject,...Mt(e)});ei.strictCreate=(t,e)=>new ei({shape:()=>t,unknownKeys:"strict",catchall:eO.create(),typeName:Xt.ZodObject,...Mt(e)});ei.lazycreate=(t,e)=>new ei({shape:t,unknownKeys:"strip",catchall:eO.create(),typeName:Xt.ZodObject,...Mt(e)});class c0 extends fn{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(a){for(const s of a)if(s.result.status==="valid")return s.result;for(const s of a)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(s=>new zc(s.ctx.common.issues));return Be(n,{code:Ve.invalid_union,unionErrors:o}),Rt}if(n.common.async)return Promise.all(r.map(async a=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let a;const o=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(l=>new zc(l));return Be(n,{code:Ve.invalid_union,unionErrors:s}),Rt}}get options(){return this._def.options}}c0.create=(t,e)=>new c0({options:t,typeName:Xt.ZodUnion,...Mt(e)});function NC(t,e){const n=Au(t),r=Au(e);if(t===e)return{valid:!0,data:t};if(n===rt.object&&r===rt.object){const i=wn.objectKeys(e),a=wn.objectKeys(t).filter(s=>i.indexOf(s)!==-1),o={...t,...e};for(const s of a){const l=NC(t[s],e[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(n===rt.array&&r===rt.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let a=0;a<t.length;a++){const o=t[a],s=e[a],l=NC(o,s);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===rt.date&&r===rt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class u0 extends fn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(a,o)=>{if(O8(a)||O8(o))return Rt;const s=NC(a.value,o.value);return s.valid?((f8(a)||f8(o))&&n.dirty(),{status:n.value,value:s.data}):(Be(r,{code:Ve.invalid_intersection_types}),Rt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}u0.create=(t,e,n)=>new u0({left:t,right:e,typeName:Xt.ZodIntersection,...Mt(n)});class Rf extends fn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==rt.array)return Be(r,{code:Ve.invalid_type,expected:rt.array,received:r.parsedType}),Rt;if(r.data.length<this._def.items.length)return Be(r,{code:Ve.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Rt;!this._def.rest&&r.data.length>this._def.items.length&&(Be(r,{code:Ve.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((o,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Ql(r,o,r.path,s)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>ua.mergeArray(n,o)):ua.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new Rf({...this._def,rest:e})}}Rf.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Rf({items:t,typeName:Xt.ZodTuple,rest:null,...Mt(e)})};class O0 extends fn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==rt.object)return Be(r,{code:Ve.invalid_type,expected:rt.object,received:r.parsedType}),Rt;const i=[],a=this._def.keyType,o=this._def.valueType;for(const s in r.data)i.push({key:a._parse(new Ql(r,s,r.path,s)),value:o._parse(new Ql(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?ua.mergeObjectAsync(n,i):ua.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof fn?new O0({keyType:e,valueType:n,typeName:Xt.ZodRecord,...Mt(r)}):new O0({keyType:mc.create(),valueType:e,typeName:Xt.ZodRecord,...Mt(n)})}}class v8 extends fn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==rt.map)return Be(r,{code:Ve.invalid_type,expected:rt.map,received:r.parsedType}),Rt;const i=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([s,l],c)=>({key:i._parse(new Ql(r,s,r.path,[c,"key"])),value:a._parse(new Ql(r,l,r.path,[c,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Rt;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Rt;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}}}}v8.create=(t,e,n)=>new v8({valueType:e,keyType:t,typeName:Xt.ZodMap,...Mt(n)});class Uy extends fn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==rt.set)return Be(r,{code:Ve.invalid_type,expected:rt.set,received:r.parsedType}),Rt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Be(r,{code:Ve.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Be(r,{code:Ve.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const a=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Rt;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const s=[...r.data.values()].map((l,c)=>a._parse(new Ql(r,l,r.path,c)));return r.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(e,n){return new Uy({...this._def,minSize:{value:e,message:st.toString(n)}})}max(e,n){return new Uy({...this._def,maxSize:{value:e,message:st.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Uy.create=(t,e)=>new Uy({valueType:t,minSize:null,maxSize:null,typeName:Xt.ZodSet,...Mt(e)});class x8 extends fn{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}x8.create=(t,e)=>new x8({getter:t,typeName:Xt.ZodLazy,...Mt(e)});class Q8 extends fn{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Be(n,{received:n.data,code:Ve.invalid_literal,expected:this._def.value}),Rt}return{status:"valid",value:e.data}}get value(){return this._def.value}}Q8.create=(t,e)=>new Q8({value:t,typeName:Xt.ZodLiteral,...Mt(e)});function pre(t,e){return new Kh({values:t,typeName:Xt.ZodEnum,...Mt(e)})}class Kh extends fn{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Be(n,{expected:wn.joinValues(r),received:n.parsedType,code:Ve.invalid_type}),Rt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Be(n,{received:n.data,code:Ve.invalid_enum_value,options:r}),Rt}return Io(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Kh.create(e,{...this._def,...n})}exclude(e,n=this._def){return Kh.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Kh.create=pre;class b8 extends fn{_parse(e){const n=wn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==rt.string&&r.parsedType!==rt.number){const i=wn.objectValues(n);return Be(r,{expected:wn.joinValues(i),received:r.parsedType,code:Ve.invalid_type}),Rt}if(this._cache||(this._cache=new Set(wn.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=wn.objectValues(n);return Be(r,{received:r.data,code:Ve.invalid_enum_value,options:i}),Rt}return Io(e.data)}get enum(){return this._def.values}}b8.create=(t,e)=>new b8({values:t,typeName:Xt.ZodNativeEnum,...Mt(e)});class f0 extends fn{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==rt.promise&&n.common.async===!1)return Be(n,{code:Ve.invalid_type,expected:rt.promise,received:n.parsedType}),Rt;const r=n.parsedType===rt.promise?n.data:Promise.resolve(n.data);return Io(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}f0.create=(t,e)=>new f0({type:t,typeName:Xt.ZodPromise,...Mt(e)});class Jh extends fn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Xt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:o=>{Be(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const o=i.transform(r.data,a);if(r.common.async)return Promise.resolve(o).then(async s=>{if(n.value==="aborted")return Rt;const l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?Rt:l.status==="dirty"||n.value==="dirty"?Bg(l.value):l});{if(n.value==="aborted")return Rt;const s=this._def.schema._parseSync({data:o,path:r.path,parent:r});return s.status==="aborted"?Rt:s.status==="dirty"||n.value==="dirty"?Bg(s.value):s}}if(i.type==="refinement"){const o=s=>{const l=i.refinement(s,a);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Rt:(s.status==="dirty"&&n.dirty(),o(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?Rt:(s.status==="dirty"&&n.dirty(),o(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Fh(o))return Rt;const s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Fh(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:n.value,value:s})):Rt);wn.assertNever(i)}}Jh.create=(t,e,n)=>new Jh({schema:t,typeName:Xt.ZodEffects,effect:e,...Mt(n)});Jh.createWithPreprocess=(t,e,n)=>new Jh({schema:e,effect:{type:"preprocess",transform:t},typeName:Xt.ZodEffects,...Mt(n)});class Fu extends fn{_parse(e){return this._getType(e)===rt.undefined?Io(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Fu.create=(t,e)=>new Fu({innerType:t,typeName:Xt.ZodOptional,...Mt(e)});class ep extends fn{_parse(e){return this._getType(e)===rt.null?Io(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ep.create=(t,e)=>new ep({innerType:t,typeName:Xt.ZodNullable,...Mt(e)});class WC extends fn{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===rt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}WC.create=(t,e)=>new WC({innerType:t,typeName:Xt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Mt(e)});class MC extends fn{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return s0(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new zc(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new zc(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}MC.create=(t,e)=>new MC({innerType:t,typeName:Xt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Mt(e)});class S8 extends fn{_parse(e){if(this._getType(e)!==rt.nan){const r=this._getOrReturnCtx(e);return Be(r,{code:Ve.invalid_type,expected:rt.nan,received:r.parsedType}),Rt}return{status:"valid",value:e.data}}}S8.create=t=>new S8({typeName:Xt.ZodNaN,...Mt(t)});class FQe extends fn{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Yq extends fn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Rt:a.status==="dirty"?(n.dirty(),Bg(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Rt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new Yq({in:e,out:n,typeName:Xt.ZodPipeline})}}class IC extends fn{_parse(e){const n=this._def.innerType._parse(e),r=i=>(Fh(i)&&(i.value=Object.freeze(i.value)),i);return s0(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}IC.create=(t,e)=>new IC({innerType:t,typeName:Xt.ZodReadonly,...Mt(e)});var Xt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Xt||(Xt={}));const ge=mc.create,ht=Hh.create,En=UC.create;eO.create;const bt=dl.create,mt=ei.create;c0.create;u0.create;Rf.create;const w8=O0.create,Pr=Kh.create;f0.create;Fu.create;ep.create;const HQe=Pr(["typescript","tsx","javascript","python"]),Jp=mt({filePath:ge(),startLine:ht(),startColumn:ht(),endLine:ht(),endColumn:ht()}),KQe=mt({name:ge(),type:ge().optional(),defaultValue:ge().optional()}),mre=mt({name:ge(),params:bt(KQe),returnType:ge().optional(),isAsync:En(),isExported:En(),location:Jp,lineCount:ht().optional(),statementCount:ht().optional(),maxNestingDepth:ht().optional()}),JQe=mt({name:ge(),type:ge().optional(),isStatic:En().optional()}),ebe=mt({name:ge(),methods:bt(mre),properties:bt(JQe),superClass:ge().optional(),interfaces:bt(ge()).optional(),decorators:bt(ge()).optional(),location:Jp}),tbe=mt({name:ge(),alias:ge().optional(),isDefault:En(),isNamespace:En()}),nbe=mt({source:ge(),specifiers:bt(tbe),isTypeOnly:En(),isFunctionScoped:En().optional()}),rbe=mt({name:ge(),isDefault:En(),source:ge().optional()}),ibe=mt({callee:ge(),arguments:bt(ge()).optional(),location:Jp,callerFunction:ge().optional()}),gre=mt({method:Pr(["GET","POST","PUT","DELETE","PATCH"]),url:ge(),location:Jp}),abe=mt({httpMethod:Pr(["GET","POST","PUT","DELETE","PATCH","ALL"]),path:ge(),handlerName:ge(),location:Jp}),obe=mt({path:ge(),routerName:ge(),location:Jp});mt({filePath:ge(),language:HQe,functions:bt(mre),classes:bt(ebe),imports:bt(nbe),exports:bt(rbe),calls:bt(ibe),httpCalls:bt(gre),routeRegistrations:bt(abe).optional(),routerMounts:bt(obe).optional()});mt({source:ge(),target:ge(),importedNames:bt(ge())});const sbe=Pr(["class","interface","standalone"]);mt({name:ge(),filePath:ge(),kind:sbe,serviceName:ge(),layerName:ge(),methodCount:ht(),propertyCount:ht(),importCount:ht(),exportCount:ht(),superClass:ge().optional(),startLine:ht().optional(),endLine:ht().optional(),lineCount:ht().optional()});mt({name:ge(),moduleName:ge(),serviceName:ge(),filePath:ge(),signature:ge(),paramCount:ht(),returnType:ge().optional(),isAsync:En(),isExported:En(),startLine:ht().optional(),endLine:ht().optional(),lineCount:ht().optional(),statementCount:ht().optional(),maxNestingDepth:ht().optional(),isImplicitCall:En().optional()});mt({sourceModule:ge(),sourceService:ge(),sourceFilePath:ge().optional(),targetModule:ge(),targetService:ge(),targetFilePath:ge().optional(),importedNames:bt(ge())});mt({callerMethod:ge(),callerModule:ge(),callerService:ge(),callerFilePath:ge().optional(),calleeMethod:ge(),calleeModule:ge(),calleeService:ge(),calleeFilePath:ge().optional(),callCount:ht()});const lbe=mt({name:ge(),type:ge(),isPrimaryKey:En().optional(),isNullable:En().optional(),decorators:bt(ge()).optional()}),cbe=mt({type:Pr(["oneToOne","oneToMany","manyToOne","manyToMany"]),targetEntity:ge(),fieldName:ge()});mt({name:ge(),service:ge(),framework:ge(),fields:bt(lbe),relationships:bt(cbe),confidence:ht().min(0).max(1),signals:bt(ge())});const d0=Pr(["data","api","service","external"]),ube=mt({layer:d0,confidence:ht().min(0).max(1),evidence:bt(ge())}),yre=Pr(["frontend","api-server","worker","library","unknown"]),Obe=Pr(["monolith","microservices"]);mt({name:ge(),rootPath:ge(),type:yre,framework:ge().optional(),fileCount:ht(),layers:bt(ube),files:bt(ge())});const fbe=mt({filePath:ge(),importedFrom:ge(),importedNames:bt(ge())});mt({source:ge(),target:ge(),dependencies:bt(fbe),httpCalls:bt(gre).optional()});mt({serviceName:ge(),layer:d0,fileCount:ht(),filePaths:bt(ge()),confidence:ht(),evidence:bt(ge())});mt({sourceServiceName:ge(),sourceLayer:d0,targetServiceName:ge(),targetLayer:d0,dependencyCount:ht(),isViolation:En(),violationReason:ge().optional()});const dbe=Pr(["architecture","dependency","violation","suggestion","warning","database","module","service","function"]),hbe=Pr(["info","low","medium","high","critical"]),pbe=Pr(["new","unchanged","resolved"]),mbe=Pr(["rule","contract-drift"]),gbe=mt({id:ge(),type:dbe,category:mbe.default("rule"),subcategory:ge().nullable().optional(),title:ge(),content:ge(),severity:hbe,status:pbe.optional(),targetServiceId:ge().optional(),targetDatabaseId:ge().optional(),targetModuleId:ge().optional(),targetMethodId:ge().optional(),targetTable:ge().optional(),fixPrompt:ge().optional(),ruleKey:ge().optional(),deterministicViolationId:ge().optional(),firstSeenAt:ge().optional(),resolvedAt:ge().optional(),createdAt:ge()}),ybe=mt({name:ge(),type:yre,framework:ge().optional(),fileCount:ht(),layers:bt(ge())});mt({architecture:Obe,totalServices:ht(),totalFiles:ht(),violations:bt(gbe),services:bt(ybe)});const $be=Pr(["postgres","redis","mongodb","mysql","sqlite"]),vbe=mt({name:ge(),type:ge(),isNullable:En().optional(),isPrimaryKey:En().optional(),isUnique:En().optional(),defaultValue:ge().optional(),isForeignKey:En().optional(),referencesTable:ge().optional(),referencesColumn:ge().optional()}),xbe=mt({name:ge().optional(),columns:bt(ge()),isUnique:En().optional()}),Qbe=mt({name:ge(),columns:bt(vbe),primaryKey:ge().optional(),indexes:bt(xbe).optional(),aliases:bt(ge()).optional()}),bbe=mt({sourceTable:ge(),targetTable:ge(),relationType:Pr(["one-to-one","one-to-many","many-to-many"]),foreignKeyColumn:ge(),foreignKeyReferencesColumn:ge().optional()}),Sbe=mt({name:ge(),type:$be,driver:ge(),connectionEnvVar:ge().optional(),tables:bt(Qbe),relations:bt(bbe),connectedServices:bt(ge())}),wbe=mt({serviceName:ge(),databaseName:ge(),driver:ge(),layerName:ge().optional()});mt({databases:bt(Sbe),connections:bt(wbe)});const Pbe=Pr(["architecture","security","bugs","code-quality","style","database","performance","reliability"]),Tbe=Pr(["service","database","module","method","code"]),kbe=Pr(["info","low","medium","high","critical"]),_be=Pr(["deterministic","llm"]),Xbe=Pr(["metadata","targeted","full-file"]),Rbe=mt({hasAsyncFunctions:En().optional(),hasRouteHandlers:En().optional(),hasDbCalls:En().optional(),hasCatchBlocks:En().optional(),hasImportsFrom:bt(ge()).optional(),hasCallsTo:bt(ge()).optional(),isTestFile:En().optional(),languages:bt(ge()).optional()}),jbe=mt({isAsync:En().optional(),isRouteHandler:En().optional(),containsCatchBlock:En().optional(),callsAny:bt(ge()).optional()}),Ebe=mt({tier:Xbe,fileFilter:Rbe.optional(),functionFilter:jbe.optional(),metadataFields:bt(Pr(["functions","classes","imports","exports","calls","httpCalls","routeRegistrations"])).optional()});mt({key:ge(),category:Tbe,domain:Pbe.optional(),name:ge(),description:ge(),prompt:ge().optional(),enabled:En(),severity:kbe,type:_be,contextRequirement:Ebe.optional()});const Cbe=Pr(["call","http","db-read","db-write","event"]),zbe=Pr(["http","event","cron","startup"]),Ybe=mt({id:ge(),flowId:ge(),stepOrder:ht(),sourceService:ge(),sourceModule:ge(),sourceMethod:ge(),targetService:ge(),targetModule:ge(),targetMethod:ge(),stepType:Cbe,dataDescription:ge().nullable(),isAsync:En(),isConditional:En()});mt({id:ge(),analysisId:ge(),name:ge(),description:ge().nullable(),entryService:ge(),entryMethod:ge(),category:ge(),trigger:zbe,stepCount:ht(),steps:bt(Ybe).optional(),createdAt:ge().optional()});const Abe=mt({analysisId:ge(),date:ge(),branch:ge().nullable(),total:ht(),new:ht(),unchanged:ht(),resolved:ht(),critical:ht(),high:ht(),medium:ht(),low:ht(),info:ht()});mt({points:bt(Abe)});mt({byCategory:w8(ge(),ht()),bySeverity:w8(ge(),ht()),total:ht()});const qbe=mt({id:ge(),name:ge(),kind:Pr(["service","module"]),violationCount:ht(),criticalCount:ht(),highCount:ht()});mt({offenders:bt(qbe),analysisId:ge()});mt({avgTimeToResolveMs:ht().nullable(),totalResolved:ht(),totalActive:ht(),resolutionRate:ht(),staleCount:ht(),staleDays:ht()});const $re=[];mt({path:ge().min(1)});mt({mode:Pr(["full","diff"]),skipGit:En().optional().default(!1)});mt({analysisId:ge().uuid().optional()});var vk={exports:{}},P8;function Zbe(){return P8||(P8=1,(function(t){function e(K){return Array.isArray(K)?K:[K]}const n=void 0,r="",i=" ",a="\\",o=/^\s+$/,s=/(?:[^\\]|^)\\$/,l=/^\\!/,c=/^\\#/,u=/\r?\n/g,f=/^\.{0,2}\/|^\.{1,2}$/,h=/\/$/,p="/";let y="node-ignore";typeof Symbol<"u"&&(y=Symbol.for("node-ignore"));const v=y,$=(K,H,re)=>(Object.defineProperty(K,H,{value:re}),re),x=/([0-z])-([0-z])/g,S=()=>!1,b=K=>K.replace(x,(H,re,F)=>re.charCodeAt(0)<=F.charCodeAt(0)?H:r),T=K=>{const{length:H}=K;return K.slice(0,H-H%2)},w=[[/^\uFEFF/,()=>r],[/((?:\\\\)*?)(\\?\s+)$/,(K,H,re)=>H+(re.indexOf("\\")===0?i:r)],[/(\\+?)\s/g,(K,H)=>{const{length:re}=H;return H.slice(0,re-re%2)+i}],[/[\\$.|*+(){^]/g,K=>`\\${K}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(K,H,re)=>H+6<re.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(K,H,re)=>{const F=re.replace(/\\\*/g,"[^\\/]*");return H+F}],[/\\\\\\(?=[$.|*+(){^])/g,()=>a],[/\\\\/g,()=>a],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(K,H,re,F,te)=>H===a?`\\[${re}${T(F)}${te}`:te==="]"&&F.length%2===0?`[${b(re)}${F}]`:"[]"],[/(?:[^*])$/,K=>/\/$/.test(K)?`${K}$`:`${K}(?=$|\\/$)`]],P=/(^|\\\/)?\\\*$/,k="regex",R="checkRegex",E="_",C={[k](K,H){return`${H?`${H}[^/]+`:"[^/]*"}(?=$|\\/$)`},[R](K,H){return`${H?`${H}[^/]*`:"[^/]*"}(?=$|\\/$)`}},z=K=>w.reduce((H,[re,F])=>H.replace(re,F.bind(K)),K),Y=K=>typeof K=="string",W=K=>K&&Y(K)&&!o.test(K)&&!s.test(K)&&K.indexOf("#")!==0,A=K=>K.split(u).filter(Boolean);class q{constructor(H,re,F,te,ie,se){this.pattern=H,this.mark=re,this.negative=ie,$(this,"body",F),$(this,"ignoreCase",te),$(this,"regexPrefix",se)}get regex(){const H=E+k;return this[H]?this[H]:this._make(k,H)}get checkRegex(){const H=E+R;return this[H]?this[H]:this._make(R,H)}_make(H,re){const F=this.regexPrefix.replace(P,C[H]),te=this.ignoreCase?new RegExp(F,"i"):new RegExp(F);return $(this,re,te)}}const N=({pattern:K,mark:H},re)=>{let F=!1,te=K;te.indexOf("!")===0&&(F=!0,te=te.substr(1)),te=te.replace(l,"!").replace(c,"#");const ie=z(te);return new q(K,H,te,re,F,ie)};class Z{constructor(H){this._ignoreCase=H,this._rules=[]}_add(H){if(H&&H[v]){this._rules=this._rules.concat(H._rules._rules),this._added=!0;return}if(Y(H)&&(H={pattern:H}),W(H.pattern)){const re=N(H,this._ignoreCase);this._added=!0,this._rules.push(re)}}add(H){return this._added=!1,e(Y(H)?A(H):H).forEach(this._add,this),this._added}test(H,re,F){let te=!1,ie=!1,se;this._rules.forEach(ue=>{const{negative:Oe}=ue;ie===Oe&&te!==ie||Oe&&!te&&!ie&&!re||!ue[F].test(H)||(te=!Oe,ie=Oe,se=Oe?n:ue)});const ae={ignored:te,unignored:ie};return se&&(ae.rule=se),ae}}const D=(K,H)=>{throw new H(K)},M=(K,H,re)=>Y(K)?K?M.isNotRelative(K)?re(`path should be a \`path.relative()\`d string, but got "${H}"`,RangeError):!0:re("path must not be empty",TypeError):re(`path must be a string, but got \`${H}\``,TypeError),V=K=>f.test(K);M.isNotRelative=V,M.convert=K=>K;class I{constructor({ignorecase:H=!0,ignoreCase:re=H,allowRelativePaths:F=!1}={}){$(this,v,!0),this._rules=new Z(re),this._strictPathCheck=!F,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(H){return this._rules.add(H)&&this._initCache(),this}addPattern(H){return this.add(H)}_test(H,re,F,te){const ie=H&&M.convert(H);return M(ie,H,this._strictPathCheck?D:S),this._t(ie,re,F,te)}checkIgnore(H){if(!h.test(H))return this.test(H);const re=H.split(p).filter(Boolean);if(re.pop(),re.length){const F=this._t(re.join(p)+p,this._testCache,!0,re);if(F.ignored)return F}return this._rules.test(H,!1,R)}_t(H,re,F,te){if(H in re)return re[H];if(te||(te=H.split(p).filter(Boolean)),te.pop(),!te.length)return re[H]=this._rules.test(H,F,k);const ie=this._t(te.join(p)+p,re,F,te);return re[H]=ie.ignored?ie:this._rules.test(H,F,k)}ignores(H){return this._test(H,this._ignoreCache,!1).ignored}createFilter(){return H=>!this.ignores(H)}filter(H){return e(H).filter(this.createFilter())}test(H){return this._test(H,this._testCache,!0)}}const B=K=>new I(K),L=K=>M(K&&M.convert(K),K,S),J=()=>{const K=re=>/^\\\\\?\\/.test(re)||/["<>|\u0000-\u001F]+/u.test(re)?re:re.replace(/\\/g,"/");M.convert=K;const H=/^[a-z]:\//i;M.isNotRelative=re=>H.test(re)||V(re)};typeof process<"u"&&process.platform==="win32"&&J(),t.exports=B,B.default=B,t.exports.isPathValid=L,$(t.exports,Symbol.for("setupWindows"),J)})(vk)),vk.exports}Zbe();function ly(){if(typeof window>"u")return"";const t=window.location.port;return t&&t!=="3001"?`http://${window.location.hostname}:3001`:""}const Vbe=ly();class em extends Error{constructor(e,n){super(n),this.status=e,this.name="ApiError"}}async function gt(t,e){const n=`${Vbe}${t}`,r=await fetch(n,{...e,credentials:"include",headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});if(!r.ok){let i="Unknown error";try{const a=await r.json();i=a.error||JSON.stringify(a)}catch{i=await r.text().catch(()=>"Unknown error")}throw new em(r.status,i)}if(r.status!==204)return r.json()}function Ube(){return gt("/api/capabilities")}function Nbe(){return gt("/api/repos")}function T8(t){return gt(`/api/repos/${t}`)}function Wbe(t){return gt("/api/repos",{method:"POST",body:JSON.stringify({path:t})})}function Mbe(t){return gt(`/api/repos/${t}`,{method:"DELETE"})}function vre(t,e){return gt(`/api/repos/${t}/analyses`,{method:"POST",body:JSON.stringify({mode:"full",...(e==null?void 0:e.skipGit)!=null?{skipGit:e.skipGit}:{}})})}function Ibe(t){return gt(`/api/repos/${t}/analyses`)}function Dbe(t,e){return gt(`/api/repos/${t}/analyses/${e}/usage`)}function Lbe(t,e){return gt(`/api/repos/${t}/analyses/${e}`,{method:"DELETE"})}function Gbe(t){return gt(`/api/repos/${t}/analyses/cancel`,{method:"POST"})}function Bbe(t,e){const n=new URLSearchParams;e!=null&&e.branch&&n.set("branch",e.branch),e!=null&&e.level&&n.set("level",e.level),e!=null&&e.analysisId&&n.set("analysisId",e.analysisId);const r=n.toString();return gt(`/api/repos/${t}/graph${r?`?${r}`:""}`)}function k8(t,e,n,r){const i=new URLSearchParams;n&&i.set("branch",n),r&&i.set("level",r);const a=i.toString();return gt(`/api/repos/${t}/graph/positions${a?`?${a}`:""}`,{method:"PUT",body:JSON.stringify({positions:e})})}function Fbe(t,e,n){const r=new URLSearchParams;e&&r.set("branch",e),n&&r.set("level",n);const i=r.toString();return gt(`/api/repos/${t}/graph/positions${i?`?${i}`:""}`,{method:"DELETE"})}function _8(t,e,n,r){const i=new URLSearchParams;n&&i.set("branch",n),r&&i.set("level",r);const a=i.toString();return gt(`/api/repos/${t}/graph/collapsed${a?`?${a}`:""}`,{method:"PUT",body:JSON.stringify({collapsedIds:e})})}function Hbe(t,e){const n=e?`?ref=${encodeURIComponent(e)}`:"";return gt(`/api/repos/${t}/files${n}`)}function xre(t,e){const n=new URLSearchParams;e&&n.set("analysisId",e);const r=n.toString();return gt(`/api/repos/${t}/violations${r?`?${r}`:""}`)}function Kbe(t,e,n){const r=new URLSearchParams;e&&r.set("branch",e),n&&r.set("analysisId",n);const i=r.toString();return gt(`/api/repos/${t}/databases${i?`?${i}`:""}`)}function Jbe(t,e,n){const r=n?`?analysisId=${encodeURIComponent(n)}`:"";return gt(`/api/repos/${t}/databases/${e}/schema${r}`)}function e0e(t){const e=t?`/api/repos/${encodeURIComponent(t)}/rules`:"/api/rules";return gt(e)}function Qre(t,e,n){return gt(`/api/repos/${encodeURIComponent(t)}/rules/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({enabled:n})})}function t0e(t){return gt(`/api/repos/${t}/analyses`,{method:"POST",body:JSON.stringify({mode:"diff"})})}function X8(t){return gt(`/api/repos/${t}/analyses/diff`)}function n0e(t,e,n){const r=new URLSearchParams({path:e});return n&&r.set("ref",n),gt(`/api/repos/${t}/file-content?${r.toString()}`)}function r0e(t,e,n){const r=new URLSearchParams;e&&r.set("file",e),n&&r.set("analysisId",n);const i=r.toString();return gt(`/api/repos/${t}/violations${i?`?${i}`:""}`)}function bre(t,e){const n=new URLSearchParams;e&&n.set("analysisId",e);const r=n.toString();return gt(`/api/repos/${t}/violations/summary${r?`?${r}`:""}`)}function i0e(t,e){const n=e?`?analysisId=${encodeURIComponent(e)}`:"";return gt(`/api/repos/${t}/flows${n}`)}function a0e(t,e,n){const r=n?`?analysisId=${encodeURIComponent(n)}`:"";return gt(`/api/repos/${t}/flows/${e}${r}`)}function o0e(t,e){return gt(`/api/repos/${t}/flows/${e}/enrich`,{method:"POST"})}function s0e(t,e,n,r){const i=new URLSearchParams;e&&i.set("branch",e),r&&i.set("analysisId",r);const a=i.toString();return gt(`/api/repos/${t}/analytics/trend${a?`?${a}`:""}`)}function l0e(t,e,n){const r=new URLSearchParams;e&&r.set("branch",e),n&&r.set("analysisId",n);const i=r.toString();return gt(`/api/repos/${t}/analytics/breakdown${i?`?${i}`:""}`)}function c0e(t,e,n){const r=new URLSearchParams;e&&r.set("branch",e),n&&r.set("analysisId",n);const i=r.toString();return gt(`/api/repos/${t}/analytics/top-offenders${i?`?${i}`:""}`)}function u0e(t,e,n){const r=new URLSearchParams;e&&r.set("branch",e),n&&r.set("analysisId",n);const i=r.toString();return gt(`/api/repos/${t}/analytics/resolution${i?`?${i}`:""}`)}function O0e(t){return gt(`/api/repos/${t}/spec/scan`)}function f0e(t){return gt(`/api/repos/${t}/spec/canonical/tree`)}function d0e(t,e,n){const r=new URLSearchParams({module:e,topic:n});return gt(`/api/repos/${t}/spec/canonical/section?${r.toString()}`)}function h0e(t){return gt(`/api/repos/${t}/contracts/tree`)}function p0e(t,e){return gt(`/api/repos/${t}/contracts/file?path=${encodeURIComponent(e)}`)}async function m0e(t){try{return await gt(`/api/repos/${t}/verify/state`)}catch(e){if(e instanceof em&&e.status===404)return null;throw e}}function g0e(t){return gt(`/api/repos/${t}/verify/run`,{method:"POST"})}async function y0e(t){try{return await gt(`/api/repos/${t}/verify/diff`)}catch(e){if(e instanceof em&&e.status===404)return null;throw e}}function $0e(t){return gt(`/api/repos/${t}/verify/diff`,{method:"POST"})}async function R8(t){try{return await gt(`/api/repos/${t}/verify/history`)}catch(e){if(e instanceof em&&e.status===404)return{runs:[]};throw e}}function v0e(t,e){return gt(`/api/repos/${t}/verify/runs/${e}`)}function x0e(t,e){return gt(`/api/repos/${t}/verify/runs/${e}`,{method:"DELETE"})}async function Q0e(t){try{return await gt(`/api/repos/${t}/spec/scan-state`)}catch(e){if(e instanceof em&&e.status===404)return null;throw e}}function b0e(t,e){return gt(`/api/repos/${t}/spec/decisions/${encodeURIComponent(e)}`,{method:"DELETE"})}function S0e(t,e){return gt(`/api/repos/${t}/spec/decisions`,{method:"POST",body:JSON.stringify(e)})}function w0e(t,e){return gt(`/api/repos/${t}/spec/docs/include`,{method:"POST",body:JSON.stringify(e)})}function P0e(t,e){return gt(`/api/repos/${t}/spec/chains/manual`,{method:"POST",body:JSON.stringify(e)})}function T0e(t,e){return gt(`/api/repos/${t}/spec/decisions/batch`,{method:"POST",body:JSON.stringify({mode:e})})}function k0e(t){return gt(`/api/repos/${t}/contracts/generate`,{method:"POST"})}function _0e(t){return gt(`/api/repos/${t}/spec/staleness`)}const Sre={edition:"community",capabilities:new Set($re),isLoading:!0,error:null},Aq=_.createContext(Sre);function X0e({children:t,initial:e}){const[n,r]=_.useState(()=>e?{edition:e.edition,capabilities:new Set(e.capabilities),isLoading:!1,error:null}:Sre);_.useEffect(()=>{if(e)return;let a=!1;return(async()=>{try{const o=await Ube();if(a)return;r({edition:o.edition,capabilities:new Set(o.capabilities),isLoading:!1,error:null})}catch(o){if(a)return;r({edition:"community",capabilities:new Set($re),isLoading:!1,error:o instanceof Error?o:new Error(String(o))})}})(),()=>{a=!0}},[e]);const i=_.useMemo(()=>n,[n]);return m.jsx(Aq.Provider,{value:i,children:t})}function R0e(){return _.useContext(Aq).edition}function wS(){return _.useContext(Aq)}const PS=[{id:"analysis",label:"Code Analysis",description:"Architecture graphs, files, flows, databases",icon:Ay,defaultTab:"home",tabs:[{id:"home",label:"Home",icon:Zve,noPanel:!0},{id:"graphs",label:"Graphs",icon:Ay,noPanel:!0},{id:"flows",label:"Flows",icon:Wne},{id:"files",label:"Files",icon:Yve},{id:"databases",label:"Databases",icon:xl},{id:"analyses",label:"Analyses",icon:JW,noPanel:!0}]},{id:"drift",label:"BL Drift",description:"Spec consolidation, contracts, verification",icon:Bu,defaultTab:"spec",tabs:[{id:"spec",label:"Spec",icon:Sve},{id:"contracts",label:"Contracts",icon:xq},{id:"verify",label:"Verify",icon:Bu,noPanel:!0},{id:"runs",label:"Runs",icon:JW,noPanel:!0},{id:"decisions",label:"Decisions",icon:EC}]}];function wre(t){return PS.find(e=>e.id===t)}function Pre(){return PS.flatMap(t=>t.tabs)}function j0e(t){return Pre().find(e=>e.id===t)}function DC(t){var e;return((e=wre(t))==null?void 0:e.defaultTab)??""}function E0e(){return new Set(Pre().map(t=>t.id))}function C0e(t){var e;return(e=PS.find(n=>n.tabs.some(r=>r.id===t)))==null?void 0:e.id}function h0(t,e){return t===void 0||e.has(t)}function z0e(){const{capabilities:t}=wS();return _.useMemo(()=>PS.filter(e=>h0(e.requiredCapability,t)).map(e=>({...e,tabs:e.tabs.filter(n=>h0(n.requiredCapability,t))})),[t])}function Y0e(t){const{capabilities:e}=wS();return _.useMemo(()=>{const n=wre(t);return n?h0(n.requiredCapability,e)?n.tabs.filter(r=>h0(r.requiredCapability,e)):[]:[]},[t,e])}function A0e({value:t,onChange:e}){const n=z0e(),[r,i]=_.useState(!1),a=_.useRef(null);_.useEffect(()=>{if(!r)return;const l=c=>{a.current&&!a.current.contains(c.target)&&i(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[r]);const o=n.find(l=>l.id===t)??n[0];if(!o)return null;const s=o.icon;return m.jsxs("div",{className:"relative",ref:a,children:[m.jsxs("button",{type:"button",onClick:()=>i(l=>!l),className:"flex items-center gap-1.5 rounded-md border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-muted/50 transition-colors","aria-haspopup":"menu","aria-expanded":r,children:[m.jsx(s,{className:"h-3.5 w-3.5 text-muted-foreground"}),m.jsx("span",{className:"font-medium",children:o.label}),m.jsx(qa,{className:"h-3 w-3 text-muted-foreground"})]}),r&&m.jsx("div",{role:"menu",className:"absolute left-0 top-full z-50 mt-1 min-w-64 rounded-md border border-border bg-popover p-1 shadow-lg",children:n.map(l=>{const c=l.icon,u=l.id===t;return m.jsxs("button",{role:"menuitemradio","aria-checked":u,onClick:()=>{i(!1),u||e(l.id)},className:`flex w-full items-start gap-2 rounded px-2 py-1.5 text-left text-xs transition-colors ${u?"bg-accent text-accent-foreground":"hover:bg-muted text-foreground"}`,children:[m.jsx(c,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("span",{className:"font-medium",children:l.label}),u&&m.jsx(Ff,{className:"h-3 w-3 text-primary"})]}),m.jsx("div",{className:"text-[11px] text-muted-foreground",children:l.description})]})]},l.id)})})]})}function q0e({branch:t}){return t?m.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[m.jsx(bq,{className:"h-3.5 w-3.5"}),t]}):null}function tm({children:t,content:e,side:n="bottom",align:r="center",width:i="auto",popoverClassName:a=""}){if(e==null)return m.jsx(m.Fragment,{children:t});const o=i==="auto"?"whitespace-nowrap":i==="narrow"?"w-64 whitespace-normal":"w-80 whitespace-normal",s=n==="top"?"bottom-full mb-1.5":"top-full mt-1.5",l=r==="start"?"left-0":r==="end"?"right-0":"left-1/2 -translate-x-1/2";return m.jsxs("span",{className:"group relative inline-flex",children:[t,m.jsx("span",{role:"tooltip",className:`pointer-events-none absolute z-50 ${s} ${l} ${o} rounded border border-border bg-popover px-3 py-2 text-xs leading-snug text-popover-foreground opacity-0 shadow-md transition-opacity group-hover:opacity-100 ${a}`,children:e})]})}function Z0e({subject:t}){return m.jsxs("div",{className:"space-y-2 text-[11px] leading-relaxed",children:[m.jsxs("div",{children:[m.jsx("p",{className:"font-semibold text-foreground",children:"Normal mode"}),m.jsxs("p",{children:["Stashes pending changes, ",t.verb," the committed code, then restores your changes. The baseline is always the committed state."]})]}),m.jsxs("div",{children:[m.jsx("p",{className:"font-semibold text-foreground",children:"Git Diff mode"}),m.jsxs("p",{children:["Compares your working tree against the committed baseline. Shows which ",t.plural," your pending changes introduce or resolve."]})]})]})}function Tre({diffMode:t,onToggle:e,subject:n}){return m.jsx(tm,{align:"end",width:"wide",content:m.jsx(Z0e,{subject:n}),children:m.jsxs("div",{className:"flex items-center rounded-md border border-border p-0.5",children:[m.jsx("button",{type:"button",onClick:()=>t&&e(!1),className:`rounded px-2 py-0.5 text-xs font-medium transition-colors ${t?"text-muted-foreground hover:text-foreground":"bg-accent text-accent-foreground"}`,children:"Normal"}),m.jsx("button",{type:"button",onClick:()=>!t&&e(!0),className:`rounded px-2 py-0.5 text-xs font-medium transition-colors ${t?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Git Diff"})]})})}function kre({items:t,selectedId:e,onSelect:n}){var s;const[r,i]=_.useState(!1),a=_.useRef(null);if(_.useEffect(()=>{const l=c=>{a.current&&!a.current.contains(c.target)&&i(!1)};return r&&document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[r]),t.length<=1)return null;const o=e?((s=t.find(l=>l.id===e))==null?void 0:s.label)??"Past run":"Latest";return m.jsxs("div",{className:"relative",ref:a,children:[m.jsxs("button",{className:"flex items-center gap-1 rounded-md border border-border bg-card px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:()=>i(l=>!l),children:[o,m.jsx(qa,{className:"h-3 w-3"})]}),r&&m.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-56 rounded-md border border-border bg-popover shadow-lg",children:m.jsxs("div",{className:"max-h-64 overflow-y-auto py-1",children:[m.jsx("button",{className:`w-full whitespace-nowrap px-3 py-1.5 text-left text-xs hover:bg-accent transition-colors ${e?"text-muted-foreground":"bg-accent/50 font-medium text-foreground"}`,onClick:()=>{n(null),i(!1)},children:"Latest"}),t.map((l,c)=>{const u=c===0,f=u?!e:e===l.id;return m.jsxs("button",{className:`w-full whitespace-nowrap px-3 py-1.5 text-left text-xs hover:bg-accent transition-colors ${f?"bg-accent/50 font-medium text-foreground":"text-muted-foreground"}`,onClick:()=>{n(u?null:l.id),i(!1)},children:[m.jsx("span",{children:l.label}),l.branch&&m.jsx("span",{className:"ml-1.5 font-mono opacity-60",children:l.branch}),u&&m.jsx("span",{className:"ml-1.5 text-primary/70",children:"(latest)"})]},l.id)})]})})]})}async function V0e(){return null}const _re=_.createContext({routes:[],navItems:[],loaded:!1});function U0e({children:t}){const{edition:e,isLoading:n,capabilities:r}=wS(),[i,a]=_.useState(null);_.useEffect(()=>{if(n)return;if(e!=="enterprise"){a(null);return}let s=!1;return V0e().then(l=>{s||a(l)}),()=>{s=!0}},[e,n]);const o=_.useMemo(()=>{const s=l=>!l||r.has(l);return{routes:((i==null?void 0:i.routes)??[]).filter(l=>s(l.requiredCapability)),navItems:((i==null?void 0:i.navItems)??[]).filter(l=>s(l.requiredCapability)),homeComponent:i==null?void 0:i.homeComponent,loaded:i!==null}},[i,r]);return m.jsx(_re.Provider,{value:o,children:t})}function Xre(){return _.useContext(_re)}const N0e={Building2:Tve};function W0e(){const{navItems:t}=Xre(),{pathname:e}=ks();return t.length===0?null:m.jsx(m.Fragment,{children:t.map(n=>{const r=n.iconName?N0e[n.iconName]:void 0,i=e===n.to;return m.jsxs(Dh,{to:n.to,className:`flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium transition-colors ${i?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[r&&m.jsx(r,{className:"h-4 w-4"}),n.label]},n.id)})})}const xk="/api/ee/auth",Rre=_.createContext({status:"disabled",user:null,signIn:()=>{},signOut:async()=>{}});function M0e({children:t}){const{edition:e,isLoading:n}=wS(),[r,i]=_.useState("loading"),[a,o]=_.useState(null);_.useEffect(()=>{if(n)return;if(e!=="enterprise"){i("disabled"),o(null);return}let u=!1;return i("loading"),fetch(`${ly()}${xk}/me`,{credentials:"include"}).then(async f=>{if(!u)if(f.ok){const h=await f.json();o(h.user),i("authed")}else o(null),i("anon")}).catch(()=>{u||(o(null),i("anon"))}),()=>{u=!0}},[e,n]);const s=_.useCallback(()=>{window.location.href=`${ly()}${xk}/login`},[]),l=_.useCallback(async()=>{try{const f=await(await fetch(`${ly()}${xk}/logout`,{method:"POST",credentials:"include"})).json().catch(()=>({}));window.location.href=f.logoutUrl??"/"}catch{window.location.href="/"}},[]),c=_.useMemo(()=>({status:r,user:a,signIn:s,signOut:l}),[r,a,s,l]);return m.jsx(Rre.Provider,{value:c,children:t})}function jre(){return _.useContext(Rre)}function j8({children:t}){return m.jsx("div",{className:"flex h-screen w-screen items-center justify-center bg-background text-foreground",children:t})}function I0e({children:t}){const{status:e,signIn:n}=jre(),r=new URLSearchParams(window.location.search).get("auth_error");return _.useEffect(()=>{e==="anon"&&!r&&n()},[e,r,n]),e==="disabled"||e==="authed"?m.jsx(m.Fragment,{children:t}):e==="anon"&&r?m.jsx(j8,{children:m.jsxs("div",{className:"max-w-sm text-center",children:[m.jsx("p",{className:"text-sm font-medium",children:"Sign-in failed"}),m.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["We couldn't complete authentication (",r,")."]}),m.jsx("button",{onClick:n,className:"mt-4 rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground hover:opacity-90",children:"Try again"})]})}):m.jsx(j8,{children:m.jsx(yn,{className:"h-6 w-6 animate-spin text-muted-foreground"})})}function Ere(){const[t,e]=_.useState(()=>typeof document<"u"&&document.documentElement.classList.contains("dark"));return _.useEffect(()=>{if(typeof document>"u")return;const n=document.documentElement,r=new MutationObserver(()=>{e(n.classList.contains("dark"))});return r.observe(n,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),t}function Cre(){const t=Ere(),e=_.useCallback(()=>{const n=!document.documentElement.classList.contains("dark");document.documentElement.classList.toggle("dark",n),localStorage.setItem("theme",n?"dark":"light")},[]);return{isDark:t,toggle:e}}const zre="https://github.com/truecourse-ai/truecourse",Yre="https://discord.gg/8AYwf26A";function Are({className:t}){return m.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:t,children:m.jsx("path",{d:"M20.317 4.369a19.79 19.79 0 0 0-4.885-1.515.074.074 0 0 0-.078.037c-.21.375-.444.864-.608 1.249a18.27 18.27 0 0 0-5.487 0 12.683 12.683 0 0 0-.617-1.249.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.369a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.105 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .077-.01c3.927 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .078.009c.12.099.246.198.373.292a.077.077 0 0 1-.006.128 12.3 12.3 0 0 1-1.873.891.077.077 0 0 0-.041.106c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.548-13.66a.061.061 0 0 0-.031-.028zM8.02 15.331c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.418 2.157-2.418 1.21 0 2.176 1.094 2.157 2.418 0 1.334-.956 2.419-2.157 2.419zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.418 2.157-2.418 1.21 0 2.176 1.094 2.157 2.418 0 1.334-.946 2.419-2.157 2.419z"})})}const uQ="flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs text-foreground hover:bg-muted transition-colors";function D0e(){var u;const{status:t,user:e,signOut:n}=jre(),{isDark:r,toggle:i}=Cre(),[a,o]=_.useState(!1),s=_.useRef(null);if(_.useEffect(()=>{if(!a)return;const f=h=>{s.current&&!s.current.contains(h.target)&&o(!1)};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[a]),t!=="authed"||!e)return null;const l=[e.firstName,e.lastName].filter(Boolean).join(" ")||e.email,c=(((u=e.firstName)==null?void 0:u[0])??e.email[0]??"?").toUpperCase();return m.jsxs("div",{className:"relative",ref:s,children:[m.jsxs("button",{type:"button",onClick:()=>o(f=>!f),className:"flex items-center gap-1.5 rounded-md px-1.5 py-1 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors","aria-haspopup":"menu","aria-expanded":a,children:[m.jsx("span",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-primary/20 text-[10px] font-semibold text-primary",children:c}),m.jsx(qa,{className:"h-3 w-3"})]}),a&&m.jsxs("div",{role:"menu",className:"absolute right-0 top-full z-50 mt-1 min-w-56 rounded-md border border-border bg-popover p-1 shadow-lg",children:[m.jsxs("div",{className:"px-2 py-1.5",children:[m.jsx("div",{className:"truncate text-xs font-medium text-foreground",children:l}),m.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:e.email})]}),m.jsx("div",{className:"my-1 border-t border-border"}),m.jsxs("button",{role:"menuitem",onClick:i,className:uQ,children:[r?m.jsx(Vne,{className:"h-3.5 w-3.5"}):m.jsx(Cne,{className:"h-3.5 w-3.5"}),r?"Light mode":"Dark mode"]}),m.jsxs("a",{role:"menuitem",href:zre,target:"_blank",rel:"noopener noreferrer",onClick:()=>o(!1),className:uQ,children:[m.jsx(Xne,{className:"h-3.5 w-3.5"}),"Star on GitHub",m.jsx(Zne,{className:"ml-auto h-3 w-3 text-muted-foreground"})]}),m.jsxs("a",{role:"menuitem",href:Yre,target:"_blank",rel:"noopener noreferrer",onClick:()=>o(!1),className:uQ+" text-[#5865F2] hover:text-[#5865F2]",children:[m.jsx(Are,{className:"h-3.5 w-3.5"}),"Discord"]}),m.jsx("div",{className:"my-1 border-t border-border"}),m.jsxs("button",{role:"menuitem",onClick:()=>{o(!1),n()},className:uQ,children:[m.jsx(Wve,{className:"h-3.5 w-3.5"}),"Sign out"]})]})]})}function qq({repoName:t,currentBranch:e,onAnalyze:n,isAnalyzing:r,showBack:i,backHref:a="/",isDiffMode:o,onEnterDiffMode:s,onExitDiffMode:l,analyses:c,selectedAnalysisId:u,onSelectAnalysis:f,currentAnalysisId:h,dashboardSection:p,onDashboardSectionChange:y,sectionActions:v}){const $=R0e(),{isDark:x,toggle:S}=Cre();return m.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border bg-card px-4",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[i&&m.jsx(Dh,{to:a,className:Tb({variant:"ghost",size:"icon-sm"}),children:m.jsx(Qne,{className:"h-5 w-5"})}),m.jsxs(Dh,{to:"/",className:"flex items-center gap-2 text-lg font-bold text-foreground",children:[m.jsx("img",{src:"/logo.svg",alt:"TrueCourse",className:"h-7 w-7"}),"TrueCourse"]}),p&&y&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted-foreground/60",children:"/"}),m.jsx(A0e,{value:p,onChange:y})]})]}),m.jsxs("div",{className:"flex items-center gap-3",children:[t&&m.jsx("span",{className:"text-sm font-medium text-foreground",children:t}),m.jsx(q0e,{branch:e}),c&&f&&m.jsx(kre,{items:c.map(b=>{const T=new Date(b.createdAt);return{id:b.id,label:`${T.toLocaleDateString()} ${T.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`,branch:b.branch}}),selectedId:u??null,onSelect:f}),s&&m.jsx(Tre,{diffMode:!!o,onToggle:b=>b?s==null?void 0:s():l==null?void 0:l(),subject:{verb:"analyzes",plural:"violations"}}),v&&m.jsx("div",{className:"flex items-center gap-2",children:v}),n&&m.jsx("div",{className:"relative flex items-center",children:m.jsxs(xn,{size:"sm",onClick:()=>n(),disabled:r,children:[r&&m.jsx(yn,{className:"h-3.5 w-3.5 animate-spin"}),r?"Analyzing...":"Analyze"]})})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx(W0e,{}),m.jsx(D0e,{}),$!=="enterprise"&&m.jsxs(m.Fragment,{children:[m.jsxs("a",{href:zre,target:"_blank",rel:"noopener noreferrer",className:Tb({variant:"ghost",size:"sm"})+" gap-1.5","aria-label":"Star TrueCourse on GitHub",children:[m.jsx(Xne,{className:"h-4 w-4"}),m.jsx(Zne,{className:"h-3.5 w-3.5"}),m.jsx("span",{className:"text-xs font-medium",children:"Star"})]}),m.jsxs("a",{href:Yre,target:"_blank",rel:"noopener noreferrer",className:Tb({variant:"ghost",size:"sm"})+" gap-1.5 text-[#5865F2] hover:text-[#5865F2]","aria-label":"Join the TrueCourse Discord",children:[m.jsx(Are,{className:"h-4 w-4"}),m.jsx("span",{className:"text-xs font-medium",children:"Discord"})]}),m.jsx(xn,{variant:"ghost",size:"icon-sm",onClick:S,"aria-label":"Toggle theme",children:x?m.jsx(Vne,{className:"h-5 w-5"}):m.jsx(Cne,{className:"h-5 w-5"})})]})]})]})}let E8=(function(t){return t.disabled="data-disabled",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t})({});const L0e={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Fg={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},G0e={disabled:!1,...Fg},B0e={valid(t){return t===null?null:t?{[E8.valid]:""}:{[E8.invalid]:""}}},F0e=_.createContext({invalid:void 0,name:void 0,validityData:{state:L0e,errors:[],error:"",value:"",initialValue:null},setValidityData:Ra,disabled:void 0,touched:Fg.touched,setTouched:Ra,dirty:Fg.dirty,setDirty:Ra,filled:Fg.filled,setFilled:Ra,focused:Fg.focused,setFocused:Ra,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:G0e,markedDirtyRef:{current:!1},validation:{getValidationProps:(t=Ii)=>t,getInputValidationProps:(t=Ii)=>t,inputRef:{current:null},commit:async()=>{}}});function qre(t=!0){const e=_.useContext(F0e);if(e.setValidityData===Ra&&!t)throw new Error(_s(28));return e}const H0e=_.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ra,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function K0e(){return _.useContext(H0e)}let C8=0;function J0e(t,e="mui"){const[n,r]=_.useState(t),i=t||n;return _.useEffect(()=>{n==null&&(C8+=1,r(`${e}-${C8}`))},[n,e]),i}const z8=cxe.useId;function Ov(t,e){if(z8!==void 0){const n=z8();return t??(e?`${e}-${n}`:n)}return J0e(t,e)}function fv(t){return Ov(t,"base-ui")}const e1e=_.createContext({controlId:void 0,registerControlId:Ra,labelId:void 0,setLabelId:Ra,messageIds:[],setMessageIds:Ra,getDescriptionProps:t=>t});function Zre(){return _.useContext(e1e)}const t1e=[];function Zq(t){_.useEffect(t,t1e)}const Qg=0;class Qs{constructor(){Wn(this,"currentId",Qg);Wn(this,"clear",()=>{this.currentId!==Qg&&(clearTimeout(this.currentId),this.currentId=Qg)});Wn(this,"disposeEffect",()=>this.clear)}static create(){return new Qs}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Qg,n()},e)}isStarted(){return this.currentId!==Qg}}function tO(){const t=yo(Qs.create).current;return Zq(t.disposeEffect),t}function n1e(t,e){return{...t,state:{...t.state,valid:!e&&t.state.valid}}}function dr(t){return(t==null?void 0:t.ownerDocument)||document}const nm=typeof navigator<"u",Qk=i1e(),Vre=o1e(),Ure=a1e(),Nre=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Wre=Qk.platform==="MacIntel"&&Qk.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Qk.platform),Mre=nm&&/apple/i.test(navigator.vendor),LC=nm&&/android/i.test(Vre)||/android/i.test(Ure),r1e=nm&&Vre.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,Ire=Ure.includes("jsdom/");function i1e(){if(!nm)return{platform:"",maxTouchPoints:-1};const t=navigator.userAgentData;return t!=null&&t.platform?{platform:t.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function a1e(){if(!nm)return"";const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(({brand:e,version:n})=>`${e}/${n}`).join(" "):navigator.userAgent}function o1e(){if(!nm)return"";const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform??""}const GC="data-base-ui-focusable",Dre="active",Lre="selected",Gre="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Js(t){var n;let e=t.activeElement;for(;((n=e==null?void 0:e.shadowRoot)==null?void 0:n.activeElement)!=null;)e=e.shadowRoot.activeElement;return e}function ln(t,e){var r;if(!t||!e)return!1;const n=(r=e.getRootNode)==null?void 0:r.call(e);if(t.contains(e))return!0;if(n&&qy(n)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function p0(t,e){if(!jn(t))return!1;const n=t;if(e.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of e.entries())if(ln(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function _a(t){return"composedPath"in t?t.composedPath()[0]:t.target}function as(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function s1e(t){return t.matches("html,body")}function TS(t){return yi(t)&&t.matches(Gre)}function Y8(t){return t?t.getAttribute("role")==="combobox"&&TS(t):!1}function l1e(t){if(!t||Ire)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function BC(t){return t?t.hasAttribute(GC)?t:t.querySelector(`[${GC}]`)||t:null}function Sc(t,e,n=!0){return t.filter(i=>{var a;return i.parentId===e&&(!n||((a=i.context)==null?void 0:a.open))}).flatMap(i=>[i,...Sc(t,i.id,n)])}function A8(t,e){var i;let n=[],r=(i=t.find(a=>a.id===e))==null?void 0:i.parentId;for(;r;){const a=t.find(o=>o.id===r);r=a==null?void 0:a.parentId,a&&(n=n.concat(a))}return n}function c1e(t){t.preventDefault(),t.stopPropagation()}function u1e(t){return"nativeEvent"in t}function O1e(t){return t.pointerType===""&&t.isTrusted?!0:LC&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function f1e(t){return Ire?!1:!LC&&t.width===0&&t.height===0||LC&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function tp(t,e){const n=["mouse","pen"];return e||n.push("",void 0),n.includes(t)}function Bre(t){const e=t.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}const d1e=["top","right","bottom","left"],np=Math.min,io=Math.max,m0=Math.round,OQ=Math.floor,hl=t=>({x:t,y:t}),h1e={left:"right",right:"left",bottom:"top",top:"bottom"};function FC(t,e,n){return io(t,np(e,n))}function Yc(t,e){return typeof t=="function"?t(e):t}function Ca(t){return t.split("-")[0]}function hO(t){return t.split("-")[1]}function Vq(t){return t==="x"?"y":"x"}function Uq(t){return t==="y"?"height":"width"}function zo(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Nq(t){return Vq(zo(t))}function p1e(t,e,n){n===void 0&&(n=!1);const r=hO(t),i=Nq(t),a=Uq(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(o=g0(o)),[o,g0(o)]}function m1e(t){const e=g0(t);return[HC(t),e,HC(e)]}function HC(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const q8=["left","right"],Z8=["right","left"],g1e=["top","bottom"],y1e=["bottom","top"];function $1e(t,e,n){switch(t){case"top":case"bottom":return n?e?Z8:q8:e?q8:Z8;case"left":case"right":return e?g1e:y1e;default:return[]}}function v1e(t,e,n,r){const i=hO(t);let a=$1e(Ca(t),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),e&&(a=a.concat(a.map(HC)))),a}function g0(t){const e=Ca(t);return h1e[e]+t.slice(e.length)}function x1e(t){return{top:0,right:0,bottom:0,left:0,...t}}function Fre(t){return typeof t!="number"?x1e(t):{top:t,right:t,bottom:t,left:t}}function y0(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Q1e(t){return fo(t).display!=="none"}/*!
|
|
535
|
+
*/const Ine=Ae("ZoomOut",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);function xS(){return typeof window<"u"}function OO(t){return kq(t)?(t.nodeName||"").toLowerCase():"#document"}function ai(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function kl(t){var e;return(e=(kq(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function kq(t){return xS()?t instanceof Node||t instanceof ai(t).Node:!1}function jn(t){return xS()?t instanceof Element||t instanceof ai(t).Element:!1}function yi(t){return xS()?t instanceof HTMLElement||t instanceof ai(t).HTMLElement:!1}function qy(t){return!xS()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof ai(t).ShadowRoot}function fO(t){const{overflow:e,overflowX:n,overflowY:r,display:i}=fo(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&i!=="inline"&&i!=="contents"}function nxe(t){return/^(table|td|th)$/.test(OO(t))}function QS(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const rxe=/transform|translate|scale|rotate|perspective|filter/,ixe=/paint|layout|strict|content/,HO=t=>!!t&&t!=="none";let pk;function _q(t){const e=jn(t)?fo(t):t;return HO(e.transform)||HO(e.translate)||HO(e.scale)||HO(e.rotate)||HO(e.perspective)||!bS()&&(HO(e.backdropFilter)||HO(e.filter))||rxe.test(e.willChange||"")||ixe.test(e.contain||"")}function axe(t){let e=Cc(t);for(;yi(e)&&!bc(e);){if(_q(e))return e;if(QS(e))return null;e=Cc(e)}return null}function bS(){return pk==null&&(pk=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),pk}function bc(t){return/^(html|body|#document)$/.test(OO(t))}function fo(t){return ai(t).getComputedStyle(t)}function SS(t){return jn(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Cc(t){if(OO(t)==="html")return t;const e=t.assignedSlot||t.parentNode||qy(t)&&t.host||kl(t);return qy(e)?e.host:e}function Dne(t){const e=Cc(t);return bc(e)?t.ownerDocument?t.ownerDocument.body:t.body:yi(e)&&fO(e)?e:Dne(e)}function Zy(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const i=Dne(t),a=i===((r=t.ownerDocument)==null?void 0:r.body),o=ai(i);if(a){const s=zC(o);return e.concat(o,o.visualViewport||[],fO(i)?i:[],s&&n?Zy(s):[])}else return e.concat(i,Zy(i,[],n))}function zC(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const e8={};function yo(t,e){const n=_.useRef(e8);return n.current===e8&&(n.current=t(e)),n}const mk=tne[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],oxe=mk&&mk!==_.useLayoutEffect?mk:t=>t();function tn(t){const e=yo(sxe).current;return e.next=t,oxe(e.effect),e.trampoline}function sxe(){const t={next:void 0,callback:lxe,trampoline:(...e)=>{var n;return(n=t.callback)==null?void 0:n.call(t,...e)},effect:()=>{t.callback=t.next}};return t}function lxe(){}const cxe={...tne},uxe=()=>{},qt=typeof document<"u"?_.useLayoutEffect:uxe;function YC(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}const sy={};function Xq(t,e,n,r,i){let a={...AC(t,sy)};return e&&(a=Pb(a,e)),n&&(a=Pb(a,n)),r&&(a=Pb(a,r)),a}function Oxe(t){if(t.length===0)return sy;if(t.length===1)return AC(t[0],sy);let e={...AC(t[0],sy)};for(let n=1;n<t.length;n+=1)e=Pb(e,t[n]);return e}function Pb(t,e){return Lne(e)?e(t):fxe(t,e)}function fxe(t,e){if(!e)return t;for(const n in e){const r=e[n];switch(n){case"style":{t[n]=YC(t.style,r);break}case"className":{t[n]=Gne(t.className,r);break}default:dxe(n,r)?t[n]=hxe(t[n],r):t[n]=r}}return t}function dxe(t,e){const n=t.charCodeAt(0),r=t.charCodeAt(1),i=t.charCodeAt(2);return n===111&&r===110&&i>=65&&i<=90&&(typeof e=="function"||typeof e>"u")}function Lne(t){return typeof t=="function"}function AC(t,e){return Lne(t)?t(e):t??sy}function hxe(t,e){return e?t?n=>{if(pxe(n)){const i=n;qC(i);const a=e(i);return i.baseUIHandlerPrevented||t==null||t(i),a}const r=e(n);return t==null||t(n),r}:e:t}function qC(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function Gne(t,e){return e?t?e+" "+t:e:t}function pxe(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}function mxe(t,e){return function(r,...i){const a=new URL(t);return a.searchParams.set("code",r.toString()),i.forEach(o=>a.searchParams.append("args[]",o)),`${e} error #${r}; visit ${a} for the full message.`}}const _s=mxe("https://base-ui.com/production-error","Base UI"),gxe=_.createContext(void 0);function yxe(t=!1){const e=_.useContext(gxe);if(e===void 0&&!t)throw new Error(_s(16));return e}function $xe(t){const{focusableWhenDisabled:e,disabled:n,composite:r=!1,tabIndex:i=0,isNativeButton:a}=t,o=r&&e!==!1,s=r&&e===!1;return{props:_.useMemo(()=>{const c={onKeyDown(u){n&&e&&u.key!=="Tab"&&u.preventDefault()}};return r||(c.tabIndex=i,!a&&n&&(c.tabIndex=e?i:-1)),(a&&(e||o)||!a&&n)&&(c["aria-disabled"]=n),a&&(!e||s)&&(c.disabled=n),c},[r,n,e,o,s,a,i])}}function Rq(t={}){const{disabled:e=!1,focusableWhenDisabled:n,tabIndex:r=0,native:i=!0,composite:a}=t,o=_.useRef(null),s=yxe(!0),l=a??s!==void 0,{props:c}=$xe({focusableWhenDisabled:n,disabled:e,composite:l,tabIndex:r,isNativeButton:i}),u=_.useCallback(()=>{const p=o.current;gk(p)&&l&&e&&c.disabled===void 0&&p.disabled&&(p.disabled=!1)},[e,c.disabled,l]);qt(u,[u]);const f=_.useCallback((p={})=>{const{onClick:y,onMouseDown:v,onKeyUp:$,onKeyDown:x,onPointerDown:S,...b}=p;return Xq({type:i?"button":void 0,onClick(w){if(e){w.preventDefault();return}y==null||y(w)},onMouseDown(w){e||v==null||v(w)},onKeyDown(w){if(e||(qC(w),x==null||x(w),w.baseUIHandlerPrevented))return;const P=w.target===w.currentTarget,k=w.currentTarget,R=gk(k),E=!i&&vxe(k),C=P&&(i?R:!E),z=w.key==="Enter",Y=w.key===" ",W=k.getAttribute("role"),A=(W==null?void 0:W.startsWith("menuitem"))||W==="option"||W==="gridcell";if(P&&l&&Y){if(w.defaultPrevented&&A)return;w.preventDefault(),E||i&&R?(k.click(),w.preventBaseUIHandler()):C&&(y==null||y(w),w.preventBaseUIHandler());return}C&&(!i&&(Y||z)&&w.preventDefault(),!i&&z&&(y==null||y(w)))},onKeyUp(w){if(!e){if(qC(w),$==null||$(w),w.target===w.currentTarget&&i&&l&&gk(w.currentTarget)&&w.key===" "){w.preventDefault();return}w.baseUIHandlerPrevented||w.target===w.currentTarget&&!i&&!l&&w.key===" "&&(y==null||y(w))}},onPointerDown(w){if(e){w.preventDefault();return}S==null||S(w)}},i?void 0:{role:"button"},c,b)},[e,c,l,i]),h=tn(p=>{o.current=p,u()});return{getButtonProps:f,buttonRef:h}}function gk(t){return yi(t)&&t.tagName==="BUTTON"}function vxe(t){return!!((t==null?void 0:t.tagName)==="A"&&(t!=null&&t.href))}function a0(t,e,n,r){const i=yo(Bne).current;return Qxe(i,t,e,n,r)&&Fne(i,[t,e,n,r]),i.callback}function xxe(t){const e=yo(Bne).current;return bxe(e,t)&&Fne(e,t),e.callback}function Bne(){return{callback:null,cleanup:null,refs:[]}}function Qxe(t,e,n,r,i){return t.refs[0]!==e||t.refs[1]!==n||t.refs[2]!==r||t.refs[3]!==i}function bxe(t,e){return t.refs.length!==e.length||t.refs.some((n,r)=>n!==e[r])}function Fne(t,e){if(t.refs=e,e.every(n=>n==null)){t.callback=null;return}t.callback=n=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),n!=null){const r=Array(e.length).fill(null);for(let i=0;i<e.length;i+=1){const a=e[i];if(a!=null)switch(typeof a){case"function":{const o=a(n);typeof o=="function"&&(r[i]=o);break}case"object":{a.current=n;break}}}t.cleanup=()=>{for(let i=0;i<e.length;i+=1){const a=e[i];if(a!=null)switch(typeof a){case"function":{const o=r[i];typeof o=="function"?o():a(null);break}case"object":{a.current=null;break}}}}}}}const Sxe=parseInt(_.version,10);function jq(t){return Sxe>=t}function t8(t){if(!_.isValidElement(t))return null;const e=t,n=e.props;return(jq(19)?n==null?void 0:n.ref:e.ref)??null}function wxe(t,e){const n={};for(const r in t){const i=t[r];if(e!=null&&e.hasOwnProperty(r)){const a=e[r](i);a!=null&&Object.assign(n,a);continue}i===!0?n[`data-${r.toLowerCase()}`]="":i&&(n[`data-${r.toLowerCase()}`]=i.toString())}return n}function Pxe(t,e){return typeof t=="function"?t(e):t}function Txe(t,e){return typeof t=="function"?t(e):t}function Ra(){}const Ii=Object.freeze({}),kxe={style:{transition:"none"}},Hne="data-base-ui-click-trigger",_xe={fallbackAxisSide:"end"},Xxe={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function ha(t,e,n={}){const r=e.render,i=Rxe(e,n);if(n.enabled===!1)return null;const a=n.state??Ii;return Exe(t,r,i,a)}function Rxe(t,e={}){const{className:n,style:r,render:i}=t,{state:a=Ii,ref:o,props:s,stateAttributesMapping:l,enabled:c=!0}=e,u=c?Pxe(n,a):void 0,f=c?Txe(r,a):void 0,h=c?wxe(a,l):Ii,p=c?YC(h,Array.isArray(s)?Oxe(s):s)??Ii:Ii;return typeof document<"u"&&(c?Array.isArray(o)?p.ref=xxe([p.ref,t8(i),...o]):p.ref=a0(p.ref,t8(i),o):a0(null,null)),c?(u!==void 0&&(p.className=Gne(p.className,u)),f!==void 0&&(p.style=YC(p.style,f)),p):Ii}const jxe=Symbol.for("react.lazy");function Exe(t,e,n,r){if(e){if(typeof e=="function")return e(n,r);const i=Xq(n,e.props);i.ref=n.ref;let a=e;return(a==null?void 0:a.$$typeof)===jxe&&(a=_.Children.toArray(e)[0]),_.cloneElement(a,i)}if(t&&typeof t=="string")return Cxe(t,n);throw new Error(_s(8))}function Cxe(t,e){return t==="button"?_.createElement("button",{type:"button",...e,key:e.key}):t==="img"?_.createElement("img",{alt:"",...e,key:e.key}):_.createElement(t,e)}const zxe=_.forwardRef(function(e,n){const{render:r,className:i,disabled:a=!1,focusableWhenDisabled:o=!1,nativeButton:s=!0,...l}=e,{getButtonProps:c,buttonRef:u}=Rq({disabled:a,focusableWhenDisabled:o,native:s});return ha("button",e,{state:{disabled:a},ref:[n,u],props:[l,c]})});function Kne(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=Kne(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function zt(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Kne(t))&&(r&&(r+=" "),r+=e);return r}const n8=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,r8=zt,Eq=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return r8(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:a}=e,o=Object.keys(i).map(c=>{const u=n==null?void 0:n[c],f=a==null?void 0:a[c];if(u===null)return null;const h=n8(u)||n8(f);return i[c][h]}),s=n&&Object.entries(n).reduce((c,u)=>{let[f,h]=u;return h===void 0||(c[f]=h),c},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((c,u)=>{let{class:f,className:h,...p}=u;return Object.entries(p).every(y=>{let[v,$]=y;return Array.isArray($)?$.includes({...a,...s}[v]):{...a,...s}[v]===$})?[...c,f,h]:c},[]);return r8(t,o,l,n==null?void 0:n.class,n==null?void 0:n.className)},Yxe=(t,e)=>{const n=new Array(t.length+e.length);for(let r=0;r<t.length;r++)n[r]=t[r];for(let r=0;r<e.length;r++)n[t.length+r]=e[r];return n},Axe=(t,e)=>({classGroupId:t,validator:e}),Jne=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),o0="-",i8=[],qxe="arbitrary..",Zxe=t=>{const e=Uxe(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{if(o.startsWith("[")&&o.endsWith("]"))return Vxe(o);const s=o.split(o0),l=s[0]===""&&s.length>1?1:0;return ere(s,l,e)},getConflictingClassGroupIds:(o,s)=>{if(s){const l=r[o],c=n[o];return l?c?Yxe(c,l):l:c||i8}return n[o]||i8}}},ere=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const i=t[e],a=n.nextPart.get(i);if(a){const c=ere(t,e+1,a);if(c)return c}const o=n.validators;if(o===null)return;const s=e===0?t.join(o0):t.slice(e).join(o0),l=o.length;for(let c=0;c<l;c++){const u=o[c];if(u.validator(s))return u.classGroupId}},Vxe=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),r=e.slice(0,n);return r?qxe+r:void 0})(),Uxe=t=>{const{theme:e,classGroups:n}=t;return Nxe(n,e)},Nxe=(t,e)=>{const n=Jne();for(const r in t){const i=t[r];Cq(i,n,r,e)}return n},Cq=(t,e,n,r)=>{const i=t.length;for(let a=0;a<i;a++){const o=t[a];Wxe(o,e,n,r)}},Wxe=(t,e,n,r)=>{if(typeof t=="string"){Mxe(t,e,n);return}if(typeof t=="function"){Ixe(t,e,n,r);return}Dxe(t,e,n,r)},Mxe=(t,e,n)=>{const r=t===""?e:tre(e,t);r.classGroupId=n},Ixe=(t,e,n,r)=>{if(Lxe(t)){Cq(t(r),e,n,r);return}e.validators===null&&(e.validators=[]),e.validators.push(Axe(n,t))},Dxe=(t,e,n,r)=>{const i=Object.entries(t),a=i.length;for(let o=0;o<a;o++){const[s,l]=i[o];Cq(l,tre(e,s),n,r)}},tre=(t,e)=>{let n=t;const r=e.split(o0),i=r.length;for(let a=0;a<i;a++){const o=r[a];let s=n.nextPart.get(o);s||(s=Jne(),n.nextPart.set(o,s)),n=s}return n},Lxe=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,Gxe=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),r=Object.create(null);const i=(a,o)=>{n[a]=o,e++,e>t&&(e=0,r=n,n=Object.create(null))};return{get(a){let o=n[a];if(o!==void 0)return o;if((o=r[a])!==void 0)return i(a,o),o},set(a,o){a in n?n[a]=o:i(a,o)}}},ZC="!",a8=":",Bxe=[],o8=(t,e,n,r,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Fxe=t=>{const{prefix:e,experimentalParseClassName:n}=t;let r=i=>{const a=[];let o=0,s=0,l=0,c;const u=i.length;for(let v=0;v<u;v++){const $=i[v];if(o===0&&s===0){if($===a8){a.push(i.slice(l,v)),l=v+1;continue}if($==="/"){c=v;continue}}$==="["?o++:$==="]"?o--:$==="("?s++:$===")"&&s--}const f=a.length===0?i:i.slice(l);let h=f,p=!1;f.endsWith(ZC)?(h=f.slice(0,-1),p=!0):f.startsWith(ZC)&&(h=f.slice(1),p=!0);const y=c&&c>l?c-l:void 0;return o8(a,p,h,y)};if(e){const i=e+a8,a=r;r=o=>o.startsWith(i)?a(o.slice(i.length)):o8(Bxe,!1,o,void 0,!0)}if(n){const i=r;r=a=>n({className:a,parseClassName:i})}return r},Hxe=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,r)=>{e.set(n,1e6+r)}),n=>{const r=[];let i=[];for(let a=0;a<n.length;a++){const o=n[a],s=o[0]==="[",l=e.has(o);s||l?(i.length>0&&(i.sort(),r.push(...i),i=[]),r.push(o)):i.push(o)}return i.length>0&&(i.sort(),r.push(...i)),r}},Kxe=t=>({cache:Gxe(t.cacheSize),parseClassName:Fxe(t),sortModifiers:Hxe(t),...Zxe(t)}),Jxe=/\s+/,eQe=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a}=e,o=[],s=t.trim().split(Jxe);let l="";for(let c=s.length-1;c>=0;c-=1){const u=s[c],{isExternal:f,modifiers:h,hasImportantModifier:p,baseClassName:y,maybePostfixModifierPosition:v}=n(u);if(f){l=u+(l.length>0?" "+l:l);continue}let $=!!v,x=r($?y.substring(0,v):y);if(!x){if(!$){l=u+(l.length>0?" "+l:l);continue}if(x=r(y),!x){l=u+(l.length>0?" "+l:l);continue}$=!1}const S=h.length===0?"":h.length===1?h[0]:a(h).join(":"),b=p?S+ZC:S,T=b+x;if(o.indexOf(T)>-1)continue;o.push(T);const w=i(x,$);for(let P=0;P<w.length;++P){const k=w[P];o.push(b+k)}l=u+(l.length>0?" "+l:l)}return l},tQe=(...t)=>{let e=0,n,r,i="";for(;e<t.length;)(n=t[e++])&&(r=nre(n))&&(i&&(i+=" "),i+=r);return i},nre=t=>{if(typeof t=="string")return t;let e,n="";for(let r=0;r<t.length;r++)t[r]&&(e=nre(t[r]))&&(n&&(n+=" "),n+=e);return n},nQe=(t,...e)=>{let n,r,i,a;const o=l=>{const c=e.reduce((u,f)=>f(u),t());return n=Kxe(c),r=n.cache.get,i=n.cache.set,a=s,s(l)},s=l=>{const c=r(l);if(c)return c;const u=eQe(l,n);return i(l,u),u};return a=o,(...l)=>a(tQe(...l))},rQe=[],hi=t=>{const e=n=>n[t]||rQe;return e.isThemeGetter=!0,e},rre=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ire=/^\((?:(\w[\w-]*):)?(.+)\)$/i,iQe=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,aQe=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oQe=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sQe=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,lQe=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cQe=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Tu=t=>iQe.test(t),Lt=t=>!!t&&!Number.isNaN(Number(t)),ku=t=>!!t&&Number.isInteger(Number(t)),yk=t=>t.endsWith("%")&&Lt(t.slice(0,-1)),rc=t=>aQe.test(t),are=()=>!0,uQe=t=>oQe.test(t)&&!sQe.test(t),zq=()=>!1,OQe=t=>lQe.test(t),fQe=t=>cQe.test(t),dQe=t=>!nt(t)&&!it(t),hQe=t=>dO(t,lre,zq),nt=t=>rre.test(t),KO=t=>dO(t,cre,uQe),s8=t=>dO(t,QQe,Lt),pQe=t=>dO(t,Ore,are),mQe=t=>dO(t,ure,zq),l8=t=>dO(t,ore,zq),gQe=t=>dO(t,sre,fQe),lQ=t=>dO(t,fre,OQe),it=t=>ire.test(t),xg=t=>Hf(t,cre),yQe=t=>Hf(t,ure),c8=t=>Hf(t,ore),$Qe=t=>Hf(t,lre),vQe=t=>Hf(t,sre),cQ=t=>Hf(t,fre,!0),xQe=t=>Hf(t,Ore,!0),dO=(t,e,n)=>{const r=rre.exec(t);return r?r[1]?e(r[1]):n(r[2]):!1},Hf=(t,e,n=!1)=>{const r=ire.exec(t);return r?r[1]?e(r[1]):n:!1},ore=t=>t==="position"||t==="percentage",sre=t=>t==="image"||t==="url",lre=t=>t==="length"||t==="size"||t==="bg-size",cre=t=>t==="length",QQe=t=>t==="number",ure=t=>t==="family-name",Ore=t=>t==="number"||t==="weight",fre=t=>t==="shadow",bQe=()=>{const t=hi("color"),e=hi("font"),n=hi("text"),r=hi("font-weight"),i=hi("tracking"),a=hi("leading"),o=hi("breakpoint"),s=hi("container"),l=hi("spacing"),c=hi("radius"),u=hi("shadow"),f=hi("inset-shadow"),h=hi("text-shadow"),p=hi("drop-shadow"),y=hi("blur"),v=hi("perspective"),$=hi("aspect"),x=hi("ease"),S=hi("animate"),b=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],w=()=>[...T(),it,nt],P=()=>["auto","hidden","clip","visible","scroll"],k=()=>["auto","contain","none"],R=()=>[it,nt,l],E=()=>[Tu,"full","auto",...R()],C=()=>[ku,"none","subgrid",it,nt],z=()=>["auto",{span:["full",ku,it,nt]},ku,it,nt],Y=()=>[ku,"auto",it,nt],W=()=>["auto","min","max","fr",it,nt],A=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],N=()=>["auto",...R()],Z=()=>[Tu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...R()],D=()=>[Tu,"screen","full","dvw","lvw","svw","min","max","fit",...R()],M=()=>[Tu,"screen","full","lh","dvh","lvh","svh","min","max","fit",...R()],V=()=>[t,it,nt],I=()=>[...T(),c8,l8,{position:[it,nt]}],B=()=>["no-repeat",{repeat:["","x","y","space","round"]}],L=()=>["auto","cover","contain",$Qe,hQe,{size:[it,nt]}],J=()=>[yk,xg,KO],K=()=>["","none","full",c,it,nt],H=()=>["",Lt,xg,KO],re=()=>["solid","dashed","dotted","double"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>[Lt,yk,c8,l8],ie=()=>["","none",y,it,nt],se=()=>["none",Lt,it,nt],ae=()=>["none",Lt,it,nt],ue=()=>[Lt,it,nt],Oe=()=>[Tu,"full",...R()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[rc],breakpoint:[rc],color:[are],container:[rc],"drop-shadow":[rc],ease:["in","out","in-out"],font:[dQe],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[rc],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[rc],shadow:[rc],spacing:["px",Lt],text:[rc],"text-shadow":[rc],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Tu,nt,it,$]}],container:["container"],columns:[{columns:[Lt,nt,it,s]}],"break-after":[{"break-after":b()}],"break-before":[{"break-before":b()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:w()}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:k()}],"overscroll-x":[{"overscroll-x":k()}],"overscroll-y":[{"overscroll-y":k()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:E()}],"inset-x":[{"inset-x":E()}],"inset-y":[{"inset-y":E()}],start:[{"inset-s":E(),start:E()}],end:[{"inset-e":E(),end:E()}],"inset-bs":[{"inset-bs":E()}],"inset-be":[{"inset-be":E()}],top:[{top:E()}],right:[{right:E()}],bottom:[{bottom:E()}],left:[{left:E()}],visibility:["visible","invisible","collapse"],z:[{z:[ku,"auto",it,nt]}],basis:[{basis:[Tu,"full","auto",s,...R()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Lt,Tu,"auto","initial","none",nt]}],grow:[{grow:["",Lt,it,nt]}],shrink:[{shrink:["",Lt,it,nt]}],order:[{order:[ku,"first","last","none",it,nt]}],"grid-cols":[{"grid-cols":C()}],"col-start-end":[{col:z()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":C()}],"row-start-end":[{row:z()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":W()}],"auto-rows":[{"auto-rows":W()}],gap:[{gap:R()}],"gap-x":[{"gap-x":R()}],"gap-y":[{"gap-y":R()}],"justify-content":[{justify:[...A(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...A()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:R()}],px:[{px:R()}],py:[{py:R()}],ps:[{ps:R()}],pe:[{pe:R()}],pbs:[{pbs:R()}],pbe:[{pbe:R()}],pt:[{pt:R()}],pr:[{pr:R()}],pb:[{pb:R()}],pl:[{pl:R()}],m:[{m:N()}],mx:[{mx:N()}],my:[{my:N()}],ms:[{ms:N()}],me:[{me:N()}],mbs:[{mbs:N()}],mbe:[{mbe:N()}],mt:[{mt:N()}],mr:[{mr:N()}],mb:[{mb:N()}],ml:[{ml:N()}],"space-x":[{"space-x":R()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":R()}],"space-y-reverse":["space-y-reverse"],size:[{size:Z()}],"inline-size":[{inline:["auto",...D()]}],"min-inline-size":[{"min-inline":["auto",...D()]}],"max-inline-size":[{"max-inline":["none",...D()]}],"block-size":[{block:["auto",...M()]}],"min-block-size":[{"min-block":["auto",...M()]}],"max-block-size":[{"max-block":["none",...M()]}],w:[{w:[s,"screen",...Z()]}],"min-w":[{"min-w":[s,"screen","none",...Z()]}],"max-w":[{"max-w":[s,"screen","none","prose",{screen:[o]},...Z()]}],h:[{h:["screen","lh",...Z()]}],"min-h":[{"min-h":["screen","lh","none",...Z()]}],"max-h":[{"max-h":["screen","lh",...Z()]}],"font-size":[{text:["base",n,xg,KO]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,xQe,pQe]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",yk,nt]}],"font-family":[{font:[yQe,mQe,e]}],"font-features":[{"font-features":[nt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[i,it,nt]}],"line-clamp":[{"line-clamp":[Lt,"none",it,s8]}],leading:[{leading:[a,...R()]}],"list-image":[{"list-image":["none",it,nt]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",it,nt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:V()}],"text-color":[{text:V()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...re(),"wavy"]}],"text-decoration-thickness":[{decoration:[Lt,"from-font","auto",it,KO]}],"text-decoration-color":[{decoration:V()}],"underline-offset":[{"underline-offset":[Lt,"auto",it,nt]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:R()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",it,nt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",it,nt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:B()}],"bg-size":[{bg:L()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ku,it,nt],radial:["",it,nt],conic:[ku,it,nt]},vQe,gQe]}],"bg-color":[{bg:V()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:V()}],"gradient-via":[{via:V()}],"gradient-to":[{to:V()}],rounded:[{rounded:K()}],"rounded-s":[{"rounded-s":K()}],"rounded-e":[{"rounded-e":K()}],"rounded-t":[{"rounded-t":K()}],"rounded-r":[{"rounded-r":K()}],"rounded-b":[{"rounded-b":K()}],"rounded-l":[{"rounded-l":K()}],"rounded-ss":[{"rounded-ss":K()}],"rounded-se":[{"rounded-se":K()}],"rounded-ee":[{"rounded-ee":K()}],"rounded-es":[{"rounded-es":K()}],"rounded-tl":[{"rounded-tl":K()}],"rounded-tr":[{"rounded-tr":K()}],"rounded-br":[{"rounded-br":K()}],"rounded-bl":[{"rounded-bl":K()}],"border-w":[{border:H()}],"border-w-x":[{"border-x":H()}],"border-w-y":[{"border-y":H()}],"border-w-s":[{"border-s":H()}],"border-w-e":[{"border-e":H()}],"border-w-bs":[{"border-bs":H()}],"border-w-be":[{"border-be":H()}],"border-w-t":[{"border-t":H()}],"border-w-r":[{"border-r":H()}],"border-w-b":[{"border-b":H()}],"border-w-l":[{"border-l":H()}],"divide-x":[{"divide-x":H()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":H()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...re(),"hidden","none"]}],"divide-style":[{divide:[...re(),"hidden","none"]}],"border-color":[{border:V()}],"border-color-x":[{"border-x":V()}],"border-color-y":[{"border-y":V()}],"border-color-s":[{"border-s":V()}],"border-color-e":[{"border-e":V()}],"border-color-bs":[{"border-bs":V()}],"border-color-be":[{"border-be":V()}],"border-color-t":[{"border-t":V()}],"border-color-r":[{"border-r":V()}],"border-color-b":[{"border-b":V()}],"border-color-l":[{"border-l":V()}],"divide-color":[{divide:V()}],"outline-style":[{outline:[...re(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Lt,it,nt]}],"outline-w":[{outline:["",Lt,xg,KO]}],"outline-color":[{outline:V()}],shadow:[{shadow:["","none",u,cQ,lQ]}],"shadow-color":[{shadow:V()}],"inset-shadow":[{"inset-shadow":["none",f,cQ,lQ]}],"inset-shadow-color":[{"inset-shadow":V()}],"ring-w":[{ring:H()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:V()}],"ring-offset-w":[{"ring-offset":[Lt,KO]}],"ring-offset-color":[{"ring-offset":V()}],"inset-ring-w":[{"inset-ring":H()}],"inset-ring-color":[{"inset-ring":V()}],"text-shadow":[{"text-shadow":["none",h,cQ,lQ]}],"text-shadow-color":[{"text-shadow":V()}],opacity:[{opacity:[Lt,it,nt]}],"mix-blend":[{"mix-blend":[...F(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":F()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Lt]}],"mask-image-linear-from-pos":[{"mask-linear-from":te()}],"mask-image-linear-to-pos":[{"mask-linear-to":te()}],"mask-image-linear-from-color":[{"mask-linear-from":V()}],"mask-image-linear-to-color":[{"mask-linear-to":V()}],"mask-image-t-from-pos":[{"mask-t-from":te()}],"mask-image-t-to-pos":[{"mask-t-to":te()}],"mask-image-t-from-color":[{"mask-t-from":V()}],"mask-image-t-to-color":[{"mask-t-to":V()}],"mask-image-r-from-pos":[{"mask-r-from":te()}],"mask-image-r-to-pos":[{"mask-r-to":te()}],"mask-image-r-from-color":[{"mask-r-from":V()}],"mask-image-r-to-color":[{"mask-r-to":V()}],"mask-image-b-from-pos":[{"mask-b-from":te()}],"mask-image-b-to-pos":[{"mask-b-to":te()}],"mask-image-b-from-color":[{"mask-b-from":V()}],"mask-image-b-to-color":[{"mask-b-to":V()}],"mask-image-l-from-pos":[{"mask-l-from":te()}],"mask-image-l-to-pos":[{"mask-l-to":te()}],"mask-image-l-from-color":[{"mask-l-from":V()}],"mask-image-l-to-color":[{"mask-l-to":V()}],"mask-image-x-from-pos":[{"mask-x-from":te()}],"mask-image-x-to-pos":[{"mask-x-to":te()}],"mask-image-x-from-color":[{"mask-x-from":V()}],"mask-image-x-to-color":[{"mask-x-to":V()}],"mask-image-y-from-pos":[{"mask-y-from":te()}],"mask-image-y-to-pos":[{"mask-y-to":te()}],"mask-image-y-from-color":[{"mask-y-from":V()}],"mask-image-y-to-color":[{"mask-y-to":V()}],"mask-image-radial":[{"mask-radial":[it,nt]}],"mask-image-radial-from-pos":[{"mask-radial-from":te()}],"mask-image-radial-to-pos":[{"mask-radial-to":te()}],"mask-image-radial-from-color":[{"mask-radial-from":V()}],"mask-image-radial-to-color":[{"mask-radial-to":V()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[Lt]}],"mask-image-conic-from-pos":[{"mask-conic-from":te()}],"mask-image-conic-to-pos":[{"mask-conic-to":te()}],"mask-image-conic-from-color":[{"mask-conic-from":V()}],"mask-image-conic-to-color":[{"mask-conic-to":V()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:B()}],"mask-size":[{mask:L()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",it,nt]}],filter:[{filter:["","none",it,nt]}],blur:[{blur:ie()}],brightness:[{brightness:[Lt,it,nt]}],contrast:[{contrast:[Lt,it,nt]}],"drop-shadow":[{"drop-shadow":["","none",p,cQ,lQ]}],"drop-shadow-color":[{"drop-shadow":V()}],grayscale:[{grayscale:["",Lt,it,nt]}],"hue-rotate":[{"hue-rotate":[Lt,it,nt]}],invert:[{invert:["",Lt,it,nt]}],saturate:[{saturate:[Lt,it,nt]}],sepia:[{sepia:["",Lt,it,nt]}],"backdrop-filter":[{"backdrop-filter":["","none",it,nt]}],"backdrop-blur":[{"backdrop-blur":ie()}],"backdrop-brightness":[{"backdrop-brightness":[Lt,it,nt]}],"backdrop-contrast":[{"backdrop-contrast":[Lt,it,nt]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Lt,it,nt]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Lt,it,nt]}],"backdrop-invert":[{"backdrop-invert":["",Lt,it,nt]}],"backdrop-opacity":[{"backdrop-opacity":[Lt,it,nt]}],"backdrop-saturate":[{"backdrop-saturate":[Lt,it,nt]}],"backdrop-sepia":[{"backdrop-sepia":["",Lt,it,nt]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":R()}],"border-spacing-x":[{"border-spacing-x":R()}],"border-spacing-y":[{"border-spacing-y":R()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",it,nt]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Lt,"initial",it,nt]}],ease:[{ease:["linear","initial",x,it,nt]}],delay:[{delay:[Lt,it,nt]}],animate:[{animate:["none",S,it,nt]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,it,nt]}],"perspective-origin":[{"perspective-origin":w()}],rotate:[{rotate:se()}],"rotate-x":[{"rotate-x":se()}],"rotate-y":[{"rotate-y":se()}],"rotate-z":[{"rotate-z":se()}],scale:[{scale:ae()}],"scale-x":[{"scale-x":ae()}],"scale-y":[{"scale-y":ae()}],"scale-z":[{"scale-z":ae()}],"scale-3d":["scale-3d"],skew:[{skew:ue()}],"skew-x":[{"skew-x":ue()}],"skew-y":[{"skew-y":ue()}],transform:[{transform:[it,nt,"","none","gpu","cpu"]}],"transform-origin":[{origin:w()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Oe()}],"translate-x":[{"translate-x":Oe()}],"translate-y":[{"translate-y":Oe()}],"translate-z":[{"translate-z":Oe()}],"translate-none":["translate-none"],accent:[{accent:V()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:V()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",it,nt]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":R()}],"scroll-mx":[{"scroll-mx":R()}],"scroll-my":[{"scroll-my":R()}],"scroll-ms":[{"scroll-ms":R()}],"scroll-me":[{"scroll-me":R()}],"scroll-mbs":[{"scroll-mbs":R()}],"scroll-mbe":[{"scroll-mbe":R()}],"scroll-mt":[{"scroll-mt":R()}],"scroll-mr":[{"scroll-mr":R()}],"scroll-mb":[{"scroll-mb":R()}],"scroll-ml":[{"scroll-ml":R()}],"scroll-p":[{"scroll-p":R()}],"scroll-px":[{"scroll-px":R()}],"scroll-py":[{"scroll-py":R()}],"scroll-ps":[{"scroll-ps":R()}],"scroll-pe":[{"scroll-pe":R()}],"scroll-pbs":[{"scroll-pbs":R()}],"scroll-pbe":[{"scroll-pbe":R()}],"scroll-pt":[{"scroll-pt":R()}],"scroll-pr":[{"scroll-pr":R()}],"scroll-pb":[{"scroll-pb":R()}],"scroll-pl":[{"scroll-pl":R()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",it,nt]}],fill:[{fill:["none",...V()]}],"stroke-w":[{stroke:[Lt,xg,KO,s8]}],stroke:[{stroke:["none",...V()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},SQe=nQe(bQe);function jr(...t){return SQe(zt(t))}const Tb=Eq("group/button inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent bg-clip-padding text-sm font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 active:translate-y-px disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground [a]:hover:bg-primary/80",outline:"border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",ghost:"hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50",destructive:"bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2",xs:"h-6 gap-1 rounded-[min(var(--radius-md),10px)] px-2 text-xs in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-7 gap-1 rounded-[min(var(--radius-md),12px)] px-2.5 text-[0.8rem] in-data-[slot=button-group]:rounded-lg has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",lg:"h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-3 has-data-[icon=inline-start]:pl-3",icon:"size-8","icon-xs":"size-6 rounded-[min(var(--radius-md),10px)] in-data-[slot=button-group]:rounded-lg [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-7 rounded-[min(var(--radius-md),12px)] in-data-[slot=button-group]:rounded-lg","icon-lg":"size-9"}},defaultVariants:{variant:"default",size:"default"}});function xn({className:t,variant:e="default",size:n="default",...r}){return m.jsx(zxe,{"data-slot":"button",className:jr(Tb({variant:e,size:n,className:t})),...r})}var wn;(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function n(i){throw new Error}t.assertNever=n,t.arrayToEnum=i=>{const a={};for(const o of i)a[o]=o;return a},t.getValidEnumValues=i=>{const a=t.objectKeys(i).filter(s=>typeof i[i[s]]!="number"),o={};for(const s of a)o[s]=i[s];return t.objectValues(o)},t.objectValues=i=>t.objectKeys(i).map(function(a){return i[a]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{const a=[];for(const o in i)Object.prototype.hasOwnProperty.call(i,o)&&a.push(o);return a},t.find=(i,a)=>{for(const o of i)if(a(o))return o},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function r(i,a=" | "){return i.map(o=>typeof o=="string"?`'${o}'`:o).join(a)}t.joinValues=r,t.jsonStringifyReplacer=(i,a)=>typeof a=="bigint"?a.toString():a})(wn||(wn={}));var u8;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(u8||(u8={}));const rt=wn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Au=t=>{switch(typeof t){case"undefined":return rt.undefined;case"string":return rt.string;case"number":return Number.isNaN(t)?rt.nan:rt.number;case"boolean":return rt.boolean;case"function":return rt.function;case"bigint":return rt.bigint;case"symbol":return rt.symbol;case"object":return Array.isArray(t)?rt.array:t===null?rt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?rt.promise:typeof Map<"u"&&t instanceof Map?rt.map:typeof Set<"u"&&t instanceof Set?rt.set:typeof Date<"u"&&t instanceof Date?rt.date:rt.object;default:return rt.unknown}},Ve=wn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class zc extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};const n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){const n=e||function(a){return a.message},r={_errors:[]},i=a=>{for(const o of a.issues)if(o.code==="invalid_union")o.unionErrors.map(i);else if(o.code==="invalid_return_type")i(o.returnTypeError);else if(o.code==="invalid_arguments")i(o.argumentsError);else if(o.path.length===0)r._errors.push(n(o));else{let s=r,l=0;for(;l<o.path.length;){const c=o.path[l];l===o.path.length-1?(s[c]=s[c]||{_errors:[]},s[c]._errors.push(n(o))):s[c]=s[c]||{_errors:[]},s=s[c],l++}}};return i(this),r}static assert(e){if(!(e instanceof zc))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,wn.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){const n={},r=[];for(const i of this.issues)if(i.path.length>0){const a=i.path[0];n[a]=n[a]||[],n[a].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}}zc.create=t=>new zc(t);const VC=(t,e)=>{let n;switch(t.code){case Ve.invalid_type:t.received===rt.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case Ve.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,wn.jsonStringifyReplacer)}`;break;case Ve.unrecognized_keys:n=`Unrecognized key(s) in object: ${wn.joinValues(t.keys,", ")}`;break;case Ve.invalid_union:n="Invalid input";break;case Ve.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${wn.joinValues(t.options)}`;break;case Ve.invalid_enum_value:n=`Invalid enum value. Expected ${wn.joinValues(t.options)}, received '${t.received}'`;break;case Ve.invalid_arguments:n="Invalid function arguments";break;case Ve.invalid_return_type:n="Invalid function return type";break;case Ve.invalid_date:n="Invalid date";break;case Ve.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:wn.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case Ve.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case Ve.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case Ve.custom:n="Invalid input";break;case Ve.invalid_intersection_types:n="Intersection results could not be merged";break;case Ve.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case Ve.not_finite:n="Number must be finite";break;default:n=e.defaultError,wn.assertNever(t)}return{message:n}};let wQe=VC;function PQe(){return wQe}const TQe=t=>{const{data:e,path:n,errorMaps:r,issueData:i}=t,a=[...n,...i.path||[]],o={...i,path:a};if(i.message!==void 0)return{...i,path:a,message:i.message};let s="";const l=r.filter(c=>!!c).slice().reverse();for(const c of l)s=c(o,{data:e,defaultError:s}).message;return{...i,path:a,message:s}};function Be(t,e){const n=PQe(),r=TQe({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===VC?void 0:VC].filter(i=>!!i)});t.common.issues.push(r)}class ua{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){const r=[];for(const i of n){if(i.status==="aborted")return Rt;i.status==="dirty"&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){const r=[];for(const i of n){const a=await i.key,o=await i.value;r.push({key:a,value:o})}return ua.mergeObjectSync(e,r)}static mergeObjectSync(e,n){const r={};for(const i of n){const{key:a,value:o}=i;if(a.status==="aborted"||o.status==="aborted")return Rt;a.status==="dirty"&&e.dirty(),o.status==="dirty"&&e.dirty(),a.value!=="__proto__"&&(typeof o.value<"u"||i.alwaysSet)&&(r[a.value]=o.value)}return{status:e.value,value:r}}}const Rt=Object.freeze({status:"aborted"}),Bg=t=>({status:"dirty",value:t}),Io=t=>({status:"valid",value:t}),O8=t=>t.status==="aborted",f8=t=>t.status==="dirty",Fh=t=>t.status==="valid",s0=t=>typeof Promise<"u"&&t instanceof Promise;var st;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(st||(st={}));class Ql{constructor(e,n,r,i){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const d8=(t,e)=>{if(Fh(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const n=new zc(t.common.issues);return this._error=n,this._error}}};function Mt(t){if(!t)return{};const{errorMap:e,invalid_type_error:n,required_error:r,description:i}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(o,s)=>{const{message:l}=t;return o.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??r??s.defaultError}:o.code!=="invalid_type"?{message:s.defaultError}:{message:l??n??s.defaultError}},description:i}}class fn{get description(){return this._def.description}_getType(e){return Au(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Au(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ua,ctx:{common:e.parent.common,data:e.data,parsedType:Au(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const n=this._parse(e);if(s0(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){const n=this._parse(e);return Promise.resolve(n)}parse(e,n){const r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){const r={common:{issues:[],async:(n==null?void 0:n.async)??!1,contextualErrorMap:n==null?void 0:n.errorMap},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Au(e)},i=this._parseSync({data:e,path:r.path,parent:r});return d8(r,i)}"~validate"(e){var r,i;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Au(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:n});return Fh(a)?{value:a.value}:{issues:n.common.issues}}catch(a){(i=(r=a==null?void 0:a.message)==null?void 0:r.toLowerCase())!=null&&i.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(a=>Fh(a)?{value:a.value}:{issues:n.common.issues})}async parseAsync(e,n){const r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){const r={common:{issues:[],contextualErrorMap:n==null?void 0:n.errorMap,async:!0},path:(n==null?void 0:n.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Au(e)},i=this._parse({data:e,path:r.path,parent:r}),a=await(s0(i)?i:Promise.resolve(i));return d8(r,a)}refine(e,n){const r=i=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(i):n;return this._refinement((i,a)=>{const o=e(i),s=()=>a.addIssue({code:Ve.custom,...r(i)});return typeof Promise<"u"&&o instanceof Promise?o.then(l=>l?!0:(s(),!1)):o?!0:(s(),!1)})}refinement(e,n){return this._refinement((r,i)=>e(r)?!0:(i.addIssue(typeof n=="function"?n(r,i):n),!1))}_refinement(e){return new Jh({schema:this,typeName:Xt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Fu.create(this,this._def)}nullable(){return ep.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return dl.create(this)}promise(){return f0.create(this,this._def)}or(e){return c0.create([this,e],this._def)}and(e){return u0.create(this,e,this._def)}transform(e){return new Jh({...Mt(this._def),schema:this,typeName:Xt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const n=typeof e=="function"?e:()=>e;return new WC({...Mt(this._def),innerType:this,defaultValue:n,typeName:Xt.ZodDefault})}brand(){return new FQe({typeName:Xt.ZodBranded,type:this,...Mt(this._def)})}catch(e){const n=typeof e=="function"?e:()=>e;return new MC({...Mt(this._def),innerType:this,catchValue:n,typeName:Xt.ZodCatch})}describe(e){const n=this.constructor;return new n({...this._def,description:e})}pipe(e){return Yq.create(this,e)}readonly(){return IC.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const kQe=/^c[^\s-]{8,}$/i,_Qe=/^[0-9a-z]+$/,XQe=/^[0-9A-HJKMNP-TV-Z]{26}$/i,RQe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,jQe=/^[a-z0-9_-]{21}$/i,EQe=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,CQe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,zQe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,YQe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let $k;const AQe=/^(?:(?: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])$/,qQe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ZQe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,VQe=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,UQe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,NQe=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dre="((\\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])))",WQe=new RegExp(`^${dre}$`);function hre(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function MQe(t){return new RegExp(`^${hre(t)}$`)}function IQe(t){let e=`${dre}T${hre(t)}`;const n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function DQe(t,e){return!!((e==="v4"||!e)&&AQe.test(t)||(e==="v6"||!e)&&ZQe.test(t))}function LQe(t,e){if(!EQe.test(t))return!1;try{const[n]=t.split(".");if(!n)return!1;const r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),i=JSON.parse(atob(r));return!(typeof i!="object"||i===null||"typ"in i&&(i==null?void 0:i.typ)!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function GQe(t,e){return!!((e==="v4"||!e)&&qQe.test(t)||(e==="v6"||!e)&&VQe.test(t))}class mc extends fn{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==rt.string){const a=this._getOrReturnCtx(e);return Be(a,{code:Ve.invalid_type,expected:rt.string,received:a.parsedType}),Rt}const r=new ua;let i;for(const a of this._def.checks)if(a.kind==="min")e.data.length<a.value&&(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="max")e.data.length>a.value&&(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),r.dirty());else if(a.kind==="length"){const o=e.data.length>a.value,s=e.data.length<a.value;(o||s)&&(i=this._getOrReturnCtx(e,i),o?Be(i,{code:Ve.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):s&&Be(i,{code:Ve.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),r.dirty())}else if(a.kind==="email")zQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"email",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="emoji")$k||($k=new RegExp(YQe,"u")),$k.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"emoji",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="uuid")RQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"uuid",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="nanoid")jQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"nanoid",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid")kQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"cuid",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="cuid2")_Qe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"cuid2",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="ulid")XQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"ulid",code:Ve.invalid_string,message:a.message}),r.dirty());else if(a.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Be(i,{validation:"url",code:Ve.invalid_string,message:a.message}),r.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"regex",code:Ve.invalid_string,message:a.message}),r.dirty())):a.kind==="trim"?e.data=e.data.trim():a.kind==="includes"?e.data.includes(a.value,a.position)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),r.dirty()):a.kind==="toLowerCase"?e.data=e.data.toLowerCase():a.kind==="toUpperCase"?e.data=e.data.toUpperCase():a.kind==="startsWith"?e.data.startsWith(a.value)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.invalid_string,validation:{startsWith:a.value},message:a.message}),r.dirty()):a.kind==="endsWith"?e.data.endsWith(a.value)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.invalid_string,validation:{endsWith:a.value},message:a.message}),r.dirty()):a.kind==="datetime"?IQe(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.invalid_string,validation:"datetime",message:a.message}),r.dirty()):a.kind==="date"?WQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.invalid_string,validation:"date",message:a.message}),r.dirty()):a.kind==="time"?MQe(a).test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.invalid_string,validation:"time",message:a.message}),r.dirty()):a.kind==="duration"?CQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"duration",code:Ve.invalid_string,message:a.message}),r.dirty()):a.kind==="ip"?DQe(e.data,a.version)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"ip",code:Ve.invalid_string,message:a.message}),r.dirty()):a.kind==="jwt"?LQe(e.data,a.alg)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"jwt",code:Ve.invalid_string,message:a.message}),r.dirty()):a.kind==="cidr"?GQe(e.data,a.version)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"cidr",code:Ve.invalid_string,message:a.message}),r.dirty()):a.kind==="base64"?UQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"base64",code:Ve.invalid_string,message:a.message}),r.dirty()):a.kind==="base64url"?NQe.test(e.data)||(i=this._getOrReturnCtx(e,i),Be(i,{validation:"base64url",code:Ve.invalid_string,message:a.message}),r.dirty()):wn.assertNever(a);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(i=>e.test(i),{validation:n,code:Ve.invalid_string,...st.errToObj(r)})}_addCheck(e){return new mc({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...st.errToObj(e)})}url(e){return this._addCheck({kind:"url",...st.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...st.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...st.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...st.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...st.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...st.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...st.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...st.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...st.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...st.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...st.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...st.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...st.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...st.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...st.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...st.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n==null?void 0:n.position,...st.errToObj(n==null?void 0:n.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...st.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...st.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...st.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...st.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...st.errToObj(n)})}nonempty(e){return this.min(1,st.errToObj(e))}trim(){return new mc({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new mc({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new mc({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}mc.create=t=>new mc({checks:[],typeName:Xt.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...Mt(t)});function BQe(t,e){const n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,i=n>r?n:r,a=Number.parseInt(t.toFixed(i).replace(".","")),o=Number.parseInt(e.toFixed(i).replace(".",""));return a%o/10**i}class Hh extends fn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==rt.number){const a=this._getOrReturnCtx(e);return Be(a,{code:Ve.invalid_type,expected:rt.number,received:a.parsedType}),Rt}let r;const i=new ua;for(const a of this._def.checks)a.kind==="int"?wn.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),Be(r,{code:Ve.invalid_type,expected:"integer",received:"float",message:a.message}),i.dirty()):a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Ve.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Ve.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),i.dirty()):a.kind==="multipleOf"?BQe(e.data,a.value)!==0&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Ve.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):a.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),Be(r,{code:Ve.not_finite,message:a.message}),i.dirty()):wn.assertNever(a);return{status:i.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,st.toString(n))}gt(e,n){return this.setLimit("min",e,!1,st.toString(n))}lte(e,n){return this.setLimit("max",e,!0,st.toString(n))}lt(e,n){return this.setLimit("max",e,!1,st.toString(n))}setLimit(e,n,r,i){return new Hh({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:st.toString(i)}]})}_addCheck(e){return new Hh({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:st.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:st.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:st.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:st.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:st.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:st.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:st.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:st.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:st.toString(e)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&wn.isInteger(e.value))}get isFinite(){let e=null,n=null;for(const r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}}Hh.create=t=>new Hh({checks:[],typeName:Xt.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...Mt(t)});class Vy extends fn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==rt.bigint)return this._getInvalidInput(e);let r;const i=new ua;for(const a of this._def.checks)a.kind==="min"?(a.inclusive?e.data<a.value:e.data<=a.value)&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Ve.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="max"?(a.inclusive?e.data>a.value:e.data>=a.value)&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Ve.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),i.dirty()):a.kind==="multipleOf"?e.data%a.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),Be(r,{code:Ve.not_multiple_of,multipleOf:a.value,message:a.message}),i.dirty()):wn.assertNever(a);return{status:i.value,value:e.data}}_getInvalidInput(e){const n=this._getOrReturnCtx(e);return Be(n,{code:Ve.invalid_type,expected:rt.bigint,received:n.parsedType}),Rt}gte(e,n){return this.setLimit("min",e,!0,st.toString(n))}gt(e,n){return this.setLimit("min",e,!1,st.toString(n))}lte(e,n){return this.setLimit("max",e,!0,st.toString(n))}lt(e,n){return this.setLimit("max",e,!1,st.toString(n))}setLimit(e,n,r,i){return new Vy({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:st.toString(i)}]})}_addCheck(e){return new Vy({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:st.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:st.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:st.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:st.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:st.toString(n)})}get minValue(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}}Vy.create=t=>new Vy({checks:[],typeName:Xt.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...Mt(t)});class UC extends fn{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==rt.boolean){const r=this._getOrReturnCtx(e);return Be(r,{code:Ve.invalid_type,expected:rt.boolean,received:r.parsedType}),Rt}return Io(e.data)}}UC.create=t=>new UC({typeName:Xt.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...Mt(t)});class l0 extends fn{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==rt.date){const a=this._getOrReturnCtx(e);return Be(a,{code:Ve.invalid_type,expected:rt.date,received:a.parsedType}),Rt}if(Number.isNaN(e.data.getTime())){const a=this._getOrReturnCtx(e);return Be(a,{code:Ve.invalid_date}),Rt}const r=new ua;let i;for(const a of this._def.checks)a.kind==="min"?e.data.getTime()<a.value&&(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),r.dirty()):a.kind==="max"?e.data.getTime()>a.value&&(i=this._getOrReturnCtx(e,i),Be(i,{code:Ve.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),r.dirty()):wn.assertNever(a);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new l0({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:st.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:st.toString(n)})}get minDate(){let e=null;for(const n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}}l0.create=t=>new l0({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Xt.ZodDate,...Mt(t)});class h8 extends fn{_parse(e){if(this._getType(e)!==rt.symbol){const r=this._getOrReturnCtx(e);return Be(r,{code:Ve.invalid_type,expected:rt.symbol,received:r.parsedType}),Rt}return Io(e.data)}}h8.create=t=>new h8({typeName:Xt.ZodSymbol,...Mt(t)});class p8 extends fn{_parse(e){if(this._getType(e)!==rt.undefined){const r=this._getOrReturnCtx(e);return Be(r,{code:Ve.invalid_type,expected:rt.undefined,received:r.parsedType}),Rt}return Io(e.data)}}p8.create=t=>new p8({typeName:Xt.ZodUndefined,...Mt(t)});class m8 extends fn{_parse(e){if(this._getType(e)!==rt.null){const r=this._getOrReturnCtx(e);return Be(r,{code:Ve.invalid_type,expected:rt.null,received:r.parsedType}),Rt}return Io(e.data)}}m8.create=t=>new m8({typeName:Xt.ZodNull,...Mt(t)});class g8 extends fn{constructor(){super(...arguments),this._any=!0}_parse(e){return Io(e.data)}}g8.create=t=>new g8({typeName:Xt.ZodAny,...Mt(t)});class y8 extends fn{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Io(e.data)}}y8.create=t=>new y8({typeName:Xt.ZodUnknown,...Mt(t)});class eO extends fn{_parse(e){const n=this._getOrReturnCtx(e);return Be(n,{code:Ve.invalid_type,expected:rt.never,received:n.parsedType}),Rt}}eO.create=t=>new eO({typeName:Xt.ZodNever,...Mt(t)});class $8 extends fn{_parse(e){if(this._getType(e)!==rt.undefined){const r=this._getOrReturnCtx(e);return Be(r,{code:Ve.invalid_type,expected:rt.void,received:r.parsedType}),Rt}return Io(e.data)}}$8.create=t=>new $8({typeName:Xt.ZodVoid,...Mt(t)});class dl extends fn{_parse(e){const{ctx:n,status:r}=this._processInputParams(e),i=this._def;if(n.parsedType!==rt.array)return Be(n,{code:Ve.invalid_type,expected:rt.array,received:n.parsedType}),Rt;if(i.exactLength!==null){const o=n.data.length>i.exactLength.value,s=n.data.length<i.exactLength.value;(o||s)&&(Be(n,{code:o?Ve.too_big:Ve.too_small,minimum:s?i.exactLength.value:void 0,maximum:o?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),r.dirty())}if(i.minLength!==null&&n.data.length<i.minLength.value&&(Be(n,{code:Ve.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),r.dirty()),i.maxLength!==null&&n.data.length>i.maxLength.value&&(Be(n,{code:Ve.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((o,s)=>i.type._parseAsync(new Ql(n,o,n.path,s)))).then(o=>ua.mergeArray(r,o));const a=[...n.data].map((o,s)=>i.type._parseSync(new Ql(n,o,n.path,s)));return ua.mergeArray(r,a)}get element(){return this._def.type}min(e,n){return new dl({...this._def,minLength:{value:e,message:st.toString(n)}})}max(e,n){return new dl({...this._def,maxLength:{value:e,message:st.toString(n)}})}length(e,n){return new dl({...this._def,exactLength:{value:e,message:st.toString(n)}})}nonempty(e){return this.min(1,e)}}dl.create=(t,e)=>new dl({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Xt.ZodArray,...Mt(e)});function ph(t){if(t instanceof ei){const e={};for(const n in t.shape){const r=t.shape[n];e[n]=Fu.create(ph(r))}return new ei({...t._def,shape:()=>e})}else return t instanceof dl?new dl({...t._def,type:ph(t.element)}):t instanceof Fu?Fu.create(ph(t.unwrap())):t instanceof ep?ep.create(ph(t.unwrap())):t instanceof Rf?Rf.create(t.items.map(e=>ph(e))):t}class ei extends fn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),n=wn.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==rt.object){const c=this._getOrReturnCtx(e);return Be(c,{code:Ve.invalid_type,expected:rt.object,received:c.parsedType}),Rt}const{status:r,ctx:i}=this._processInputParams(e),{shape:a,keys:o}=this._getCached(),s=[];if(!(this._def.catchall instanceof eO&&this._def.unknownKeys==="strip"))for(const c in i.data)o.includes(c)||s.push(c);const l=[];for(const c of o){const u=a[c],f=i.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new Ql(i,f,i.path,c)),alwaysSet:c in i.data})}if(this._def.catchall instanceof eO){const c=this._def.unknownKeys;if(c==="passthrough")for(const u of s)l.push({key:{status:"valid",value:u},value:{status:"valid",value:i.data[u]}});else if(c==="strict")s.length>0&&(Be(i,{code:Ve.unrecognized_keys,keys:s}),r.dirty());else if(c!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const c=this._def.catchall;for(const u of s){const f=i.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new Ql(i,f,i.path,u)),alwaysSet:u in i.data})}}return i.common.async?Promise.resolve().then(async()=>{const c=[];for(const u of l){const f=await u.key,h=await u.value;c.push({key:f,value:h,alwaysSet:u.alwaysSet})}return c}).then(c=>ua.mergeObjectSync(r,c)):ua.mergeObjectSync(r,l)}get shape(){return this._def.shape()}strict(e){return st.errToObj,new ei({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{var a,o;const i=((o=(a=this._def).errorMap)==null?void 0:o.call(a,n,r).message)??r.defaultError;return n.code==="unrecognized_keys"?{message:st.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new ei({...this._def,unknownKeys:"strip"})}passthrough(){return new ei({...this._def,unknownKeys:"passthrough"})}extend(e){return new ei({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ei({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Xt.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new ei({...this._def,catchall:e})}pick(e){const n={};for(const r of wn.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new ei({...this._def,shape:()=>n})}omit(e){const n={};for(const r of wn.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new ei({...this._def,shape:()=>n})}deepPartial(){return ph(this)}partial(e){const n={};for(const r of wn.objectKeys(this.shape)){const i=this.shape[r];e&&!e[r]?n[r]=i:n[r]=i.optional()}return new ei({...this._def,shape:()=>n})}required(e){const n={};for(const r of wn.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let a=this.shape[r];for(;a instanceof Fu;)a=a._def.innerType;n[r]=a}return new ei({...this._def,shape:()=>n})}keyof(){return pre(wn.objectKeys(this.shape))}}ei.create=(t,e)=>new ei({shape:()=>t,unknownKeys:"strip",catchall:eO.create(),typeName:Xt.ZodObject,...Mt(e)});ei.strictCreate=(t,e)=>new ei({shape:()=>t,unknownKeys:"strict",catchall:eO.create(),typeName:Xt.ZodObject,...Mt(e)});ei.lazycreate=(t,e)=>new ei({shape:t,unknownKeys:"strip",catchall:eO.create(),typeName:Xt.ZodObject,...Mt(e)});class c0 extends fn{_parse(e){const{ctx:n}=this._processInputParams(e),r=this._def.options;function i(a){for(const s of a)if(s.result.status==="valid")return s.result;for(const s of a)if(s.result.status==="dirty")return n.common.issues.push(...s.ctx.common.issues),s.result;const o=a.map(s=>new zc(s.ctx.common.issues));return Be(n,{code:Ve.invalid_union,unionErrors:o}),Rt}if(n.common.async)return Promise.all(r.map(async a=>{const o={...n,common:{...n.common,issues:[]},parent:null};return{result:await a._parseAsync({data:n.data,path:n.path,parent:o}),ctx:o}})).then(i);{let a;const o=[];for(const l of r){const c={...n,common:{...n.common,issues:[]},parent:null},u=l._parseSync({data:n.data,path:n.path,parent:c});if(u.status==="valid")return u;u.status==="dirty"&&!a&&(a={result:u,ctx:c}),c.common.issues.length&&o.push(c.common.issues)}if(a)return n.common.issues.push(...a.ctx.common.issues),a.result;const s=o.map(l=>new zc(l));return Be(n,{code:Ve.invalid_union,unionErrors:s}),Rt}}get options(){return this._def.options}}c0.create=(t,e)=>new c0({options:t,typeName:Xt.ZodUnion,...Mt(e)});function NC(t,e){const n=Au(t),r=Au(e);if(t===e)return{valid:!0,data:t};if(n===rt.object&&r===rt.object){const i=wn.objectKeys(e),a=wn.objectKeys(t).filter(s=>i.indexOf(s)!==-1),o={...t,...e};for(const s of a){const l=NC(t[s],e[s]);if(!l.valid)return{valid:!1};o[s]=l.data}return{valid:!0,data:o}}else if(n===rt.array&&r===rt.array){if(t.length!==e.length)return{valid:!1};const i=[];for(let a=0;a<t.length;a++){const o=t[a],s=e[a],l=NC(o,s);if(!l.valid)return{valid:!1};i.push(l.data)}return{valid:!0,data:i}}else return n===rt.date&&r===rt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class u0 extends fn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=(a,o)=>{if(O8(a)||O8(o))return Rt;const s=NC(a.value,o.value);return s.valid?((f8(a)||f8(o))&&n.dirty(),{status:n.value,value:s.data}):(Be(r,{code:Ve.invalid_intersection_types}),Rt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([a,o])=>i(a,o)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}u0.create=(t,e,n)=>new u0({left:t,right:e,typeName:Xt.ZodIntersection,...Mt(n)});class Rf extends fn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==rt.array)return Be(r,{code:Ve.invalid_type,expected:rt.array,received:r.parsedType}),Rt;if(r.data.length<this._def.items.length)return Be(r,{code:Ve.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Rt;!this._def.rest&&r.data.length>this._def.items.length&&(Be(r,{code:Ve.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());const a=[...r.data].map((o,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new Ql(r,o,r.path,s)):null}).filter(o=>!!o);return r.common.async?Promise.all(a).then(o=>ua.mergeArray(n,o)):ua.mergeArray(n,a)}get items(){return this._def.items}rest(e){return new Rf({...this._def,rest:e})}}Rf.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Rf({items:t,typeName:Xt.ZodTuple,rest:null,...Mt(e)})};class O0 extends fn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==rt.object)return Be(r,{code:Ve.invalid_type,expected:rt.object,received:r.parsedType}),Rt;const i=[],a=this._def.keyType,o=this._def.valueType;for(const s in r.data)i.push({key:a._parse(new Ql(r,s,r.path,s)),value:o._parse(new Ql(r,r.data[s],r.path,s)),alwaysSet:s in r.data});return r.common.async?ua.mergeObjectAsync(n,i):ua.mergeObjectSync(n,i)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof fn?new O0({keyType:e,valueType:n,typeName:Xt.ZodRecord,...Mt(r)}):new O0({keyType:mc.create(),valueType:e,typeName:Xt.ZodRecord,...Mt(n)})}}class v8 extends fn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==rt.map)return Be(r,{code:Ve.invalid_type,expected:rt.map,received:r.parsedType}),Rt;const i=this._def.keyType,a=this._def.valueType,o=[...r.data.entries()].map(([s,l],c)=>({key:i._parse(new Ql(r,s,r.path,[c,"key"])),value:a._parse(new Ql(r,l,r.path,[c,"value"]))}));if(r.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of o){const c=await l.key,u=await l.value;if(c.status==="aborted"||u.status==="aborted")return Rt;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}})}else{const s=new Map;for(const l of o){const c=l.key,u=l.value;if(c.status==="aborted"||u.status==="aborted")return Rt;(c.status==="dirty"||u.status==="dirty")&&n.dirty(),s.set(c.value,u.value)}return{status:n.value,value:s}}}}v8.create=(t,e,n)=>new v8({valueType:e,keyType:t,typeName:Xt.ZodMap,...Mt(n)});class Uy extends fn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==rt.set)return Be(r,{code:Ve.invalid_type,expected:rt.set,received:r.parsedType}),Rt;const i=this._def;i.minSize!==null&&r.data.size<i.minSize.value&&(Be(r,{code:Ve.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),n.dirty()),i.maxSize!==null&&r.data.size>i.maxSize.value&&(Be(r,{code:Ve.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),n.dirty());const a=this._def.valueType;function o(l){const c=new Set;for(const u of l){if(u.status==="aborted")return Rt;u.status==="dirty"&&n.dirty(),c.add(u.value)}return{status:n.value,value:c}}const s=[...r.data.values()].map((l,c)=>a._parse(new Ql(r,l,r.path,c)));return r.common.async?Promise.all(s).then(l=>o(l)):o(s)}min(e,n){return new Uy({...this._def,minSize:{value:e,message:st.toString(n)}})}max(e,n){return new Uy({...this._def,maxSize:{value:e,message:st.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}}Uy.create=(t,e)=>new Uy({valueType:t,minSize:null,maxSize:null,typeName:Xt.ZodSet,...Mt(e)});class x8 extends fn{get schema(){return this._def.getter()}_parse(e){const{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}}x8.create=(t,e)=>new x8({getter:t,typeName:Xt.ZodLazy,...Mt(e)});class Q8 extends fn{_parse(e){if(e.data!==this._def.value){const n=this._getOrReturnCtx(e);return Be(n,{received:n.data,code:Ve.invalid_literal,expected:this._def.value}),Rt}return{status:"valid",value:e.data}}get value(){return this._def.value}}Q8.create=(t,e)=>new Q8({value:t,typeName:Xt.ZodLiteral,...Mt(e)});function pre(t,e){return new Kh({values:t,typeName:Xt.ZodEnum,...Mt(e)})}class Kh extends fn{_parse(e){if(typeof e.data!="string"){const n=this._getOrReturnCtx(e),r=this._def.values;return Be(n,{expected:wn.joinValues(r),received:n.parsedType,code:Ve.invalid_type}),Rt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const n=this._getOrReturnCtx(e),r=this._def.values;return Be(n,{received:n.data,code:Ve.invalid_enum_value,options:r}),Rt}return Io(e.data)}get options(){return this._def.values}get enum(){const e={};for(const n of this._def.values)e[n]=n;return e}get Values(){const e={};for(const n of this._def.values)e[n]=n;return e}get Enum(){const e={};for(const n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return Kh.create(e,{...this._def,...n})}exclude(e,n=this._def){return Kh.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}}Kh.create=pre;class b8 extends fn{_parse(e){const n=wn.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==rt.string&&r.parsedType!==rt.number){const i=wn.objectValues(n);return Be(r,{expected:wn.joinValues(i),received:r.parsedType,code:Ve.invalid_type}),Rt}if(this._cache||(this._cache=new Set(wn.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const i=wn.objectValues(n);return Be(r,{received:r.data,code:Ve.invalid_enum_value,options:i}),Rt}return Io(e.data)}get enum(){return this._def.values}}b8.create=(t,e)=>new b8({values:t,typeName:Xt.ZodNativeEnum,...Mt(e)});class f0 extends fn{unwrap(){return this._def.type}_parse(e){const{ctx:n}=this._processInputParams(e);if(n.parsedType!==rt.promise&&n.common.async===!1)return Be(n,{code:Ve.invalid_type,expected:rt.promise,received:n.parsedType}),Rt;const r=n.parsedType===rt.promise?n.data:Promise.resolve(n.data);return Io(r.then(i=>this._def.type.parseAsync(i,{path:n.path,errorMap:n.common.contextualErrorMap})))}}f0.create=(t,e)=>new f0({type:t,typeName:Xt.ZodPromise,...Mt(e)});class Jh extends fn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Xt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:n,ctx:r}=this._processInputParams(e),i=this._def.effect||null,a={addIssue:o=>{Be(r,o),o.fatal?n.abort():n.dirty()},get path(){return r.path}};if(a.addIssue=a.addIssue.bind(a),i.type==="preprocess"){const o=i.transform(r.data,a);if(r.common.async)return Promise.resolve(o).then(async s=>{if(n.value==="aborted")return Rt;const l=await this._def.schema._parseAsync({data:s,path:r.path,parent:r});return l.status==="aborted"?Rt:l.status==="dirty"||n.value==="dirty"?Bg(l.value):l});{if(n.value==="aborted")return Rt;const s=this._def.schema._parseSync({data:o,path:r.path,parent:r});return s.status==="aborted"?Rt:s.status==="dirty"||n.value==="dirty"?Bg(s.value):s}}if(i.type==="refinement"){const o=s=>{const l=i.refinement(s,a);if(r.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(r.common.async===!1){const s=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Rt:(s.status==="dirty"&&n.dirty(),o(s.value),{status:n.value,value:s.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(s=>s.status==="aborted"?Rt:(s.status==="dirty"&&n.dirty(),o(s.value).then(()=>({status:n.value,value:s.value}))))}if(i.type==="transform")if(r.common.async===!1){const o=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Fh(o))return Rt;const s=i.transform(o.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:s}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(o=>Fh(o)?Promise.resolve(i.transform(o.value,a)).then(s=>({status:n.value,value:s})):Rt);wn.assertNever(i)}}Jh.create=(t,e,n)=>new Jh({schema:t,typeName:Xt.ZodEffects,effect:e,...Mt(n)});Jh.createWithPreprocess=(t,e,n)=>new Jh({schema:e,effect:{type:"preprocess",transform:t},typeName:Xt.ZodEffects,...Mt(n)});class Fu extends fn{_parse(e){return this._getType(e)===rt.undefined?Io(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Fu.create=(t,e)=>new Fu({innerType:t,typeName:Xt.ZodOptional,...Mt(e)});class ep extends fn{_parse(e){return this._getType(e)===rt.null?Io(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ep.create=(t,e)=>new ep({innerType:t,typeName:Xt.ZodNullable,...Mt(e)});class WC extends fn{_parse(e){const{ctx:n}=this._processInputParams(e);let r=n.data;return n.parsedType===rt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}}WC.create=(t,e)=>new WC({innerType:t,typeName:Xt.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Mt(e)});class MC extends fn{_parse(e){const{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return s0(i)?i.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new zc(r.common.issues)},input:r.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new zc(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}MC.create=(t,e)=>new MC({innerType:t,typeName:Xt.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Mt(e)});class S8 extends fn{_parse(e){if(this._getType(e)!==rt.nan){const r=this._getOrReturnCtx(e);return Be(r,{code:Ve.invalid_type,expected:rt.nan,received:r.parsedType}),Rt}return{status:"valid",value:e.data}}}S8.create=t=>new S8({typeName:Xt.ZodNaN,...Mt(t)});class FQe extends fn{_parse(e){const{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}}class Yq extends fn{_parse(e){const{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const a=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Rt:a.status==="dirty"?(n.dirty(),Bg(a.value)):this._def.out._parseAsync({data:a.value,path:r.path,parent:r})})();{const i=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?Rt:i.status==="dirty"?(n.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:r.path,parent:r})}}static create(e,n){return new Yq({in:e,out:n,typeName:Xt.ZodPipeline})}}class IC extends fn{_parse(e){const n=this._def.innerType._parse(e),r=i=>(Fh(i)&&(i.value=Object.freeze(i.value)),i);return s0(n)?n.then(i=>r(i)):r(n)}unwrap(){return this._def.innerType}}IC.create=(t,e)=>new IC({innerType:t,typeName:Xt.ZodReadonly,...Mt(e)});var Xt;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Xt||(Xt={}));const ge=mc.create,ht=Hh.create,En=UC.create;eO.create;const bt=dl.create,mt=ei.create;c0.create;u0.create;Rf.create;const w8=O0.create,Pr=Kh.create;f0.create;Fu.create;ep.create;const HQe=Pr(["typescript","tsx","javascript","python"]),Jp=mt({filePath:ge(),startLine:ht(),startColumn:ht(),endLine:ht(),endColumn:ht()}),KQe=mt({name:ge(),type:ge().optional(),defaultValue:ge().optional()}),mre=mt({name:ge(),params:bt(KQe),returnType:ge().optional(),isAsync:En(),isExported:En(),location:Jp,lineCount:ht().optional(),statementCount:ht().optional(),maxNestingDepth:ht().optional()}),JQe=mt({name:ge(),type:ge().optional(),isStatic:En().optional()}),ebe=mt({name:ge(),methods:bt(mre),properties:bt(JQe),superClass:ge().optional(),interfaces:bt(ge()).optional(),decorators:bt(ge()).optional(),location:Jp}),tbe=mt({name:ge(),alias:ge().optional(),isDefault:En(),isNamespace:En()}),nbe=mt({source:ge(),specifiers:bt(tbe),isTypeOnly:En(),isFunctionScoped:En().optional()}),rbe=mt({name:ge(),isDefault:En(),source:ge().optional()}),ibe=mt({callee:ge(),arguments:bt(ge()).optional(),location:Jp,callerFunction:ge().optional()}),gre=mt({method:Pr(["GET","POST","PUT","DELETE","PATCH"]),url:ge(),location:Jp}),abe=mt({httpMethod:Pr(["GET","POST","PUT","DELETE","PATCH","ALL"]),path:ge(),handlerName:ge(),location:Jp}),obe=mt({path:ge(),routerName:ge(),location:Jp});mt({filePath:ge(),language:HQe,functions:bt(mre),classes:bt(ebe),imports:bt(nbe),exports:bt(rbe),calls:bt(ibe),httpCalls:bt(gre),routeRegistrations:bt(abe).optional(),routerMounts:bt(obe).optional()});mt({source:ge(),target:ge(),importedNames:bt(ge())});const sbe=Pr(["class","interface","standalone"]);mt({name:ge(),filePath:ge(),kind:sbe,serviceName:ge(),layerName:ge(),methodCount:ht(),propertyCount:ht(),importCount:ht(),exportCount:ht(),superClass:ge().optional(),startLine:ht().optional(),endLine:ht().optional(),lineCount:ht().optional()});mt({name:ge(),moduleName:ge(),serviceName:ge(),filePath:ge(),signature:ge(),paramCount:ht(),returnType:ge().optional(),isAsync:En(),isExported:En(),startLine:ht().optional(),endLine:ht().optional(),lineCount:ht().optional(),statementCount:ht().optional(),maxNestingDepth:ht().optional(),isImplicitCall:En().optional()});mt({sourceModule:ge(),sourceService:ge(),sourceFilePath:ge().optional(),targetModule:ge(),targetService:ge(),targetFilePath:ge().optional(),importedNames:bt(ge())});mt({callerMethod:ge(),callerModule:ge(),callerService:ge(),callerFilePath:ge().optional(),calleeMethod:ge(),calleeModule:ge(),calleeService:ge(),calleeFilePath:ge().optional(),callCount:ht()});const lbe=mt({name:ge(),type:ge(),isPrimaryKey:En().optional(),isNullable:En().optional(),decorators:bt(ge()).optional()}),cbe=mt({type:Pr(["oneToOne","oneToMany","manyToOne","manyToMany"]),targetEntity:ge(),fieldName:ge()});mt({name:ge(),service:ge(),framework:ge(),fields:bt(lbe),relationships:bt(cbe),confidence:ht().min(0).max(1),signals:bt(ge())});const d0=Pr(["data","api","service","external"]),ube=mt({layer:d0,confidence:ht().min(0).max(1),evidence:bt(ge())}),yre=Pr(["frontend","api-server","worker","library","unknown"]),Obe=Pr(["monolith","microservices"]);mt({name:ge(),rootPath:ge(),type:yre,framework:ge().optional(),fileCount:ht(),layers:bt(ube),files:bt(ge())});const fbe=mt({filePath:ge(),importedFrom:ge(),importedNames:bt(ge())});mt({source:ge(),target:ge(),dependencies:bt(fbe),httpCalls:bt(gre).optional()});mt({serviceName:ge(),layer:d0,fileCount:ht(),filePaths:bt(ge()),confidence:ht(),evidence:bt(ge())});mt({sourceServiceName:ge(),sourceLayer:d0,targetServiceName:ge(),targetLayer:d0,dependencyCount:ht(),isViolation:En(),violationReason:ge().optional()});const dbe=Pr(["architecture","dependency","violation","suggestion","warning","database","module","service","function"]),hbe=Pr(["info","low","medium","high","critical"]),pbe=Pr(["new","unchanged","resolved"]),mbe=Pr(["rule","contract-drift"]),gbe=mt({id:ge(),type:dbe,category:mbe.default("rule"),subcategory:ge().nullable().optional(),title:ge(),content:ge(),severity:hbe,status:pbe.optional(),targetServiceId:ge().optional(),targetDatabaseId:ge().optional(),targetModuleId:ge().optional(),targetMethodId:ge().optional(),targetTable:ge().optional(),fixPrompt:ge().optional(),ruleKey:ge().optional(),deterministicViolationId:ge().optional(),firstSeenAt:ge().optional(),resolvedAt:ge().optional(),createdAt:ge()}),ybe=mt({name:ge(),type:yre,framework:ge().optional(),fileCount:ht(),layers:bt(ge())});mt({architecture:Obe,totalServices:ht(),totalFiles:ht(),violations:bt(gbe),services:bt(ybe)});const $be=Pr(["postgres","redis","mongodb","mysql","sqlite"]),vbe=mt({name:ge(),type:ge(),isNullable:En().optional(),isPrimaryKey:En().optional(),isUnique:En().optional(),defaultValue:ge().optional(),isForeignKey:En().optional(),referencesTable:ge().optional(),referencesColumn:ge().optional()}),xbe=mt({name:ge().optional(),columns:bt(ge()),isUnique:En().optional()}),Qbe=mt({name:ge(),columns:bt(vbe),primaryKey:ge().optional(),indexes:bt(xbe).optional(),aliases:bt(ge()).optional()}),bbe=mt({sourceTable:ge(),targetTable:ge(),relationType:Pr(["one-to-one","one-to-many","many-to-many"]),foreignKeyColumn:ge(),foreignKeyReferencesColumn:ge().optional()}),Sbe=mt({name:ge(),type:$be,driver:ge(),connectionEnvVar:ge().optional(),tables:bt(Qbe),relations:bt(bbe),connectedServices:bt(ge())}),wbe=mt({serviceName:ge(),databaseName:ge(),driver:ge(),layerName:ge().optional()});mt({databases:bt(Sbe),connections:bt(wbe)});const Pbe=Pr(["architecture","security","bugs","code-quality","style","database","performance","reliability"]),Tbe=Pr(["service","database","module","method","code"]),kbe=Pr(["info","low","medium","high","critical"]),_be=Pr(["deterministic","llm"]),Xbe=Pr(["metadata","targeted","full-file"]),Rbe=mt({hasAsyncFunctions:En().optional(),hasRouteHandlers:En().optional(),hasDbCalls:En().optional(),hasCatchBlocks:En().optional(),hasImportsFrom:bt(ge()).optional(),hasCallsTo:bt(ge()).optional(),isTestFile:En().optional(),languages:bt(ge()).optional()}),jbe=mt({isAsync:En().optional(),isRouteHandler:En().optional(),containsCatchBlock:En().optional(),callsAny:bt(ge()).optional()}),Ebe=mt({tier:Xbe,fileFilter:Rbe.optional(),functionFilter:jbe.optional(),metadataFields:bt(Pr(["functions","classes","imports","exports","calls","httpCalls","routeRegistrations"])).optional()});mt({key:ge(),category:Tbe,domain:Pbe.optional(),name:ge(),description:ge(),prompt:ge().optional(),enabled:En(),severity:kbe,type:_be,contextRequirement:Ebe.optional()});const Cbe=Pr(["call","http","db-read","db-write","event"]),zbe=Pr(["http","event","cron","startup"]),Ybe=mt({id:ge(),flowId:ge(),stepOrder:ht(),sourceService:ge(),sourceModule:ge(),sourceMethod:ge(),targetService:ge(),targetModule:ge(),targetMethod:ge(),stepType:Cbe,dataDescription:ge().nullable(),isAsync:En(),isConditional:En()});mt({id:ge(),analysisId:ge(),name:ge(),description:ge().nullable(),entryService:ge(),entryMethod:ge(),category:ge(),trigger:zbe,stepCount:ht(),steps:bt(Ybe).optional(),createdAt:ge().optional()});const Abe=mt({analysisId:ge(),date:ge(),branch:ge().nullable(),total:ht(),new:ht(),unchanged:ht(),resolved:ht(),critical:ht(),high:ht(),medium:ht(),low:ht(),info:ht()});mt({points:bt(Abe)});mt({byCategory:w8(ge(),ht()),bySeverity:w8(ge(),ht()),total:ht()});const qbe=mt({id:ge(),name:ge(),kind:Pr(["service","module"]),violationCount:ht(),criticalCount:ht(),highCount:ht()});mt({offenders:bt(qbe),analysisId:ge()});mt({avgTimeToResolveMs:ht().nullable(),totalResolved:ht(),totalActive:ht(),resolutionRate:ht(),staleCount:ht(),staleDays:ht()});const $re=[];mt({path:ge().min(1)});mt({mode:Pr(["full","diff"]),skipGit:En().optional().default(!1)});mt({analysisId:ge().uuid().optional()});var vk={exports:{}},P8;function Zbe(){return P8||(P8=1,(function(t){function e(K){return Array.isArray(K)?K:[K]}const n=void 0,r="",i=" ",a="\\",o=/^\s+$/,s=/(?:[^\\]|^)\\$/,l=/^\\!/,c=/^\\#/,u=/\r?\n/g,f=/^\.{0,2}\/|^\.{1,2}$/,h=/\/$/,p="/";let y="node-ignore";typeof Symbol<"u"&&(y=Symbol.for("node-ignore"));const v=y,$=(K,H,re)=>(Object.defineProperty(K,H,{value:re}),re),x=/([0-z])-([0-z])/g,S=()=>!1,b=K=>K.replace(x,(H,re,F)=>re.charCodeAt(0)<=F.charCodeAt(0)?H:r),T=K=>{const{length:H}=K;return K.slice(0,H-H%2)},w=[[/^\uFEFF/,()=>r],[/((?:\\\\)*?)(\\?\s+)$/,(K,H,re)=>H+(re.indexOf("\\")===0?i:r)],[/(\\+?)\s/g,(K,H)=>{const{length:re}=H;return H.slice(0,re-re%2)+i}],[/[\\$.|*+(){^]/g,K=>`\\${K}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"}],[/\\\/\\\*\\\*(?=\\\/|$)/g,(K,H,re)=>H+6<re.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(K,H,re)=>{const F=re.replace(/\\\*/g,"[^\\/]*");return H+F}],[/\\\\\\(?=[$.|*+(){^])/g,()=>a],[/\\\\/g,()=>a],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(K,H,re,F,te)=>H===a?`\\[${re}${T(F)}${te}`:te==="]"&&F.length%2===0?`[${b(re)}${F}]`:"[]"],[/(?:[^*])$/,K=>/\/$/.test(K)?`${K}$`:`${K}(?=$|\\/$)`]],P=/(^|\\\/)?\\\*$/,k="regex",R="checkRegex",E="_",C={[k](K,H){return`${H?`${H}[^/]+`:"[^/]*"}(?=$|\\/$)`},[R](K,H){return`${H?`${H}[^/]*`:"[^/]*"}(?=$|\\/$)`}},z=K=>w.reduce((H,[re,F])=>H.replace(re,F.bind(K)),K),Y=K=>typeof K=="string",W=K=>K&&Y(K)&&!o.test(K)&&!s.test(K)&&K.indexOf("#")!==0,A=K=>K.split(u).filter(Boolean);class q{constructor(H,re,F,te,ie,se){this.pattern=H,this.mark=re,this.negative=ie,$(this,"body",F),$(this,"ignoreCase",te),$(this,"regexPrefix",se)}get regex(){const H=E+k;return this[H]?this[H]:this._make(k,H)}get checkRegex(){const H=E+R;return this[H]?this[H]:this._make(R,H)}_make(H,re){const F=this.regexPrefix.replace(P,C[H]),te=this.ignoreCase?new RegExp(F,"i"):new RegExp(F);return $(this,re,te)}}const N=({pattern:K,mark:H},re)=>{let F=!1,te=K;te.indexOf("!")===0&&(F=!0,te=te.substr(1)),te=te.replace(l,"!").replace(c,"#");const ie=z(te);return new q(K,H,te,re,F,ie)};class Z{constructor(H){this._ignoreCase=H,this._rules=[]}_add(H){if(H&&H[v]){this._rules=this._rules.concat(H._rules._rules),this._added=!0;return}if(Y(H)&&(H={pattern:H}),W(H.pattern)){const re=N(H,this._ignoreCase);this._added=!0,this._rules.push(re)}}add(H){return this._added=!1,e(Y(H)?A(H):H).forEach(this._add,this),this._added}test(H,re,F){let te=!1,ie=!1,se;this._rules.forEach(ue=>{const{negative:Oe}=ue;ie===Oe&&te!==ie||Oe&&!te&&!ie&&!re||!ue[F].test(H)||(te=!Oe,ie=Oe,se=Oe?n:ue)});const ae={ignored:te,unignored:ie};return se&&(ae.rule=se),ae}}const D=(K,H)=>{throw new H(K)},M=(K,H,re)=>Y(K)?K?M.isNotRelative(K)?re(`path should be a \`path.relative()\`d string, but got "${H}"`,RangeError):!0:re("path must not be empty",TypeError):re(`path must be a string, but got \`${H}\``,TypeError),V=K=>f.test(K);M.isNotRelative=V,M.convert=K=>K;class I{constructor({ignorecase:H=!0,ignoreCase:re=H,allowRelativePaths:F=!1}={}){$(this,v,!0),this._rules=new Z(re),this._strictPathCheck=!F,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(H){return this._rules.add(H)&&this._initCache(),this}addPattern(H){return this.add(H)}_test(H,re,F,te){const ie=H&&M.convert(H);return M(ie,H,this._strictPathCheck?D:S),this._t(ie,re,F,te)}checkIgnore(H){if(!h.test(H))return this.test(H);const re=H.split(p).filter(Boolean);if(re.pop(),re.length){const F=this._t(re.join(p)+p,this._testCache,!0,re);if(F.ignored)return F}return this._rules.test(H,!1,R)}_t(H,re,F,te){if(H in re)return re[H];if(te||(te=H.split(p).filter(Boolean)),te.pop(),!te.length)return re[H]=this._rules.test(H,F,k);const ie=this._t(te.join(p)+p,re,F,te);return re[H]=ie.ignored?ie:this._rules.test(H,F,k)}ignores(H){return this._test(H,this._ignoreCache,!1).ignored}createFilter(){return H=>!this.ignores(H)}filter(H){return e(H).filter(this.createFilter())}test(H){return this._test(H,this._testCache,!0)}}const B=K=>new I(K),L=K=>M(K&&M.convert(K),K,S),J=()=>{const K=re=>/^\\\\\?\\/.test(re)||/["<>|\u0000-\u001F]+/u.test(re)?re:re.replace(/\\/g,"/");M.convert=K;const H=/^[a-z]:\//i;M.isNotRelative=re=>H.test(re)||V(re)};typeof process<"u"&&process.platform==="win32"&&J(),t.exports=B,B.default=B,t.exports.isPathValid=L,$(t.exports,Symbol.for("setupWindows"),J)})(vk)),vk.exports}Zbe();function ly(){if(typeof window>"u")return"";const t=window.location.port;return t&&t!=="3001"?`http://${window.location.hostname}:3001`:""}const Vbe=ly();class em extends Error{constructor(e,n){super(n),this.status=e,this.name="ApiError"}}async function gt(t,e){const n=`${Vbe}${t}`,r=await fetch(n,{...e,credentials:"include",headers:{"Content-Type":"application/json",...e==null?void 0:e.headers}});if(!r.ok){let i="Unknown error";try{const a=await r.json();i=a.error||JSON.stringify(a)}catch{i=await r.text().catch(()=>"Unknown error")}throw new em(r.status,i)}if(r.status!==204)return r.json()}function Ube(){return gt("/api/capabilities")}function Nbe(){return gt("/api/repos")}function T8(t){return gt(`/api/repos/${t}`)}function Wbe(t){return gt("/api/repos",{method:"POST",body:JSON.stringify({path:t})})}function Mbe(t){return gt(`/api/repos/${t}`,{method:"DELETE"})}function vre(t,e){return gt(`/api/repos/${t}/analyses`,{method:"POST",body:JSON.stringify({mode:"full",...(e==null?void 0:e.skipGit)!=null?{skipGit:e.skipGit}:{}})})}function Ibe(t){return gt(`/api/repos/${t}/analyses`)}function Dbe(t,e){return gt(`/api/repos/${t}/analyses/${e}/usage`)}function Lbe(t,e){return gt(`/api/repos/${t}/analyses/${e}`,{method:"DELETE"})}function Gbe(t){return gt(`/api/repos/${t}/analyses/cancel`,{method:"POST"})}function Bbe(t,e){const n=new URLSearchParams;e!=null&&e.branch&&n.set("branch",e.branch),e!=null&&e.level&&n.set("level",e.level),e!=null&&e.analysisId&&n.set("analysisId",e.analysisId);const r=n.toString();return gt(`/api/repos/${t}/graph${r?`?${r}`:""}`)}function k8(t,e,n,r){const i=new URLSearchParams;n&&i.set("branch",n),r&&i.set("level",r);const a=i.toString();return gt(`/api/repos/${t}/graph/positions${a?`?${a}`:""}`,{method:"PUT",body:JSON.stringify({positions:e})})}function Fbe(t,e,n){const r=new URLSearchParams;e&&r.set("branch",e),n&&r.set("level",n);const i=r.toString();return gt(`/api/repos/${t}/graph/positions${i?`?${i}`:""}`,{method:"DELETE"})}function _8(t,e,n,r){const i=new URLSearchParams;n&&i.set("branch",n),r&&i.set("level",r);const a=i.toString();return gt(`/api/repos/${t}/graph/collapsed${a?`?${a}`:""}`,{method:"PUT",body:JSON.stringify({collapsedIds:e})})}function Hbe(t,e){const n=e?`?ref=${encodeURIComponent(e)}`:"";return gt(`/api/repos/${t}/files${n}`)}function xre(t,e){const n=new URLSearchParams;e&&n.set("analysisId",e);const r=n.toString();return gt(`/api/repos/${t}/violations${r?`?${r}`:""}`)}function Kbe(t,e,n){const r=new URLSearchParams;e&&r.set("branch",e),n&&r.set("analysisId",n);const i=r.toString();return gt(`/api/repos/${t}/databases${i?`?${i}`:""}`)}function Jbe(t,e,n){const r=n?`?analysisId=${encodeURIComponent(n)}`:"";return gt(`/api/repos/${t}/databases/${e}/schema${r}`)}function e0e(t){const e=t?`/api/repos/${encodeURIComponent(t)}/rules`:"/api/rules";return gt(e)}function Qre(t,e,n){return gt(`/api/repos/${encodeURIComponent(t)}/rules/${encodeURIComponent(e)}`,{method:"PATCH",body:JSON.stringify({enabled:n})})}function t0e(t){return gt(`/api/repos/${t}/analyses`,{method:"POST",body:JSON.stringify({mode:"diff"})})}function X8(t){return gt(`/api/repos/${t}/analyses/diff`)}function n0e(t,e,n){const r=new URLSearchParams({path:e});return n&&r.set("ref",n),gt(`/api/repos/${t}/file-content?${r.toString()}`)}function r0e(t,e,n){const r=new URLSearchParams;e&&r.set("file",e),n&&r.set("analysisId",n);const i=r.toString();return gt(`/api/repos/${t}/violations${i?`?${i}`:""}`)}function bre(t,e){const n=new URLSearchParams;e&&n.set("analysisId",e);const r=n.toString();return gt(`/api/repos/${t}/violations/summary${r?`?${r}`:""}`)}function i0e(t,e){const n=e?`?analysisId=${encodeURIComponent(e)}`:"";return gt(`/api/repos/${t}/flows${n}`)}function a0e(t,e,n){const r=n?`?analysisId=${encodeURIComponent(n)}`:"";return gt(`/api/repos/${t}/flows/${e}${r}`)}function o0e(t,e){return gt(`/api/repos/${t}/flows/${e}/enrich`,{method:"POST"})}function s0e(t,e,n,r){const i=new URLSearchParams;e&&i.set("branch",e),r&&i.set("analysisId",r);const a=i.toString();return gt(`/api/repos/${t}/analytics/trend${a?`?${a}`:""}`)}function l0e(t,e,n){const r=new URLSearchParams;e&&r.set("branch",e),n&&r.set("analysisId",n);const i=r.toString();return gt(`/api/repos/${t}/analytics/breakdown${i?`?${i}`:""}`)}function c0e(t,e,n){const r=new URLSearchParams;e&&r.set("branch",e),n&&r.set("analysisId",n);const i=r.toString();return gt(`/api/repos/${t}/analytics/top-offenders${i?`?${i}`:""}`)}function u0e(t,e,n){const r=new URLSearchParams;e&&r.set("branch",e),n&&r.set("analysisId",n);const i=r.toString();return gt(`/api/repos/${t}/analytics/resolution${i?`?${i}`:""}`)}function O0e(t){return gt(`/api/repos/${t}/spec/scan`)}function f0e(t){return gt(`/api/repos/${t}/spec/canonical/tree`)}function d0e(t,e,n){const r=new URLSearchParams({module:e,topic:n});return gt(`/api/repos/${t}/spec/canonical/section?${r.toString()}`)}function h0e(t){return gt(`/api/repos/${t}/contracts/tree`)}function p0e(t,e){return gt(`/api/repos/${t}/contracts/file?path=${encodeURIComponent(e)}`)}async function m0e(t){try{return await gt(`/api/repos/${t}/verify/state`)}catch(e){if(e instanceof em&&e.status===404)return null;throw e}}function g0e(t){return gt(`/api/repos/${t}/verify/run`,{method:"POST"})}async function y0e(t){try{return await gt(`/api/repos/${t}/verify/diff`)}catch(e){if(e instanceof em&&e.status===404)return null;throw e}}function $0e(t){return gt(`/api/repos/${t}/verify/diff`,{method:"POST"})}async function R8(t){try{return await gt(`/api/repos/${t}/verify/history`)}catch(e){if(e instanceof em&&e.status===404)return{runs:[]};throw e}}function v0e(t,e){return gt(`/api/repos/${t}/verify/runs/${e}`)}function x0e(t,e){return gt(`/api/repos/${t}/verify/runs/${e}`,{method:"DELETE"})}async function Q0e(t){try{return await gt(`/api/repos/${t}/spec/scan-state`)}catch(e){if(e instanceof em&&e.status===404)return null;throw e}}function b0e(t,e){return gt(`/api/repos/${t}/spec/decisions/${encodeURIComponent(e)}`,{method:"DELETE"})}function S0e(t,e){return gt(`/api/repos/${t}/spec/decisions`,{method:"POST",body:JSON.stringify(e)})}function w0e(t,e){return gt(`/api/repos/${t}/spec/docs/include`,{method:"POST",body:JSON.stringify(e)})}function P0e(t,e){return gt(`/api/repos/${t}/spec/chains/manual`,{method:"POST",body:JSON.stringify(e)})}function T0e(t,e){return gt(`/api/repos/${t}/spec/decisions/batch`,{method:"POST",body:JSON.stringify({mode:e})})}function k0e(t){return gt(`/api/repos/${t}/contracts/generate`,{method:"POST"})}function _0e(t){return gt(`/api/repos/${t}/spec/staleness`)}const Sre={edition:"community",capabilities:new Set($re),isLoading:!0,error:null},Aq=_.createContext(Sre);function X0e({children:t,initial:e}){const[n,r]=_.useState(()=>e?{edition:e.edition,capabilities:new Set(e.capabilities),isLoading:!1,error:null}:Sre);_.useEffect(()=>{if(e)return;let a=!1;return(async()=>{try{const o=await Ube();if(a)return;r({edition:o.edition,capabilities:new Set(o.capabilities),isLoading:!1,error:null})}catch(o){if(a)return;r({edition:"community",capabilities:new Set($re),isLoading:!1,error:o instanceof Error?o:new Error(String(o))})}})(),()=>{a=!0}},[e]);const i=_.useMemo(()=>n,[n]);return m.jsx(Aq.Provider,{value:i,children:t})}function R0e(){return _.useContext(Aq).edition}function wS(){return _.useContext(Aq)}const PS=[{id:"analysis",label:"Code Analysis",description:"Architecture graphs, files, flows, databases",icon:Ay,defaultTab:"home",tabs:[{id:"home",label:"Home",icon:Zve,noPanel:!0},{id:"graphs",label:"Graphs",icon:Ay,noPanel:!0},{id:"flows",label:"Flows",icon:Wne},{id:"files",label:"Files",icon:Yve},{id:"databases",label:"Databases",icon:xl},{id:"analyses",label:"Analyses",icon:JW,noPanel:!0}]},{id:"drift",label:"BL Drift",description:"Spec consolidation, contracts, verification",icon:Bu,defaultTab:"spec",tabs:[{id:"spec",label:"Spec",icon:Sve},{id:"contracts",label:"Contracts",icon:xq},{id:"verify",label:"Verify",icon:Bu,noPanel:!0},{id:"runs",label:"Runs",icon:JW,noPanel:!0},{id:"decisions",label:"Decisions",icon:EC}]}];function wre(t){return PS.find(e=>e.id===t)}function Pre(){return PS.flatMap(t=>t.tabs)}function j0e(t){return Pre().find(e=>e.id===t)}function DC(t){var e;return((e=wre(t))==null?void 0:e.defaultTab)??""}function E0e(){return new Set(Pre().map(t=>t.id))}function C0e(t){var e;return(e=PS.find(n=>n.tabs.some(r=>r.id===t)))==null?void 0:e.id}function h0(t,e){return t===void 0||e.has(t)}function z0e(){const{capabilities:t}=wS();return _.useMemo(()=>PS.filter(e=>h0(e.requiredCapability,t)).map(e=>({...e,tabs:e.tabs.filter(n=>h0(n.requiredCapability,t))})),[t])}function Y0e(t){const{capabilities:e}=wS();return _.useMemo(()=>{const n=wre(t);return n?h0(n.requiredCapability,e)?n.tabs.filter(r=>h0(r.requiredCapability,e)):[]:[]},[t,e])}function A0e({value:t,onChange:e}){const n=z0e(),[r,i]=_.useState(!1),a=_.useRef(null);_.useEffect(()=>{if(!r)return;const l=c=>{a.current&&!a.current.contains(c.target)&&i(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[r]);const o=n.find(l=>l.id===t)??n[0];if(!o)return null;const s=o.icon;return m.jsxs("div",{className:"relative",ref:a,children:[m.jsxs("button",{type:"button",onClick:()=>i(l=>!l),className:"flex items-center gap-1.5 rounded-md border border-border bg-card px-2 py-1 text-xs text-foreground hover:bg-muted/50 transition-colors","aria-haspopup":"menu","aria-expanded":r,children:[m.jsx(s,{className:"h-3.5 w-3.5 text-muted-foreground"}),m.jsx("span",{className:"font-medium",children:o.label}),m.jsx(qa,{className:"h-3 w-3 text-muted-foreground"})]}),r&&m.jsx("div",{role:"menu",className:"absolute left-0 top-full z-50 mt-1 min-w-64 rounded-md border border-border bg-popover p-1 shadow-lg",children:n.map(l=>{const c=l.icon,u=l.id===t;return m.jsxs("button",{role:"menuitemradio","aria-checked":u,onClick:()=>{i(!1),u||e(l.id)},className:`flex w-full items-start gap-2 rounded px-2 py-1.5 text-left text-xs transition-colors ${u?"bg-accent text-accent-foreground":"hover:bg-muted text-foreground"}`,children:[m.jsx(c,{className:"mt-0.5 h-3.5 w-3.5 shrink-0 text-muted-foreground"}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[m.jsx("span",{className:"font-medium",children:l.label}),u&&m.jsx(Ff,{className:"h-3 w-3 text-primary"})]}),m.jsx("div",{className:"text-[11px] text-muted-foreground",children:l.description})]})]},l.id)})})]})}function q0e({branch:t}){return t?m.jsxs("span",{className:"flex items-center gap-1 text-xs text-muted-foreground",children:[m.jsx(bq,{className:"h-3.5 w-3.5"}),t]}):null}function tm({children:t,content:e,side:n="bottom",align:r="center",width:i="auto",popoverClassName:a=""}){if(e==null)return m.jsx(m.Fragment,{children:t});const o=i==="auto"?"whitespace-nowrap":i==="narrow"?"w-64 whitespace-normal":"w-80 whitespace-normal",s=n==="top"?"bottom-full mb-1.5":"top-full mt-1.5",l=r==="start"?"left-0":r==="end"?"right-0":"left-1/2 -translate-x-1/2";return m.jsxs("span",{className:"group relative inline-flex",children:[t,m.jsx("span",{role:"tooltip",className:`pointer-events-none absolute z-50 ${s} ${l} ${o} rounded border border-border bg-popover px-3 py-2 text-xs leading-snug text-popover-foreground opacity-0 shadow-md transition-opacity group-hover:opacity-100 ${a}`,children:e})]})}function Z0e({subject:t}){return m.jsxs("div",{className:"space-y-2 text-[11px] leading-relaxed",children:[m.jsxs("div",{children:[m.jsx("p",{className:"font-semibold text-foreground",children:"Normal mode"}),m.jsxs("p",{children:["Stashes pending changes, ",t.verb," the committed code, then restores your changes. The baseline is always the committed state."]})]}),m.jsxs("div",{children:[m.jsx("p",{className:"font-semibold text-foreground",children:"Git Diff mode"}),m.jsxs("p",{children:["Compares your working tree against the committed baseline. Shows which ",t.plural," your pending changes introduce or resolve."]})]})]})}function Tre({diffMode:t,onToggle:e,subject:n}){return m.jsx(tm,{align:"end",width:"wide",content:m.jsx(Z0e,{subject:n}),children:m.jsxs("div",{className:"flex items-center rounded-md border border-border p-0.5",children:[m.jsx("button",{type:"button",onClick:()=>t&&e(!1),className:`rounded px-2 py-0.5 text-xs font-medium transition-colors ${t?"text-muted-foreground hover:text-foreground":"bg-accent text-accent-foreground"}`,children:"Normal"}),m.jsx("button",{type:"button",onClick:()=>!t&&e(!0),className:`rounded px-2 py-0.5 text-xs font-medium transition-colors ${t?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground"}`,children:"Git Diff"})]})})}function kre({items:t,selectedId:e,onSelect:n}){var s;const[r,i]=_.useState(!1),a=_.useRef(null);if(_.useEffect(()=>{const l=c=>{a.current&&!a.current.contains(c.target)&&i(!1)};return r&&document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[r]),t.length<=1)return null;const o=e?((s=t.find(l=>l.id===e))==null?void 0:s.label)??"Past run":"Latest";return m.jsxs("div",{className:"relative",ref:a,children:[m.jsxs("button",{className:"flex items-center gap-1 rounded-md border border-border bg-card px-2 py-1 text-xs text-muted-foreground hover:text-foreground transition-colors",onClick:()=>i(l=>!l),children:[o,m.jsx(qa,{className:"h-3 w-3"})]}),r&&m.jsx("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-56 rounded-md border border-border bg-popover shadow-lg",children:m.jsxs("div",{className:"max-h-64 overflow-y-auto py-1",children:[m.jsx("button",{className:`w-full whitespace-nowrap px-3 py-1.5 text-left text-xs hover:bg-accent transition-colors ${e?"text-muted-foreground":"bg-accent/50 font-medium text-foreground"}`,onClick:()=>{n(null),i(!1)},children:"Latest"}),t.map((l,c)=>{const u=c===0,f=u?!e:e===l.id;return m.jsxs("button",{className:`w-full whitespace-nowrap px-3 py-1.5 text-left text-xs hover:bg-accent transition-colors ${f?"bg-accent/50 font-medium text-foreground":"text-muted-foreground"}`,onClick:()=>{n(u?null:l.id),i(!1)},children:[m.jsx("span",{children:l.label}),l.branch&&m.jsx("span",{className:"ml-1.5 font-mono opacity-60",children:l.branch}),u&&m.jsx("span",{className:"ml-1.5 text-primary/70",children:"(latest)"})]},l.id)})]})})]})}async function V0e(){return null}const _re=_.createContext({routes:[],navItems:[],loaded:!1});function U0e({children:t}){const{edition:e,isLoading:n,capabilities:r}=wS(),[i,a]=_.useState(null);_.useEffect(()=>{if(n)return;if(e!=="enterprise"){a(null);return}let s=!1;return V0e().then(l=>{s||a(l)}),()=>{s=!0}},[e,n]);const o=_.useMemo(()=>{const s=l=>!l||r.has(l);return{routes:((i==null?void 0:i.routes)??[]).filter(l=>s(l.requiredCapability)),navItems:((i==null?void 0:i.navItems)??[]).filter(l=>s(l.requiredCapability)),homeComponent:i==null?void 0:i.homeComponent,loaded:i!==null}},[i,r]);return m.jsx(_re.Provider,{value:o,children:t})}function Xre(){return _.useContext(_re)}const N0e={Building2:Tve};function W0e(){const{navItems:t}=Xre(),{pathname:e}=ks();return t.length===0?null:m.jsx(m.Fragment,{children:t.map(n=>{const r=n.iconName?N0e[n.iconName]:void 0,i=e===n.to;return m.jsxs(Dh,{to:n.to,className:`flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium transition-colors ${i?"bg-accent text-accent-foreground":"text-muted-foreground hover:text-foreground hover:bg-muted/50"}`,children:[r&&m.jsx(r,{className:"h-4 w-4"}),n.label]},n.id)})})}const xk="/api/ee/auth",Rre=_.createContext({status:"disabled",user:null,signIn:()=>{},signOut:async()=>{}});function M0e({children:t}){const{edition:e,isLoading:n}=wS(),[r,i]=_.useState("loading"),[a,o]=_.useState(null);_.useEffect(()=>{if(n)return;if(e!=="enterprise"){i("disabled"),o(null);return}let u=!1;return i("loading"),fetch(`${ly()}${xk}/me`,{credentials:"include"}).then(async f=>{if(!u)if(f.ok){const h=await f.json();o(h.user),i("authed")}else o(null),i("anon")}).catch(()=>{u||(o(null),i("anon"))}),()=>{u=!0}},[e,n]);const s=_.useCallback(()=>{window.location.href=`${ly()}${xk}/login`},[]),l=_.useCallback(async()=>{try{const f=await(await fetch(`${ly()}${xk}/logout`,{method:"POST",credentials:"include"})).json().catch(()=>({}));window.location.href=f.logoutUrl??"/"}catch{window.location.href="/"}},[]),c=_.useMemo(()=>({status:r,user:a,signIn:s,signOut:l}),[r,a,s,l]);return m.jsx(Rre.Provider,{value:c,children:t})}function jre(){return _.useContext(Rre)}function j8({children:t}){return m.jsx("div",{className:"flex h-screen w-screen items-center justify-center bg-background text-foreground",children:t})}function I0e({children:t}){const{status:e,signIn:n}=jre(),r=new URLSearchParams(window.location.search).get("auth_error");return _.useEffect(()=>{e==="anon"&&!r&&n()},[e,r,n]),e==="disabled"||e==="authed"?m.jsx(m.Fragment,{children:t}):e==="anon"&&r?m.jsx(j8,{children:m.jsxs("div",{className:"max-w-sm text-center",children:[m.jsx("p",{className:"text-sm font-medium",children:"Sign-in failed"}),m.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["We couldn't complete authentication (",r,")."]}),m.jsx("button",{onClick:n,className:"mt-4 rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground hover:opacity-90",children:"Try again"})]})}):m.jsx(j8,{children:m.jsx(yn,{className:"h-6 w-6 animate-spin text-muted-foreground"})})}function Ere(){const[t,e]=_.useState(()=>typeof document<"u"&&document.documentElement.classList.contains("dark"));return _.useEffect(()=>{if(typeof document>"u")return;const n=document.documentElement,r=new MutationObserver(()=>{e(n.classList.contains("dark"))});return r.observe(n,{attributes:!0,attributeFilter:["class"]}),()=>r.disconnect()},[]),t}function Cre(){const t=Ere(),e=_.useCallback(()=>{const n=!document.documentElement.classList.contains("dark");document.documentElement.classList.toggle("dark",n),localStorage.setItem("theme",n?"dark":"light")},[]);return{isDark:t,toggle:e}}const zre="https://github.com/truecourse-ai/truecourse",Yre="https://discord.gg/TanxB63arz";function Are({className:t}){return m.jsx("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",className:t,children:m.jsx("path",{d:"M20.317 4.369a19.79 19.79 0 0 0-4.885-1.515.074.074 0 0 0-.078.037c-.21.375-.444.864-.608 1.249a18.27 18.27 0 0 0-5.487 0 12.683 12.683 0 0 0-.617-1.249.077.077 0 0 0-.079-.037A19.736 19.736 0 0 0 3.677 4.369a.07.07 0 0 0-.032.027C.533 9.046-.32 13.58.099 18.057a.082.082 0 0 0 .031.057 19.9 19.9 0 0 0 5.993 3.03.078.078 0 0 0 .084-.028 14.09 14.09 0 0 0 1.226-1.994.076.076 0 0 0-.041-.105 13.107 13.107 0 0 1-1.872-.892.077.077 0 0 1-.008-.128c.126-.094.252-.192.372-.291a.074.074 0 0 1 .077-.01c3.927 1.793 8.18 1.793 12.061 0a.074.074 0 0 1 .078.009c.12.099.246.198.373.292a.077.077 0 0 1-.006.128 12.3 12.3 0 0 1-1.873.891.077.077 0 0 0-.041.106c.36.698.772 1.362 1.225 1.993a.076.076 0 0 0 .084.028 19.84 19.84 0 0 0 6.002-3.03.077.077 0 0 0 .032-.054c.5-5.177-.838-9.674-3.548-13.66a.061.061 0 0 0-.031-.028zM8.02 15.331c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.956-2.418 2.157-2.418 1.21 0 2.176 1.094 2.157 2.418 0 1.334-.956 2.419-2.157 2.419zm7.975 0c-1.183 0-2.157-1.085-2.157-2.419 0-1.333.955-2.418 2.157-2.418 1.21 0 2.176 1.094 2.157 2.418 0 1.334-.946 2.419-2.157 2.419z"})})}const uQ="flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-xs text-foreground hover:bg-muted transition-colors";function D0e(){var u;const{status:t,user:e,signOut:n}=jre(),{isDark:r,toggle:i}=Cre(),[a,o]=_.useState(!1),s=_.useRef(null);if(_.useEffect(()=>{if(!a)return;const f=h=>{s.current&&!s.current.contains(h.target)&&o(!1)};return document.addEventListener("mousedown",f),()=>document.removeEventListener("mousedown",f)},[a]),t!=="authed"||!e)return null;const l=[e.firstName,e.lastName].filter(Boolean).join(" ")||e.email,c=(((u=e.firstName)==null?void 0:u[0])??e.email[0]??"?").toUpperCase();return m.jsxs("div",{className:"relative",ref:s,children:[m.jsxs("button",{type:"button",onClick:()=>o(f=>!f),className:"flex items-center gap-1.5 rounded-md px-1.5 py-1 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/50 transition-colors","aria-haspopup":"menu","aria-expanded":a,children:[m.jsx("span",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-primary/20 text-[10px] font-semibold text-primary",children:c}),m.jsx(qa,{className:"h-3 w-3"})]}),a&&m.jsxs("div",{role:"menu",className:"absolute right-0 top-full z-50 mt-1 min-w-56 rounded-md border border-border bg-popover p-1 shadow-lg",children:[m.jsxs("div",{className:"px-2 py-1.5",children:[m.jsx("div",{className:"truncate text-xs font-medium text-foreground",children:l}),m.jsx("div",{className:"truncate text-[11px] text-muted-foreground",children:e.email})]}),m.jsx("div",{className:"my-1 border-t border-border"}),m.jsxs("button",{role:"menuitem",onClick:i,className:uQ,children:[r?m.jsx(Vne,{className:"h-3.5 w-3.5"}):m.jsx(Cne,{className:"h-3.5 w-3.5"}),r?"Light mode":"Dark mode"]}),m.jsxs("a",{role:"menuitem",href:zre,target:"_blank",rel:"noopener noreferrer",onClick:()=>o(!1),className:uQ,children:[m.jsx(Xne,{className:"h-3.5 w-3.5"}),"Star on GitHub",m.jsx(Zne,{className:"ml-auto h-3 w-3 text-muted-foreground"})]}),m.jsxs("a",{role:"menuitem",href:Yre,target:"_blank",rel:"noopener noreferrer",onClick:()=>o(!1),className:uQ+" text-[#5865F2] hover:text-[#5865F2]",children:[m.jsx(Are,{className:"h-3.5 w-3.5"}),"Discord"]}),m.jsx("div",{className:"my-1 border-t border-border"}),m.jsxs("button",{role:"menuitem",onClick:()=>{o(!1),n()},className:uQ,children:[m.jsx(Wve,{className:"h-3.5 w-3.5"}),"Sign out"]})]})]})}function qq({repoName:t,currentBranch:e,onAnalyze:n,isAnalyzing:r,showBack:i,backHref:a="/",isDiffMode:o,onEnterDiffMode:s,onExitDiffMode:l,analyses:c,selectedAnalysisId:u,onSelectAnalysis:f,currentAnalysisId:h,dashboardSection:p,onDashboardSectionChange:y,sectionActions:v}){const $=R0e(),{isDark:x,toggle:S}=Cre();return m.jsxs("header",{className:"flex h-14 items-center justify-between border-b border-border bg-card px-4",children:[m.jsxs("div",{className:"flex items-center gap-3",children:[i&&m.jsx(Dh,{to:a,className:Tb({variant:"ghost",size:"icon-sm"}),children:m.jsx(Qne,{className:"h-5 w-5"})}),m.jsxs(Dh,{to:"/",className:"flex items-center gap-2 text-lg font-bold text-foreground",children:[m.jsx("img",{src:"/logo.svg",alt:"TrueCourse",className:"h-7 w-7"}),"TrueCourse"]}),p&&y&&m.jsxs(m.Fragment,{children:[m.jsx("span",{className:"text-muted-foreground/60",children:"/"}),m.jsx(A0e,{value:p,onChange:y})]})]}),m.jsxs("div",{className:"flex items-center gap-3",children:[t&&m.jsx("span",{className:"text-sm font-medium text-foreground",children:t}),m.jsx(q0e,{branch:e}),c&&f&&m.jsx(kre,{items:c.map(b=>{const T=new Date(b.createdAt);return{id:b.id,label:`${T.toLocaleDateString()} ${T.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})}`,branch:b.branch}}),selectedId:u??null,onSelect:f}),s&&m.jsx(Tre,{diffMode:!!o,onToggle:b=>b?s==null?void 0:s():l==null?void 0:l(),subject:{verb:"analyzes",plural:"violations"}}),v&&m.jsx("div",{className:"flex items-center gap-2",children:v}),n&&m.jsx("div",{className:"relative flex items-center",children:m.jsxs(xn,{size:"sm",onClick:()=>n(),disabled:r,children:[r&&m.jsx(yn,{className:"h-3.5 w-3.5 animate-spin"}),r?"Analyzing...":"Analyze"]})})]}),m.jsxs("div",{className:"flex items-center gap-1",children:[m.jsx(W0e,{}),m.jsx(D0e,{}),$!=="enterprise"&&m.jsxs(m.Fragment,{children:[m.jsxs("a",{href:zre,target:"_blank",rel:"noopener noreferrer",className:Tb({variant:"ghost",size:"sm"})+" gap-1.5","aria-label":"Star TrueCourse on GitHub",children:[m.jsx(Xne,{className:"h-4 w-4"}),m.jsx(Zne,{className:"h-3.5 w-3.5"}),m.jsx("span",{className:"text-xs font-medium",children:"Star"})]}),m.jsxs("a",{href:Yre,target:"_blank",rel:"noopener noreferrer",className:Tb({variant:"ghost",size:"sm"})+" gap-1.5 text-[#5865F2] hover:text-[#5865F2]","aria-label":"Join the TrueCourse Discord",children:[m.jsx(Are,{className:"h-4 w-4"}),m.jsx("span",{className:"text-xs font-medium",children:"Discord"})]}),m.jsx(xn,{variant:"ghost",size:"icon-sm",onClick:S,"aria-label":"Toggle theme",children:x?m.jsx(Vne,{className:"h-5 w-5"}):m.jsx(Cne,{className:"h-5 w-5"})})]})]})]})}let E8=(function(t){return t.disabled="data-disabled",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t})({});const L0e={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},Fg={valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},G0e={disabled:!1,...Fg},B0e={valid(t){return t===null?null:t?{[E8.valid]:""}:{[E8.invalid]:""}}},F0e=_.createContext({invalid:void 0,name:void 0,validityData:{state:L0e,errors:[],error:"",value:"",initialValue:null},setValidityData:Ra,disabled:void 0,touched:Fg.touched,setTouched:Ra,dirty:Fg.dirty,setDirty:Ra,filled:Fg.filled,setFilled:Ra,focused:Fg.focused,setFocused:Ra,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:G0e,markedDirtyRef:{current:!1},validation:{getValidationProps:(t=Ii)=>t,getInputValidationProps:(t=Ii)=>t,inputRef:{current:null},commit:async()=>{}}});function qre(t=!0){const e=_.useContext(F0e);if(e.setValidityData===Ra&&!t)throw new Error(_s(28));return e}const H0e=_.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Ra,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function K0e(){return _.useContext(H0e)}let C8=0;function J0e(t,e="mui"){const[n,r]=_.useState(t),i=t||n;return _.useEffect(()=>{n==null&&(C8+=1,r(`${e}-${C8}`))},[n,e]),i}const z8=cxe.useId;function Ov(t,e){if(z8!==void 0){const n=z8();return t??(e?`${e}-${n}`:n)}return J0e(t,e)}function fv(t){return Ov(t,"base-ui")}const e1e=_.createContext({controlId:void 0,registerControlId:Ra,labelId:void 0,setLabelId:Ra,messageIds:[],setMessageIds:Ra,getDescriptionProps:t=>t});function Zre(){return _.useContext(e1e)}const t1e=[];function Zq(t){_.useEffect(t,t1e)}const Qg=0;class Qs{constructor(){Wn(this,"currentId",Qg);Wn(this,"clear",()=>{this.currentId!==Qg&&(clearTimeout(this.currentId),this.currentId=Qg)});Wn(this,"disposeEffect",()=>this.clear)}static create(){return new Qs}start(e,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=Qg,n()},e)}isStarted(){return this.currentId!==Qg}}function tO(){const t=yo(Qs.create).current;return Zq(t.disposeEffect),t}function n1e(t,e){return{...t,state:{...t.state,valid:!e&&t.state.valid}}}function dr(t){return(t==null?void 0:t.ownerDocument)||document}const nm=typeof navigator<"u",Qk=i1e(),Vre=o1e(),Ure=a1e(),Nre=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),Wre=Qk.platform==="MacIntel"&&Qk.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(Qk.platform),Mre=nm&&/apple/i.test(navigator.vendor),LC=nm&&/android/i.test(Vre)||/android/i.test(Ure),r1e=nm&&Vre.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,Ire=Ure.includes("jsdom/");function i1e(){if(!nm)return{platform:"",maxTouchPoints:-1};const t=navigator.userAgentData;return t!=null&&t.platform?{platform:t.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function a1e(){if(!nm)return"";const t=navigator.userAgentData;return t&&Array.isArray(t.brands)?t.brands.map(({brand:e,version:n})=>`${e}/${n}`).join(" "):navigator.userAgent}function o1e(){if(!nm)return"";const t=navigator.userAgentData;return t!=null&&t.platform?t.platform:navigator.platform??""}const GC="data-base-ui-focusable",Dre="active",Lre="selected",Gre="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function Js(t){var n;let e=t.activeElement;for(;((n=e==null?void 0:e.shadowRoot)==null?void 0:n.activeElement)!=null;)e=e.shadowRoot.activeElement;return e}function ln(t,e){var r;if(!t||!e)return!1;const n=(r=e.getRootNode)==null?void 0:r.call(e);if(t.contains(e))return!0;if(n&&qy(n)){let i=e;for(;i;){if(t===i)return!0;i=i.parentNode||i.host}}return!1}function p0(t,e){if(!jn(t))return!1;const n=t;if(e.hasElement(n))return!n.hasAttribute("data-trigger-disabled");for(const[,r]of e.entries())if(ln(r,n))return!r.hasAttribute("data-trigger-disabled");return!1}function _a(t){return"composedPath"in t?t.composedPath()[0]:t.target}function as(t,e){if(e==null)return!1;if("composedPath"in t)return t.composedPath().includes(e);const n=t;return n.target!=null&&e.contains(n.target)}function s1e(t){return t.matches("html,body")}function TS(t){return yi(t)&&t.matches(Gre)}function Y8(t){return t?t.getAttribute("role")==="combobox"&&TS(t):!1}function l1e(t){if(!t||Ire)return!0;try{return t.matches(":focus-visible")}catch{return!0}}function BC(t){return t?t.hasAttribute(GC)?t:t.querySelector(`[${GC}]`)||t:null}function Sc(t,e,n=!0){return t.filter(i=>{var a;return i.parentId===e&&(!n||((a=i.context)==null?void 0:a.open))}).flatMap(i=>[i,...Sc(t,i.id,n)])}function A8(t,e){var i;let n=[],r=(i=t.find(a=>a.id===e))==null?void 0:i.parentId;for(;r;){const a=t.find(o=>o.id===r);r=a==null?void 0:a.parentId,a&&(n=n.concat(a))}return n}function c1e(t){t.preventDefault(),t.stopPropagation()}function u1e(t){return"nativeEvent"in t}function O1e(t){return t.pointerType===""&&t.isTrusted?!0:LC&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function f1e(t){return Ire?!1:!LC&&t.width===0&&t.height===0||LC&&t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"||t.width<1&&t.height<1&&t.pressure===0&&t.detail===0&&t.pointerType==="touch"}function tp(t,e){const n=["mouse","pen"];return e||n.push("",void 0),n.includes(t)}function Bre(t){const e=t.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}const d1e=["top","right","bottom","left"],np=Math.min,io=Math.max,m0=Math.round,OQ=Math.floor,hl=t=>({x:t,y:t}),h1e={left:"right",right:"left",bottom:"top",top:"bottom"};function FC(t,e,n){return io(t,np(e,n))}function Yc(t,e){return typeof t=="function"?t(e):t}function Ca(t){return t.split("-")[0]}function hO(t){return t.split("-")[1]}function Vq(t){return t==="x"?"y":"x"}function Uq(t){return t==="y"?"height":"width"}function zo(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function Nq(t){return Vq(zo(t))}function p1e(t,e,n){n===void 0&&(n=!1);const r=hO(t),i=Nq(t),a=Uq(i);let o=i==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(o=g0(o)),[o,g0(o)]}function m1e(t){const e=g0(t);return[HC(t),e,HC(e)]}function HC(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const q8=["left","right"],Z8=["right","left"],g1e=["top","bottom"],y1e=["bottom","top"];function $1e(t,e,n){switch(t){case"top":case"bottom":return n?e?Z8:q8:e?q8:Z8;case"left":case"right":return e?g1e:y1e;default:return[]}}function v1e(t,e,n,r){const i=hO(t);let a=$1e(Ca(t),n==="start",r);return i&&(a=a.map(o=>o+"-"+i),e&&(a=a.concat(a.map(HC)))),a}function g0(t){const e=Ca(t);return h1e[e]+t.slice(e.length)}function x1e(t){return{top:0,right:0,bottom:0,left:0,...t}}function Fre(t){return typeof t!="number"?x1e(t):{top:t,right:t,bottom:t,left:t}}function y0(t){const{x:e,y:n,width:r,height:i}=t;return{width:r,height:i,top:n,left:e,right:e+r,bottom:n+i,x:e,y:n}}function Q1e(t){return fo(t).display!=="none"}/*!
|
|
536
536
|
* tabbable 6.4.0
|
|
537
537
|
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
538
538
|
*/var b1e=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],$0=b1e.join(","),Hre=typeof Element>"u",rp=Hre?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,v0=!Hre&&Element.prototype.getRootNode?function(t){var e;return t==null||(e=t.getRootNode)===null||e===void 0?void 0:e.call(t)}:function(t){return t==null?void 0:t.ownerDocument},x0=function(e,n){var r;n===void 0&&(n=!0);var i=e==null||(r=e.getAttribute)===null||r===void 0?void 0:r.call(e,"inert"),a=i===""||i==="true",o=a||n&&e&&(typeof e.closest=="function"?e.closest("[inert]"):x0(e.parentNode));return o},S1e=function(e){var n,r=e==null||(n=e.getAttribute)===null||n===void 0?void 0:n.call(e,"contenteditable");return r===""||r==="true"},Kre=function(e,n,r){if(x0(e))return[];var i=Array.prototype.slice.apply(e.querySelectorAll($0));return n&&rp.call(e,$0)&&i.unshift(e),i=i.filter(r),i},Q0=function(e,n,r){for(var i=[],a=Array.from(e);a.length;){var o=a.shift();if(!x0(o,!1))if(o.tagName==="SLOT"){var s=o.assignedElements(),l=s.length?s:o.children,c=Q0(l,!0,r);r.flatten?i.push.apply(i,c):i.push({scopeParent:o,candidates:c})}else{var u=rp.call(o,$0);u&&r.filter(o)&&(n||!e.includes(o))&&i.push(o);var f=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),h=!x0(f,!1)&&(!r.shadowRootFilter||r.shadowRootFilter(o));if(f&&h){var p=Q0(f===!0?o.children:f.children,!0,r);r.flatten?i.push.apply(i,p):i.push({scopeParent:o,candidates:p})}else a.unshift.apply(a,o.children)}}return i},Jre=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},eie=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||S1e(e))&&!Jre(e)?0:e.tabIndex},w1e=function(e,n){var r=eie(e);return r<0&&n&&!Jre(e)?0:r},P1e=function(e,n){return e.tabIndex===n.tabIndex?e.documentOrder-n.documentOrder:e.tabIndex-n.tabIndex},tie=function(e){return e.tagName==="INPUT"},T1e=function(e){return tie(e)&&e.type==="hidden"},k1e=function(e){var n=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return n},_1e=function(e,n){for(var r=0;r<e.length;r++)if(e[r].checked&&e[r].form===n)return e[r]},X1e=function(e){if(!e.name)return!0;var n=e.form||v0(e),r=function(s){return n.querySelectorAll('input[type="radio"][name="'+s+'"]')},i;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")i=r(window.CSS.escape(e.name));else try{i=r(e.name)}catch(o){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",o.message),!1}var a=_1e(i,e.form);return!a||a===e},R1e=function(e){return tie(e)&&e.type==="radio"},j1e=function(e){return R1e(e)&&!X1e(e)},E1e=function(e){var n,r=e&&v0(e),i=(n=r)===null||n===void 0?void 0:n.host,a=!1;if(r&&r!==e){var o,s,l;for(a=!!((o=i)!==null&&o!==void 0&&(s=o.ownerDocument)!==null&&s!==void 0&&s.contains(i)||e!=null&&(l=e.ownerDocument)!==null&&l!==void 0&&l.contains(e));!a&&i;){var c,u,f;r=v0(i),i=(c=r)===null||c===void 0?void 0:c.host,a=!!((u=i)!==null&&u!==void 0&&(f=u.ownerDocument)!==null&&f!==void 0&&f.contains(i))}}return a},V8=function(e){var n=e.getBoundingClientRect(),r=n.width,i=n.height;return r===0&&i===0},C1e=function(e,n){var r=n.displayCheck,i=n.getShadowRoot;if(r==="full-native"&&"checkVisibility"in e){var a=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!a}if(getComputedStyle(e).visibility==="hidden")return!0;var o=rp.call(e,"details>summary:first-of-type"),s=o?e.parentElement:e;if(rp.call(s,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="full-native"||r==="legacy-full"){if(typeof i=="function"){for(var l=e;e;){var c=e.parentElement,u=v0(e);if(c&&!c.shadowRoot&&i(c)===!0)return V8(e);e.assignedSlot?e=e.assignedSlot:!c&&u!==e.ownerDocument?e=u.host:e=c}e=l}if(E1e(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return V8(e);return!1},z1e=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var n=e.parentElement;n;){if(n.tagName==="FIELDSET"&&n.disabled){for(var r=0;r<n.children.length;r++){var i=n.children.item(r);if(i.tagName==="LEGEND")return rp.call(n,"fieldset[disabled] *")?!0:!i.contains(e)}return!0}n=n.parentElement}return!1},KC=function(e,n){return!(n.disabled||T1e(n)||C1e(n,e)||k1e(n)||z1e(n))},JC=function(e,n){return!(j1e(n)||eie(n)<0||!KC(e,n))},Y1e=function(e){var n=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(n)||n>=0)},nie=function(e){var n=[],r=[];return e.forEach(function(i,a){var o=!!i.scopeParent,s=o?i.scopeParent:i,l=w1e(s,o),c=o?nie(i.candidates):s;l===0?o?n.push.apply(n,c):n.push(s):r.push({documentOrder:a,tabIndex:l,item:i,isScope:o,content:c})}),r.sort(P1e).reduce(function(i,a){return a.isScope?i.push.apply(i,a.content):i.push(a.content),i},[]).concat(n)},kS=function(e,n){n=n||{};var r;return n.getShadowRoot?r=Q0([e],n.includeContainer,{filter:JC.bind(null,n),flatten:!1,getShadowRoot:n.getShadowRoot,shadowRootFilter:Y1e}):r=Kre(e,n.includeContainer,JC.bind(null,n)),nie(r)},A1e=function(e,n){n=n||{};var r;return n.getShadowRoot?r=Q0([e],n.includeContainer,{filter:KC.bind(null,n),flatten:!0,getShadowRoot:n.getShadowRoot}):r=Kre(e,n.includeContainer,KC.bind(null,n)),r},rie=function(e,n){if(n=n||{},!e)throw new Error("No node provided");return rp.call(e,$0)===!1?!1:JC(n,e)};const dv=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function iie(t,e){const n=kS(t,dv()),r=n.length;if(r===0)return;const i=Js(dr(t)),a=n.indexOf(i),o=a===-1?e===1?0:r-1:a+e;return n[o]}function aie(t){return iie(dr(t).body,1)||t}function oie(t){return iie(dr(t).body,-1)||t}function cy(t,e){const n=e||t.currentTarget,r=t.relatedTarget;return!r||!ln(n,r)}function q1e(t){kS(t,dv()).forEach(n=>{n.dataset.tabindex=n.getAttribute("tabindex")||"",n.setAttribute("tabindex","-1")})}function U8(t){t.querySelectorAll("[data-tabindex]").forEach(n=>{const r=n.dataset.tabindex;delete n.dataset.tabindex,r?n.setAttribute("tabindex",r):n.removeAttribute("tabindex")})}const fQ=null;class Z1e{constructor(){Wn(this,"callbacks",[]);Wn(this,"callbacksCount",0);Wn(this,"nextId",1);Wn(this,"startId",1);Wn(this,"isScheduled",!1);Wn(this,"tick",e=>{var i;this.isScheduled=!1;const n=this.callbacks,r=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,r>0)for(let a=0;a<n.length;a+=1)(i=n[a])==null||i.call(n,e)})}request(e){const n=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),n}cancel(e){const n=e-this.startId;n<0||n>=this.callbacks.length||(this.callbacks[n]=null,this.callbacksCount-=1)}}const dQ=new Z1e;class el{constructor(){Wn(this,"currentId",fQ);Wn(this,"cancel",()=>{this.currentId!==fQ&&(dQ.cancel(this.currentId),this.currentId=fQ)});Wn(this,"disposeEffect",()=>this.cancel)}static create(){return new el}static request(e){return dQ.request(e)}static cancel(e){return dQ.cancel(e)}request(e){this.cancel(),this.currentId=dQ.request(()=>{this.currentId=fQ,e()})}}function Wq(){const t=yo(el.create).current;return Zq(t.disposeEffect),t}function sc(t){return t==null?t:"current"in t?t.current:t}let Ny=(function(t){return t.startingStyle="data-starting-style",t.endingStyle="data-ending-style",t})({});const V1e={[Ny.startingStyle]:""},U1e={[Ny.endingStyle]:""},Mq={transitionStatus(t){return t==="starting"?V1e:t==="ending"?U1e:null}};function N1e(t,e=!1,n=!0){const r=Wq();return tn((i,a=null)=>{r.cancel();function o(){Pl.flushSync(i)}const s=sc(t);if(s==null)return;const l=s;if(typeof l.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED)i();else{let f=function(){const p=Ny.startingStyle;if(!l.hasAttribute(p)){r.request(h);return}const y=new MutationObserver(()=>{l.hasAttribute(p)||(y.disconnect(),h())});y.observe(l,{attributes:!0,attributeFilter:[p]}),a==null||a.addEventListener("abort",()=>y.disconnect(),{once:!0})},h=function(){Promise.all(l.getAnimations().map(p=>p.finished)).then(()=>{a!=null&&a.aborted||o()}).catch(()=>{const p=l.getAnimations();if(n){if(a!=null&&a.aborted)return;o()}else p.length>0&&p.some(y=>y.pending||y.playState!=="finished")&&h()})};var c=f,u=h;if(e){f();return}r.request(h)}})}function Iq(t){const{enabled:e=!0,open:n,ref:r,onComplete:i}=t,a=tn(i),o=N1e(r,n,!1);_.useEffect(()=>{if(!e)return;const s=new AbortController;return o(a,s.signal),()=>{s.abort()}},[e,n,a,o])}function W1e(t,e=!1,n=!1){const[r,i]=_.useState(t&&e?"idle":void 0),[a,o]=_.useState(t);return t&&!a&&(o(!0),i("starting")),!t&&a&&r!=="ending"&&!n&&i("ending"),!t&&!a&&r==="ending"&&i(void 0),qt(()=>{if(!t&&a&&r!=="ending"&&n){const s=el.request(()=>{i("ending")});return()=>{el.cancel(s)}}},[t,a,r,n]),qt(()=>{if(!t||e)return;const s=el.request(()=>{i(void 0)});return()=>{el.cancel(s)}},[e,t]),qt(()=>{if(!t||!e)return;t&&a&&r!=="idle"&&i("starting");const s=el.request(()=>{i("idle")});return()=>{el.cancel(s)}},[e,t,a,i,r]),_.useMemo(()=>({mounted:a,setMounted:o,transitionStatus:r}),[a,r])}function M1e({controlled:t,default:e,name:n,state:r="value"}){const{current:i}=_.useRef(t!==void 0),[a,o]=_.useState(e),s=i?t:a,l=_.useCallback(c=>{i||o(c)},[]);return[s,l]}function I1e(t={}){const{id:e,implicit:n=!1,controlRef:r}=t,{controlId:i,registerControlId:a}=Zre(),o=fv(e),s=n?i:void 0,l=yo(()=>Symbol("labelable-control")),c=_.useRef(!1),u=_.useRef(e!=null),f=tn(()=>{!c.current||a===Ra||(c.current=!1,a(l.current,void 0))});return qt(()=>{if(a===Ra)return;let h;if(n){const p=r==null?void 0:r.current;jn(p)&&p.closest("label")!=null?h=e??null:h=s??o}else if(e!=null)u.current=!0,h=e;else if(u.current)h=o;else{f();return}if(h===void 0){f();return}c.current=!0,a(l.current,h)},[e,r,s,a,n,o,l,f]),_.useEffect(()=>f,[f]),i??o}function D1e(t){const{enabled:e=!0,value:n,id:r,name:i,controlRef:a,commit:o}=t,{formRef:s}=K0e(),{invalid:l,markedDirtyRef:c,validityData:u,setValidityData:f}=qre(),h=tn(t.getValue);qt(()=>{if(!e)return;let p=n;p===void 0&&(p=h()),u.initialValue===null&&p!==null&&f(y=>({...y,initialValue:p}))},[e,f,n,u.initialValue,h]),qt(()=>{!e||!r||s.current.fields.set(r,{getValue:h,name:i,controlRef:a,validityData:n1e(u,l),validate(p=!0){let y=n;y===void 0&&(y=h()),c.current=!0,p?Pl.flushSync(()=>o(y)):o(y)}})},[o,a,e,s,h,r,l,c,i,u,n]),qt(()=>{const p=s.current.fields;return()=>{r&&p.delete(r)}},[s,r])}const Dq="none",Wy="trigger-press",us="trigger-hover",kb="trigger-focus",sie="outside-press",L1e="close-press",lie="focus-out",Lq="escape-key",G1e="disabled",cie="imperative-action";function or(t,e,n,r){let i=!1,a=!1;const o=Ii;return{reason:t,event:e??new Event("base-ui"),cancel(){i=!0},allowPropagation(){a=!0},get isCanceled(){return i},get isPropagationAllowed(){return a},trigger:n,...o}}const B1e=_.forwardRef(function(e,n){const{render:r,className:i,id:a,name:o,value:s,disabled:l=!1,onValueChange:c,defaultValue:u,autoFocus:f=!1,...h}=e,{state:p,name:y,disabled:v,setTouched:$,setDirty:x,validityData:S,setFocused:b,setFilled:T,validationMode:w,validation:P}=qre(),k=v||l,R=y??o,E={...p,disabled:k},{labelId:C}=Zre(),z=I1e({id:a});qt(()=>{var D;const Z=s!=null;(D=P.inputRef.current)!=null&&D.value||Z&&s!==""?T(!0):Z&&s===""&&T(!1)},[P.inputRef,T,s]);const Y=_.useRef(null);qt(()=>{f&&Y.current===Js(dr(Y.current))&&b(!0)},[f,b]);const[W]=M1e({controlled:s,default:u,name:"FieldControl",state:"value"}),A=s!==void 0,q=A?W:void 0;return D1e({id:z,name:R,commit:P.commit,value:q,getValue:()=>{var Z;return(Z=P.inputRef.current)==null?void 0:Z.value},controlRef:P.inputRef}),ha("input",e,{ref:[n,Y],state:E,props:[{id:z,disabled:k,name:R,ref:P.inputRef,"aria-labelledby":C,autoFocus:f,...A?{value:q}:{defaultValue:u},onChange(Z){const D=Z.currentTarget.value;c==null||c(D,or(Dq,Z.nativeEvent)),x(D!==S.initialValue),T(D!=="")},onFocus(){b(!0)},onBlur(Z){$(!0),b(!1),w==="onBlur"&&P.commit(Z.currentTarget.value)},onKeyDown(Z){Z.currentTarget.tagName==="INPUT"&&Z.key==="Enter"&&($(!0),P.commit(Z.currentTarget.value))}},P.getInputValidationProps(),h],stateAttributesMapping:B0e})}),F1e=_.forwardRef(function(e,n){return m.jsx(B1e,{ref:n,...e})});function H1e({className:t,type:e,...n}){return m.jsx(F1e,{type:e,"data-slot":"input",className:jr("h-8 w-full min-w-0 rounded-lg border border-input bg-transparent px-2.5 py-1 text-base transition-colors outline-none file:inline-flex file:h-6 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:disabled:bg-input/80 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40",t),...n})}function K1e({onAdd:t}){const[e,n]=_.useState(""),[r,i]=_.useState(!1),a=async o=>{if(o.preventDefault(),!!e.trim()){i(!0);try{await t(e.trim()),n("")}catch{}finally{i(!1)}}};return m.jsx("form",{onSubmit:a,className:"w-full",children:m.jsxs("div",{className:"flex gap-2",children:[m.jsxs("div",{className:"relative flex-1",children:[m.jsx(zve,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),m.jsx(H1e,{type:"text",value:e,onChange:o=>n(o.target.value),placeholder:"Paste repository path...",className:"pl-10"})]}),m.jsxs(xn,{type:"submit",disabled:r||!e.trim(),children:[r?m.jsx(yn,{className:"h-4 w-4 animate-spin"}):m.jsx(Yne,{className:"h-4 w-4"}),"Add Repository"]})]})})}function J1e({repos:t,onDelete:e}){const n=(r,i)=>{r.preventDefault(),r.stopPropagation();const a=i.lastAnalyzed?`Delete "${i.name}"? This will remove all analyses, violations, and chat history.`:`Delete "${i.name}"?`;confirm(a)&&e(i.id)};return t.length===0?m.jsxs("div",{className:"flex flex-col items-center justify-center rounded-lg border border-dashed border-border py-16",children:[m.jsx(Lh,{className:"mb-4 h-12 w-12 text-muted-foreground"}),m.jsx("p",{className:"text-lg font-medium text-foreground",children:"No repositories yet"}),m.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:"Add a repository path above to get started"})]}):m.jsx("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-3",children:t.map(r=>m.jsxs(Dh,{to:`/repos/${r.id}`,className:"group relative flex flex-col rounded-xl border border-border bg-card p-4 ring-1 ring-foreground/10 transition-all hover:shadow-md hover:ring-primary/30",children:[m.jsx("button",{onClick:i=>n(i,r),className:"absolute right-3 top-3 rounded-md p-1 text-muted-foreground/50 opacity-0 transition-all hover:bg-destructive/10 hover:text-destructive group-hover:opacity-100","aria-label":"Delete repository",children:m.jsx(Pq,{className:"h-3.5 w-3.5"})}),m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("div",{className:"flex h-10 w-10 flex-shrink-0 items-center justify-center rounded-lg bg-primary/10",children:m.jsx(Lh,{className:"h-5 w-5 text-primary"})}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsx("h3",{className:"truncate text-sm font-semibold text-foreground",children:r.name}),m.jsx("p",{className:"truncate text-[11px] text-muted-foreground",children:r.path})]})]}),m.jsxs("div",{className:"mt-4 flex items-center justify-between",children:[r.lastAnalyzed?m.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[m.jsx(gS,{className:"h-3 w-3"}),m.jsxs("span",{children:["Analyzed"," ",new Date(r.lastAnalyzed).toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})]})]}):m.jsx("span",{className:"text-[11px] text-muted-foreground/60",children:"Not analyzed yet"}),m.jsx(Qve,{className:"h-3.5 w-3.5 text-muted-foreground/50 transition-transform group-hover:translate-x-0.5 group-hover:text-primary"})]})]},r.id))})}function eSe(){const[t,e]=_.useState([]),[n,r]=_.useState(!0),[i,a]=_.useState(null),o=_.useCallback(async()=>{r(!0),a(null);try{const u=await Nbe();e(u)}catch(u){a(u instanceof Error?u.message:"Failed to fetch repos")}finally{r(!1)}},[]);_.useEffect(()=>{o()},[o]);const s=_.useCallback(async u=>{try{const f=await Wbe(u);return e(h=>[...h,f]),f}catch(f){const h=f instanceof Error?f.message:"Failed to add repo";throw a(h),f}},[]),l=_.useCallback(async u=>{try{await Mbe(u),e(f=>f.filter(h=>h.id!==u))}catch(f){const h=f instanceof Error?f.message:"Failed to delete repo";throw a(h),f}},[]),c=_.useCallback(async(u,f)=>{try{return await vre(u,f)}catch(h){const p=h instanceof Error?h.message:"Failed to start analysis";throw a(p),h}},[]);return{repos:t,isLoading:n,error:i,addRepo:s,deleteRepo:l,analyzeRepo:c,refetch:o}}const tSe=Eq("group/alert relative grid w-full gap-0.5 rounded-lg border px-2.5 py-2 text-left text-sm has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-2 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-card text-card-foreground",destructive:"bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current"}},defaultVariants:{variant:"default"}});function uy({className:t,variant:e,...n}){return m.jsx("div",{"data-slot":"alert",role:"alert",className:jr(tSe({variant:e}),t),...n})}function N8({className:t,...e}){return m.jsx("div",{"data-slot":"alert-title",className:jr("font-medium group-has-[>svg]/alert:col-start-2 [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground",t),...e})}function Oy({className:t,...e}){return m.jsx("div",{"data-slot":"alert-description",className:jr("text-sm text-balance text-muted-foreground md:text-pretty [&_a]:underline [&_a]:underline-offset-3 [&_a]:hover:text-foreground [&_p:not(:last-child)]:mb-4",t),...e})}function nSe(){const{repos:t,isLoading:e,error:n,addRepo:r,deleteRepo:i}=eSe(),a=async o=>{try{await i(o)}catch{}};return m.jsxs("div",{className:"flex min-h-screen flex-col",children:[m.jsx(qq,{}),m.jsxs("main",{className:"mx-auto w-full max-w-5xl flex-1 px-4 py-8",children:[m.jsxs("div",{className:"mb-8 text-center",children:[m.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"TrueCourse"}),m.jsx("p",{className:"mt-2 text-muted-foreground",children:"Visualize and understand your codebase architecture"})]}),m.jsxs("div",{className:"mb-8 space-y-5",children:[m.jsxs("div",{className:"flex flex-col items-center gap-2.5 rounded-lg border border-border bg-card p-6",children:[m.jsx("p",{className:"text-sm text-muted-foreground",children:"Run this from your project directory:"}),m.jsx("code",{className:"rounded-md bg-muted px-4 py-2.5 font-mono text-sm text-foreground select-all",children:"npx truecourse add"})]}),m.jsxs("div",{className:"flex items-center gap-3",children:[m.jsx("div",{className:"h-px flex-1 bg-border"}),m.jsx("span",{className:"text-xs text-muted-foreground",children:"or add manually"}),m.jsx("div",{className:"h-px flex-1 bg-border"})]}),m.jsx(K1e,{onAdd:r})]}),n&&m.jsx(uy,{variant:"destructive",className:"mb-6",children:m.jsx(Oy,{children:n})}),e?m.jsx("div",{className:"flex items-center justify-center py-16",children:m.jsx(yn,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):m.jsx(J1e,{repos:t,onDelete:a})]})]})}function rSe({section:t,activeTab:e,onTabChange:n,children:r,defaultWidth:i=350,minWidth:a=260,badgeCounts:o,tabWarnings:s}){var S;const[l,c]=_.useState(i),[u,f]=_.useState(800),h=_.useRef(!1),p=Y0e(t),y=_.useMemo(()=>new Set(p.filter(b=>b.noPanel).map(b=>b.id)),[p]);_.useEffect(()=>{const b=()=>Math.floor(window.innerWidth*.8);f(b());const T=()=>f(b());return window.addEventListener("resize",T),()=>window.removeEventListener("resize",T)},[]);const v=_.useCallback(b=>{b.preventDefault(),h.current=!0;const T=b.clientX,w=l,P=R=>{if(!h.current)return;const E=R.clientX-T;c(Math.min(u,Math.max(a,w+E)))},k=()=>{h.current=!1,document.removeEventListener("mousemove",P),document.removeEventListener("mouseup",k)};document.addEventListener("mousemove",P),document.addEventListener("mouseup",k)},[l,a,u]),$=e!==null&&!y.has(e),x=e?((S=j0e(e))==null?void 0:S.label)??"":"";return m.jsxs("div",{className:"flex flex-shrink-0 h-full",children:[m.jsx("div",{className:"flex w-12 flex-col items-center gap-1 border-r border-border bg-card pt-2",children:p.map(b=>{const T=b.icon,w=e===b.id;return m.jsxs("button",{onClick:()=>n(w?null:b.id),className:`group relative flex h-10 w-10 items-center justify-center rounded-md transition-colors ${w?"bg-accent text-accent-foreground":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,"aria-label":b.label,children:[w&&m.jsx("div",{className:"absolute left-0 top-1.5 bottom-1.5 w-0.5 rounded-r bg-primary"}),m.jsx(T,{className:"h-5 w-5"}),m.jsx("span",{className:"pointer-events-none absolute left-full ml-2 whitespace-nowrap rounded bg-popover px-2 py-1 text-xs text-popover-foreground shadow-md border border-border opacity-0 group-hover:opacity-100 transition-opacity z-50",children:b.label}),(()=>{const P=o==null?void 0:o[b.id];return P==null?null:typeof P=="number"?P>0?m.jsx("span",{className:"absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-primary px-1 text-[9px] font-bold text-primary-foreground",children:P}):null:P.newCount+P.resolvedCount>0?m.jsxs("span",{className:"absolute -right-1 -top-1 flex items-center gap-px rounded-full bg-card border border-border px-1 py-px",children:[P.newCount>0&&m.jsxs("span",{className:"text-[8px] font-bold text-red-400",children:["+",P.newCount]}),P.resolvedCount>0&&m.jsxs("span",{className:"text-[8px] font-bold text-emerald-400",children:["-",P.resolvedCount]})]}):null})()]},b.id)})}),$&&m.jsxs("aside",{className:"relative flex-shrink-0 border-r border-border bg-card",style:{width:l},children:[m.jsxs("div",{className:"flex h-10 items-center gap-2 border-b border-border px-3",children:[m.jsx("span",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:x}),(()=>{const b=e?s==null?void 0:s[e]:void 0;return b?m.jsx(tm,{align:"start",width:"wide",content:b,children:m.jsx("span",{className:"flex items-center text-amber-400",children:m.jsx(zi,{className:"h-3.5 w-3.5"})})}):null})(),(()=>{const b=e?o==null?void 0:o[e]:void 0;return b==null?null:typeof b=="number"?b>0?m.jsx("span",{className:"rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium text-muted-foreground",children:b}):null:b.newCount+b.resolvedCount>0?m.jsxs("span",{className:"flex items-center gap-1.5 rounded-full bg-muted px-1.5 py-0.5 text-[10px] font-medium",children:[b.newCount>0&&m.jsxs("span",{className:"text-red-400",children:["+",b.newCount," new"]}),b.resolvedCount>0&&m.jsxs("span",{className:"text-emerald-400",children:["-",b.resolvedCount," resolved"]})]}):null})()]}),m.jsx("div",{className:"h-[calc(100%-40px)] overflow-hidden",children:r}),m.jsx("div",{className:"absolute inset-y-0 right-0 z-10 w-1 cursor-col-resize hover:bg-primary/30 active:bg-primary/50",onMouseDown:v})]})]})}const W8=["tab","mode","scopeService","scopeModule","file","flow","canonical","contract","drift"];function ez(t){return(t==null?void 0:t.get("section"))==="drift"?"drift":"analysis"}function M8(t){const e=(t==null?void 0:t.get("tab"))??null;return e==="violations"?"graphs":e==="analytics"?"home":e&&E0e().has(e)?e:t!=null&&t.get("flow")?"flows":t!=null&&t.get("file")?"files":t!=null&&t.get("canonical")?"spec":t!=null&&t.get("contract")?"contracts":t!=null&&t.get("drift")?"verify":DC(ez(t))}const uie=_.createContext(null);function iSe({children:t}){const[e]=uv(),n=uO(),[r,i]=_.useState(()=>ez(e)),[a,o]=_.useState(()=>M8(e)),s=_.useCallback(u=>{i(u);const f=DC(u);o(f);const h=new URL(window.location.href);u==="drift"?h.searchParams.set("section","drift"):h.searchParams.delete("section");for(const p of W8)h.searchParams.delete(p);h.searchParams.delete("view"),f!=="home"&&h.searchParams.set("tab",f),n(h.pathname+h.search)},[n]),l=_.useCallback(u=>{o(u);const f=new URL(window.location.href);if(u&&u!=="home")f.searchParams.set("tab",u);else for(const h of W8)f.searchParams.delete(h);n(f.pathname+f.search)},[n]);_.useEffect(()=>{const u=ez(e),f=M8(e),p=C0e(f)===u?f:DC(u);i(u),o(p)},[e]);const c=_.useMemo(()=>({section:r,leftTab:a,setSection:s,setLeftTab:l}),[r,a,s,l]);return m.jsx(uie.Provider,{value:c,children:t})}function Oie(){const t=_.useContext(uie);if(!t)throw new Error("useNavigation must be used inside <NavigationProvider>");return t}const I8={services:"services",modules:"modules",functions:"methods"},D8={services:"services",modules:"modules",methods:"functions"},fie=_.createContext(null);function aSe({children:t}){const[e]=uv(),n=uO(),[r,i]=_.useState(null),[a,o]=_.useState(()=>I8[(e==null?void 0:e.get("mode"))||""]||"services"),[s,l]=_.useState(()=>(e==null?void 0:e.get("scopeService"))||null),[c,u]=_.useState(()=>(e==null?void 0:e.get("scopeModule"))||null),[f,h]=_.useState(null),p=_.useCallback(S=>{l(S);const b=new URL(window.location.href);S?b.searchParams.set("scopeService",S):b.searchParams.delete("scopeService"),n(b.pathname+b.search)},[n]),y=_.useCallback(S=>{u(S);const b=new URL(window.location.href);S?b.searchParams.set("scopeModule",S):b.searchParams.delete("scopeModule"),n(b.pathname+b.search)},[n]),v=_.useCallback(S=>{o(S);const b=new URL(window.location.href);S==="services"?(b.searchParams.delete("mode"),b.searchParams.delete("scopeService"),b.searchParams.delete("scopeModule")):S==="modules"?(b.searchParams.set("mode","modules"),b.searchParams.delete("scopeModule"),s&&b.searchParams.set("scopeService",s)):(b.searchParams.set("mode",D8[S]),s&&b.searchParams.set("scopeService",s),c&&b.searchParams.set("scopeModule",c)),n(b.pathname+b.search)},[n,s,c]),$=_.useCallback((S,b,T)=>{const w=b??a;let P=s,k=c;w==="services"?(P=null,k=null):w==="modules"?((T==null?void 0:T.serviceId)!==void 0&&(P=T.serviceId??null),k=null):((T==null?void 0:T.serviceId)!==void 0&&(P=T.serviceId??null),(T==null?void 0:T.moduleId)!==void 0&&(k=T.moduleId??null)),o(w),l(P),u(k);const R=new URL(window.location.href);w==="services"?R.searchParams.delete("mode"):R.searchParams.set("mode",D8[w]),P?R.searchParams.set("scopeService",P):R.searchParams.delete("scopeService"),k?R.searchParams.set("scopeModule",k):R.searchParams.delete("scopeModule"),n(R.pathname+R.search),b&&b!==a?setTimeout(()=>h({nodeId:S,key:Date.now()}),500):h({nodeId:S,key:Date.now()})},[a,s,c,n]);_.useEffect(()=>{o(I8[(e==null?void 0:e.get("mode"))??""]??"services"),l((e==null?void 0:e.get("scopeService"))??null),u((e==null?void 0:e.get("scopeModule"))??null)},[e]);const x=_.useMemo(()=>({selectedService:r,setSelectedService:i,depthLevel:a,setDepthLevel:v,scopedServiceId:s,setScopedServiceId:p,scopedModuleId:c,setScopedModuleId:y,focusRequest:f,setFocusRequest:h,locateNode:$}),[r,a,v,s,p,c,y,f,$]);return m.jsx(fie.Provider,{value:x,children:t})}function oSe(){const t=_.useContext(fie);if(!t)throw new Error("useGraphView must be used inside <GraphViewProvider>");return t}const die=_.createContext(null);function sSe({children:t}){const[e]=uv(),n=uO(),{setLeftTab:r}=Oie(),i=(e==null?void 0:e.get("file"))||null,[a,o]=_.useState(()=>i?[{path:i,pinned:!0}]:[]),[s,l]=_.useState(i),c=_.useCallback(M=>{l(M);const V=new URL(window.location.href);M?V.searchParams.set("file",M):V.searchParams.delete("file"),n(V.pathname+V.search)},[n]),u=_.useCallback((M,V,I)=>{o(B=>B.find(K=>K.path===M)?B.map(K=>K.path===M?{...K,pinned:V||K.pinned,scrollToLine:I??K.scrollToLine}:K):V?[...B,{path:M,pinned:!0,scrollToLine:I}]:B.find(K=>!K.pinned)?B.map(K=>K.pinned?K:{path:M,pinned:!1,scrollToLine:I}):[...B,{path:M,pinned:!1,scrollToLine:I}]),c(M),r("files")},[c,r]),f=_.useCallback(M=>{if(o(V=>V.filter(I=>I.path!==M)),s===M){const V=a.filter(I=>I.path!==M);c(V.length>0?V[V.length-1].path:null)}},[a,s,c]),h=(e==null?void 0:e.get("flow"))||null,[p,y]=_.useState(()=>h?[{id:h,name:"Flow",pinned:!0}]:[]),[v,$]=_.useState(h),x=_.useCallback(M=>{$(M);const V=new URL(window.location.href);M?(V.searchParams.set("flow",M),V.searchParams.delete("file")):V.searchParams.delete("flow"),n(V.pathname+V.search)},[n]),S=_.useCallback(M=>{if(y(V=>V.filter(I=>I.id!==M)),v===M){const V=p.filter(I=>I.id!==M);x(V.length>0?V[V.length-1].id:null)}},[p,v,x]),b=_.useCallback(M=>{M.length!==0&&y(V=>V.map(I=>{const B=M.find(L=>L.id===I.id);return B?{...I,name:B.name}:I}))},[]),[T,w]=_.useState([]),[P,k]=_.useState(null),R=_.useCallback(M=>{k(M)},[]),E=_.useCallback(M=>{if(w(V=>V.filter(I=>I.id!==M)),P===M){const V=T.filter(I=>I.id!==M);R(V.length>0?V[V.length-1].id:null)}},[T,P,R]),C=_.useCallback(()=>{c(null),x(null),R(null)},[c,x,R]),z=_.useCallback(M=>{c(M),x(null),R(null),M!==null&&r("files")},[c,x,R,r]),Y=_.useCallback(M=>{z(M)},[z]),W=_.useCallback(M=>{x(M),c(null),R(null),M!==null&&r("flows")},[x,c,R,r]),A=_.useCallback(M=>{R(M),c(null),x(null),M!==null&&r("databases")},[R,c,x,r]),q=_.useCallback((M,V,I)=>{y(B=>B.find(K=>K.id===M)?B.map(K=>K.id===M?{...K,name:V,pinned:I||K.pinned}:K):I?[...B,{id:M,name:V,pinned:!0}]:B.find(K=>!K.pinned)?B.map(K=>K.pinned?K:{id:M,name:V,pinned:!1}):[...B,{id:M,name:V,pinned:!1}]),W(M)},[W]),N=_.useCallback((M,V,I)=>{w(B=>B.find(K=>K.id===M)?B.map(K=>K.id===M?{...K,pinned:I||K.pinned}:K):I?[...B,{id:M,name:V,pinned:!0}]:B.find(K=>!K.pinned)?B.map(K=>K.pinned?K:{id:M,name:V,pinned:!1}):[...B,{id:M,name:V,pinned:!1}]),A(M)},[A]),Z=_.useCallback(M=>{const V=M??"home";r(V),V==="flows"&&v===null&&p.length>0?x(p[p.length-1].id):V==="files"&&s===null&&a.length>0?c(a[a.length-1].path):V==="databases"&&P===null&&T.length>0&&R(T[T.length-1].id)},[r,v,p,x,s,a,c,P,T,R]);_.useEffect(()=>{l((e==null?void 0:e.get("file"))??null),$((e==null?void 0:e.get("flow"))??null)},[e]);const D=_.useMemo(()=>({openFiles:a,activeFilePath:s,setActiveFilePath:c,handleOpenFile:u,handleCloseFile:f,openFlows:p,activeFlowId:v,setActiveFlowId:x,handleOpenFlow:q,handleCloseFlow:S,syncFlowNames:b,openDatabases:T,activeDbId:P,setActiveDbId:R,handleOpenDatabase:N,handleCloseDatabase:E,clearActiveDetailView:C,showFileView:z,handleSelectTab:Y,showFlowView:W,showDatabaseView:A,handleLeftTabChange:Z}),[a,s,c,u,f,p,v,x,q,S,b,T,P,R,N,E,C,z,Y,W,A,Z]);return m.jsx(die.Provider,{value:D,children:t})}function lSe(){const t=_.useContext(die);if(!t)throw new Error("useOpenTabs must be used inside <OpenTabsProvider>");return t}const hie=_.createContext(null);function cSe({children:t}){const[e]=uv(),n=uO(),r=(e==null?void 0:e.get("canonical"))||null,i=(e==null?void 0:e.get("contract"))||null,[a,o]=_.useState(null),[s,l]=_.useState(r),[c,u]=_.useState(()=>r?[{path:r,pinned:!0}]:[]),f=_.useCallback(q=>{l(q);const N=new URL(window.location.href);q?N.searchParams.set("canonical",q):N.searchParams.delete("canonical"),n(N.pathname+N.search)},[n]),[h,p]=_.useState(i),[y,v]=_.useState(()=>i?[{path:i,pinned:!0}]:[]),$=_.useCallback(q=>{p(q);const N=new URL(window.location.href);q?N.searchParams.set("contract",q):N.searchParams.delete("contract"),n(N.pathname+N.search)},[n]),x=_.useCallback((q,N)=>{v(Z=>Z.find(V=>V.path===q)?Z.map(V=>V.path===q?{...V,pinned:N||V.pinned}:V):N?[...Z,{path:q,pinned:!0}]:Z.find(V=>!V.pinned)?Z.map(V=>V.pinned?V:{path:q,pinned:!1}):[...Z,{path:q,pinned:!1}]),$(q)},[]),S=_.useCallback(q=>{if(v(N=>N.filter(Z=>Z.path!==q)),h===q){const N=y.filter(Z=>Z.path!==q);$(N.length>0?N[N.length-1].path:null)}},[y,h]),b=_.useCallback((q,N)=>{u(Z=>Z.find(V=>V.path===q)?Z.map(V=>V.path===q?{...V,pinned:N||V.pinned}:V):N?[...Z,{path:q,pinned:!0}]:Z.find(V=>!V.pinned)?Z.map(V=>V.pinned?V:{path:q,pinned:!1}):[...Z,{path:q,pinned:!1}]),f(q),o(null)},[]),T=_.useCallback(q=>{o(q),q!==null&&f(null)},[]),w=_.useCallback(q=>{if(u(N=>N.filter(Z=>Z.path!==q)),s===q){const N=c.filter(Z=>Z.path!==q);f(N.length>0?N[N.length-1].path:null)}},[c,s]),P=(e==null?void 0:e.get("drift"))||null,[k,R]=_.useState(P),[E,C]=_.useState(()=>P?[{id:P,pinned:!0}]:[]),z=_.useCallback((q,N)=>{C(Z=>Z.find(V=>V.id===q)?Z.map(V=>V.id===q?{...V,pinned:N||V.pinned}:V):N?[...Z,{id:q,pinned:!0}]:Z.find(V=>!V.pinned)?Z.map(V=>V.pinned?V:{id:q,pinned:!1}):[...Z,{id:q,pinned:!1}]),R(q)},[]),Y=_.useCallback(q=>{if(C(N=>N.filter(Z=>Z.id!==q)),k===q){const N=E.filter(Z=>Z.id!==q);R(N.length>0?N[N.length-1].id:null)}},[E,k]),W=_.useCallback(q=>{if(q===null){C([]),R(null);return}C(N=>N.filter(Z=>q.has(Z.id))),R(N=>N&&q.has(N)?N:null)},[]);_.useEffect(()=>{l((e==null?void 0:e.get("canonical"))??null),p((e==null?void 0:e.get("contract"))??null),R((e==null?void 0:e.get("drift"))??null)},[e]),_.useEffect(()=>{const q=new URLSearchParams(window.location.search).get("drift");if((k??"")===(q??""))return;const N=new URL(window.location.href);k?N.searchParams.set("drift",k):N.searchParams.delete("drift"),n(N.pathname+N.search)},[k,n]);const A=_.useMemo(()=>({activeSpecConflictId:a,setActiveSpecConflictId:o,handleSelectSpecConflict:T,activeCanonicalPath:s,setActiveCanonicalPath:f,openCanonicalFiles:c,handleOpenCanonical:b,handleCloseCanonical:w,activeContractsPath:h,setActiveContractsPath:$,openContractsFiles:y,handleOpenContracts:x,handleCloseContracts:S,activeDriftId:k,setActiveDriftId:R,openDriftTabs:E,handleOpenDrift:z,handleCloseDrift:Y,reconcileDriftTabs:W}),[a,T,s,c,b,w,h,y,x,S,k,E,z,Y,W]);return m.jsx(hie.Provider,{value:A,children:t})}function uSe(){const t=_.useContext(hie);if(!t)throw new Error("useDriftView must be used inside <DriftViewProvider>");return t}const pie=_.createContext(null);function OSe({children:t}){const[e]=uv(),n=uO(),[r,i]=_.useState(()=>(e==null?void 0:e.get("view"))==="diff"),[a,o]=_.useState(null),[s,l]=_.useState(null),c=_.useCallback(f=>{i(f);const h=new URL(window.location.href);f?h.searchParams.set("view","diff"):h.searchParams.delete("view"),n(h.pathname+h.search)},[n]);_.useEffect(()=>{i((e==null?void 0:e.get("view"))==="diff")},[e]);const u=_.useMemo(()=>({isDiffMode:r,setIsDiffMode:c,selectedAnalysisId:a,setSelectedAnalysisId:o,selectedPath:s,setSelectedPath:l}),[r,c,a,s]);return m.jsx(pie.Provider,{value:u,children:t})}function fSe(){const t=_.useContext(pie);if(!t)throw new Error("useViewMode must be used inside <ViewModeProvider>");return t}const mie=_.createContext(null);function dSe({repoId:t,children:e}){const[n,r]=_.useState(null),[i,a]=_.useState(!0),[o,s]=_.useState(!1),[l,c]=_.useState(null),[u,f]=_.useState(null),[h,p]=_.useState(0);_.useEffect(()=>{let w=!1;return(async()=>{try{const P=await Q0e(t);!w&&P&&r(P)}catch(P){w||c(P.message)}finally{w||a(!1)}})(),()=>{w=!0}},[t]);const y=_.useCallback(async()=>{s(!0),c(null);try{const w=await O0e(t);r(w),p(P=>P+1)}catch(w){ah("Spec scan failed",w,c)}finally{s(!1)}},[t]),v=_.useCallback(async(w,P)=>{f(w.id);try{await S0e(t,{conflictId:w.id,resolution:P,candidateFingerprint:w.candidateFingerprint}),await y()}catch(k){ah("Saving decision failed",k,c)}finally{f(null)}},[t,y]),$=_.useCallback(async()=>{s(!0);try{await T0e(t,"all-defaults"),await y()}catch(w){ah("Accept all defaults failed",w,c)}finally{s(!1)}},[t,y]),x=_.useCallback(async w=>{f(w);try{await b0e(t,w),await y()}catch(P){ah("Revoking decision failed",P,c)}finally{f(null)}},[t,y]),S=_.useCallback(async(w,P,k)=>{s(!0);try{await P0e(t,{older:w,newer:P,note:k}),await y()}catch(R){ah("Marking supersession failed",R,c)}finally{s(!1)}},[t,y]),b=_.useCallback(async w=>{s(!0);try{await w0e(t,{path:w}),await y()}catch(P){ah("Including doc failed",P,c)}finally{s(!1)}},[t,y]),T=_.useMemo(()=>({scan:n,hydrating:i,loading:o,error:l,busyConflictId:u,canonicalVersion:h,refresh:y,resolveConflict:v,acceptAllDefaults:$,revokeDecision:x,markSuperseded:S,includeDoc:b}),[n,i,o,l,u,h,y,v,$,x,S,b]);return m.jsx(mie.Provider,{value:T,children:e})}function Mc(){const t=_.useContext(mie);if(!t)throw new Error("useSpec must be used inside <SpecProvider>");return t}function ah(t,e,n){const r=e instanceof Error?e.message:String(e);n(r),hc.error(t,{description:r})}function hSe(){const{scan:t,loading:e,refresh:n,acceptAllDefaults:r}=Mc(),i=((t==null?void 0:t.openConflicts.length)??0)>0,a=!t;return m.jsxs(m.Fragment,{children:[m.jsxs(xn,{size:"sm",variant:"outline",onClick:n,disabled:e,title:"Discover docs, extract claims, surface conflicts",children:[e?m.jsx(yn,{className:"mr-2 h-3.5 w-3.5 animate-spin"}):m.jsx(vS,{className:"mr-2 h-3.5 w-3.5"}),e?"Scanning...":"Scan"]}),m.jsxs(xn,{size:"sm",variant:"outline",onClick:r,disabled:a||!i||e,title:"Accept the engine's default pick on every open conflict (chains first, then content)",children:[m.jsx(Nne,{className:"mr-2 h-3.5 w-3.5"}),"Accept all defaults"]})]})}function pSe(){const{scan:t}=Mc(),e=t&&t.openConflicts.length===0?"Select a section from the canonical spec to view it.":"Select a conflict from the list to review its candidates, or pick a canonical section below.";return m.jsx("div",{className:"flex h-full flex-col items-center justify-center gap-2 px-6 text-center text-sm text-muted-foreground",children:m.jsx("p",{children:e})})}function mSe({progress:t,onDismiss:e}){const n=t.step==="error";return m.jsxs("div",{className:`fixed bottom-4 left-1/2 z-40 w-80 -translate-x-1/2 rounded-lg border bg-card p-3 shadow-lg ${n?"border-destructive/50":"border-border"}`,children:[m.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[m.jsx("span",{className:`text-[11px] font-medium ${n?"text-destructive":"text-foreground"}`,children:n?"Spec failed":"Running…"}),n&&m.jsx("button",{onClick:e,className:"shrink-0 rounded p-0.5 text-muted-foreground hover:bg-muted hover:text-foreground",title:"Dismiss",children:m.jsx(Rr,{className:"h-3.5 w-3.5"})})]}),n?m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsx(i0,{className:"h-3.5 w-3.5 shrink-0 translate-y-px text-destructive"}),m.jsx("span",{className:"text-[11px] text-muted-foreground",children:t.detail||"An error occurred"})]}):t.steps&&t.steps.length>0?m.jsx("div",{className:"space-y-1",children:t.steps.map(r=>m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsxs("div",{className:"shrink-0 translate-y-px",children:[r.status==="done"&&m.jsx(Ff,{className:"h-3.5 w-3.5 text-emerald-500"}),r.status==="active"&&m.jsx(yn,{className:"h-3.5 w-3.5 animate-spin text-primary"}),r.status==="error"&&m.jsx(i0,{className:"h-3.5 w-3.5 text-destructive"}),r.status==="pending"&&m.jsx("div",{className:"h-2.5 w-2.5 rounded-full border border-muted-foreground/30"})]}),m.jsx("div",{className:"min-w-0 flex-1",children:m.jsxs("span",{className:`text-[11px] leading-[18px] ${r.status==="active"?"font-medium text-foreground":r.status==="done"?"text-muted-foreground":r.status==="error"?"text-destructive":"text-muted-foreground/60"}`,children:[r.label,r.detail&&r.status!=="pending"&&m.jsx("span",{className:"ml-1.5 text-[10px] font-normal text-muted-foreground/70",children:r.detail})]})})]},r.key))}):m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx(yn,{className:"h-3.5 w-3.5 shrink-0 animate-spin text-primary"}),m.jsx("span",{className:"text-[11px] text-muted-foreground",children:t.detail||t.step})]})]})}function pl({icon:t,title:e,body:n}){return m.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-3 px-6 text-center",children:[m.jsx(t,{className:"h-8 w-8 text-muted-foreground/60"}),m.jsxs("div",{children:[m.jsx("h3",{className:"text-sm font-semibold text-foreground",children:e}),m.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:n})]})]})}function gSe({tree:t,isLoading:e,error:n,activePath:r,validationIssues:i,onOpen:a}){if(e&&!t)return m.jsx("div",{className:"flex h-full items-center justify-center",children:m.jsx(yn,{className:"h-5 w-5 animate-spin text-muted-foreground"})});if(n)return m.jsxs("div",{className:"flex h-full flex-col items-center justify-center gap-2 px-4 text-center text-sm text-muted-foreground",children:[m.jsx(zi,{className:"h-5 w-5 text-destructive"}),m.jsx("span",{children:n})]});if(!t||!t.hasContracts)return m.jsx(pl,{icon:xq,title:"No contracts yet",body:m.jsxs(m.Fragment,{children:["Resolve all open conflicts in ",m.jsx("strong",{children:"Spec"}),", click"," ",m.jsx("strong",{children:"Apply"}),", then click ",m.jsx("strong",{children:"Generate"})," here to extract TC contracts."]})});const o=i??[],s=o.filter(c=>c.severity==="hard"),l=o.filter(c=>c.severity==="soft");return m.jsxs("div",{className:"flex h-full flex-col overflow-hidden",children:[o.length>0&&m.jsx($Se,{hardIssues:s,softIssues:l}),m.jsx("div",{className:"flex-1 overflow-auto",children:t.modules.map(c=>m.jsx(ySe,{label:c.name,files:c.files,activePath:r,onOpen:a},c.name))})]})}function ySe({label:t,files:e,activePath:n,onOpen:r}){const[i,a]=_.useState(!0),o=e.some(s=>s.path===n);return m.jsxs("div",{children:[m.jsxs("button",{type:"button",onClick:()=>a(s=>!s),className:`sticky top-0 z-10 flex w-full items-center justify-between gap-2 border-b border-border bg-card px-4 py-1.5 text-left text-[10px] uppercase tracking-wider hover:text-foreground ${o?"text-foreground":"text-muted-foreground"}`,"aria-expanded":i,children:[m.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[i?m.jsx(qa,{className:"h-3 w-3 shrink-0"}):m.jsx(Wc,{className:"h-3 w-3 shrink-0"}),m.jsx(Lh,{className:"h-3 w-3 shrink-0"}),m.jsx("span",{className:"truncate",children:t})]}),m.jsx("span",{children:e.length})]}),i&&e.map(s=>{const l=s.path===n,c=s.path.replace(/^[^/]+\//,"");return m.jsxs("button",{type:"button",onClick:()=>r(s.path,!1),onDoubleClick:()=>r(s.path,!0),className:`flex w-full items-center gap-2 border-b border-border/60 px-4 py-2 pl-9 text-left text-[13px] transition-colors ${l?"bg-primary/10 text-foreground":"text-muted-foreground hover:bg-muted/40 hover:text-foreground"}`,title:`${s.path} — click to preview, double-click to pin`,children:[m.jsx(xq,{className:"h-3 w-3 shrink-0"}),m.jsx("span",{className:"truncate",children:c})]},s.path)})]})}function $Se({hardIssues:t,softIssues:e}){const[n,r]=_.useState(!0),i=t.length+e.length,a=t.length>0,o=a?"text-red-400":"text-amber-400",s=a?"border-red-500/30":"border-amber-500/30",l=a?"bg-red-500/5":"bg-amber-500/5";return m.jsxs("div",{className:`shrink-0 border-b ${s} ${l}`,children:[m.jsxs("button",{type:"button",onClick:()=>r(c=>!c),className:`flex w-full items-center justify-between px-4 py-1.5 text-[10px] uppercase tracking-wider ${o} hover:opacity-80`,"aria-expanded":n,children:[m.jsxs("div",{className:"flex items-center gap-1.5",children:[n?m.jsx(qa,{className:"h-3 w-3"}):m.jsx(Wc,{className:"h-3 w-3"}),m.jsx("span",{children:"Validation issues"})]}),m.jsx("span",{children:i})]}),n&&m.jsxs("ul",{className:"max-h-72 overflow-auto px-2 pb-2",children:[t.map((c,u)=>m.jsx(L8,{issue:c},`hard-${c.artifactKey}-${u}`)),e.map((c,u)=>m.jsx(L8,{issue:c},`soft-${c.artifactKey}-${u}`))]})]})}function L8({issue:t}){const[e,n]=_.useState(!1),r=t.severity==="hard"?"border-red-500/30 bg-red-500/5 text-red-700 dark:text-red-300":"border-amber-500/30 bg-amber-500/5 text-amber-800 dark:text-amber-200";return m.jsx("li",{className:`mt-1.5 rounded border ${r} px-2 py-1.5`,children:m.jsxs("div",{className:"flex items-start gap-2",children:[m.jsx("span",{className:`mt-0.5 shrink-0 rounded px-1 py-0.5 text-[9px] uppercase tracking-wider ${t.severity==="hard"?"bg-red-500/20 text-red-700 dark:text-red-300":"bg-amber-500/20 text-amber-800 dark:text-amber-200"}`,children:t.severity}),m.jsxs("div",{className:"min-w-0 flex-1",children:[m.jsxs("div",{className:"flex items-center gap-2",children:[m.jsx("span",{className:"truncate font-mono text-[11px] text-foreground",children:t.artifactKey}),t.tcSource&&m.jsx("button",{type:"button",onClick:()=>n(i=>!i),className:"shrink-0 text-[10px] text-muted-foreground hover:text-foreground",children:e?"hide":"source"})]}),m.jsx("div",{className:"mt-0.5 break-words text-[11px]",children:t.message}),e&&t.tcSource&&m.jsx("pre",{className:"mt-1 max-h-40 overflow-auto rounded bg-muted/40 p-2 font-mono text-[10px] text-muted-foreground",children:t.tcSource})]})]})})}let tz=[],gie=[];(()=>{let t="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,n=0;e<t.length;e++)(e%2?gie:tz).push(n=n+t[e])})();function vSe(t){if(t<768)return!1;for(let e=0,n=tz.length;;){let r=e+n>>1;if(t<tz[r])n=r;else if(t>=gie[r])e=r+1;else return!0;if(e==n)return!1}}function G8(t){return t>=127462&&t<=127487}const B8=8205;function xSe(t,e,n=!0,r=!0){return(n?yie:QSe)(t,e,r)}function yie(t,e,n){if(e==t.length)return e;e&&$ie(t.charCodeAt(e))&&vie(t.charCodeAt(e-1))&&e--;let r=bk(t,e);for(e+=F8(r);e<t.length;){let i=bk(t,e);if(r==B8||i==B8||n&&vSe(i))e+=F8(i),r=i;else if(G8(i)){let a=0,o=e-2;for(;o>=0&&G8(bk(t,o));)a++,o-=2;if(a%2==0)break;e+=2}else break}return e}function QSe(t,e,n){for(;e>0;){let r=yie(t,e-2,n);if(r<e)return r;e--}return 0}function bk(t,e){let n=t.charCodeAt(e);if(!vie(n)||e+1==t.length)return n;let r=t.charCodeAt(e+1);return $ie(r)?(n-55296<<10)+(r-56320)+65536:n}function $ie(t){return t>=56320&&t<57344}function vie(t){return t>=55296&&t<56320}function F8(t){return t<65536?1:2}let qn=class xie{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,n,r){[e,n]=ip(this,e,n);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(n,this.length,i,1),rl.from(i,this.length-(n-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,n=this.length){[e,n]=ip(this,e,n);let r=[];return this.decompose(e,n,r,0),rl.from(r,n-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let n=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new fy(this),a=new fy(e);for(let o=n,s=n;;){if(i.next(o),a.next(o),o=0,i.lineBreak!=a.lineBreak||i.done!=a.done||i.value!=a.value)return!1;if(s+=i.value.length,i.done||s>=r)return!0}}iter(e=1){return new fy(this,e)}iterRange(e,n=this.length){return new Qie(this,e,n)}iterLines(e,n){let r;if(e==null)r=this.iter();else{n==null&&(n=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,n==this.lines+1?this.length:n<=1?0:this.line(n-1).to))}return new bie(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?xie.empty:e.length<=32?new Lr(e):rl.from(Lr.split(e,[]))}};class Lr extends qn{constructor(e,n=bSe(e)){super(),this.text=e,this.length=n}get lines(){return this.text.length}get children(){return null}lineInner(e,n,r,i){for(let a=0;;a++){let o=this.text[a],s=i+o.length;if((n?r:s)>=e)return new SSe(i,s,r,o);i=s+1,r++}}decompose(e,n,r,i){let a=e<=0&&n>=this.length?this:new Lr(H8(this.text,e,n),Math.min(n,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),s=_b(a.text,o.text.slice(),0,a.length);if(s.length<=32)r.push(new Lr(s,o.length+a.length));else{let l=s.length>>1;r.push(new Lr(s.slice(0,l)),new Lr(s.slice(l)))}}else r.push(a)}replace(e,n,r){if(!(r instanceof Lr))return super.replace(e,n,r);[e,n]=ip(this,e,n);let i=_b(this.text,_b(r.text,H8(this.text,0,e)),n),a=this.length+r.length-(n-e);return i.length<=32?new Lr(i,a):rl.from(Lr.split(i,[]),a)}sliceString(e,n=this.length,r=`
|